2013年10月25日 星期五

[情報] 納特•帕格的問題(Bug of Nat Pagle)

Manabender:
I've recorded my results with Nat Pagle thus far, and come to the conclusion that he is definitely not working as intended, based on statistical analysis.

Just for completeness, the following is my data: (Each number is a turn ended with Nat Pagle in play and not silenced. 0 = no draw, 1 = draw, / = divides plays)
001011 / 000 / 1 / 1011000 / 1100 / 0 / 000 / 100010 / 0 / 0 / 01 / 00 / 0 / 000 / 0 / 0 / 0000 / 00 / 0 / 0 / 010 / 01 / 001 / 1 / 11 / 10 / 00 / 0 / 0 / 0 / 000 / 00 / 0 / 0000 / 0 / 00

This is a total of 19 draws and 62 no-draws. Running this through a chi-square test of goodness of fit (against expected frequencies of 40.5 and 40.5) gives a chi-square of 22.827 and a p-value of 1.77e-6.

In layman's terms, that means there is a 0.000177% chance that this data is so bad only because I have bad luck. The other 99.999823% chance is that something is wrong and the "claimed" 50% is inaccurate.

I think I know what happened, though. The chance is really 25%. Running the same chi-square test against expected frequencies of 20.25 and 60.75 gives a p-value of 0.74839974. In layman's terms, that means it's probably very close to 25%.

I would guess that what happened is that the game code says something like "If (50% chance) then {If (50% chance) then {Draw a card}}", when it should just say "If (50% chance) then {Draw a card}".




Ben Brode:
Hey guys!

We did track down a problem with Nat that was causing his draw % to be 25% instead of 50%. Great job to the OP for drawing our attention to the issue!

We'll get a fix out for the problem soon - and it shouldn't require a client patch.

Thanks everyone, and sorry for not running the simulation properly the first time and misleading everyone. :-/

- Ben





Dido:
Simulations are fine but think you should also look at the code and algorythm itself.
If you look at the code it should be pretty easy to see if it is 50% or 25%?



Ben Brode:
In this case, the problem was the interaction of several systems that all looked correct on their own. For example, Nat's code was basically: "If (Get a random number between 1 and 2) = 1, then draw a card". We tested the "Get a random number between 1 and 2" code and it returned "1" 50% of the time. (this was the initial simulation).


來源: 官網