How many bytes contain exactly two 1's?

  • Context: MHB 
  • Thread starter Thread starter find_the_fun
  • Start date Start date
  • Tags Tags
    bytes
Click For Summary

Discussion Overview

The discussion revolves around the combinatorial problem of determining how many 8-bit bytes contain exactly two 1's. Participants explore different approaches to calculating this quantity, including the use of binomial coefficients and permutations.

Discussion Character

  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant questions the answer key's use of \binom{8}{2}, suggesting that after selecting two bits for 1's, there are still 2^6 ways to arrange the remaining bits, which seems larger than 28.
  • Another participant explains that there are 8 positions for the first 1 and 7 for the second, but since order does not matter, the calculation should be divided by 2, leading to the conclusion that there are 28 valid combinations.
  • A similar explanation is reiterated by another participant, emphasizing the reasoning behind dividing by 2 to avoid double counting permutations of the same selection.
  • One participant notes that once the two bits for 1's are chosen, the remaining bits must all be 0's, indicating that there is only one way to arrange the remaining bits.
  • A later reply expresses a personal feeling of confusion and fatigue regarding the problem, indicating a struggle with understanding the reasoning involved.

Areas of Agreement / Disagreement

Participants express differing views on the initial reasoning behind the problem. While some agree with the combinatorial approach leading to 28, others remain uncertain about the validity of their initial interpretations.

Contextual Notes

There is a lack of consensus on the initial misunderstanding of the problem, with some participants not fully grasping why their approach differs from the combinatorial solution provided.

find_the_fun
Messages
147
Reaction score
0
How many bytes contain exactly two 1's?

The answer key give [math]\binom{8}{2}[/math] and I don't get why. Even if two bytes have been taken there are still [math]2^6[/math] ways to arrange the other bytes, which is much larger than 28.
 
Physics news on Phys.org
You could look at it this way:

There are 8 bit positions you could choose for the first 1 and that leaves 7 for the second bit position. But, order does not matter, so you want to divide by 2 so that you do not count each possible permutation twice. For example, suppose you chose the third bit the first time and the fifth bit the second time. This is equivalent to choosing the fifth bit the first time and the third bit the second time. So, we find:

$$N=\frac{8\cdot7}{2}=28$$
 
MarkFL said:
You could look at it this way:

There are 8 bit positions you could choose for the first 1 and that leaves 7 for the second bit position. But, order does not matter, so you want to divide by 2 so that you do not count each possible permutation twice. For example, suppose you chose the third bit the first time and the fifth bit the second time. This is equivalent to choosing the fifth bit the first time and the third bit the second time. So, we find:

$$N=\frac{8\cdot7}{2}=28$$

What I don't see is why the way I was looking at it was wrong.
 
If you have already chosen the two bits that are 1, then the remaining 6 bits must be zeroes, and there is only 1 way this can be.
 
MarkFL said:
If you have already chosen the two bits that are 1, then the remaining 6 bits must be zeroes, and there is only 1 way this can be.

That's what I was waiting for someone to say! I don't know what's wrong with me I need more sleep.
 

Similar threads

Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
Replies
1
Views
4K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
3
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K