Elements the Game Forum - Free Online Fantasy Card Game

Elements the Game => Report In-game Issues => Issue Archive => Topic started by: oblowsky on March 19, 2012, 09:49:00 pm

Title: what is 50% in real life
Post by: oblowsky on March 19, 2012, 09:49:00 pm
hi everyone
this is my first post on this forum, and I came here for only one purpose: to share with you my analysis about dusk mantle, the "50%" card
I did have some extra time during last week... so here are results of my little research:

2002 times!
yeah right: 2k times. not a small number for serious stats :)
so 2002 times my creatures attacked into dusk mantle
1288 times attack was 'miss'  >:D
724 times was good

that is not even near 50%.  this is bug or just very bad design.
and again, I'm not talking about one game. I'm talking about cca 150 games and result is cca 64%

ty for your time and sry for my bad english

regards
Title: Re: what is 50% in real life
Post by: daccoo on March 19, 2012, 09:54:37 pm
M8 it has 50% chance to miss or hit ...
That is chance it can hit 1000 times and it can miss 1000 times it depends of how much luck you have .
For example fog has 40 % chance but i played a lot of games when they miss me 4 or 5 times in a row.
It is all mater of luck
Title: Re: what is 50% in real life
Post by: oblowsky on March 19, 2012, 09:57:07 pm
I know that m8
but after 2000 attacks it's very wrong to have that kind of difference
very, very, very wrong

and again, I'm not talking about one or two games. I'm talking about counting 2000 attacks
Title: Re: what is 50% in real life
Post by: regen2k9 on March 19, 2012, 10:01:15 pm
In order to tell if there is statistical significance to the results of this large sample (2002 trial sample), you must first conduct a t test.  If the community wants one done I'd be more than happy to do it, but until one is conducted, we cannot judge whether or not this inaccuracy is valid.
Title: Re: what is 50% in real life
Post by: Aves on March 19, 2012, 10:04:57 pm
The larger the sample size, the more ideal your results will be (generally speaking- there is always a chance for it to go the other way). 2k is not sufficiently big a sample size. In order to prove that the chance is not 50%, you'd need to make your sample size much larger, like tallying the community's entire count, as regen suggests.
Title: Re: what is 50% in real life
Post by: daccoo on March 19, 2012, 10:06:42 pm
The larger the sample size, the more ideal your results will be (generally speaking- there is always a chance for it to go the other way). 2k is not sufficiently big a sample size. In order to prove that the chance is not 50%, you'd need to make your sample size much larger, like tallying the community's entire count, as regen suggests.
True.
Title: Re: what is 50% in real life
Post by: oblowsky on March 19, 2012, 10:07:22 pm
@regen2k9

I understand your scepticism and I don't blame you
I would also like to see other players results.
maybe I'm just so unununununbelievable unlucky???   :-\
Title: Re: what is 50% in real life
Post by: oblowsky on March 19, 2012, 10:08:59 pm
@aves

sry m8 but 2k is good enough size for that kind of statistic...
Title: Re: what is 50% in real life
Post by: ralouf on March 19, 2012, 10:14:51 pm
You can ask about how much this is coded but I'm sure it's 50% for real, it just that luck is a big issue when you play this card.
Title: Re: what is 50% in real life
Post by: oblowsky on March 19, 2012, 10:17:42 pm
I was not expecting fifty-fifty results. no way.
the bigger the sample size, the more likely results will be 50-50
I'll be all right with 55-45, or even more, but after 2000 attacks: 64,5% - 35,5%????
something is wrong....
Title: Re: what is 50% in real life
Post by: bogtro on March 19, 2012, 10:45:02 pm
Using the game simulator (http://xenocidius.allalla.com/simulator/), I got, in a quick sample of 399 attacks, 202 misses and 197 hits. While this is a small sample size, this is a large enough sample to suggest that nothing is broken (I will repeat this again later). You should expect variance when flipping a coin. 2000 times is not a strong enough sample to prove unfairness either way.
Title: Re: what is 50% in real life
Post by: teffy on March 19, 2012, 11:13:58 pm
The sample size of 2000 is high enough. We would get more problems, if p~0, or p~1. But here:

For normal distribution, we often demand : var = sd^2 = n*p* (1-p) > 9.  500,5 >3.
Other formulas which say when I can use normal distribution give similar results.

Using normal distribution for coin toss, and the 3-sigma rule, we get the result:

The chance is  ~ 99,73 % , that      number blocked creatures / number of creatures    is in the intervall  [0,5 - 0, 033524 , 0,5+ 0, 033524]

( 0,5 +/-   3/ (2* sqrt(n)) ,  sqrt (n) = n^(1/2) )

We have 1288 / 2002 ~ 0,643 > 0,533524!

That means, the result above is very very unlikely!

That´s either a wrong measurement, or an algorithm mistake or very very bad luck.

Edit: missed a "3". Mistake corrected.
0,1117*3=0,033524
Title: Re: what is 50% in real life [Not a bug]
Post by: waterzx on March 20, 2012, 01:21:09 am
How can one say that 2000 samples are too small in number ?

It's not big enough to eliminate all possible errors but it is big enough not to have more than 10% deviation from the "true" value (50%)

Anyway, everything is possible in statistics....
Title: Re: what is 50% in real life
Post by: Belligerence on March 20, 2012, 03:19:35 am
The 50% is a statistical number, not a concrete number. Each attack has a 50% chance of missing. When you compile all the data together, you would assume that the final numbers would be +/- 5% of the suggested 50%. But because each attack has a 50% chance of missing, you can come up with a much different result than what you expect. This does not mean that the original 50% suggested is wrong, it simply shows that our data table is either small, incorrect, or deviant. This is known simply as "luck" or "chance", and is why, while your data sample suggests otherwise, the 50% suggested on Dusk Mantle is in fact 50%. (Also note that if you ever take a statistics class, saying "I'm due to get a <heads/tail/whatever variable you're using> during the probability portion will likely dock you a few points. Probability doesn't care if you're "due" something, it doesn't care at all.)
Title: Re: what is 50% in real life
Post by: kev on March 20, 2012, 04:09:00 am
The chance is  ~ 99,73 % , that      number blocked creatures / number of creatures    is in the intervall  [0,5 - 0, 01117 , 0,5+ 0, 01117]

We have 1288 / 2002 ~ 0,643 > 0,51117 !
+rep to Teffy and oblowsky

Not everyone is getting what was said above.  Flipping a coin twice and getting two heads is luck.  Flipping a coin 2002 times and getting 1288 heads isn't luck, it's something that happens in less than 0.135% of simulations, as Teffy showed above.  Assuming oblowsky can count and Teffy's stats hold (and I suspect both are good), it looks highly likely there's a problem with the code and zanz needs to look into it.

Maybe the best way to catch zanz's attention is to move this to Bugs forum?
Title: Re: what is 50% in real life
Post by: Xenocidius on March 20, 2012, 09:23:22 am
Using the game simulator (http://xenocidius.allalla.com/simulator/), I got, in a quick sample of 399 attacks, 202 misses and 197 hits. While this is a small sample size, this is a large enough sample to suggest that nothing is broken (I will repeat this again later). You should expect variance when flipping a coin. 2000 times is not a strong enough sample to prove unfairness either way.
Note that the Game Simulator is a very bad way of measuring things like this; it is not written in Actionscript, for one thing, and does not reflect the actual game code in some respects.

I'm a bit confused, to be honest. I have no idea why Dusk Mantle shouldn't reflect its 50% chance, which leads me to believe that either Actionscript's random function leaves a lot to be desired, or that either the measurements or above stats are incorrect. And yeah, this should probably be in the Bugs forum.
Title: Re: what is 50% in real life
Post by: waterzx on March 20, 2012, 09:44:58 am
The chance is  ~ 99,73 % , that      number blocked creatures / number of creatures    is in the intervall  [0,5 - 0, 01117 , 0,5+ 0, 01117]

We have 1288 / 2002 ~ 0,643 > 0,51117 !
+rep to Teffy and oblowsky

Not everyone is getting what was said above.  Flipping a coin twice and getting two heads is luck.  Flipping a coin 2002 times and getting 1288 heads isn't luck, it's something that happens in less than 0.135% of simulations, as Teffy showed above.  Assuming oblowsky can count and Teffy's stats hold (and I suspect both are good), it looks highly likely there's a problem with the code and zanz needs to look into it.

Maybe the best way to catch zanz's attention is to move this to Bugs forum?
I appreciate that you are the first one who mentioned the game-code.

Aside from  the "luck factor" which is very unlikely to cause such big deviation but mentioned by a lot of people, a corrupted game-code is another possible reason.

Now we have statistics for "luck factor" , then we should look into the game-code to find out the real reason


Edit : If we are gonna dig through the problem , shouldn't we test fog shield as well ?
Title: Re: what is 50% in real life
Post by: teffy on March 20, 2012, 11:23:46 am
Found that I missed a "3".  Edited my first post.
Also tested the 2002 - coin toss experiment using a statistic software (R). I did the 2002 coin toss experiment 100.000 times. In none of these experiments I got more than ~56 % head.

Title: Re: what is 50% in real life
Post by: bogtro on March 20, 2012, 11:29:16 am
Using the game simulator (http://xenocidius.allalla.com/simulator/), I got, in a quick sample of 399 attacks, 202 misses and 197 hits. While this is a small sample size, this is a large enough sample to suggest that nothing is broken (I will repeat this again later). You should expect variance when flipping a coin. 2000 times is not a strong enough sample to prove unfairness either way.
Note that the Game Simulator is a very bad way of measuring things like this; it is not written in Actionscript, for one thing, and does not reflect the actual game code in some respects.

I'm a bit confused, to be honest. I have no idea why Dusk Mantle shouldn't reflect its 50% chance, which leads me to believe that either Actionscript's random function leaves a lot to be desired, or that either the measurements or above stats are incorrect. And yeah, this should probably be in the Bugs forum.
Yeah, I figured :/

If these results are actually accurate, then it's quite possible that something is up with it. There is a mound of empirical and anecdotal evidence (there is a reason that DM is called "haxx" :P) that suggests this, so it's not unthinkable that this actually occurs. However, knowing no programming, I highly doubt that there's any sophisticated coding for zanz in DM, so it's probably a problem with the script used (if at all).
Title: Re: what is 50% in real life
Post by: Shantu on March 20, 2012, 06:28:18 pm
I've always said the RNG was screwed in Elements. Anyone telling you otherwise is either blind or have not played enough.

I might try a test like this on my own; another 2000 (or more) hits against Dusk.
Title: Re: what is 50% in real life
Post by: Shantu on March 20, 2012, 08:07:42 pm
Sorry for the double post. I am done with my own test:

2338 attacks
1158 hits (vs 1180 misses)
This means ~49,5% hit.

This was done in trainer.

As you can see, quite different than the result of the topic starter.

For those interested, here's the test sheet (a bunch of numbers) attached:
Title: Re: what is 50% in real life
Post by: zanzarino on March 21, 2012, 01:19:44 am
The funny thing is that sometimes in my code I use:

If (Math.random()>.5){
   do something
}
 
Sometimes I use:
If (Math.random()<.5){
   do something
}

In both cases I get complaints about the RNG being biased, which means that not only it is biased, it can read your mind  :o
It decreases the returned number when you would prefer a big number and increases it when you want a small number!

I am going to insta-send this to Stephen Hawking because last time I checked there was no software capable of reading the human mind: I smell a Nobel prize coming my way  8)

http://www.elementsthegame.com/dusk.html (http://www.elementsthegame.com/dusk.html)

P.S. : If you are thinking that I should consider the case of the random number being ==.50000000000000000000000000000000 well, lol: I'll let you figure out why it does not matter.
Title: Re: what is 50% in real life
Post by: bogtro on March 21, 2012, 01:25:07 am
<3 zanz

More seriously, confirms what I thought. Statistical variance (although a large one) is not a large enough sample to claim bias. Also quite possible that these statistics are not quite valid, as suggested by statistics.
Title: Re: what is 50% in real life
Post by: EmeraldTiger on March 21, 2012, 01:41:09 am
see this
(http://i.imgur.com/Ot8t4.png)
Title: Re: what is 50% in real life
Post by: waterzx on March 21, 2012, 02:09:30 am
The funny thing is that sometimes in my code I use:

If (Math.random()>.5){
   do something
}
 
Sometimes I use:
If (Math.random()<.5){
   do something
}

In both cases I get complaints about the RNG being biased, which means that not only it is biased, it can read your mind  :o
It decreases the returned number when you would prefer a big number and increases it when you want a small number!

I am going to insta-send this to Stephen Hawking because last time I checked there was no software capable of reading the human mind: I smell a Nobel prize coming my way  8)

http://www.elementsthegame.com/dusk.html (http://www.elementsthegame.com/dusk.html)

P.S. : If you are thinking that I should consider the case of the random number being ==.50000000000000000000000000000000 well, lol: I'll let you figure out why it does not matter.
I did expect such a quick reply !

Can you really read people's mind , Zanz ?

Anyway, now it seems Murphy's law is behind the whole thing >:(
Title: Re: what is 50% in real life
Post by: sunyata on March 21, 2012, 02:27:12 am
Found that I missed a "3".  Edited my first post.
Also tested the 2002 - coin toss experiment using a statistic software (R). I did the 2002 coin toss experiment 100.000 times. In none of these experiments I got more than ~56 % head.
Nice to see there's another R user on EtG. One of the best pieces of open-source software in existence.
The correct test to use here is a binomial test.  We can use the simple code

binom.test(724,2002,(1/2),alternative="two.sided")

in R to calculate the probability that a 50% prob shield would give 724 misses out of 2002 trials.  It comes out as probability = 2.2x10^-16.  In other words, if OP counted successes/failures correctly it is unequivocal that the probability is not 50%.
Title: Re: what is 50% in real life
Post by: Kardo on March 21, 2012, 05:18:36 am
Just throwing it out there. Is it possible OP used Adrenaline to increase the speed of testing and somehow Adren reacts badly with Dusk/Fog shield?
Title: Re: what is 50% in real life
Post by: ralouf on March 21, 2012, 06:16:51 am
Did like ET and got 51.4522821576763% success in my attack. That's just in you mind that dusk is bugged :p (OK in mine too :p)
Title: Re: what is 50% in real life
Post by: teffy on March 21, 2012, 11:28:58 am
Good that the experiment in the OP is not repeatable...


P.S. : If you are thinking that I should consider the case of the random number being ==.50000000000000000000000000000000 well, lol: I'll let you figure out why it does not matter.
However, 0.5 is an existing machine number, and excluding this case could bring us very rare bugs, which we could see once in a lifetime (or more seldom). My guess is 1 : 2^30 (~1 billion) or 1: 2^62  (4 *10^18) per random number. Math.random doesn´t choose each machine number with the same probability, but the dimension should be correct. Can 0.5 be chosen by math.random() ?.
Title: Re: what is 50% in real life
Post by: Wizy on March 22, 2012, 04:23:37 pm
Math.random()>.5 should be in theory more accurate, since the random function will never return exactly 1 but it may return exactly 0 (albeit almost impossible) thus 0.5 would be less than half.
Anyway, the range of error is so small, it will not make any difference.
Title: Re: what is 50% in real life
Post by: sunyata on March 22, 2012, 08:34:20 pm
Math.random()>.5 should be in theory more accurate, since the random function will never return exactly 1 but it may return exactly 0 (albeit almost impossible) thus 0.5 would be less than half.
Anyway, the range of error is so small, it will not make any difference.
Too right it won't make any measurable difference.  Actionscript uses 64bit number type, so the prob of getting exactly 0.5 is less than 1 in 30,000,000,000,000,000,000.  You'd have a better chance of winning the UK, European, and USA lotteries all on the 29th February.

The code zanz used is fine.  The problem is either with the RNG, or (in light of the issue not being replicated by others) the OP's measurements.
blarg: