PDA

View Full Version : Expected Value Question


J6o All In
04-05-2005, 12:56 PM
I will pay you 1/rand() dollars where rand() is Excel's random number generation function.

How much will you pay me to play this game?

jason1990
04-05-2005, 03:03 PM
How much do you want? Once we decide on a price, how many times can I play at that price?

gaming_mouse
04-05-2005, 05:04 PM
[ QUOTE ]
How much do you want? Once we decide on a price, how many times can I play at that price?

[/ QUOTE ]

I think he just means for you to calcualte the EV, which would be the integral from 0 to 1 of x*(1/x), right? So the EV is 1?

BruceZ
04-05-2005, 05:19 PM
[ QUOTE ]
[ QUOTE ]
How much do you want? Once we decide on a price, how many times can I play at that price?

[/ QUOTE ]

I think he just means for you to calcualte the EV, which would be the integral from 0 to 1 of x*(1/x), right? So the EV is 1?

[/ QUOTE ]

So you'll only charge me a dollar to play? When can we start?

gaming_mouse
04-05-2005, 05:24 PM
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
How much do you want? Once we decide on a price, how many times can I play at that price?

[/ QUOTE ]

I think he just means for you to calcualte the EV, which would be the integral from 0 to 1 of x*(1/x), right? So the EV is 1?

[/ QUOTE ]

So you'll only charge me a dollar to play? When can we start?

[/ QUOTE ]

What? Is the EV infinite and I made some simple mistake?

elitegimp
04-05-2005, 05:31 PM
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
[ QUOTE ]
How much do you want? Once we decide on a price, how many times can I play at that price?

[/ QUOTE ]

I think he just means for you to calcualte the EV, which would be the integral from 0 to 1 of x*(1/x), right? So the EV is 1?

[/ QUOTE ]

So you'll only charge me a dollar to play? When can we start?

[/ QUOTE ]

What? Is the EV infinite and I made some simple mistake?

[/ QUOTE ]

yeah, x is a uniform variable between 0 and 1, so its distribution is just f(x) = 1 (0<x<1). So EV = Integral from 0 to 1 of 1/x = infinity

Roscoe
04-05-2005, 05:40 PM
A question:

what happens if the random number generator returns a value of zero? I did a simuation and the I did get a trial where the random number generator did get a value of rand=0

If you address the "zero" problem by "re-picking", then the expected value would be (the integral of 1/x from .000000000000001 to .999999999999999) divided by .999999999999999.




(ln (.999999999999999)-ln(.000000000000001))/.999999999999999

this is approximately equal to 34.5

Excel produces a random number with 15 decimal places. This is how I got the numbers above.

If I did something wrong, please let me know.


By the way, to answer your question, I would pay $10.

BruceZ
04-05-2005, 08:40 PM
[ QUOTE ]
A question:

what happens if the random number generator returns a value of zero? I did a simuation and the I did get a trial where the random number generator did get a value of rand=0

If you address the "zero" problem by "re-picking", then the expected value would be (the integral of 1/x from .000000000000001 to .999999999999999) divided by .999999999999999.




(ln (.999999999999999)-ln(.000000000000001))/.999999999999999

this is approximately equal to 34.5

Excel produces a random number with 15 decimal places. This is how I got the numbers above.

If I did something wrong, please let me know.

[/ QUOTE ]


.000000000000001 is nowhere near the smallest representable positive number in Excel, and what it displays as 0 depends on the number of decimal places you have set and whether you are in scientific mode. The smallest positive number, to 8 significant figures, is 2.2250739E-308. I don't know if the rand function can produce a number this small, however.

BruceZ
04-05-2005, 09:40 PM
[ QUOTE ]
[ QUOTE ]
A question:

what happens if the random number generator returns a value of zero? I did a simuation and the I did get a trial where the random number generator did get a value of rand=0

If you address the "zero" problem by "re-picking", then the expected value would be (the integral of 1/x from .000000000000001 to .999999999999999) divided by .999999999999999.




(ln (.999999999999999)-ln(.000000000000001))/.999999999999999

this is approximately equal to 34.5

Excel produces a random number with 15 decimal places. This is how I got the numbers above.

If I did something wrong, please let me know.

[/ QUOTE ]


.000000000000001 is nowhere near the smallest representable positive number in Excel, and what it displays as 0 depends on the number of decimal places you have set and whether you are in scientific mode. The smallest positive number, to 8 significant figures, is 2.2250739E-308. I don't know if the rand function can produce a number this small, however.

[/ QUOTE ]

On second thought, the rand function may not produce any positive numbers smaller than .000000000000001, since if it did, then the probability of each number would not be the same. The larger numbers would occur more frequently since there would be a larger distance between them than between the tiniest numbers (non-uniform quantization). It does say that the numbers are "evenly distributed". If we take that to mean "equally probable", then I agree with your analysis.

It does seem unlikely that the zero you observed was really a zero, unless you produced on the order of 10^15 numbers, or unless there is something wrong with the rand function that makes zero more likely. Were you displaying all 15 decimal places when it occurred?

RubbleRobble
04-05-2005, 10:29 PM
Lolol, the integral of the basic uniform random variable (f(x)=1 on 0<=x<=1) is definitely NOT infinity. In fact, legit pdf's only have an integral of 1 by the three basic principles of probability.

Roscoe
04-05-2005, 10:33 PM
Well, the zero I encountered was using the rnd function in qbasic (which has fewer significant digits). I would assume that excel is capable of returning a value of zero (although as you noted, highly unlikely).

gaming_mouse
04-05-2005, 10:55 PM
[ QUOTE ]
Lolol, the integral of the basic uniform random variable (f(x)=1 on 0<=x<=1) is definitely NOT infinity. In fact, legit pdf's only have an integral of 1 by the three basic principles of probability.

[/ QUOTE ]

the EV is the integral of 1*(1/x), and that's what he's saying is infinite, b/c it is.

irchans
04-06-2005, 08:38 AM
If you repeatedly played this game with a perfect random number generator, the most you should pay to play the game is (1 + B)^(1 + 1/B) - B where B is your current bankroll. If you consistently pay more than that amount, you will go bust.

If B is 1 million dollars, then the most you should pay to play the game is $14.81.

If B is $100,000, then the most you should pay to play the game is $12.51.

If B is $10,000, then the most you should pay to play the game is $10.21.