Post Reply 
Little math problem(s) April 2019
04-23-2019, 09:35 PM
Post: #1
Little math problem(s) April 2019
There is a deck of 52 cards. 26 red and 26 black. Shuffled.
The host is going to turn one card at time.

You get 1 dollar/euro/pound/<equivalent unit of money> each time you correctly predict the color of the card turned. You get nothing if you fail.

What is the best strategy for the game, to maximize the expected value of the money got from the game?

Wikis are great, Contribute :)
Find all posts by this user
Quote this message in a reply
04-23-2019, 10:10 PM
Post: #2
RE: Little math problem(s) April 2019
I think I'd call whichever colour has most cards remaining in the pack (if they are different).

— Ian Abbott
Find all posts by this user
Quote this message in a reply
04-24-2019, 12:16 AM
Post: #3
RE: Little math problem(s) April 2019
(04-23-2019 10:10 PM)ijabbott Wrote:  I think I'd call whichever colour has most cards remaining in the pack (if they are different).

This gives you about $4 more Smile

Code:
from random import randrange, shuffle
       
def pick_less_seen(win=0, deck=[0,1]*26):
    seen = [0,0]
    shuffle(deck)
    for card in deck:
        pick = randrange(2) if seen[0]==seen[1] else (seen[0] > seen[1])
        win += pick == card
        seen[card] += 1
    return win

>>> n = 10000
>>> print sum(pick_less_seen() for i in range(n)) / n - 26
4.0425
Find all posts by this user
Quote this message in a reply
04-24-2019, 07:39 PM
Post: #4
RE: Little math problem(s) April 2019
I guess red every time and win $26.
Find all posts by this user
Quote this message in a reply
04-24-2019, 09:14 PM (This post was last modified: 04-24-2019 09:14 PM by ijabbott.)
Post: #5
RE: Little math problem(s) April 2019
(04-24-2019 07:39 PM)David Hayden Wrote:  I guess red every time and win $26.

That's a safe bet as it guarantees winning (at least) 26 hands. However, once 26 reds have been revealed, it would make sense to switch to black!

— Ian Abbott
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)