.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 3: The Awakening

Reply
 
Thread Tools Display Modes
  #1  
Old November 15th, 2007, 02:09 PM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Site Searching Statistics Questions

Quote:
Baalz said:
I don't think this is quite right. From what I remember about statistics the logic is like this. If you flip a coin 10 times and it comes up heads every time, what is the chance it'll come up heads the next time you toss it? Answer: 50% because the coin has no memory.
This isn't like a coin flip though. It's more like for every province you have three cups (actually, nine) and one pea (actually, zero to four) under one of the cups. You want to find the peas. You can turn up one cup at a time. For a province where you haven't searched yet, that's three cups and lifting one of them is a 33% chance of finding the pea. If you already lifted one of them and did not find the pea, then you'll have a 50% chance of finding the pea if you try again for that province. This is better than trying another province where you only have a 33% chance of finding one.

This is, of course, a very simple model which isn't exactly like what we have in the game, so don't take it literally.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief
Reply With Quote
  #2  
Old November 15th, 2007, 02:48 PM

VedalkenBear VedalkenBear is offline
Second Lieutenant
 
Join Date: May 2006
Posts: 465
Thanks: 10
Thanked 16 Times in 14 Posts
VedalkenBear is on a distinguished road
Default Re: Site Searching Statistics Questions

Ich has it correct, and there's a distribution that is used precisely for this issue; it is the hypergeometric distribution.

Consider the following. A province in ME, by default, has a 40% chance of having a site. Let us assume no terrain modifiers are in place.

The number of sites that are available to find is given by the binomial distribution. The probabilities are:

0 - 0.1296
1 - 0.3456
2 - 0.3456
3 - 0.1536
4 - 0.0256

(Incidentally, this means that the average number of sites in a province with a per-site chance of 40% is 1.6.)

Therefore, if you have an unsearched province, and you cast Gnome Lore on that province, the probability that you find an earth site is the probability that there are X sites, and that there is at least one site among those X. That is:

[P(1 site) AND (Probability that site is Earth)] OR [P(2 sites) AND (Probability that the first site is earth OR Probability that the second site Earth)] OR [P(3 sites) AND (Probability that first site is Earth OR Probability that second site is Earth OR Probability of third site is Earth)] OR [P(4 sites) AND (Probability of first site is Earth OR Probability of second site is Earth OR Probability of third site being Earth OR Probability of fourth site being Earth). Since AND is mathematically multiplication, OR is mathematically addition, and P1 OR P2 OR P3 ... is equal to 1-P1*P2*P3..., we have, assuming equal chances of each type of site in this province:

(0.1296)(0) + (0.3456)(0.111) + (0.3456)(0.210) + (.1536)(0.298) + (0.0256)(0.376)

= 0.1663

or an 16.33% chance of finding an Earth site in that province.

Now, what happens if you have an Earth site in a province, and then cast Astral Probing on the same Province? Then the probability is:

P(2 sites)*(1-P(that site is not Earth) + P(3 sites)*(1-P(neither site remaining is Earth) + P(4 sites)*(1-P(none of the three sites remaining is Earth).

Or

0.3456*0.111 + 0.1536*0.210 + 0.0256*0.298

= 0.0783

Or an 7.83% chance of finding an Astral site in a province that already has another Earth site, _provided you did not search for the Earth site_. If you did, then it is 0.0876, or an 8.76% chance.

I hope this makes sense. If anyone wants other probabilities (especially the way this all changes if you select a different per-site probability), just let me know.
Reply With Quote
  #3  
Old November 15th, 2007, 03:01 PM

Evilhomer Evilhomer is offline
Captain
 
Join Date: Nov 2006
Location: Sweden, Ume�
Posts: 991
Thanks: 5
Thanked 1 Time in 1 Post
Evilhomer is on a distinguished road
Default Re: Site Searching Statistics Questions

I do belive you are incorrect VedalkenBear. It was a while since i studied statistic (I will give you that) but probabilites change if we get to know something about the result (like knowing that we have 1 earth site). The binomical chances you listed:

0 - 0.1296
1 - 0.3456
2 - 0.3456
3 - 0.1536
4 - 0.0256

are probably correct if you have no prior knowledge (I have not dubble checked this but I will trust them). They will however change once it is known that we have 1 site (from the earth check - obviously now the chance of having 0 sites is 0). This will change the result on the following calculation....
__________________
MP guide to MA/LA Rlyeh
Reply With Quote
  #4  
Old November 15th, 2007, 03:09 PM

VedalkenBear VedalkenBear is offline
Second Lieutenant
 
Join Date: May 2006
Posts: 465
Thanks: 10
Thanked 16 Times in 14 Posts
VedalkenBear is on a distinguished road
Default Re: Site Searching Statistics Questions

Evilhomer: Actually it doesn't. The other calculation used the probability of 2 sites (0.3456) multiplied by the chance that the second site (since the first is already occupied) is the appropriate kind.

The binomial numbers above came right out of Excel's BINOMDIST function. Also, I know they're correct because I've had to use that exact P for Work Measurement several times.

Remember, the number of sites are mutually exclusive. Having 2 sites is not dependent on having 1. Obviously, you can't have 2 without having 1, but in a probabilistic sense, the states are mutually exclusive and independent.
Reply With Quote
  #5  
Old November 15th, 2007, 03:17 PM

Evilhomer Evilhomer is offline
Captain
 
Join Date: Nov 2006
Location: Sweden, Ume�
Posts: 991
Thanks: 5
Thanked 1 Time in 1 Post
Evilhomer is on a distinguished road
Default Re: Site Searching Statistics Questions

I am not sure we understand each other here I must say. I will give you an example:

The same hypergeometric distribution GIVEN that we have 4 sites in that province would be:

0 - 0.0
1 - 0.0
2 - 0.0
3 - 0.0
4 - 1.0

In the same way the distribution you gave would change GIVEN that we have atleast 1 site, so using this:

0 - 0.1296
1 - 0.3456
2 - 0.3456
3 - 0.1536
4 - 0.0256

just cannot be accurate for the second calculation (when we know we have atleast 1 site). Maybe I misunderstood you somewhere along the way, a bit to tired to go into detailed math analysis.
__________________
MP guide to MA/LA Rlyeh
Reply With Quote
  #6  
Old November 15th, 2007, 03:07 PM
Edratman's Avatar

Edratman Edratman is offline
First Lieutenant
 
Join Date: May 2007
Location: Reading, PA
Posts: 724
Thanks: 93
Thanked 37 Times in 27 Posts
Edratman is on a distinguished road
Default Re: Site Searching Statistics Questions

VedalkenBear - first class analysis.

What I think would be most helpful (and you have provided ample evidence of ability) would be a table showing the average number of sites per province with the settings of 10,20,.....100%. (The values higher than 75 are available using map edit.)

Thank you.
__________________
Men do not quit playing because they grow old; they grow old because they quit playing.
Oliver Wendell Holmes
Reply With Quote
  #7  
Old November 15th, 2007, 03:14 PM

VedalkenBear VedalkenBear is offline
Second Lieutenant
 
Join Date: May 2006
Posts: 465
Thanks: 10
Thanked 16 Times in 14 Posts
VedalkenBear is on a distinguished road
Default Re: Site Searching Statistics Questions

Hey, I'm an Industrial Engineering student, and probability/statistics are used in every single one of my classes. I hope I'd be good at it.

As for the expected number of sites per province, it really is just (4*p). I've verified it for several different values of p in Excel, and it follows exactly.

Now, if someone were to give me the actual terrain differences on the different types of sites, I could do some more advanced analysis.
Reply With Quote
  #8  
Old November 15th, 2007, 03:18 PM

VedalkenBear VedalkenBear is offline
Second Lieutenant
 
Join Date: May 2006
Posts: 465
Thanks: 10
Thanked 16 Times in 14 Posts
VedalkenBear is on a distinguished road
Default Re: Site Searching Statistics Questions

Thejeff: Sorry, the 1-(P of not Earth) was supposed to be not Astral.

The 'if not searched' value included the probability in the Astral analysis that an Earth site could be any one of the remaining sites (that is, the probability of the site NOT being Astral was 8/9). If Earth was searched (at level 4 or 9), then the probability that the sites could be Astral would be 1/8, not 1/9. The slightly higher value takes this into account. (I had this value at hand because I initially forgot Holy sites, and therefore had done all the calculations for 1/8 instead of 1/9.)
Reply With Quote
  #9  
Old November 15th, 2007, 03:25 PM

VedalkenBear VedalkenBear is offline
Second Lieutenant
 
Join Date: May 2006
Posts: 465
Thanks: 10
Thanked 16 Times in 14 Posts
VedalkenBear is on a distinguished road
Default Re: Site Searching Statistics Questions

Oh, I'm using the binomial not the hypergeometric. The binomial probabilities are simply the probabilities of a given number of sites in a province. These states are not dependent on one another. If the site placement algorithm checked for a first site, found none, and _did not check anymore_, that would be conditional probability.

Basically, for the second calculation you have:

0 sites in province (trivial case): 0
1 site in province (also trivial): 0
2 sites in province, 1 is earth, chance that the second is earth: Probability that there are two sites in province * 1-(Probability that the first is not Astral(1)*Probability that the second is not Astral(0.875) = 0.3456*(1-(1*0.875)

And so on. If the probabilities change given one state, that means the probabilities are conditional. The only way for that to happen in this case would be if the site search algorithm were to stop checking for sites if any check failed. That AFAIK does not happen.
Reply With Quote
  #10  
Old November 15th, 2007, 03:07 PM

thejeff thejeff is offline
General
 
Join Date: Apr 2005
Posts: 3,327
Thanks: 4
Thanked 133 Times in 117 Posts
thejeff is on a distinguished road
Default Re: Site Searching Statistics Questions

Ok, without actually checking the numbers I followed you up through the 16.33% chance of an earth site.

For the astral search:
Why (1-P(site is not Earth))? Isn't that the same as the chance that the site is Earth? Where does the chance that the site is astral come in?

Nor do I see where you get the 8.76% if you have searched for an earth site.

If there isn't an earth site, but you've searched for one, how does that change the probability of finding an Astral site?
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:55 PM.


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