# Calculating permutations for a normally distributed variable

• Paul Uszak
In summary, you can have 216 permutations (order matters) if you use dice with a uniform probability distribution.
Paul Uszak
For three dice, you can have 6 * 6 * 6 = 216 permutations (order matters). The dice has a uniform probability distribution of p(x) = 1/6. Easy.

I'm trying to get an estimate of how many permutations you can have if a variable has a normal probability distribution. So for example, if a variable has mean 100, standard deviation 5, how many permutations can I get if I measure the variable 3 times repeatedly? I suspect that someone's somehow going to include a %age in their answer...

Last edited:
There will be infinitely many permutations because there are infinitely many values to be permuted, as the normal distribution is a continuous distribution - so the value of a draw from the normal dist is a continuous random variable (RV). Compare this to the dice, where the RV has only six different possible values - so we call it a 'discrete' RV.

This can be fixed by rounding the normal RV to the nearest integer, but even that isn't enough, as there is no limit on the size of a random draw. Even with the dist you gave, there is an indescribably small, yet nonzero chance of a draw of 1 billion.

To remove that, you need to limit the values the RV can take both above and below.

For instance, if you define RV ##X## by ##X=round(\max(50,\min(150,100+5\cdot Z)))## where ##Z\sim N(0,1)## (ie ##Z## is a standard normal RV), then you can ask the question about ##X##. But the answer will be very boring. The number of permutations is simply ##101^n## where ##n## is the number of draws. Note that 101 is the number of different possible values of ##X##, although values outside the range ##85-115 will be very rare.

What would be more interesting would be the frequency histogram of the different combinations that can be drawn.

andrewkirk said:
There will be infinitely many permutations because there are infinitely many values to be permuted, as the normal distribution is a continuous distribution - so the value of a draw from the normal dist is a continuous random variable (RV). Compare this to the dice, where the RV has only six different possible values - so we call it a 'discrete' RV.

This can be fixed by rounding the normal RV to the nearest integer, but even that isn't enough, as there is no limit on the size of a random draw. Even with the dist you gave, there is an indescribably small, yet nonzero chance of a draw of 1 billion.

To remove that, you need to limit the values the RV can take both above and below.

For instance, if you define RV ##X## by ##X=round(\max(50,\min(150,100+5\cdot Z)))## where ##Z\sim N(0,1)## (ie ##Z## is a standard normal RV), then you can ask the question about ##X##. But the answer will be very boring. The number of permutations is simply ##101^n## where ##n## is the number of draws. Note that 101 is the number of different possible values of ##X##, although values outside the range ##85-115 will be very rare.

What would be more interesting would be the frequency histogram of the different combinations that can be drawn.
You're absolutely right - I know that the distribution is discrete. I just wrote normal for unknown reasons . I think it's actually a Poisson, and I'll elaborate...
I threw in the dice example because I cross posted this question on another site that's pretty useless for answering my statistics questions. What I meant to say is that I've taken the RGB values of a single pixel, and tallied them over 10,000 frames from a webcam under static conditions. The values I got are as follows:-

I want to know how many permutations are possible for the unique values of that pixel. This would equate to how many unique colours that pixel might be. So you say that I need to set some hard limits on the values each channel can take - you seem to have implied +/- 3 standard deviations in your calculation?

Side question - how could I generate your suggested frequency histogram of the different combinations that can be drawn?

I doubt the distribution can be Poisson, as that distribution has no upper limit, and colour values in digitised video have an upper limit, since they are denoted by a fixed number of bits.

If the potential colour values for each of R, G and B are the integers from 0 to ##2^n-1## (so if it's 24-bit colour, n is 8 and there are 256 different potential values for each of R G and B) then there are ##2^{3n}## permutations (unique colours) which for n=8 is 16,777,216.

Simulation is the easiest way to generate a histogram, where there isn't an analytic formula for the compound distribution, which is probably the case here. I use R (r-cran) for simulation. Do you have that? It would only need a few lines of code to make a histogram. The difficulty is working out what you want your buckets to be and how you want to arrange them, since the buckets will be indexed by three dimensions R G and B.

andrewkirk said:
I doubt the distribution can be Poisson, as that distribution has no upper limit, and colour values in digitised video have an upper limit, since they are denoted by a fixed number of bits.

If the potential colour values for each of R, G and B are the integers from 0 to ##2^n-1## (so if it's 24-bit colour, n is 8 and there are 256 different potential values for each of R G and B) then there are ##2^{3n}## permutations (unique colours) which for n=8 is 16,777,216.

Simulation is the easiest way to generate a histogram, where there isn't an analytic formula for the compound distribution, which is probably the case here. I use R (r-cran) for simulation. Do you have that? It would only need a few lines of code to make a histogram. The difficulty is working out what you want your buckets to be and how you want to arrange them, since the buckets will be indexed by three dimensions R G and B.
Andrew, there's a histogram in my first reply to you. Can you not see it? It's my first piccy post.

Your picture is a histogram of the individual colour values - ie it's actually three separate histograms overlaid on one another and distinguished by the colours of the columns. It is not a histogram of the 3-colour combinations.

andrewkirk said:
a histogram of the 3-colour combinations.
Isn't this the crux of my question? How many buckets would there be? Are you saying that there is no way to calculate /estimate the number of potential buckets without actually measuring it? Does your 101n algorithm not apply any more in light of the histogram..?

Aren't you looking to find the distribution of ## X \times X \times X ##, given you know the distribution of ##X##?

Paul it's necessary to appreciate the difference between:
1. identifying the different possibilities ('buckets'); and
2. calculating the expected frequency of occurrence of each possibility.

Step 1 is trivial for 24-bit colour. The answer is that the number of buckets is ##2^{24}=(2^8)^3=256^3=16,777,216##.
Step 2 is where distributions and histograms come into play.

You have three random variables R, G and B, each of which has a discrete distribution over the integers from 0 to 255. If the three distributions are identical, it becomes the problem that WWGD has described. If they are not, as is the case with the three-histogram graph you have shown, then the problem is more complex.

WWGD said:
Aren't you looking to find the distribution of ## X \times X \times X ##, given you know the distribution of ##X##?
YES! You've hit it on the head. I just didn't know how to write it down.

I know X because I have a histogram (shown earlier in this thread). Is the number of permutations really as simple as:-

(width of red histogram) * (width of green histogram) * (width of blue histogram) ?

So an approximation would be (33-18) * (53-20) * (29-14) = 7425 permutations /colours...

## 1. How do you calculate the number of permutations for a normally distributed variable?

To calculate the number of permutations for a normally distributed variable, you can use the formula n!/(n-r)!, where n represents the total number of values and r represents the number of values being selected. For example, if you have 10 values and you want to select 3 of them, the calculation would be 10!/(10-3)! = 10!/7! = 10*9*8 = 720 permutations.

## 2. What does a normally distributed variable refer to?

A normally distributed variable refers to a continuous random variable that follows a normal distribution, also known as a Gaussian distribution. This type of distribution is characterized by a bell-shaped curve and is commonly used in statistics and probability.

## 3. Can the number of permutations for a normally distributed variable be negative?

No, the number of permutations for a normally distributed variable cannot be negative. Permutations are always positive integers that represent the different ways in which a set of values can be arranged.

## 4. How does the mean and standard deviation of a normally distributed variable affect its permutations?

The mean and standard deviation of a normally distributed variable do not directly affect its permutations. The number of permutations is only affected by the total number of values and the number of values being selected, as calculated by the formula n!/(n-r)!. However, the mean and standard deviation can provide important information about the distribution and variability of the data.

## 5. Can the number of permutations for a normally distributed variable be greater than the total number of values?

No, the number of permutations for a normally distributed variable cannot be greater than the total number of values. This is because permutations represent all possible ways in which a set of values can be arranged, and it is not possible to have more permutations than the total number of values in the set.

• Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
30
Views
3K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
5
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
7
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
2
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
1
Views
1K
• Set Theory, Logic, Probability, Statistics
Replies
6
Views
2K
• Set Theory, Logic, Probability, Statistics
Replies
3
Views
2K