Skip to main content
replaced http://stats.stackexchange.com/ with https://stats.stackexchange.com/
Source Link

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined herehere?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

replaced http://math.stackexchange.com/ with https://math.stackexchange.com/
Source Link

As explained herehere, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

added 14 characters in body; edited tags
Source Link
user147263
user147263

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought Pi$\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $sqrt(10000*2/{\pi})$ = approx 79.788$\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of -0.025$-0.025$ with a variance of 3.811875$3.811875$, and using simulation, I get approx 268.8$\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought Pi was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $sqrt(10000*2/{\pi})$ = approx 79.788.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of -0.025 with a variance of 3.811875, and using simulation, I get approx 268.8 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

As explained here, the average distance or 'travel' of a random walk with $N$ coin tosses approaches: $$\sqrt{\dfrac{2N}{\pi}}$$

What a beautiful result - who would've thought $\pi$ was involved! However, what would be the formula to use for an arbitrary paytable?

For example, a coin toss has the paytable:

  • 0.5 : -1
  • 0.5 : 1

...so a 50% chance of both winning or losing a point. After 10,000 coin tosses, the travel on average will be $\sqrt{10000\cdot2/{\pi}} \approx 79.788$.

However a dice roll where you need to land a six to win could have the paytable:

  • 0.8333.. : -1
  • 0.1666.. : 5

After 10,000 dice rolls, the travel on average will be about 178. However, I only know that because I used simulation to brute force the result - I don't know the formula.

More generally, a paytable could have multiple entries where all the probabilities add up to one:

  • probability1 : payout1
  • probability2 : payout2
  • probability3 : payout3
  • ...
  • ...
  • probabilityN : payoutN

Note that the total of the payouts may not necessarily be zero. It could be weighted to produce an unfair game. For example:

  • 0.75 : -1
  • 0.1 : 0.5
  • 0.15 : 4.5

That's an average payout of $-0.025$ with a variance of $3.811875$, and using simulation, I get $\approx 268.8$ 'travel' from 10000 runs. But how would I find this out directly?

In other words, how would you find the average 'travel' of such a generalized paytable without resorting to simulation? As a side question, would this figure also be a better indication of risk for such a 'game' compared to the standard deviation of the paytable as defined here?

Here's the code I used for the simulation: http://pastebin.com/985eDTFh

It's written in C#, but is otherwise very well self-contained. Most of it is a fast random class, but you can use the default Random class if you prefer. Also, if you're not using C#, don't worry too much about converting the convertCSVtoPayoutTable() function as you can hard code the probability and payout arrays yourself if you prefer.

added 418 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
Notice removed Draw attention by CommunityBot
Bounty Ended with Colm Bhandal's answer chosen by CommunityBot
Tweeted twitter.com/#!/StackMath/status/645121394834075648
added 58 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
Notice added Draw attention by Dan W
Bounty Started worth 50 reputation by Dan W
added 190 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
added 115 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
deleted 10 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
added 64 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
deleted 1 character in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
added 42 characters in body
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading
Source Link
Dan W
  • 645
  • 1
  • 7
  • 16
Loading