# Thread: Similar numbers in a data set

1. ## Similar numbers in a data set

Hi guys,

I am looking at a programming problem here, and would like to "deduce" a formula out of my problem.

I have an array of n (known) columns and two rows. I populate this array with number in a range (1 to n) let's say 1 to 5 for the example.

Code:
1 3 2 5 1 n
2 4 1 4 2 n
What I would like to determine is the possible number of occurrences of each set of two numbers. Example, what are the number of chances {1,2} occurs once in the array, or twice, or etc, but being able to determine it for each of the sets {3,4}, {2,1} etc.

I do understand that each number, occurs 1/range but I don't know how to link everything together to actually make a formula out of it, so if any of you has suggestion or an explanation ... i'd be really happy to read it.

Thanks

2. ## Re: Similar numbers in a data set

Let see if your question is like this:

You have an array of i.i.d. discrete uniform random variables

with support

By independence, we have

Finally the number of times that a particular outcome appear among the columns will follow a Binomial distribution, write

Then the required probabilities can be directly calculated via its probability mass function.

3. ## Re: Similar numbers in a data set

Originally Posted by BGM
Let see if your question is like this:

You have an array of i.i.d. discrete uniform random variables

with support

By independence, we have

Finally the number of times that a particular outcome appear among the columns will follow a Binomial distribution, write

Then the required probabilities can be directly calculated via its probability mass function.
Thank you for your answer, although (sorry i'm not good at math notations),but since I have an array of 2 row and n columns (and I'm looking for associations of

corresponding the to index 0 of the first cell of each row, both numbers at index have

of occurring right ? so my probability of find

exactly one time is going to be

am i right ? So I am wondering, once I have calculated the probability of the first one occurring one OR more in my array, how can I calculate the probability of the second one also occurring one or more ?

so since I want the probability of the first set (1,2) to occur once or more I can change my formula to

and so one for the first set, but how am i going to calculate, it for the second set after ? since there is X chances for the first set, how many chances are there for the second ?

 Tweet