 ## Recommended Posts

lets suppose the prize is the number 1 and the 2 and 3 goats

you take ten cards and divide it in two halves of 5 and pick one

your chance to get the price in your pick is one half

but that bet will cost you 1.5 bucks because on average of 3 cards there will be 1.5 in your pick since its a half pick of 3

so half the times on average you lose 1.5 euro and half the times you win 2

so whats wrong with this?

##### Share on other sites

Ok so I did a brute force on your game as I understood it. You pick 5 cards out of a pool of 10 which contains 3 prices. You get a dollar for each winner in the 5 you picked. In 1'000'002 simulated games I got 374'381times 1, 376'340 times 2 and 125'030 times 3 giving me a value of 1'502'151 dollars. This makes an average win of 1.502147996 dollars per game. So roughly the calculated 1.5 now if your goal is to just get at least one price and any overflow disappears I got to a chance of roughly 0.875749249 for winning a game means if the price is 1 dollar it would be worth 0.876… dollars to invest. Now since you brought out the goats why don't we extend this into a Monty-Hall problem. You have a pool of 10 with 3 prices, split it into 5 and then get the chance to pay the dealer to reveal either 0, 1 or 2 goats from your 5, how much would those options be worth.

##### Share on other sites

well i figured out a secret

casinos are an alternative to banks

imagine you want to buy a 10k car

you can ask a loan to a bank and risk get fired and then lose your hous for unpayment or

you can gamble 10 dollar for around 3 years for a 10k pot in a casino

but what is an even more secret

casinos pay you and edge of 2.9% playing blackjack with the basic startegy

i guess its worth for them just to have a casino full of people gambling and giving life

re:
pflag=0
dflag=0
doubleflag=0
bet=1

i=i+1
dealerhand=Math.GetRandomNumber(13)
If dealerhand>10 Then
dealerhand=10
EndIf
If dealerhand=1 Then
dealerhand=11
dflag=1
EndIf
If dealerhand=6 Or dealerhand=5 Or dealerhand=4 then

tope=12
ElseIf dealerhand=3then
tope=13
elseif   dealerhand=2 then

tope=13
ElseIf dealerhand=7    then

tope=17
ElseIf dealerhand=8    then

tope=17
elseif dealerhand=9 then

tope=17
elseif dealerhand=10  then

tope=17
elseif dealerhand=11 then

tope=17
endif

card1=Math.GetRandomNumber(13)
If card1>10 Then
card1=10
EndIf
If card1=1 Then
card1=11
pflag=1

EndIf
card2=Math.GetRandomNumber(13)
If card2>10 then
card2=10
endif
If card2=1 Then
card2=11
pflag=1

EndIf
playerhand=card1+card2
If (playerhand=10 ) or (playerhand=11 ) or (playerhand=9 And dealerhand<7 And dealerhand>3 ) Then
bet=2
doubleflag=1
Goto skip
endif
If card1=11 and card2=11 And dealerhand<6 then

playerhand=11
doubleflag=1
Goto skip
endif

If (playerhand=18 And pflag=1 And dealerhand=6) Then
bet=2
doubleflag=1
Goto skip
endif
If (playerhand=17 And pflag=1 And dealerhand<7)and dealerhand<>2  Then
bet=2
doubleflag=1
Goto skip
endif
If (playerhand=16 Or playerhand=15) And pflag=1 And dealerhand<6and dealerhand>3  Then
bet=2
doubleflag=1
Goto skip
endif

if (playerhand=14 Or playerhand=13) And pflag=1 And dealerhand<6 and dealerhand>4 Then
bet=2
doubleflag=1
Goto skip
endif
doubleflag=0
skip:

If card1=6 and card2=6 And dealerhand<7 then

playerhand=6
bet=2
endif
If card1=7 and card2=7 And dealerhand<8 then

playerhand=7
bet=2
endif
If card1=8 and card2=8  then

playerhand=8
bet=2
endif

If card1=3 and card2=3 And (dealerhand=4 Or dealerhand=5 Or dealerhand=6) then

playerhand=3
bet=2
endif

If card1=9 and card2=9 And (dealerhand<>9 and dealerhand<>10 and dealerhand<>11) then

playerhand=9
bet=2
endif
If card1=2 and card2=2 And (dealerhand<7) then

playerhand=2
bet=2
endif

If (card1=10 and card2=11) or (card1=11 and card2=10) then
temp=Math.GetRandomNumber(13)
If (dealerhand=11 and temp>9) or (temp=1 and dealerhand=10) then
bob=bob+0
Goto re
endif

bob=bob+1.5
Goto re
endif

player()
dealer()

If dealerhand>playerhand Or playerhand=0 then

bob=bob-bet
endif
If playerhand>dealerhand then
bob=bob+bet
endif
If Math.Remainder(i,1000)=0 then
TextWindow.WriteLine(bob+"*"+(bob/i)*100+" % * game number: "+i)
endif
Goto re

Sub player

While playerhand<tope Or doubleflag=1
card=Math.GetRandomNumber(13)
If card>10 Then
card=10
EndIf
If card=1 Then
card=11
pflag=1

EndIf
playerhand=playerhand+card
rep:
doubleflag=0
EndWhile

If playerhand>21 Then

If pflag=1  Then
playerhand=playerhand-10
pflag=0

Goto rep

EndIf
playerhand=0
EndIf

EndSub

Sub dealer

While dealerhand<17
card=Math.GetRandomNumber(13)
If card>10 Then
card=10
EndIf
If card=1 Then
card=11
pflag=1

EndIf
dealerhand=dealerhand+card
rep2:
EndWhile

If dealerhand>21 Then
If dflag=1 Then
dealerhand=dealerhand-10
dflag=0
Goto rep2
EndIf
dealerhand=0
EndIf

EndSub