Not sure what this problem would be called....

In summary, Povilas is trying to find a function to determine the probability of having M or less mismatching bits when randomly generating two N long bit arrays. His testing indicates that a bell curve is formed around N/2, but he doesn't know the formula for it.
  • #1
Povilas M
9
1
Hi,

I am trying to write a function which would take two arguments:
-> number of bits (which are a binary 0 or 1 value) N
-> and acceptable number of mismatching bits M
The function would statistically determine the probability of having M or less mismatching bits when randomly generating two N long bit arrays and comparing them. Difference between 1001 and 1011 would be 1 for example as only the third bit differs. My testing indicates a bell curve is formed around N/2, but I've not done maths for years, it's hard for me to figure the formula out...

Thanks a lot
 
Physics news on Phys.org
  • #2
Povilas M said:
My testing indicates a bell curve is formed around N/2
Hi Povilas:

Your problem statement confuses me a bit.
1. You did not mention what the the probability of generating a "1" is with the bit generator you are using. In the above quote the "N/2" suggests the probability is exactly 1/2, but you did not say that explicitly.
2. You say that your experiments produce a "bell curve", but your description says you want a curve for "M or less mismatching bits". That seems wrong to me since a curve for that result would not be bell shaped. What would be approximately bell shaped is a curve for exactly M matches.

If the "bell curve" you want is for exactly M matches, the answer is a binomial distribution curve. Take a look at

Hope this helps.

Regards,
Buzz
 
  • Like
Likes Povilas M and jedishrfu
  • #3
Can you provide a context of where you might use this function?

I was thinking that you could simplify the problem by considering the first N bit array as all zeros and
now you only need to count all the N bit arrays with <=M bits as ones:

Basically its a binomial distribution problem ala pascal's triangle kind of problem:

https://en.wikipedia.org/wiki/Pascal's_triangle

540px-Pascal%27s_triangle_5.svg.png


so for a five bit string you'd have:
- 1 string of zeros
- 5 strings with 1 one bit
- 10 strings with 2 one bits
- 10 strings with 3 one bits
- 5 strings with 4 one bitys
- 1 string with all one bits
 
  • Like
Likes Povilas M
  • #4
jedishrfu said:
Can you provide a context of where you might use this function?
Hi @jedishrfu:

I am not sure you were asking the question for me to answer, but here it is.

The binomial distribution has many uses. A common example is to calculate the probability of getting M heads when flipping "an honest coin" N times.
This is exactly the same probability of getting M matches (heads and heads or tails and tails) when flipping two "honest coins" M times.

jedishrfu said:
Basically its a binomial distribution problem ala pascal's triangle kind of problem:
Pascals triangle is a way of calculating the number of combinations of N things when M are of one kind and N-M are of a different kind. This usually noted as
(N over M).​
(Sorry about the awkwardness of the way I show the notation. The Wikipedia citation in post #2 shows it correctly.)
In the quote above I am not sure what "ala" means exactly, but
P(N,M) = (N over M) × (1/2)N,​
where P is the binomial distribution probability when P(1,1) = 1/2, the probability of heads for an "honest coin".

Regards,
Buzz
 
  • Like
Likes Povilas M
  • #5
Thanks all! Binomial distribution curve was exactly what I needed, I figured out the rest from there. Jedishrfu, simplifying the problem was a very useful point as well!
Thanks again!
 
  • Like
Likes jedishrfu
  • #6
My context question was for the original poster.

Hopefully, he can tell us more about the problem he's trying to solve.
 
  • #7
Povilas M said:
Thanks all! Binomial distribution curve was exactly what I needed, I figured out the rest from there. Jedishrfu, simplifying the problem was a very useful point as well!
Thanks again!
So i guess youre not going to tell us the context.
 

1. What is the scientific method and how does it apply to this problem?

The scientific method is a systematic approach to problem-solving that involves making observations, forming a hypothesis, conducting experiments or gathering data, analyzing the results, and drawing conclusions. It can be applied to any problem in order to find evidence-based solutions.

2. Can this problem be solved using existing scientific knowledge or will new research be necessary?

This largely depends on the specific problem and the available information. In some cases, existing scientific knowledge and techniques may be sufficient to solve the problem. However, in other cases, new research may be necessary in order to gain a better understanding of the problem and find a solution.

3. How can collaboration with other scientists and experts help in solving this problem?

Collaboration with other scientists and experts can bring diverse perspectives and expertise to the problem-solving process. This can lead to more innovative and effective solutions as well as facilitate the sharing of knowledge and resources.

4. What are some potential challenges or limitations in addressing this problem?

Some potential challenges or limitations in addressing a scientific problem could include limited resources, ethical considerations, technical difficulties, or conflicting data. It is important to carefully consider and address these challenges in order to ensure the validity and reliability of the solution.

5. How can the findings and solutions from addressing this problem contribute to the advancement of science and society?

Solving a scientific problem can lead to new discoveries and advancements in a specific field of study. It can also have practical applications and benefits for society, such as improving technology, healthcare, or environmental sustainability. By addressing problems, scientists can contribute to the overall progress and betterment of society.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
919
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
16
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
7
Views
296
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
6
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
2
Views
997
Back
Top