Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Turn over baby!

Status
Not open for further replies.

SidYuca

Technical User
Nov 13, 2008
79
MX
I hesitate but I am a risk taker!
I offer you a chance to play a game. The rules are simple. There are 100 cards, face down. Of the cards, 55 say "win" and 45 say "lose!"
Although the problem doesn't say I assure you that the table is not clear glass etc. The problem IS the problem.

You begin with a bankroll of $10,000. You must bet one-half of your money on each card turned over, and you either win or lose that amount
based on what the card says. At the end of the game, all cards have been turned over. How much money do you have at the end of the game?


 
Mathematically, you are certain to end up with 2^10 times your original bankroll, or $10,240,000. I question, however, how well this would work in the real world. If you happened to go on a long losing streak at the beginning, your stash could shrink to a tiny fraction of a cent. Since currency can't be subdivided that finely, I would say it's debatable whether you would be declared bankrupt at some point.
 
[hide]After as few as seven card turns, you can end up with 1/2 cent amounts, how are these split? Also, what happens if you only have 1 cent to bet?[/hide]

**********************************************
What's most important is that you realise ... There is no spoon.
 
You two guys are frustrated lawyers!
It's a math problem..deal with the problem. If you need a fraction of a penny make it with fractions or decimals. The money in the problem is nit real, Use fractions, decimals but above all use math. As for going broke..IMPOSSIBLE under the conditions (you only bet half the remaining each time.

You should not hide your questions..I'm sure there are other lawyers out there ;>))
 
Not enough for bus fair home!

Computers are like Air conditioners:-
Both stop working when you open Windows
 
[hidden]
The order of the cards is completely unimportant
the result is always (stake/2^[loosing cards])*(2^[winning cards])
in this case $1.38 (rounding up from 1.3761)

Python code to demonstrate:
Code:
import random
WIN=55 #winning cards
LOSE=45 # loosing cards
BANK=10000.0
def win(stake):
    return stake*1.5 # bet was half stake!
    
def lose(stake):
    return stake/2
    
def play(deck):
    stake=BANK
    for card in deck:
        if card:
           stake=win(stake)
        else:
            stake=lose(stake)
    return stake

def main():
    a=[True]*WIN+[False]*LOSE #create list of cards
# win first 
    print play(list(a))
# lose next
    a.reverse()
    print play(list(a))
#random
    random.shuffle(a)
    print play(list(a))
    return 0

if __name__ == '__main__': main()
I would not take you on until 64/36 :)
[/hidden]

Computers are like Air conditioners:-
Both stop working when you open Windows
 
Damn sorry guys looks like my hidden tags didn't work :-(

Computers are like Air conditioners:-
Both stop working when you open Windows
 
Yeah, it looks as if IPGuru has the right answer. I incorrectly read the problem to state that you either doubled or halved your money at each step. But you are actually only increasing it by a factor of 1.5 if you win, but still losing half if you lose. So the answer should be 1.5^55/2^45 = 1.37616. Well, that's still bus fare home, where I live!
 
[hidden]
I had a typo in my formula
winnings=st(stake/2^{loosing cards)*(1.5^[winning cards])
[hidden]

Strongm your figure disagrees with the results from my program
is there any detail you could provide so I can see if my code is incorrect?



Computers are like Air conditioners:-
Both stop working when you open Windows
 
Once writing a program that computes the final result I already see the card order does not make any difference.

[hidden]
You can look at it this way:

In each step before turning a card you have half your money, the other half is your stake. If you win, the stake doubles, so the money you have in your hand multiplies by 3.

As multiplication and division is permutable the total factor simply is (3^55)/(2^100).

1.376162... dollars remain in the end.
[/hidden]

Bye, Olaf.
 
The tag to use is <spoiler> of course....

Each single step in code can be written like

Money = Money / 2;
if (win) Money = Money * 3;

Of course you could also talk about factors .5 and 1.5 in comparison to each rounds initial amount.

Bye, Olaf.
 
That was quick. Another approach:

Code:
Every time you win one and lose one,(in any order)you will ultimately lose 1/4 of your money (i.e keep 3/4). The problem provides 45 win-lose times and then 10 extra win cards.

You will, therefore, end up with $10,000(3/4)^45 * (3/2)^10 = $10,000*(0.000137616 . . .)or $1.38 rounded off.
Code:
 
There are several ways to hide your posts.
1: You can print it as white on white[ignore]
[COLOR=white white]This is hidden text[/color][/ignore]
shows as
[COLOR=white white]This is hidden text[/color]

2: You can use the spoiler tag[ignore]
This is spoiled text
[/ignore]
shows as
This is spoiled text

3: You can use the hide tag[ignore]
[hide]This is hidden text[/hide][/ignore]
shows as
[hide]This is hidden text[/hide]

--------------
Good Luck
To get the most from your Tek-Tips experience, please read
FAQ181-2886
Wise men speak because they have something to say, fools because they have to say something. - Plato
 
Thought my result was odd, but was in a hurry when I wrote my simulation ... did a bogus comparison. Corrected it, and now my result comes out as

1.37616162511746
 
just look at how plush casinos can afford to be & they work on house advantages of as little as 1.5% in blackjack


Computers are like Air conditioners:-
Both stop working when you open Windows
 
Thanks CajunCenturion,

thanks, I see, the "hidden" caption differs from the "hide" tag name.

Then why don't they call the spoiler tag spoil?

;)

Bye, Olaf.
 
[hide]
I get a high limit value of $48419382672504.40

I get a low limit value of $0.0000000284217

I get a final value of $1.376161325[/hide]

Oh and Sid, we hide because even mistakes can reveal insights and spoil the fun for others.

**********************************************
What's most important is that you realise ... There is no spoon.
 
kbw your min and max figures nicely demonstrate one of the golden rules of casino play.
Never chase a loss!

That includes a loss from your maximum winnings



Computers are like Air conditioners:-
Both stop working when you open Windows
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top