Hunterhill
Hunterhill
  • Threads: 53
  • Posts: 2151
Joined: Aug 1, 2011
March 26th, 2016 at 5:43:37 AM permalink
Saw this on fivethirtyeight.com

Suppose a casino invents a new game that you must pay $250 to play. The game works like this: The casino draws random numbers between 0 and 1, from a uniform distribution. It adds them together until their sum is greater than 1, at which time it stops drawing new numbers. You get a payout of $100 each time a new number is drawn.

For example, suppose the casino draws 0.4 and then 0.7. Since the sum is greater than 1, it will stop after these two draws, and you receive $200. If instead it draws 0.2, 0.3, 0.3, and then 0.6, it will stop after the fourth draw and you will receive $400. Given the $250 entrance fee, should you play the game?
The mountain is tall but grass grows on top of the mountain.
DJTeddyBear
DJTeddyBear
  • Threads: 207
  • Posts: 10992
Joined: Nov 2, 2009
March 26th, 2016 at 8:22:34 AM permalink
Based on a knee-jerk, gut reaction, my answer is: yes HELL YES!

Since there must be at least two numbers drawn, simple math says that 50% of the time it will be only two numbers and lose $50, and 50% of the time it will be at least three numbers and win $50 or more.

It's the "or more" that puts a smile on my face.

While four or more numbers won't happen very often, it's certainly often enough to make this a positive expectation game.

And there's another "or more" in that statement. 😊
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? 😁
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6274
Joined: Jun 22, 2011
March 26th, 2016 at 9:19:48 AM permalink
I agree with yes.


Simulation shows a number very close to e, so I am paying $250 to play a game with an ER of about $271.28.

I also "kinda sorta" have a proof of this:
Let P(n) be the probability that your first n numbers sum to < 1
The expected value = 100 x (
2 x (1 - the probability that your first 2 numbers sum to < 1)
+ 3 x (the probability that your first 2 numbers sum to < 1 - the probability that your first 3 numbers sum to < 1)
+ 4 x (the probability that your first 3 numbers sum to < 1 - the probability that your first 4 numbers sum to < 1)
+ ...)
= 100 x (2 x (1 - P(2)) + 3 x (P(2) - P(3)) + 4 x (P(3) - P(4)) + ...)
= 100 x (2 + P(2) + P(3) + P(4) + ...)
If P(n) = 1 / n! (and I have gotten this for 2, 3, and 4, but haven't found a general proof for all n), then this = e.

Okay, MathExtremist and the other real mathoids here - can somebody prove:



Last edited by: ThatDonGuy on Mar 26, 2016
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 26th, 2016 at 10:41:20 AM permalink

Interesting! I find the expected gross return to the player to be $100*e =! $271.72. It costs $250 to play, so the expected profit is $21.72.


Also, please put answers and solutions in spoiler tags, to not ruin the fun for everybody else. I'd like to suggest, ThatDonGuy, that you please edit your post to put in in spoiler tags.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6274
Joined: Jun 22, 2011
March 26th, 2016 at 11:57:25 AM permalink
Quote: Wizard


Interesting! I find the expected gross return to the player to be $100*e =! $271.72. It costs $250 to play, so the expected profit is $21.72.


Also, please put answers and solutions in spoiler tags, to not ruin the fun for everybody else. I'd like to suggest, ThatDonGuy, that you please edit your post to put in in spoiler tags.


Okay, although I didn't treat this as a "math problem," but as a request for information, so I don't see why the answer needs to be hidden.

And how did you get your answer?
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 10:17:08 AM permalink
Quote: ThatDonGuy

Okay, although I didn't treat this as a "math problem," but as a request for information, so I don't see why the answer needs to be hidden.

And how did you get your answer?



This is a great exercise in calculus. I have been meaning to write up my solution, but it will take a while. Below is a ...


First, use a double integral to determine the probability of going over 1 in two tries.

Second, use a triple integral to determine the probability of going over 1 in three tries.

Third, use a quadruple integral to determine the probability of going over 1 in four tries.

You will see a pattern between this three probabilities. Once you see this pattern you will be able to easily calculate the answer in Excel. Or you can get it directly if you're familiar with a particular infinite series.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
Ayecarumba
Ayecarumba
  • Threads: 236
  • Posts: 6763
Joined: Nov 17, 2009
March 28th, 2016 at 10:23:45 AM permalink
The example in the original problem gives the possible draw values as .1, .2, .3, etc. Is it possible that the values could be .001, .002, etc.?

If the values can only be .1, .2, etc., then there is a maximum "win" of $1100 (10 draws at .1 + one additional draw to go over 1.0). Does this affect the expected value?
Simplicity is the ultimate sophistication - Leonardo da Vinci
charliepatrick
charliepatrick
  • Threads: 39
  • Posts: 2946
Joined: Jun 17, 2011
March 28th, 2016 at 10:50:06 AM permalink
Quote: beachbumbabs from duplicate thread

It's an interesting question, so I'm placing the link below that you tried to publish (your linkage ability is restricted by your new membership).

538 puzzler

I've posted it also gives the solution to an interesting puzzle from the week before.
Romes
Romes
  • Threads: 29
  • Posts: 5602
Joined: Jul 22, 2014
March 28th, 2016 at 12:00:03 PM permalink
From the context of the question there exists a random number generator pulling numbers between 0 and 1 (.1,... .9, etc). It will add the numbers together and whenever the number is OVER 1, it stops. This is the key factor in the wording of the riddle, in my opinion. The value of the result must be GREATER THAN 1 for the game to stop. For every draw you earn $100. If this is the case the mean of these numbers would be .5, and the average number of draws to meet the requirements would be 3, because the result value of 1 requires another draw to get GREATER THAN 1. Thus, on average, you would require 3 draws, making $300. There is a $250 entry fee, so your Expected Value each time you play the game would be $50.
Playing it correctly means you've already won.
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 12:03:38 PM permalink
Quote: Wizard


Interesting! I find the expected gross return to the player to be $100*e =! $271.72. It costs $250 to play, so the expected profit is $21.72.

Agree. Except, in practice it is impossible to chose a random number in the indicated range, so the language of the problem as a gambling problem is incorrect.
Climate Casino: https://climatecasino.net/climate-casino/
Romes
Romes
  • Threads: 29
  • Posts: 5602
Joined: Jul 22, 2014
March 28th, 2016 at 12:19:57 PM permalink
Quote: teliot

Quote: Wizard


Interesting! I find the expected gross return to the player to be $100*e =! $271.72. It costs $250 to play, so the expected profit is $21.72.

Agree. Except, in practice it is impossible to chose a random number in the indicated range, so the language of the problem as a gambling problem is incorrect.

While technically you are correct for the RNG's that exist today, they are as random as we can possibly get, and for all intensive purposes, can be considered random.
Playing it correctly means you've already won.
TwoFeathersATL
TwoFeathersATL
  • Threads: 37
  • Posts: 3616
Joined: May 22, 2013
March 28th, 2016 at 12:45:14 PM permalink
Quote: teliot

Quote: Wizard


Interesting! I find the expected gross return to the player to be $100*e =! $271.72. It costs $250 to play, so the expected profit is $21.72.

Agree. Except, in practice it is impossible to chose a random number in the indicated range, so the language of the problem as a gambling problem is incorrect.

Who did you say had a gambling problem? I missed something ;-)
Youuuuuu MIGHT be a 'rascal' if.......(nevermind ;-)...2F
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 2:17:09 PM permalink
Quote: Romes

]While technically you are correct for the RNG's that exist today, they are as random as we can possibly get, and for all intensive purposes, can be considered random.

Surely you didn't mean "intensive purposes."

And yes, there is no such thing as a true RNG that selects from one of infinitely many possible values, as the problem indicates. Nor will there ever be. Such a true RNG is a physical impossibility. In fact, RNGs can only produce rational numbers, and among those, only those with finitely many non-0 decimal digits. No RNG can output a random irrational number. There isn't enough storage space in the universe for the decimal digits of even one such number.
Climate Casino: https://climatecasino.net/climate-casino/
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 3:28:47 PM permalink
Quote: teliot

Agree. Except, in practice it is impossible to chose a random number in the indicated range, so the language of the problem as a gambling problem is incorrect.



What wording would you suggest? I plan to use this for a future Ask the Wizard question. I was planning to remove mention of the word "casino" and go with something like this:

Quote:

What is the expected number of trails before the sum of random numbers drawn from a uniform distribution from 0 to 1 exceeds a total of 1?

"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
DRich
DRich
  • Threads: 86
  • Posts: 11724
Joined: Jul 6, 2012
March 28th, 2016 at 3:30:34 PM permalink
Quote: Wizard

What wording would you suggest? I plan to use this for a future Ask the Wizard question. I was planning to remove mention of the word "casino" and go with something like this:

Quote:

What is the expected number of trails before the sum of random numbers drawn from a uniform distribution from 0 to 1 exceeds a total of 1?



You may want to change trails to trials. :)
At my age, a "Life In Prison" sentence is not much of a deterrent.
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 28th, 2016 at 3:36:49 PM permalink
Quote: teliot

Surely you didn't mean "intensive purposes."

And yes, there is no such thing as a true RNG that selects from one of infinitely many possible values, as the problem indicates. Nor will there ever be. Such a true RNG is a physical impossibility. In fact, RNGs can only produce rational numbers, and among those, only those with finitely many non-0 decimal digits. No RNG can output a random irrational number. There isn't enough storage space in the universe for the decimal digits of even one such number.

All that is correct, and at an even more basic level no finite computer can directly represent any irrational number like pi. Still, asking the question itself isn't improper -- the question was "should you play this game" not "could you." The "should you" question can be answered with continuous math even if a truly continuous embodiment can't be physically realized. Quantum mechanics and all that.
From Wolfram MathWorld:
http://mathworld.wolfram.com/UniformSumDistribution.html
That page links to the OEIS sequence here: http://oeis.org/A001048

It turns out that I have some familiarity with this sequence. I developed a side bet for keno/bingo games based on drawing increasing numbers from the ball hopper (and paying more as the sequence continues). It turns out that the probability of drawing exactly N increasing numbers before the sequence is terminated by the N+1th draw being less than the Nth draw is 1 in (N! + (N-1)!). E.g., the chances of the second ball being less than the first are 1 in (1! + 0!) = 1/2.
"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
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 3:54:21 PM permalink
Quote: Wizard

What is the expected number of trials before the sum of random numbers drawn from a uniform distribution from 0 to 1 exceeds a total of 1?

Far be it from me to philosophize about the meaning of a "random number" - however, in all my days on this planet, I have yet to see a random number. A true random number would not be expressible symbolically (with probability 1), as nearly all numbers are incapable of such a description. Moreover, the average size of a randomly chosen positive integer is much larger than the number of elementary particles in the known universe.

That said, your statement above seems good to me.
Climate Casino: https://climatecasino.net/climate-casino/
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 28th, 2016 at 4:24:42 PM permalink
Quote: teliot

Far be it from me to philosophize about the meaning of a "random number" - however, in all my days on this planet, I have yet to see a random number. A true random number would not be expressible symbolically (with probability 1), as nearly all numbers are incapable of such a description. Moreover, the average size of a randomly chosen positive integer is much larger than the number of elementary particles in the known universe.

I'm not above philosophizing. :) I think "random number" needs to be taken in context. If I tell you I've seen plenty of random integers between 1 and 6 (inclusive) at the craps table, I think you'd be hard-pressed to argue. The concept of a random real is, as you note, a tougher concept to quantify -- but not to observe. Radioactive decay produces random reals in the form of elapsed time between particle emissions. However, we don't have the technology to record those elapsed times with infinite precision (and never will, I think). That's not a failure of the random process itself, it's a failure of our ability to capture the data.
"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
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 4:31:52 PM permalink
Quote: MathExtremist

The concept of a random real is, as you note, a tougher concept to quantify -- but not to observe. Radioactive decay produces random reals in the form of elapsed time between particle emissions.

I disagree. Those times are only valid down to the Planck time, which is about 10^(-43) seconds, in other words, only a scant 43 non-0 decimal digits maximum in that RNG.

Quote:

However, we don't have the technology to record those elapsed times with infinite precision

That's because they provably don't exist. Thought you'd get that by me, eh? It was a good try, assuming time is continuous and all.

And there is a very good argument to make that time will cease to exist eventually. So, even in the best of all possible universes, your RNG has a half-life.

http://www.scientificamerican.com/article/could-time-end/

(I read the article many years ago, sorry the link is so lame - they're talking about maybe 100T years in the future, when the entire universe is just quantum fluctuations and everything greater than that has evaporated). No, continuous RNGs will never be, no way, not in this universe.
Climate Casino: https://climatecasino.net/climate-casino/
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 28th, 2016 at 4:58:33 PM permalink
Quote: teliot

I disagree. Those times are only valid down to the Planck time, which is about 10^(-43) seconds, in other words, only a scant 43 non-0 decimal digits maximum in that RNG.

That's because they provably don't exist. Thought you'd get that by me, eh? It was a good try, assuming time is continuous and all.

Okay, I'm out of my depth on the question of continuity of time. But I think you could argue that even if time were continuous, it wouldn't matter to humans. Sensory processing takes a measurable time and I recall reading somewhere that the maximum neural transmission is slower than the speed of sound. But back to philosophizing, that's one of the reasons why math exists as a discipline separate from physics -- to study things that can't exist in real life. Like gambling games based on random reals in the range [0,1].

XKCD: Purity
"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
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 4:58:39 PM permalink
This is a great discussion! The very kind I hoped would flourish here. Keep at it gentlemen.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
DRich
DRich
  • Threads: 86
  • Posts: 11724
Joined: Jul 6, 2012
March 28th, 2016 at 5:08:26 PM permalink
How would we ever know if a number is random? Can anything be proved to be random? My thought is randomness does not exist we just don't necessarily know how it was derived.
At my age, a "Life In Prison" sentence is not much of a deterrent.
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 5:12:17 PM permalink
Quote: Wizard

Keep at it gentlemen.

Mike, It's just another one in my very long list of science-based pet peeves -- pick a random number in the interval [0,1] -- pah! But at least this pet peeve is deeper than most.
Climate Casino: https://climatecasino.net/climate-casino/
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 28th, 2016 at 5:14:33 PM permalink
Quote: DRich

How would we ever know if a number is random? Can anything be proved to be random? My thought is randomness does not exist we just don't necessarily know how it was derived.

You're not the first to have that thought:

Quote: Of the Laws of Chance, or, a method of Calculation of the Hazards of Game, Plainly demonstrated, And applied to Games as present most in Use


It is impossible for a Die, with such determin'd force and direction, not to fall on such determin'd side, only I don't know the force and direction which makes it fall on such determin'd side, and therefore I call it Chance, wich is nothing but the want of art...


Translated by John Arbuthnot in 1692 from "De Ratiociniis in Ludo Aleae", which in turn was translated from the original 1656 German work "Van Rekeningh in Spelen van Geluck" by Christiaan Huygens.
"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
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6274
Joined: Jun 22, 2011
March 28th, 2016 at 5:58:09 PM permalink
Quote: Wizard

This is a great exercise in calculus. I have been meaning to write up my solution, but it will take a while.


Here's some help for you:


Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 6:03:35 PM permalink
Quote: teliot

Mike, It's just another one in my very long list of science-based pet peeves -- pick a random number in the interval [0,1] -- pah! But at least this pet peeve is deeper than most.



It would be hard to teach probability and statistics without such exercises.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 6:12:33 PM permalink
Quote: Wizard

It would be hard to teach probability and statistics without such exercises.

You have these continuous "attractor" distributions (like the bell curve via the central limit theorem) that allow us to say approximately continuous things for discrete distributions. But, really, it's all discrete when you get right down to it.

Here's an exercise, Mike. I'm not saying you're not going to find it. But, find me a probability or statistics exercise in some book you have that talks about picking a "random number" generically in a continuous range of values in a similar fashion to this problem.

-continues pet peeve-
Climate Casino: https://climatecasino.net/climate-casino/
AcesAndEights
AcesAndEights
  • Threads: 67
  • Posts: 4300
Joined: Jan 5, 2012
March 28th, 2016 at 7:29:28 PM permalink
Philosophy, man.

*head asplode*
"So drink gamble eat f***, because one day you will be dust." -ontariodealer
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 7:39:29 PM permalink
Okay, I hope you people are happy. Here is a link to my solution to the original problem. I welcome all comments and corrections.
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
DJTeddyBear
DJTeddyBear
  • Threads: 207
  • Posts: 10992
Joined: Nov 2, 2009
March 28th, 2016 at 7:42:46 PM permalink
Quote: Wizard

This is a great discussion! The very kind I hoped would flourish here. Keep at it gentlemen.

This discussion is both completely different in context but completely the same in concept, as the 0.999999... = 1 thread from a while back.
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? 😁
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 7:48:08 PM permalink
Quote: teliot

Here's an exercise, Mike. I'm not saying you're not going to find it. But, find me a probability or statistics exercise in some book you have that talks about picking a "random number" generically in a continuous range of values in a similar fashion to this problem.



From Probability and Statistics by Morris H. Degroot, second edition, copyright 1986, page 193. See exercise 2 or 3.

"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 28th, 2016 at 7:48:44 PM permalink
Quote: teliot

Here's an exercise, Mike. I'm not saying you're not going to find it. But, find me a probability or statistics exercise in some book you have that talks about picking a "random number" generically in a continuous range of values in a similar fashion to this problem.


This probably isn't what you mean, but Chapter 7 of Numerical Recipes basically starts out with that:

Quote: Numerical Recipes in C, 2nd edition, p. 275



From http://apps.nrbook.com/c/index.html (the old version is free online, the new version is subscription-only.)
"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
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 8:18:31 PM permalink
Quote: DJTeddyBear

This discussion is both completely different in context but completely the same in concept, as the 0.999999... = 1 thread from a while back.

No it's not. Not in the least. I think you don't understand the questions that are being asked in both cases, otherwise you couldn't possibly equate them. One is trivially easy. The other is impossibly difficult.
Last edited by: teliot on Mar 28, 2016
Climate Casino: https://climatecasino.net/climate-casino/
rsactuary
rsactuary
  • Threads: 29
  • Posts: 2315
Joined: Sep 6, 2014
March 28th, 2016 at 8:27:59 PM permalink
This is just a presentation comment.. but why wouldn't it be $150 to play, but $100 is returned only from the second number on?

Since the drawings can't stop at one pick, because the total must be OVER 1.0, you're just paying $100 to get it right back. I wouldn't expect a casino would want to rate a player and comp on that.

Obviously, the math is the same either way, but it just seems to me an odd way to word the question.
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 8:45:32 PM permalink
Thanks Mike and ME, easier than I thought and the uniform deviates is new to me. But it's the "picking" that doesn't quite work out. So, tell me one such function that you would be satisfied with using as a RNG. I mean, they talk about these things as if they're easy to come up with.

For example, how about this, f(n) = the real number you get in the range [0,1] by disregarding the first n digits of pi and using the remainder to get the decimal number. For example, f(1) = 0.1415926535..., f(2) = 0.415926535..., f(3) = 0.15926535 .... and so on. All you need is a good way to seed it (choose the n to start at). So, pick a random positive integer as the seed. And of course, you would have the nearly impossible task of proving that the resulting decimal numbers are uniformly distributed. And, of course, they form only a countably dense subset of [0,1], so not every number is possible. But, even so, you couldn't name a single irrational number that is not in the range. Sigh.
Climate Casino: https://climatecasino.net/climate-casino/
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 28th, 2016 at 9:13:43 PM permalink
Quote: teliot

Thanks Mike and ME, easier than I thought ...



I think you owe each of us a beer.

I'm not sure where our point of departure is. I am not arguing it is impossible to draw a perfect random number. However, that doesn't mean that problems like that of the OP can't have a correct answer or are not worthy of being discussed.
Last edited by: Wizard on Mar 29, 2016
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 28th, 2016 at 9:27:16 PM permalink
Quote: Wizard

I think you owe each of us a beer.

I'm not sure where our point of departure is. I am not arguing it is impossible to try a perfect random number. However, that doesn't mean that problems like that of the OP can't have a correct answer or are not worthy of being discussed.

Beer it is.

I don't think we depart on any of this. The math question was interesting,and the solutions I've seen are geometrically curious. It's just that the statement of the problem is misguided in its language phrasing it as a gambling problem. I can think of lots of practical ways to pick a number from 1 to 38. But, I can't think of a single practical way to pick a random number in the interval [0,1]. I wouldn't know where to begin. So how could we ever play this so-called gambling game? I think ME came closest, but for Planck time.
Climate Casino: https://climatecasino.net/climate-casino/
ThatDonGuy
ThatDonGuy
  • Threads: 117
  • Posts: 6274
Joined: Jun 22, 2011
March 29th, 2016 at 6:11:34 AM permalink
Quote: Wizard

Okay, I hope you people are happy. Here is a link to my solution to the original problem. I welcome all comments and corrections.


Severe glaring at and loss of 25 Mathoid points for using "I think it is safe to assume that" in a proof.
Wonko33
Wonko33
  • Threads: 15
  • Posts: 122
Joined: Aug 29, 2015
March 29th, 2016 at 8:01:52 AM permalink
Quote: Wizard



I'm not sure where our point of departure is. I am not arguing it is impossible to try a perfect random number. However, that doesn't mean that problems like that of the OP can't have a correct answer or are not worthy of being discussed.



I agree, while some keep arguing about perfect random generators, a bunch of us would be busy betting the house on this thing.
So Wizard, still no basic strategy for strip poker huh?
Romes
Romes
  • Threads: 29
  • Posts: 5602
Joined: Jul 22, 2014
March 29th, 2016 at 8:28:23 AM permalink
Quote: ThatDonGuy

Severe glaring at and loss of 25 Mathoid points for using "I think it is safe to assume that" in a proof.

Hahaha I had the same thought when I saw that. Verbiage Mike... "Therefor I conclude that" would have gotten the extra 25 Mathoid points =P.

Quote: DRich

How would we ever know if a number is random? Can anything be proved to be random? My thought is randomness does not exist we just don't necessarily know how it was derived.

It can be proven... Have a billion drawing simulation and thus you should be able to prove that each number comes out the number of times it should.

i.e. If you had whole integers 1-10 then you would expect over a billion "random" drawings that each number would come up 1/10th of the time. With the RNG's we're capable of making it can never be "truly random" and it will never be exactly .1 for this example... but it will be .0999999999999999999999999999999999999999, which for me personally, I take as .1 and thus "random."
Playing it correctly means you've already won.
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 29th, 2016 at 8:38:21 AM permalink
Quote: teliot

Beer it is.



Thank you!

Quote:

But, I can't think of a single practical way to pick a random number in the interval [0,1]. I wouldn't know where to begin.



Can't Mathematica draw a random integer from just about any range? For example, 0 to a google. Assuming it can, then take that number and divide it by a google to get, for all intents and purposes a random number from [0,1]?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 29th, 2016 at 8:42:04 AM permalink
Quote: teliot

Beer it is.

I don't think we depart on any of this. The math question was interesting,and the solutions I've seen are geometrically curious. It's just that the statement of the problem is misguided in its language phrasing it as a gambling problem. I can think of lots of practical ways to pick a number from 1 to 38. But, I can't think of a single practical way to pick a random number in the interval [0,1]. I wouldn't know where to begin. So how could we ever play this so-called gambling game? I think ME came closest, but for Planck time.

Whiskey for me, actually. But I won't make you fork over the $18 for a Manhattan on the Strip. :)

Again, I don't think it's a question of whether a human, or any human-created construct, could pick any possible real in [0,1]. The Numerical Recipes book is specifically directed toward how to do numerical operations in a computer. It's a foregone conclusion that the base 2 (or base 10) representation of an irrational number, which is infinite, can't be perfectly stored in a finite computer. That doesn't mean you can't do operations with irrationals; computers pass around sqrt(2) or pi() all the time and end up with results including those terms. It's just that converting a finite formulaic representation like 0.5*sqrt(2)/pi() into a floating point decimal representation results in an inevitable loss of precision. For tasks like Monte Carlo simulation, it doesn't matter, and that's the premise of the random numbers section of Numerical Recipes. The question there is "given that you want to approximate the selection of a uniform real over [0,1] using a digital computer, what are good algorithms to do it?" That's different than asking whether those algorithms are approximations in the first place, because of course they are. Most standard computing systems use no more than 64 bits to represent floating point numbers. Due to the way IEEE 754 stores data, double-precision floats can represent very small numbers, but it's easy to see where that system breaks down. For example, the binary representation of the following two numbers in 64-bit floats is identical so clearly there's data being lost:
1.0000000000000002
1.0000000000000003
Also, try copying that into Excel and see what happens...

I'll again admit to ignorance regarding the issue of radioactive decay vis-a-vis Planck time -- I couldn't find any information that the timing of a subatomic particle decay is necessarily quantized to some integer multiple of Planck time units. What is certainly true is that we can't possibly build a measuring tool capable of telling the difference, and that's an important distinction.
"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
Ibeatyouraces
Ibeatyouraces
  • Threads: 68
  • Posts: 11933
Joined: Jan 12, 2010
March 29th, 2016 at 8:47:58 AM permalink
Quote: Romes

...It can be proven... Have a billion drawing simulation and thus you should be able to prove that each number comes out the number of times it should...


While having each number come out an equal amount of times, that doesn't prove random.
DUHHIIIIIIIII HEARD THAT!
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 29th, 2016 at 8:48:31 AM permalink
Quote: Wizard

Can't Mathematica draw a random integer from just about any range? For example, 0 to a google. Assuming it can, then take that number and divide it by a google to get, for all intents and purposes a random number from [0,1]?

Yes, but those purposes matter. First off, you'll need a lot more storage to represent that data than the typical 64 bits (see my prior post). Obviously, the more space you dedicate to a digital representation, the more precise you can make it. I just gave the example of how 1.0000000000000002 can't be accurately represented in just 64 bits, but what I just typed there actually uses 18 bytes (characters) so that's an exact 144 bit representation.

More to teliot's point, I think, anything that involves the technique you describe -- and which is the same technique used by most PRNGs to derive floating point values over a given range -- is necessarily producing only rational numbers. Generating an integer between 0 and INT_MAX, and then dividing by INT_MAX, still leaves a lot of holes in the number line. For example, here's the Mersenne Twister code that does exactly this:
/* generates a random number on [0,1)-real-interval */
double genrand64_real2(void)
{
return (genrand64_int64() >> 11) * (1.0/9007199254740992.0);
}

from http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/VERSIONS/C-LANG/mt19937-64.c
"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
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 29th, 2016 at 10:26:33 AM permalink
Quote: MathExtremist

More to teliot's point, I think, anything that involves the technique you describe -- and which is the same technique used by most PRNGs to derive floating point values over a given range -- is necessarily producing only rational numbers. Generating an integer between 0 and INT_MAX, and then dividing by INT_MAX, still leaves a lot of holes in the number line.



If you can draw an integer from 0 to a google, and then divide by a google, those holes will be pretty tiny. Can anyone provide a real world application for needing a random number where a 128-byte RNG won't do? Yes, such an RNG can't create a true irrational number, but for what purpose would one need one?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 29th, 2016 at 10:41:03 AM permalink
Quote: Wizard

If you can draw an integer from 0 to a google, and then divide by a google, those holes will be pretty tiny.

Actually, they are infinitely large. That's teliot's objection, I believe. If you pick any two real numbers, there are infinitely many reals between them.
Quote:

Can anyone provide a real world application for needing a random number where a 128-byte RNG won't do? Yes, such an RNG can't create a true irrational number, but for what purpose would one need one?

I can't think of one, but I'm in the gaming world where "sufficiently random" is 6 bits of data, e.g., craps, roulette, card shuffling. Slot machines have been approved using 8-bit PRNGs. It doesn't take much for people to bet on something uncertain, even if it's not sufficiently precise for, say, meteorological simulations.
"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
Wizard
Administrator
Wizard
  • Threads: 1493
  • Posts: 26504
Joined: Oct 14, 2009
March 29th, 2016 at 10:43:20 AM permalink
Quote: MathExtremist

If you pick any two real numbers, there are infinitely many reals between them.



Agreed, but in the real world, who cares?
"For with much wisdom comes much sorrow." -- Ecclesiastes 1:18 (NIV)
MathExtremist
MathExtremist
  • Threads: 88
  • Posts: 6526
Joined: Aug 31, 2010
March 29th, 2016 at 10:48:07 AM permalink
Quote: Wizard

Agreed, but in the real world, who cares?

I don't know that anyone does, and back to my argument about measurability, I don't know that anyone could tell either. I think it's a matter of semantics -- it's impossible to select "any" real from the range [0,1] but it's easy (sort of) to select one of a finite subset of reals in the range [0,1] and use that as a practical approximation to "any". How to do that selection is an interesting computational problem.
"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
Ayecarumba
Ayecarumba
  • Threads: 236
  • Posts: 6763
Joined: Nov 17, 2009
March 29th, 2016 at 10:51:44 AM permalink
Quote: Wizard

If you can draw an integer from 0 to a google, and then divide by a google, those holes will be pretty tiny. Can anyone provide a real world application for needing a random number where a 128-byte RNG won't do? Yes, such an RNG can't create a true irrational number, but for what purpose would one need one?



Data encryption is usually first on the list of applications. Gambling applications seem to be a close second.

As for your generator, what method would you use to select the initial integer to divide? How would you randomize that selection process?

Fermilabs uses decaying Cesium to generate numbers. I think we can trust that source to extent that we can measure it accurately.
Simplicity is the ultimate sophistication - Leonardo da Vinci
teliot
teliot
  • Threads: 43
  • Posts: 2871
Joined: Oct 19, 2009
March 29th, 2016 at 10:57:51 AM permalink
Quote: Wizard

If you can draw an integer from 0 to a google, and then divide by a google, those holes will be pretty tiny. Can anyone provide a real world application for needing a random number where a 128-byte RNG won't do? Yes, such an RNG can't create a true irrational number, but for what purpose would one need one?

Mike, in the problem stated on 538 that you answered in this thread, it is not the least bit clear that the bias of any given computer rng wouldn't substantially impact the odds of the game. If you read through the Big Crush tests to certify rngs, you would be surprised to learn the the Mersenne Twister doesn't pass all of those tests, even though the Mersenne Twister does pass the much less robust Diehard tests. I would hardly know where to begin to compute the EV of the game using the Mersenne Twister as the RNG and 64 bit representations for the doubles in the range [0,1].

As for holes -- you've given only finitely many numbers on a continuous interval, and you ask if there are holes. Yikes!
Climate Casino: https://climatecasino.net/climate-casino/
  • Jump to: