I've encountered the following situation within various trials.
Why does such a difference arise between bulk sampling and one-by-one sampling?
(*Bulk sampling*)
SeedRandom[1234];
RandomVariate[NormalDistribution[], 10]
(*sampling one-by-one*)
SeedRandom[1234];
Table[RandomVariate[NormalDistribution[]], 10]
Example: For example, consider the following game.
- The player gains points depending on the value of variable x every time.
- x is a random number, and is subject to NormalDistribution [0, 1]
- If x> 0 then the player gets + 1,otherwise, x <0, the player gets -1.
I believed that expectation value of game scores should be equal regardless of how random numbers are generated.
However, the experiment is as follows.
About Mean:
{BlockRandom[SeedRandom[1234];
N@Mean@Table[
Total[If[# > 0, 1, -1] & /@
RandomVariate[NormalDistribution[], 10]], {100}]],
BlockRandom[SeedRandom[1234];
N@Mean@Table[
Total[If[# > 0, 1, -1] & /@
Table[First@RandomVariate[NormalDistribution[], 1],
10]], {100}]]}
{0.18, -0.68}
Histogram[{BlockRandom[SeedRandom[1234];
Table[Total[
If[# > 0, 1, -1] & /@
RandomVariate[NormalDistribution[], 10]], {100}]],
BlockRandom[SeedRandom[1234];
Table[Total[
If[# > 0, 1, -1] & /@
Table[First@RandomVariate[NormalDistribution[], 1],
10]], {100}]]}]
I didn't understand why this happens and found out the phenomenon in this question.