# Thread: Unable to find the correct combination / permutation rule for my statistics project

1. ## Unable to find the correct combination / permutation rule for my statistics project

First and foremost, THANK YOU in advance for helping me with my statistics project that I have been unable to solve on my own or through the help of my statistics book and google.

I am working on an excel spreadsheet for use with the game Eve Online. I will give you a bit of background on what this involves below:

A player owned starbase out in space allows its owner to place various defensive modules around its perimeter. These modules randomly target enemy ships on the battlefield, applying various detrimental effects to them.

INITIAL GOAL: To find average number of unique enemy ships targeted at any given time.

The spreadsheet will allow the user to input the number of enemy ships on the battlefield as well as the number of defensive modules present. It will need to use this information to fulfill my initial goal. Let me illustrate with an example:

3 Ships on battlefield 3 modules on battlefield

I have found a way I can find the total number of available combinations by the following formula: (ships on battlefield)^(modules on battlefield). My logic behind this is from viewpoint of the module: one module has t potential targets (3 in this case) and since there are m modules, you multiply each set of potential choices together (3 in this case) which is 3^3 = 27 total combinations (which agrees with my testing results of manually listing all of the combinations).

I need to find the average number of UNIQUE ships targeted on the battlefield. This means if module 1, 2 and 3 are all targeting ship 1, this only counts as 1 unique ship targeted. If module 1,2 and 3 are all targeting different ships I now have 3 unique ships targeted.

My aim (correct me if i'm wrong, or if this is a flawed approach) in finding the average number of unique ships targeted at any given time is by finding the 'expected value' of the discrete random variable. i.e., make the random variable x = ship number (in this case ship #1, ship #2 and ship#3, or more simply 1, 2 and 3). Then, multiply each possible value of x by its probability p(x), and then sum this product over all possible values of x.

So, we have 1*p(x) + 2*p(x) + 3*p(x) = E(x), or average unique ships targeted. For this illustration, I have manually found the probabilities by listing all combinations and counting the number of combinations that fulfill each state as follows (refer to screenshot for how I did this):

Total combinations available: 27
1 Unique ship targeted: 3 = 3/27 = 1/9
2 Unique ships targeted: 18 = 18/27 = 2/3
3 Unique ships targeted: 6 = 6/27 = 2/9

So, plugging these probabilities into the above equation, we have:

1*(1/9) + 2*(2/3) + 3*(2/9) = E(x) = 2.111 ships targeted on average.

This is great, however, I have yet to find (outside of manually listing all available combinations and counting the ones that fulfill my criteria) a way to find the probability for x ships targeted, of which the above formula requires to work properly. I know it will involve using combinatorial / permutation counting rules which use factorials but I have been unable to find one that fits my requirements.

I think the main difficulty of finding a suitable counting rule to isolate the number of possibilites which would result in x number of unique ships targeted arises from the modules' ability to target a ship which is already targeted by another module. For instance, if I just wanted to find all the different combinations of selecting 2 ships from the 3 available, I would use 3^2 which = 9 but as you can see above, it is actually 18 so this cant be right. Likewise, if I use N!/(N-n)! I get = 6, still not 18. I try N!/n!(N-n)! and get = 3... still not 18.

Most likely this will involve using multiple combination and / or permutation counting rules working together in a certain way to achieve my goal, however I am just not experienced enough to figure this out. Any help is much appreciated!

After we tackle this part of my goal, I will post the next goal for this project and perhaps we can take a stab at that as well

2. ## Re: Unable to find the correct combination / permutation rule for my statistics proje

Hey eveellence.

For finding the number of targeting say x unique ships, you can use the the combinatorial identity 3CN which lists the number of ways of picking N things from 3 (so 3C2 will be the number of ways of picking 2 ships from 3 original ones which is 3C2 = 6).

This formula can be used to get the number of combinations of ships from a total number and you can extend this beyond three.

Also I have to ask: is this probability going to be skewed by the geometric distribution of ships? (I.e. will be based on radius and location information instead of the above assumptions)?

3. ## Re: Unable to find the correct combination / permutation rule for my statistics proje

Originally Posted by chiro
Hey eveellence.

For finding the number of targeting say x unique ships, you can use the the combinatorial identity 3CN which lists the number of ways of picking N things from 3 (so 3C2 will be the number of ways of picking 2 ships from 3 original ones which is 3C2 = 6).

This formula can be used to get the number of combinations of ships from a total number and you can extend this beyond three.

Also I have to ask: is this probability going to be skewed by the geometric distribution of ships? (I.e. will be based on radius and location information instead of the above assumptions)?
Thanks for your response! Yes, I already tried this, however using identity 3CN like you suggest gives 6, not 18 which would be the correct answer. As you can see in the screenshot, there are 18 different ways of targeting 3 unique ships in this situation. Do I need to use 3CN, then multiply the result by the number in the 3 position (in this case 3)?

4. ## Re: Unable to find the correct combination / permutation rule for my statistics proje

Are you familiar with the hyper-geometric distribution?

5. ## Re: Unable to find the correct combination / permutation rule for my statistics proje

I actually got this answered over at another forum, I am pasting the answer here, to help out others that may be helped by it

OK, if I understand your question correctly, there are m modules (shooters) and t ships (targets), each module selects a single ship independently and at random, and you want to know the expected number of distinct ships selected as targets.

Let
$X_i = \begin{cases} 1 &\text{if ship i is selected as a target}\\ 0 &\text{otherwise.} \end{cases}$
for i = 1, 2, 3, ... t

A ship is not selected as a target if all the modules select other ships. So
$\Pr(X_i = 0) = \left(1 - \frac{1}{t} \right)^m$
and
$\Pr(X_i = 1) = 1- \left(1 - \frac{1}{t} \right)^m$
so
$E(X_i) = 1- \left(1 - \frac{1}{t} \right)^m$

Then the expected number of distinct ships selected as targets is
$E(\sum_{i=1}^t X_i) = \sum_{i=1}^t E(X_i) = t \left[ 1- \left(1 - \frac{1}{t} \right)^m \right]$

Here we have used the theorem that E(X+Y) = E(X) + E(Y). It's important to realize that this theorem holds even if X and Y are not independent. That's good for us here, because the $X_i$'s are not independent.[/QUOTE]

6. ## Re: Unable to find the correct combination / permutation rule for my statistics proje

Ok, now for the next hurdle in my project. Now that I know the average expected number of distinct ships that will be targeted, I now need to look deeper into how a specific type of module on the battlefield will affect its

targeted ship. In order for you to understand this a bit better, lets briefly discus the module in question.

It is the Electronic Counter Measures, or ECM module. Its purpose is to 'jam' the targeted ship, preventing the ship from locking any target (and thus disabling the ship from its ability to do damage). The mechanics are

as follows:

1) It takes roughly 15s for the module to acquire target lock on an enemy ship. This is variable and can be as high has 20 and as low as 12. Lets just make it 15 for now. Call this t = lock time.

2) After locking, it performs 4 jamming attempt cycles, each 7.5s in length. If successful, the target is 'jammed' for 7.5s in duration. After the 4 cycles are performed, it automatically switches to a new, randomly acquired

target, as described in the original post. The probability calculation for a successful, or unsuccessful jam cycle on the module's target is found by dividing the jam strength of the module by the sensor strength of the

ship. This is where it gets interesting. For a 'racial' jammer (meaning the module has an increased chance against its target) the jam strength is 45. For a 'non-racial' jammer, the jam strength is 15.

So, for instance, for a racial jammer vs a ship of sensor strength 90, we have 45/90 = 50% chance of jam. Likewise, for non-racial vs. the same ship we have 15/90 = a ~ 16.67% chance for jam.

My overall goal here is to use the equation given by the solution post above to find total number of distinct ships targeted, then find the % of time those ships are jammed, which will give me a total % of ships that, on average, are effectively removed from the battlefield given a certain number of racial jammers, non-racial jammers and enemy ships present.

So, my question here is this: How should I treat the two different types of ecm modules (racial, and non-racial) present in my calculations? Here are the different ways I see of doing this below, I am writing the complete equation which will accomplish my overall goal as stated above.
t = 10 = quantity of enemy targets
r = 10 = quantity of racial jamming modules
n = 10 = quantity of non-racial jamming modules
jr = 45 = jamming strength of racial jammer module
jn = 15 = jamming strength of non-racial jammer module
s = 90 = sensor strength of enemy ships
c = total cycle time (30 seconds in this case [7.5*4 = 30])
l = 15 = lock time (time for module to acquire target lock on enemy ship)

A) Treat the two ecm module types as the same for targeting purposes, but different in terms of probability of successful jam (by averaging the total jam strength across all the modules). For example:

$\text{percent of ships jammed =}\left [ 1-\left ( 1-\frac{1}{t} \right )^{r+n} \right ]\frac{c\left (j_{r}r+j_{n}n \right )100}{s\left (r+n \right )\left ( c+l \right )}\rightarrow \left [ 1-\left ( 1-\frac{1}{10} \right )^{10+10} \right ]\frac{30\left (45 \cdot10 +15 \cdot 10 \right )100}{90\left (10+10 \right )\left ( 30+15 \right )} \text{= 19.52 percent}$

So, this tells me that 19.52% of all enemy ships will effectively be removed from the field (on average) with the presence of 10 enemy ships, 10 racial jammers, and 10 non-racial jammers.

*EDIT* I examined the above equation further and it was flawed. It was not factoring in the overlap of modules that were targeting more than one target. For instance, with 20 enemy ships, 40 racial and 40 non racial jammers, the equation tells me only 21.86% of ships would be jammed, which is obviously flawed since it should be much higher than that.

My logic in fixing this is as follows: Re-write the formula so it divides the total number of modules by number of distinct ships targeted, returning an average number of modules per targeted ship. This is then multiplied by the % of time each module can jam a target for (with the product limited to 100%), which results in (I believe) a much more accurate result.

Here is the modified equation below, followed by the simplified one:

$\text{percent of ships jammed =}\left [ 1-\left ( 1-\frac{1}{t} \right )^{r+n} \right ]\cdot y$
$y= \frac{c\left (j_{r}r+j_{n}n \right )100}{s\left (r+n \right )\left ( c+l \right )}\cdot \frac{r+n}{t\left [ 1-\left ( 1-\frac{1}{t} \right )^{r+n} \right ]}$
$\left \{ y|y\leq 1 \right \}$

I realize that the above equation simplifies to:

$\frac{c\left ( j_{r}r+j_{n}n \right )100}{s\cdot t\left ( c+l \right )}$ However, I must limit the above described y to 1 or less in order for everything to work properly. If you guys have any ideas on how to clean this up, or even if my logic is wrong let me know

The weaknesses in this method I see are:

1) I treat the 4 individual cycle times of 7.5 seconds each as a continuous time length. Correct me if i'm wrong, but I don't think this will affect the number i'm looking for at all.

2) I'm averaging the differences of jamming module strengths ( 45 vs. 15) across all of the jamming modules. I have a feeling this isn't the right way of doing this, so I will list the other idea I have below. *EDIT* I have since modeled the differences between the averaging method and individual method and it doesn't look like they are any different from each other, in providing the average % of ships effectively removed from the field, but please share your thoughts on this, I may not be looking at it correctly.

B) Treat the two ecm module types as completely separate for targeting and jam probability calculation. The main issue I see here is that the initial equation given in the previous post for the effective number of distinct ships targeted will have to be changed somehow. This is because now there will be two groups of modules targeting the same ships.

What do you suggest the best way of going about this is? Thanks again for all your help!