A few days ago
afaoutkaster

math probability problem, help?

I need to derive an expression for the probability p(n;k1,k2) that a binary sequence of length n has greater than or equal to k1 0’s and less than or equal to k2 0’s, where k1, k2 are elements of the set containing the first n positive integers.

Top 1 Answers
A few days ago
Merlyn

Favorite Answer

for a n digit long binary number you will have at most n 1’s but ever fewer than one 1. for the same n digit binary number you will have at most (n-1) 0’s and as few as zero 0’s.

there are for an n digit binary number there is a total of 2^(n-1) numbers. for example, n = 4 are the binary numbers 1000 to 1111, 8 to 15 in decimal at total of 8 numbers or 2^3 = 2^(4-1).

further the first 1 is static for a n digit binary number so only (n-1) digits will change.

as a result you really on have to look at combinations of getting r 1’s or 0’s in n-1 options.

The number of zeros in an n digit binary number has a probability of 0 for having n 0’s, i.e., P(k = n | n) = 0, where k is the number of zeros in an n digit binary number.

in general P(k = r | n) = ( (n-1)!/( r! * (n -r)!) ) / (2^(n-1)

is the defined for r = 0, 1, 2, 3, …. , n-1.

to get P(k > r | n) = 2^(1-n) * Σ( (n-1)! / (i! * (n-i)! )) for i = r to n – 1.

you can verify this is a probability mass function by seeing that summing over i = 0 to n-1 will result in the pmf summing ot 1.

for P( r1 < k < r1 | n) = the same sum but with the index going from r1 to r2. I would be more than happy to provide a more detailed derivation and write this out by hand and scan it for you if this is to difficult to read.

0