Thread Rating:

Ayecarumba
Ayecarumba
  • Threads: 236
  • Posts: 6763
Joined: Nov 17, 2009
December 15th, 2010 at 1:54:51 AM permalink
Ask the Wizard #265 included a q/a regarding the number of rolls of 2 dice required to have a 50/50 chance of rolling a 12. The Wizard's precise answer was between 24 and 25.

If the above is true, is it possible to have an advantage by waiting for a streak of non-12 rolls, then flat betting it until it hits? If so, how long would this streak need to be in order to have a 55% chance of rolling a 12 within the next 30 rolls?

Of course the dice don't know that they have not come up 12, so the true odds on any single roll are always 36-1. I am looking for an explaination for how these two, apparently contradictory truths can co-exist.
Simplicity is the ultimate sophistication - Leonardo da Vinci
boymimbo
boymimbo
  • Threads: 17
  • Posts: 5994
Joined: Nov 12, 2009
December 15th, 2010 at 5:51:24 AM permalink
The casino pays $30 for rolling a 12 and you should be paid $36.

It's not a contradiction: The odds of NOT rolling a 12 after one roll is 35/36. After n rolls, the odds of NOT rolling a 12 are (35/36) exp n.

The chances of rolling at least 1 12 over 30 rolls is 57.05 percent. Over 36 rolls it's 63.7 percent.

Let's say for argument's sake that you have a 50/50 chance of rolling a 12 over 24 rolls.

A 50/50 chance means that for you bet $24, you would win $24 and lose $24 at that point. The casino doesn't offer that bet. Instead, it would first off pay you $20.
----- You want the truth! You can't handle the truth!
rdw4potus
rdw4potus
  • Threads: 80
  • Posts: 7237
Joined: Mar 11, 2010
December 15th, 2010 at 6:50:15 AM permalink
Quote: Ayecarumba

Ask the Wizard #265 included a q/a regarding the number of rolls of 2 dice required to have a 50/50 chance of rolling a 12. The Wizard's precise answer was between 24 and 25.

If the above is true, is it possible to have an advantage by waiting for a streak of non-12 rolls, then flat betting it until it hits? If so, how long would this streak need to be in order to have a 55% chance of rolling a 12 within the next 30 rolls?

Of course the dice don't know that they have not come up 12, so the true odds on any single roll are always 36-1. I am looking for an explaination for how these two, apparently contradictory truths can co-exist.



If you roll two dice 1,000,000 times, you'll get about 40,000 twelves (1/25th of 1,000,000). But you will NOT get a twelve on every 25th roll, nor will a twelve ever be "due" just because it hasn't hit in 30 or 40 or 100 rolls.

Plus, like Boymimbo points out, the payouts on a 12 bet are not fair in the first place. The bet has a 16.66% house edge. So even IF counting twelves worked like counting cards in BJ, you'd have the mother of all house edges to clear before it was a + EV bet.
"So as the clock ticked and the day passed, opportunity met preparation, and luck happened." - Maurice Clarett
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
December 15th, 2010 at 7:02:37 AM permalink
Quote: rdw4potus

If you roll two dice 1,000,000 times, you'll get about 40,000 twelves (1/25th of 1,000,000).

Um....

You'll get a 12 about 27,777 times in 1,000,000 rolls - 1/36 of the time.

While it would be extremely unlikely, you still can't guarantee getting at least one 12 in 1,000,000 rolls.
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
DJTeddyBear
DJTeddyBear
  • Threads: 211
  • Posts: 11063
Joined: Nov 2, 2009
December 15th, 2010 at 7:14:07 AM permalink
Maybe this will help. This chart shows the odds of rolling a 12 within the number of rolls given.

As you can see, the 50%/50% point is at 24.6 rolls. And if you double it, at 50 rolls, there's only a 75% chance of hitting it.

And even at 500 rolls, there is no guarantee of rolling a 12.

And at 36 rolls? The statistical point where it should have hit? There's only a 63.7% chance of it happening.

Rolls Odds Rolls Odds
1 0.027778 40 0.675943
2 0.054784 45 0.718519
3 0.081040 50 0.755501
4 0.106567 55 0.787624
5 0.131384 60 0.815527
6 0.155512 65 0.839764
7 0.178970 70 0.860816
8 0.201777 75 0.879103
9 0.223950 80 0.894987
10 0.245507 85 0.908784
11 0.266465 90 0.920768
12 0.286841 95 0.931178
13 0.306651 100 0.940220
14 0.325910 110 0.954897
15 0.344635 120 0.965970
16 0.362840 130 0.974324
17 0.380539 140 0.980628
18 0.397746 150 0.985384
19 0.414475 160 0.988972
20 0.430740 170 0.991680
21 0.446553 180 0.993722
22 0.461926 190 0.995264
23 0.476873 200 0.996426
24 0.491404 210 0.997304
24.6051 0.500000 220 0.997966
25 0.505532 230 0.998465
26 0.519267 240 0.998842
27 0.532620 250 0.999126
28 0.545603 260 0.999341
29 0.558225 270 0.999503
30 0.570497 280 0.999625
31 0.582428 290 0.999717
32 0.594027 300 0.999786
33 0.605304 325 0.999894
34 0.616268 350 0.999948
35 0.626927 375 0.999974
36 0.637290 400 0.999987
37 0.647365 425 0.999994
38 0.657161 450 0.999997
39 0.666684 475 0.999998
40 0.675943 500 0.999999

The formula used is: Odds = 1 - ( 35 / 36 ) ^ Rolls
I invented a few casino games. Info: http://www.DaveMillerGaming.com/ ————————————————————————————————————— Superstitions are silly, childish, irrational rituals, born out of fear of the unknown. But how much does it cost to knock on wood? 😁
rdw4potus
rdw4potus
  • Threads: 80
  • Posts: 7237
Joined: Mar 11, 2010
December 15th, 2010 at 7:39:01 AM permalink
Quote: DJTeddyBear

Um....

You'll get a 12 about 27,777 times in 1,000,000 rolls - 1/36 of the time.

While it would be extremely unlikely, you still can't guarantee getting at least one 12 in 1,000,000 rolls.



lol! Epic fail on that one. Was in a hurry and latched on to the 25 in the Wiz's numbers. But really, 6*6 is 36?
"So as the clock ticked and the day passed, opportunity met preparation, and luck happened." - Maurice Clarett
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 15th, 2010 at 8:31:50 AM permalink
Quote: Ayecarumba

Ask the Wizard #265 included a q/a regarding the number of rolls of 2 dice required to have a 50/50 chance of rolling a 12. The Wizard's precise answer was between 24 and 25.

If the above is true, is it possible to have an advantage by waiting for a streak of non-12 rolls, then flat betting it until it hits? If so, how long would this streak need to be in order to have a 55% chance of rolling a 12 within the next 30 rolls?

Of course the dice don't know that they have not come up 12, so the true odds on any single roll are always 36-1. I am looking for an explaination for how these two, apparently contradictory truths can co-exist.



Here's why there's no contradiction.

Proposition 1) The chances of a 12 in a single roll of the dice are 1/36.
Proposition 2) The chances of at least one 12 in the next 25 rolls are just over 1/2.

If you wait for 30 non-12 rolls and then make a bet, what are you betting on?

If that question is unclear, re-read proposition 2 and focus on the word "next".

Hint: the house doesn't offer bets on proposition 2. But even if they did, would it be on previous rolls or next rolls?
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
superrick
superrick
  • Threads: 28
  • Posts: 775
Joined: Jul 14, 2010
December 15th, 2010 at 9:52:52 AM permalink
The math of the game gives you just the probability and nothing more, just because the math tells you that the 12 should roll 1/36 times it doesn't mean that it will happen!

I have seen players that thought the math of the game was infallible only to learn the truth the hard way!
There are days that you might not see a 12 for hours on the craps table, and you would be losing if you went by the math of the game, nothing is written in stone, and you can't use the math of the game to make you a winner, as it's all based on the probabilities of the math and that is all there is to it!
Note, all my post start with this is just my opinion...! You do good brada ..! superrick Winning comes from knowledge and skill when your betting and not reading fiction http://procraps4u2.myfanforum.org/index.php ...
kauboj
kauboj
  • Threads: 16
  • Posts: 88
Joined: Dec 19, 2010
December 19th, 2010 at 8:12:03 PM permalink
what are the odd that a 12 will not be rolled in 100 rolls. i am just trying to determine how the rng compares to real world. i mean realistically you would expect to see at least 3 12s in 100 rolls and with true randomness probably more.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 19th, 2010 at 8:54:17 PM permalink
The odds that a 12 will not be rolled in 100 rolls is (35/36)^100. This has nothing to do with whether you're using an algorithm to generate two numbers between one and six, or two dice to generate numbers between one and six. It is not true that "real world" is meaningfully different than using a computer that models the real world.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
kauboj
kauboj
  • Threads: 16
  • Posts: 88
Joined: Dec 19, 2010
December 19th, 2010 at 9:59:20 PM permalink
please answer that in laymans terms i mean by this is what is the likelyhood that you will not roll a 12 in 100 rolls of the dice
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 19th, 2010 at 10:32:30 PM permalink
you have a 6% chance or 1 in 16 chance that you will hit no 12's in 100 rolls given the data that was so well put together in the previous post.

94% of the time you will hit at least one 12 in 100 rolls. Yay.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 19th, 2010 at 10:36:00 PM permalink
Quote: kauboj

please answer that in laymans terms i mean by this is what is the likelyhood that you will not roll a 12 in 100 rolls of the dice



You can take the formula I gave and just put it into Google. It returns:

(35 / 36)^100 = 0.0597797863
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
superrick
superrick
  • Threads: 28
  • Posts: 775
Joined: Jul 14, 2010
December 19th, 2010 at 10:36:47 PM permalink
kauboj

I am no math guy, but I do know one thing as far as rolling any point in 100 rolls there is no way of telling, if a 12 is going to roll in the 100 rolls of the dice!

Today there were two 12's rolled in 106 rolls of the dice on the table I was playing on, yesterday there were 4 out of 222 rolls.

Two days ago there were 2 out of 74 rolls!
Three days ago there were 5 out of 106 rolls!

The math of the game does not always add up in real play, unless you are going to be at the table for 10,000 rolls of the dice!

I have seen plenty of days that you will not see a 12, even rolled in two or three hours of play!

Take it for what it's worth, just because you haven't seen a 12 in 36 rolls of the dice it does not mean that it's about to come up!

There is a big difference between the math of the game and what really happens on the tables!

...
Note, all my post start with this is just my opinion...! You do good brada ..! superrick Winning comes from knowledge and skill when your betting and not reading fiction http://procraps4u2.myfanforum.org/index.php ...
kauboj
kauboj
  • Threads: 16
  • Posts: 88
Joined: Dec 19, 2010
December 19th, 2010 at 10:38:19 PM permalink
now that is stastical probabilities. in my time at the casino i have never seen that many rolls go by with out having several 12's show
kauboj
kauboj
  • Threads: 16
  • Posts: 88
Joined: Dec 19, 2010
December 19th, 2010 at 10:44:30 PM permalink
please understand i am not asking these questions of ignorance.. i am just trying to improve the longevity of play time i have at the tables.. i love craps i love the atsmosphere around the time. i have fun playing. i go several times a week and only take what i am willing to loose at the given time. however i do get aggrevated when i am there for 5 minutes and my bankroll is gone.. id just like to be able to extend my play time to get the time to enjoy it before my bankroll goes to the wayside..

and sometimes i get a little ansy and make wagers i know better than to make and i wind of cursing myself right after i do it.
thecesspit
thecesspit
  • Threads: 53
  • Posts: 5936
Joined: Apr 19, 2010
December 19th, 2010 at 10:55:03 PM permalink
There is no difference between the math of the game and what happens at the tables.

Simple variance, which is part of the game of rolling two dice, models this perfectly.
"Then you can admire the real gambler, who has neither eaten, slept, thought nor lived, he has so smarted under the scourge of his martingale, so suffered on the rack of his desire for a coup at trente-et-quarante" - Honore de Balzac, 1829
kauboj
kauboj
  • Threads: 16
  • Posts: 88
Joined: Dec 19, 2010
December 19th, 2010 at 11:04:22 PM permalink
ehh i guess i continue to play as i play... sometimes i win sometimes i lose... but most of the time i have fun...
DeMango
DeMango
  • Threads: 36
  • Posts: 2958
Joined: Feb 2, 2010
December 20th, 2010 at 4:45:38 AM permalink
Nothing like buying the 12 in a Northern Mississippi casino for say $35 which is a $209 payout after paying $1 vig! (yea I'm braggin!)
When a rock is thrown into a pack of dogs, the one that yells the loudest is the one who got hit.
FleaStiff
FleaStiff
  • Threads: 265
  • Posts: 14484
Joined: Oct 19, 2009
December 20th, 2010 at 5:20:32 AM permalink
Quote: Ayecarumba

is it possible to have an advantage by waiting for a streak of non-12 rolls, then flat betting it until it hits? If so, how long would this streak need to be in order to have a 55% chance of rolling a 12 within the next 30 rolls?
Of course the dice don't know that they have not come up 12, so the true odds on any single roll are always 36-1. I am looking for an explaination for how these two, apparently contradictory truths can co-exist.


The essential point in your question is that irrespective of your obvious realization that the dice do not know they have not come up 12 for awhile, you still think that the non-occurrence of the event will affect that next roll. If you want to make money betting on twelve, you should feel free to do it immediately after there have been a noticeable number of rolls that were 12. The dice don't know about the occurrence of the event any more than they know about the non-occurrence of the event. It is you, and a great many other players, who somehow imbue the dice or Nature or The World with some viewpoint that the Next Roll will obey some ultimate "evening out" desire that smooths the Real World results into something that is compatible with moral expectations. Whether there have been lots of 12s or none at all, that Next Roll is most likely to be a 7. It could also be 12. There may have been a dry spell of 12s. There may also have been a dry spell of 7s. That next roll won't smooth out nothing! It will simply be a roll like any other roll.
ElectricDreams
ElectricDreams
  • Threads: 4
  • Posts: 194
Joined: Sep 8, 2010
December 20th, 2010 at 7:53:23 AM permalink
Honestly, the best way to lengthen your playing time is to just bet less. I try to not have more than one pass line bet + one other low-HE bet at a time (something like a come bet or place 6 or 8). Sure, you don't win huge gobs of money, but I can stick around and actually enjoy craps for hours at a time, usually.

I have a friend who plays it much differently. He'll blow through like half his bankroll in no time, and then wanders off to play some table game because he gets pissed he lost so much so fast. It's kind of funny.
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 9:29:32 AM permalink
Yes, if you want to make your money last the longest, it's easy .. bet the pass line for the minimum bet until you either double your money or lose it all.

Chances are good that you will do neither unless you have a lot of time on your hands, or else you are betting more than 5% of your bankroll on the passline for the first bet. (EG: start with $100 at a $5 minimum table is the most common way to do this).

Don't place odds or any other bet at all. The dealers will let you stay there and you can get free drinks.

I have been accused of "playing for free drinks" and thus, I assume I have demonstrated to the dealers that I know how. LOL.

Those with simulation models should give an answer to this question more completely. The true answer is bet the don't pass, but you will look awkward if you do this, when others lose a bunch of money and you win $5, and I don't recommend it.

Anyone with a simulator got an answer for the average number of rolls if you bet a $5 bet for a $100 bankroll on the passline until it's all gone .. or doubled .. whichever comes first?

You can double it quickly if you get a lot of good natural rolls, which does happen.
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 10:09:28 AM permalink
Lasted 781 rolls with a total of 515 in winnings and 615 in losses resulting in a bankroll of 0
Lasted 2160 rolls with a total of 1570 in winnings and 1665 in losses resulting in a bankroll of 0
Lasted 2374 rolls with a total of 1855 in winnings and 1750 in losses resulting in a bankroll of 200
Lasted 257 rolls with a total of 255 in winnings and 150 in losses resulting in a bankroll of 200
.
.
deleted about 995 lines of output for purposes of brevity....
.
.
Lasted 403 rolls with a total of 255 in winnings and 355 in losses resulting in a bankroll of 0
Average number of rolls over 1000 trials was 1299.09
Walked away a winner 330 times (33%)
Walked away a loser 670 times (67%)


----------- cut here ----- source code -------


#!/usr/bin/perl
$br = 100; # bankroll
$numtrials = 1000;
$minbet = 5;
$point = 0;
&main;
exit 0;

sub roll
{
$d1 = int( rand( 6 ) ) + 1;
$d2 = int( rand( 6 ) ) + 1;
$roll = $d1 + $d2;
$rollcount++;
}

sub resolve
{
if( $point == 0 ) #comeout
{
if( $roll == 12 || $roll == 2 || $roll == 3 )
{
$losses += $passline;
$passline = 0;
}
elsif( $roll == 7 || $roll == 11 )
{
$wins += $passline;
$br += $passline;
}
else
{
$point = $roll;
}

return;
}
else
{
if( $roll == 7 )
{
$losses += $passline;
$passline = 0;
$point = 0;
}
elsif( $roll == $point )
{
$wins += $passline;
$br += $passline;
$point = 0;
}
}
}

sub main
{
$initial_br = $br;

for( $trial=0; $trial < $numtrials; $trial++ )
{
$br = $initial_br;
$wins = 0;
$losses = 0;
$passline = 0;
$rollcount = 0;

while( $br >= $minbet && $br < $initial_br * 2 )
{
if( $passline < $minbet )
{
$passline += $minbet;
$br -= $minbet;
}

&roll;
&resolve;

# $results += sprintf( "$rollcount : br $br roll $roll point $point\n" );
}

$total_rolls += $rollcount;
if( $br > 0 )
{
$total_win_trips++;
}
else
{
$total_lose_trips++;
}

$results .= "Lasted $rollcount rolls with a total of $wins in winnings and $losses in losses resulting in a bankroll of $br\n";
}

print $results;

$avg = $total_rolls / $numtrials;

print "Average number of rolls over $numtrials trials was $avg\n";
printf( "Walked away a winner $total_win_trips times (%d\%)\n", $total_win_trips * 100 / $numtrials );
printf( "Walked away a loser $total_lose_trips times (%d\%)\n", $total_lose_trips * 100 / $numtrials );
}
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 10:48:32 AM permalink
One more line of output I added shows:

Total change in bankroll was -90400 over 8926903 rolls or -0.010127 (-0.2025%) per roll or -0.068422 (-1.3684%) per bet

I think these are already available in the wizard's web pages on house odds and advantages, but it's good to have independent verification. A penny per roll for a $5 passline bet is pretty easy to remember if you are worried about how long you can last or what the long term costs are.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 20th, 2010 at 11:18:48 AM permalink
Something didn't calculate properly there -- the EV/roll of the passline should be twice as high as you're reporting. The rough rule is $5 betting costs 2c/roll, not 1c/roll. That said, if you're playing for free drinks, go to a $10 table at a higher-end casino. Even if you're betting $10 every shooter (which you don't have to do, btw), your hourly EV is in the -$4 range. That's far cheaper than the cost of a good drink.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 11:48:30 AM permalink
Your probably thinking about place bets per roll. I'm pretty sure $.01/roll is correct on the passline. LMK.

$.02 would be right on a $10 table for the pass.

From:

https://wizardofodds.com/craps

Place Bet Pays Prob. Win House Edge per Bet Resolved House Edge per Roll
6,8 7 to 6 0.454545 0.015152 0.004630
5,9 7 to 5 0.400000 0.040000 0.011111
4,10 9 to 5 0.333333 0.066667 0.016667
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 20th, 2010 at 12:39:21 PM permalink
See https://wizardofodds.com/craps/appendix2.html
You got 0.2% per roll; the actual number should be 0.4% or so.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 1:56:57 PM permalink
Yep, you were right. I had an extra total_rolls += rollcount in my trial loop.

I should have known better than to argue with someone who's name is MathExtremist.

Quote: MathExtremist

See https://wizardofodds.com/craps/appendix2.html
You got 0.2% per roll; the actual number should be 0.4% or so.

aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 3:17:12 PM permalink
Shortest session was 70 rolls
Longest session was 9440 rolls
Average number of rolls over 10000 trials starting with 100 bankroll and stopping at broke or 200 was 1249.36 (3.3789 per $5 bet)
Total change in bankroll was -252785 over 12493613 rolls or -0.020233 (-0.4047%) per roll or -0.068158 (-1.3632%) per bet
Walked away a winner 3597 times (35.970%)
Walked away a loser 6403 times (64.030%)

Is this getting closer? Sorry I am a newb to craps sims.
weaselman
weaselman
  • Threads: 20
  • Posts: 2349
Joined: Jul 11, 2010
December 20th, 2010 at 3:30:31 PM permalink
Quote: MathExtremist

That said, if you're playing for free drinks, go to a $10 table at a higher-end casino.


Why not 1c slots? $100 should be able to get you really-really drunk ...

aahigh: not that it matters very much in this case, but int( rand( 6 ) ) is a lousy way to generate random numbers. Something like int(rand(1<<31)%6) should be a lot better distributed.
"When two people always agree one of them is unnecessary"
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 20th, 2010 at 4:15:00 PM permalink
From "man perlfunc" .. it seems I'm okay here. 0.0 to 5.999999 equally distributed for rand(6) .. rounded down to 0 to 5 with the int and then add one .. or am I missing something you're trying to explain to me.

rand EXPR
rand Returns a random fractional number greater than or equal to 0 and less than the value of EXPR. (EXPR should be positive.) If
EXPR is omitted, the value 1 is used. Currently EXPR with the value 0 is also special-cased as 1 - this has not been documented
before perl 5.8.0 and is subject to change in future versions of perl. Automatically calls "srand" unless "srand" has already
been called. See also "srand".

Apply "int()" to the value returned by "rand()" if you want random integers instead of random fractional numbers. For example,

int(rand(10))

returns a random integer between 0 and 9, inclusive.

(Note: If your rand function consistently returns numbers that are too large or too small, then your version of Perl was probably
compiled with the wrong number of RANDBITS.)

I'm sure I'm about to get schooled again .. LOL.
weaselman
weaselman
  • Threads: 20
  • Posts: 2349
Joined: Jul 11, 2010
December 20th, 2010 at 4:28:51 PM permalink
I don't know what I was thinking, your method is actually better than what I suggested (because it uses high order bits).
Today's my "opposite day" :)
"When two people always agree one of them is unnecessary"
nope27
nope27
  • Threads: 5
  • Posts: 126
Joined: Sep 5, 2010
December 20th, 2010 at 11:14:05 PM permalink
Quote: superrick

I am no math guy, but I do know one thing as far as rolling any point in 100 rolls there is no way of telling, if a 12 is going to roll in the 100 rolls of the dice!


I think us math guys knows what happens at a craps table relative to the theoretical numbers.
I would like to know the frequencies of each 12 that hit, the math shows how close they are also. Remember half of all 12s that roll will do so within 25 rolls.
=BINOMDIST(B2,A$2,A$4,FALSE) in Excel shows a 5.9780% chance of exactly "0" 12s rolled in 100 rolls of the dice.
Quote: superrick

Today there were two 12's rolled in 106 rolls of the dice on the table I was playing on,


"2.9" 12s was the expected number of 12s in 106 rolls.
Exactly "2" 12s rolled in 106 rolls is the most probable outcome at 22.9338%
Quote: superrick

yesterday there were 4 out of 222 rolls.


"6.1" 12s is the expected number of 12s to roll in 222 rolls. So we have a sample that was 2 off. It still was the 4th most probable outcome.
Quote: superrick

Two days ago there were 2 out of 74 rolls!


"2.1" expected number of 12s. dead on!
Quote: superrick

Three days ago there were 5 out of 106 rolls!


"2.9" expected. Table results 2 higher. The 5th most probable outcome.
Quote: superrick

The math of the game does not always add up in real play, unless you are going to be at the table for 10,000 rolls of the dice!


I know you are wrong with the number of trials needed.
Your example shows 508 rolls and "13" 12s rolled.
"14.1" is the expected number that should have rolled in 508 rolls. Interesting...only 1 off. Standard Deviation is 3.7039.
Quote: superrick

I have seen plenty of days that you will not see a 12, even rolled in two or three hours of play!
Take it for what it's worth, just because you haven't seen a 12 in 36 rolls of the dice it does not mean that it's about to come up!


You are 100% correct there. The 12 can disappear for many many dice rolls. I tracked a game once over 350 rolls before a 12 hit just 1 time. But it showed more often after that happened.
Quote: superrick

There is a big difference between the math of the game and what really happens on the tables!...


NO, not really. They are close, considering the standard deviation in the short run.

Relative frequencies can tell a better story than just actual hits of any number.
But I am sure you did not track what roll each 12 hit on so the frequencies can be tabulated.

DJ"s table on page 1 is an accurate "cumulative frequency table", meaning the probability of a frequency hit at or below a certain percentage. Again slightly more than 50% of all 12 "hits" will happen within 25 rolls. After that, the table can show how far it can go... and it can disappear for a long time.

The reason for my lengthy reply was to show that the math does show how close actual play can be in the short run.

Some "math numbers" are more valuable than others.
I gamble by frequencies.

HO HO HO
back to craps I go...
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 20th, 2010 at 11:48:25 PM permalink
Quote: weaselman

I don't know what I was thinking, your method is actually better than what I suggested (because it uses high order bits).
Today's my "opposite day" :)



We don't know that unless we know the scaling method used in perl. I think your assumption was based on generating ints, but it appears that the perl RNG generates doubles. I'm not sure how that's done under the covers (but I bet that info is readily available).
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
weaselman
weaselman
  • Threads: 20
  • Posts: 2349
Joined: Jul 11, 2010
December 21st, 2010 at 5:04:11 AM permalink
Quote: MathExtremist

We don't know that unless we know the scaling method used in perl. I think your assumption was based on generating ints, but it appears that the perl RNG generates doubles. I'm not sure how that's done under the covers (but I bet that info is readily available).



Perl doesn't have its own RNG, it just uses whatever the underlying system has. I have never heard of an algorithm, that generates random doubles out of the box (I don't claim a lot of expertise in the area, so may be wrong, but I do know some stuff) - usually it is either individual bits, or groups of bits (like 8 or 32 at once) that get generated. Once you generate enough bits, you can always interpret them as an int, and divide by the maximum possible number to get a [0-1] double.
"When two people always agree one of them is unnecessary"
aahigh
aahigh
  • Threads: 3
  • Posts: 77
Joined: Dec 10, 2010
December 21st, 2010 at 9:10:51 AM permalink
Quote: weaselman

Perl doesn't have its own RNG, it just uses whatever the underlying system has. I have never heard of an algorithm, that generates random doubles out of the box (I don't claim a lot of expertise in the area, so may be wrong, but I do know some stuff) - usually it is either individual bits, or groups of bits (like 8 or 32 at once) that get generated. Once you generate enough bits, you can always interpret them as an int, and divide by the maximum possible number to get a [0-1] double.



It's true that there is no RNG source code built into the base perl.

It can be configured a couple of ways, you can see what the configure script prefers (drand48):

: How can we generate normalized random numbers ?
echo " "
echo "Looking for a random number function..." >&4
case "$randfunc" in
'')
if set drand48 val -f; eval $csym; $val; then
dflt="drand48"
echo "Good, found drand48()." >&4
elif set random val -f; eval $csym; $val; then
dflt="random"
echo "OK, found random()." >&4
else
dflt="rand"
echo "Yick, looks like I have to use rand()." >&4
fi
echo " "
;;
*)
dflt="$randfunc"
;;
esac
cont=true


hightoa/cygdrive/c/perl-5.12.1> grep drand01 *
Configure:drand01=''
Configure: drand01="drand48()"
Configure: drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"
Configure: drand01="($randfunc() / (double) ((unsigned long)1 << $randbits))"

and the source code for perl's rand() function:


#ifndef HAS_DRAND48_PROTO
extern double drand48 (void);
#endif

PP(pp_rand)
{
dVAR; dSP; dTARGET;
NV value;
if (MAXARG < 1)
value = 1.0;
else
value = POPn;
if (value == 0.0)
value = 1.0;
if (!PL_srand_called) {
(void)seedDrand01((Rand_seed_t)seed());
PL_srand_called = TRUE;
}
value *= Drand01();
XPUSHn(value);
RETURN;
}

PP(pp_srand)
{
dVAR; dSP;
const UV anum = (MAXARG < 1) ? seed() : POPu;
(void)seedDrand01((Rand_seed_t)anum);
PL_srand_called = TRUE;
EXTEND(SP, 1);
RETPUSHYES;
}

There is also a Math::TrulyRandom module available from CPAN for those who want better results than what is available through your operating system.

Boy you guys like to dig deep on this stuff...
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
December 21st, 2010 at 9:46:22 AM permalink
I haven't done perl in years, but there are a few implementations of the Mersenne Twister on CPAN. I suggest using one of those to alleviate any concerns you have about what system RNG you've got compiled in.
"In my own case, when it seemed to me after a long illness that death was close at hand, I found no little solace in playing constantly at dice." -- Girolamo Cardano, 1563
mustangsally
mustangsally
  • Threads: 25
  • Posts: 2463
Joined: Mar 29, 2011
September 22nd, 2014 at 6:28:43 PM permalink
Hi ME
Quote: aahigh

Yes, if you want to make your money last the longest, it's easy ..
bet the pass line for the minimum bet until you either double your money or lose it all. <snip> <snip> <snip>

Anyone with a simulator got an answer for the average number of rolls if you bet a $5 bet for a $100 bankroll on the passline until it's all gone .. or doubled .. whichever comes first?

yes, there are many to choose from, and I used this one (I have seen the code)

Simulation of Craps Pass Line Wagers
Odds Multiplier . . . . = 0
Session Bankroll . . . = 20.00
Win goal to quit session= 20.00
Max. Decisions to quit = 10000000
No. Sessions simulated = 1000000
Starting Random seed . = 6540012
------------------------------------
All bets are a single unit
------------------------------------
Simulation Results per Session
------------------------------------
Avg. No. games played . = 389.22
Avg. No. games won . . = 191.86
Avg. No. games lost . . = 197.36
Avg. No. dice rolls . . = 1313.99
Std-dev # games played = 315.60
Median # games played = 294.61

Avg. Total amount bet . = 389.22
Bankroll was busted . . = 63.766% of the time ( 637656)
Win goal was met . . . = 36.234% of the time ( 362344)
Bankroll decreased . . = 63.766% of the time
Bankroll increased . . = 36.234% of the time
Avg (mean) end bankroll = 14.49 (change of -5.51)
===============================================

never forget the don't pass to compare

Simulation of Craps Don't Pass Wagers
Odds Multiplier . . . . = 0
Session Bankroll . . . = 20.00
Win goal to quit session= 20.00
Max. Decisions to quit = 10000000
No. Sessions simulated = 1000000
Starting Random seed . = 6540012
------------------------------------
All bets are a single unit
------------------------------------
Simulation Results per Session
------------------------------------
Avg. No. games played . = 390.02
Avg. No. games won . . = 192.28
Avg. No. games lost . . = 197.74
Avg. No. games tied . . = 11.14
Avg. No. dice rolls . . = 1354.31
Std-dev # games played = 316.66
Median # games played = 295.05

Avg. Total amount bet . = 390.02
Bankroll was busted . . = 63.652% of the time ( 636516)
Win goal was met . . . = 36.348% of the time ( 363484)
Bankroll decreased . . = 63.652% of the time
Bankroll increased . . = 36.348% of the time
Avg (mean) end bankroll = 14.54 (change of -5.46)

Quote: aahigh

You can double it quickly if you get a lot of good natural rolls, which does happen.

this can be calculated, very easy too.
The formula comes from the Gambler's Ruin formula and that goes back to the 1600s
(they had no tv or radio or internet or rock and roll back then,
so it was all about sex, drugs and gambling)

The formula I show (can be found too in math books)
b_x = bankroll in units
your example $100 bankroll and flat bets $5, no odds = 20 bank units
p=244/495 = prob of a win for pass line
q=1-p
p+q=1
(hint: q-p looks to be the house edge)

average # of trials = (b_x/(q-p)) * ((((q/p)^b_x)-1) / (((q/p)^b_x)+1))
try it!

I gets
389.689626 trials
of course each pass line trial is 557/165 rolls long, so multiply the two
I gets there
1315.497706 rolls on average

now
IF p=q Then # of trials = b_x^2/(2*p)

Sally is nice and is not just another pretty face

formula to double a bankroll flat betting (some avg bets work too)
=1/((q/p)^b_x+1)
easy when p=q

added: for those interested in R program
> #even money matrix
> p <- 244/495 ###enter
> target <- 40 ###enter
> q <- 1-p
> #vP <- c(0,0,1,0,0)
> m <- target-1
> vQ <- c(rep(1,m))
>
> A = matrix(0,m+2,m+2,dimnames = list(c(1:(m+1),0),c(1:(m+1),0)))
> A[m+2,m+2] = 1
> A[m+1,m+1] = 1
> A[1,m+2]=q
> A[m,m+1]=p
> A[1:(m-1),2:m] = diag(p,m-1,m-1)
> #A
> S <- A[1:m,1:m]
> diag(S[-1,])<- q
> #S
> T <- A[1:m,(m+1):(m+2)]
> #T
> I <- diag(m)
> #I
> Q <-solve(I-S) # Gives Matrix Q
> #Q
> Q %*% vQ # gives Matrix Mu
[,1]
1 32.07183
2 63.03506
3 92.85789
4 121.50761
5 148.95055
6 175.15211
7 200.07666
8 223.68757
9 245.94715
10 266.81664
11 286.25616
12 304.22468
13 320.68000
14 335.57871
15 348.87616
16 360.52640
17 370.48218
18 378.69488
19 385.11451
20 389.68963 <<< example for 20 units
21 392.36730
22 393.09311
23 391.81105
24 388.46352
25 382.99127
26 375.33333
27 365.42702
28 353.20781
29 338.60937
30 321.56344
31 301.99979
32 279.84620
33 255.02836
34 227.46986
35 197.09205
36 163.81406
37 127.55268
38 88.22233
39 45.73496
> Q %*% T # gives Matrix AbsorbStates
40 0
1 0.01366148 0.98633852
2 0.02771488 0.97228512
3 0.04217145 0.95782855
4 0.05704277 0.94295723
5 0.07234071 0.92765929
6 0.08807754 0.91192246
7 0.10426583 0.89573417
8 0.12091854 0.87908146
9 0.13804899 0.86195101
10 0.15567088 0.84432912
11 0.17379833 0.82620167
12 0.19244582 0.80755418
13 0.21162828 0.78837172
14 0.23136106 0.76863894
15 0.25165995 0.74834005
16 0.27254117 0.72745883
17 0.29402145 0.70597855
18 0.31611797 0.68388203
19 0.33884840 0.66115160
20 0.36223094 0.63776906 <<< example for 20 units
21 0.38628429 0.61371571
22 0.41102769 0.58897231
23 0.43648094 0.56351906
24 0.46266441 0.53733559
25 0.48959905 0.51040095
26 0.51730640 0.48269360
27 0.54580863 0.45419137
28 0.57512855 0.42487145
29 0.60528962 0.39471038
30 0.63631596 0.36368404
31 0.66823240 0.33176760
32 0.70106448 0.29893552
33 0.73483846 0.26516154
34 0.76958136 0.23041864
35 0.80532099 0.19467901
36 0.84208594 0.15791406
37 0.87990562 0.12009438
38 0.91881029 0.08118971
39 0.95883108 0.04116892
>
by starting with 26 units or $130 instead of $100, one now has
better than a 50% chance of hitting a $200 target with just a few trials less on average.

another beauty of math and not just grabbing at numbers
I Heart Vi Hart
  • Jump to: