.com.unity Forums
  The Official e-Store of Shrapnel Games

This Month's Specials

Raging Tiger- Save $9.00
winSPMBT: Main Battle Tank- Save $5.00

   







Go Back   .com.unity Forums > Illwinter Game Design > Dominions 2: The Ascension Wars

Reply
 
Thread Tools Display Modes
  #1  
Old February 4th, 2005, 12:23 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
Bummer_Duck said:
I totally agree that 8 smiths is too small of sample. I believe I stated 14+ earlier, but perhaps not.

Here calculations are getting more complicated.
Probability of 14 smiths missing one of the paths is 80.8%.

Quote:
Bummer_Duck said:
In my current game, I will be recruiting my 15th drawf this year, and I am still missing representation of 2 magic paths. 3 paths represent 71.4% of the mages, with 3, 3, and 4 mages per magic path, respectively (3 magic paths have 1 representative each). This is the widest distribution of paths I can remember in all my tests. So...turn those equations around for me. How likely is it that in each game or test, that ~3 paths would represent +71% of the mages?

It seems to be even more complicated to calculate (Probability that 10 or more smiths out of 14 will be concentrated in 3 paths). It seems to be around 40-45%, but I had to drop the tail of the sequence, so I'm not sure about accuracy. I will try to calculate it precisely later.

Quote:
Bummer_Duck said:
shouldn't it approach 3/8? or 37.5% the larger the sample is? What am I missing here?
You mean number of mages concentrated in 3 paths should approach 37.5% of total number of mages? - No it should not, what are you saying would effectively mean that the equal number of mages in each path, which is very unlikely event. On the large samples peak of probability will probably be somewhere in 45-60% range (that's very rough estimate, I will try to calculate it precisely some time later)
Reply With Quote
  #2  
Old February 4th, 2005, 06:50 AM

Ivan Pedroso Ivan Pedroso is offline
Corporal
 
Join Date: Feb 2004
Location: Denmark
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Ivan Pedroso is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
alexti said:
Quote:
Bummer_Duck said:
shouldn't it approach 3/8? or 37.5% the larger the sample is? What am I missing here?
You mean number of mages concentrated in 3 paths should approach 37.5% of total number of mages? - No it should not, what are you saying would effectively mean that the equal number of mages in each path, which is very unlikely event. On the large samples peak of probability will probably be somewhere in 45-60% range (that's very rough estimate, I will try to calculate it precisely some time later)
Hmmmmmm, why shouldn't it approach 3/8 ?!?

Let us assume that the distribution behind the scenes is uniform. Then the observed frequencies will approach 1/8. Of cause getting a sequence that actually results in an observed frequency of exactly 1/8 for every path will be highly unlikely, but they WILL approach 1/8 as the sample grows. I mean: if you use a uniform distribution to generate some values, then the distributed values will look more and more uniform. And therefor adding the frequencies of the three highest represented paths will tend towards 3/8 (from above obviously). I concede that getting the result 3/8 in a test sample will "never" happen.
__________________
If I have seen further, it is by standing on the shoulders of Niefel Jarls
- Sir Ice-ac Newton
Reply With Quote
  #3  
Old February 4th, 2005, 11:02 AM

atul atul is offline
Captain
 
Join Date: Oct 2003
Location: Finland
Posts: 883
Thanks: 14
Thanked 11 Times in 9 Posts
atul is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
Ivan Pedroso said:
Hmmmmmm, why shouldn't it approach 3/8 ?!?

Let us assume that the distribution behind the scenes is uniform. Then the observed frequencies will approach 1/8.
What you're missing here, assuming I've managed to follow the debate, is that they're talking about 3 most common random result. As there's selection based on how the randoms have turned out, the distribution is altered.

Gah, talking hard, let me give an example.

Two random numbers, x1 and x2, both with uniform distribution from zero to one. Each have an expected value of 0.5. But if you're asking what's the expected value of the _greater_ of two, that's 2/3!

Same thing told in the universal language of love (mathematics):
x1,x2 ~ U(0,1)
E(x1)=E(x2)=1/2
E(max(x1,x2))=2/3

My language or notation may be a bit off, but I hope the general idea is clear.

Of course, same applies to discrete case with magic randoms and so on, but is a bit harder to calculate.
Reply With Quote
  #4  
Old February 4th, 2005, 08:38 PM

Ivan Pedroso Ivan Pedroso is offline
Corporal
 
Join Date: Feb 2004
Location: Denmark
Posts: 67
Thanks: 0
Thanked 0 Times in 0 Posts
Ivan Pedroso is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
atul said:
Quote:
Ivan Pedroso said:
Hmmmmmm, why shouldn't it approach 3/8 ?!?

Let us assume that the distribution behind the scenes is uniform. Then the observed frequencies will approach 1/8.
Two random numbers, x1 and x2, both with uniform distribution from zero to one. Each have an expected value of 0.5. But if you're asking what's the expected value of the _greater_ of two, that's 2/3!

You a right that if I roll a number of dies (in this case eight-sided) and then only write down the largest value every time, then the average of this "highest-value-thrown" will indeed be higher than the usual 4.5 that is the average value of a standard eight-sided die. But that is (if understand it correctly) not the situation at hand.

As I see it, we are dealing with:
Some dude rolls a bunch of eight-sided dies, and then write down how many ones he got, how many twos he got and so on. He then adds the numbers of the three most common results, and divides this number with the total number of dies rolled.

An example:
100 eight-sided dies are rolled, and the following is written down:
#1 : 15
#2 : 12
#3 : 19
#4 : 10
#5 : 9
#6 : 12
#7 : 10
#8 : 13
The three highest are added (i.e. #3,#1, and #8) and we get:
19+15+13 = 47
And get (the Duck_Number): 47/100 = 0.47

The observed frequencies of the different values of the above example are:
P(x=1) : 15/100 = 0.15
P(x=2) : 12/100 = 0.12
P(x=3) : 19/100 = 0.19
P(x=4) : 10/100 = 0.10
P(x=5) : 9/100 = 0.09
P(x=6) : 12/100 = 0.12
P(x=7) : 10/100 = 0.10
P(x=8) : 13/100 = 0.13
Which are not all that close to the 1/8 = 0.125 value that where used to generate this sample.

If you increase the number of rolled dies to a much larger number than 100, then these frequencies will be closer to 1/8. (Well the probability of getting a sample using say 1.000.000.000.000.000 dies that results in frequencies that deviate greatly from 1/8 will be extremely unlikely - that is why I say that they "will approach" 1/8)

In fact you could choose any two small positive numbers, epsilon >0 and delta >0, (could be 0.00000001 and 0.000000001) and it will then be possible to find a laaaarge number N that insures that:

If N dies are rolled then the probability of getting an observed frequency that deviates from 1/8 with more than the small number epsilon, is smaller than delta.

That is:
Probability( |"observed frequency" - 1/8| > epsilon ) < delta

And then adding up the three largest observed frequencies will then result in a value that is in the interval
[3/8 - 3*epsilon ; 3/8 + 3*epsilon]
with as close to one hundred percent certainty as you want (just choose epsilon and delta to be very small)

So yes - I do in fact claim that given N = some extremely large number, then the Duck_Number will (most most most likely) be (ever ever ever so close to) 3/8.

Sorry for all this dry boring stuff
__________________
If I have seen further, it is by standing on the shoulders of Niefel Jarls
- Sir Ice-ac Newton
Reply With Quote
  #5  
Old February 4th, 2005, 08:56 PM
Taqwus's Avatar

Taqwus Taqwus is offline
Major General
 
Join Date: Aug 2000
Location: Mountain View, CA
Posts: 2,162
Thanks: 2
Thanked 4 Times in 4 Posts
Taqwus is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

No.

Think about it: it's actually impossible for the total allocation of the three most-picked paths to be anything less than 3/8. If it were, at least one of those three paths would necessarily be underrepresented (below 1/8) and at least one of the five "rarer" paths must be overrepresented (above 1/8), which is a contradiction because then they wouldn't be the three most-picked paths.
__________________
Are we insane yet? Are we insane yet? Aiiieeeeee...
Reply With Quote
  #6  
Old February 4th, 2005, 10:26 PM

atul atul is offline
Captain
 
Join Date: Oct 2003
Location: Finland
Posts: 883
Thanks: 14
Thanked 11 Times in 9 Posts
atul is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
Ivan Pedroso said:
So yes - I do in fact claim that given N = some extremely large number, then the Duck_Number will (most most most likely) be (ever ever ever so close to) 3/8.
Okay, you are the undisputed king of the hill when it comes to these things, I grant you that. Unless someone like Alexti wishes to disagree, I'll leave that dispute to you. ;p

Anyway, I was mostly worried by the way some people seemed to think that 20 or so instances would be a amount enough for representative statistics. With 100 or so randoms the distribution is hardly yet uniform, I'd call a test for a lot larger sample before anyone makes any hasty decisions...

...although that disrepancy between elemental and sorcery picks seems interesting, not all of the results are statistically significant but there's a trend forming.
Reply With Quote
  #7  
Old February 4th, 2005, 10:36 PM
The_Tauren13's Avatar

The_Tauren13 The_Tauren13 is offline
First Lieutenant
 
Join Date: Jul 2004
Location: Albuquerque, NM
Posts: 605
Thanks: 0
Thanked 0 Times in 0 Posts
The_Tauren13 is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

31-17
30-28
51-45
48-48
28-23
99-93
97-97
110-86
98-100
154-138

Total of all statistics posted on this thread:
Elemental: 746
Sorcery: 675
__________________
Every time you download music, God kills a kitten.
Reply With Quote
  #8  
Old February 4th, 2005, 11:10 PM
The_Tauren13's Avatar

The_Tauren13 The_Tauren13 is offline
First Lieutenant
 
Join Date: Jul 2004
Location: Albuquerque, NM
Posts: 605
Thanks: 0
Thanked 0 Times in 0 Posts
The_Tauren13 is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Using the BINOMDIST function that is only a 3% chance... make of that what you will.
__________________
Every time you download music, God kills a kitten.
Reply With Quote
  #9  
Old February 5th, 2005, 12:55 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

Quote:
Ivan Pedroso said:
In fact you could choose any two small positive numbers, epsilon >0 and delta >0, (could be 0.00000001 and 0.000000001) and it will then be possible to find a laaaarge number N that insures that:

If N dies are rolled then the probability of getting an observed frequency that deviates from 1/8 with more than the small number epsilon, is smaller than delta.

That is:
Probability( |"observed frequency" - 1/8| > epsilon ) < delta

Do you know how to proof it? I don't see any obvious one. Let us consider frequency of death picks.
Code:

Probability to roll exactly k out of n P(k,n) = C(k,n)*p0^k*(1-p0)^(n-k). (p0 = 1/8)

For simplicity, let's consider overrunning your range up. Probability of that P(m+,n) = sum[k=m..n]{P(k,n)},
where m is smallest that satisfy m/n > p0 + epsilon.
Ignoring rounding effects we can write m=a*n, where a = p0 + epsilon.
Then P(m+,n) = sum[k=m..n]{P(k,n)}
= p0^(a*n) * sum[k=a*n..n]{C(k,n)*p0^(k-a*n)*(1-p0)^(n-k)}.

And that's where I'm getting stuck. p0^(a*n) quickly goes to 0 when n grows,
but the sum part has number of elements proportional to n,
with the dominant n! on the top, so it will grow very quickly.
Does this P(m+,n) converge to anything? And if it does, to what value?



I have tried to run a test program to see what is happening.
I didn't have few billion years to wait until the probability to get within the epsilon = 0.00000001 will become distinguishable from 0, so I took 0.002 as epsilon. Unfortunately, at around n=3000 my program is running out of precision of double. At that moment P(m+,n) is around 40%. Until then it was slowly going down, but the rate of descend was decrementing. So, the experiment didn't suggest any conclusion

Quote:
Ivan Pedroso said:
And then adding up the three largest observed frequencies will then result in a value that is in the interval
[3/8 - 3*epsilon ; 3/8 + 3*epsilon]

That looks wrong. You could do this if your frequencies were independent random processes. However, in our case they are dependent from each other, because the total of all frequencies is always 1. And of course, sum of three largest frequencies is always >= 3/8, but that isn't a problem.

I'm still unsure if your theorem is right or not, but your proof needs fixing.
Reply With Quote
  #10  
Old February 5th, 2005, 12:58 AM

alexti alexti is offline
First Lieutenant
 
Join Date: Dec 2003
Location: Calgary, Canada
Posts: 762
Thanks: 0
Thanked 0 Times in 0 Posts
alexti is on a distinguished road
Default Re: Random Magic Paths - is it truly random?

To everybody who submits statistics from the real games. Please make sure that you were not conducting any particular strategy with those random mages (meaning that you sure that some of them couldn't have been killed in the battles or by assasins, remote spells etc). Also if you were buying those mages until you got some particular pick, your statistics is also invalid (because it's guaranteed that it doesn't contain more than once instance of that pick)
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT -4. The time now is 12:18 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©1999 - 2025, Shrapnel Games, Inc. - All Rights Reserved.