Counting Methods: Understanding 8-Bit String Patterns

  • Thread starter Thread starter ptex
  • Start date Start date
  • Tags Tags
    Counting
AI Thread Summary
The discussion focuses on calculating the number of 8-bit strings based on specific conditions. For strings with either the second or fourth bit set to 1, the solution is derived as 3*2^6, which accounts for combinations where the second bit is 1, the fourth bit is 1, and both bits are 1. For strings that begin and end with 1, the calculation shows there are 64 possible combinations, as there are 6 variable bits in between. The explanation emphasizes understanding the logic behind counting rather than relying solely on formulas. Overall, the thread encourages a conceptual approach to solving bit string problems.
ptex
Messages
42
Reaction score
0
The question is how many 8-bit strings have either the second or the fourth bit 1 (or both)?
I know the soulution is 3*2^6 but why??

Also this question how many 8 bit strings begin and end with 1? is it 8C2?
 
Last edited:
Physics news on Phys.org
1. If the second bit is 1, we 7 variable bits so that is 2^7 different combinations. In this, the combinations where the fourth bit is also 1 are included, so we have to add the number of combinations where the second bit is 0 and the fourth bit is 1 and that is an additional 2^6. 2^7 + 2^6 = 192 (This is your 3*2^6).

2. I don't know what 8C2 means but if the 8 bit string begins and ends with a 1 then we have 6 variable bits, each with 2 possible values so it's 2^6 = 64.

Don't be discouraged by problems like this, you don't need any "formulas" for stuff like this, just think this way (for example, in the second question):

We have to count all possible bit strings of the form 1xxxxxx1. There is 1 possibility for the first bit, 1, for that there is 2 possibilities for the second bit, 0 and 1, for each of those there are 2 possibilities for the third bit, for each of those ... there are 2 possibilities for the seventh bit, for each of those there is 1 possibility for the eighth bit. That is 1*2*2*2*2*2*2*1 = 2^6 = 64

If something is unclear, ask. :)
 
Last edited:
Why 2? Because we are talking about 2 bits?
 
No. Because a bit has 2 possible values - 0 and 1.

For example, let's say we want to count all strings of 4 letters which begin with letter 'a' or 'f' and end with anything except 'c'.

We have 2 possibilities for the first letter (a and f). For each of those 2, we have 26 possibilities for the second letter (any letter), for each of those we have 26 possibilities for the third letter (any letter), for each of those we have 25 possibilities for the fourth letter (anything but c).

So that's 2*26*26*25. :)
 
Thank you I will ponder this for a few and try a few more problems. Again thank you.
 
I multiplied the values first without the error limit. Got 19.38. rounded it off to 2 significant figures since the given data has 2 significant figures. So = 19. For error I used the above formula. It comes out about 1.48. Now my question is. Should I write the answer as 19±1.5 (rounding 1.48 to 2 significant figures) OR should I write it as 19±1. So in short, should the error have same number of significant figures as the mean value or should it have the same number of decimal places as...
Thread 'A cylinder connected to a hanging mass'
Let's declare that for the cylinder, mass = M = 10 kg Radius = R = 4 m For the wall and the floor, Friction coeff = ##\mu## = 0.5 For the hanging mass, mass = m = 11 kg First, we divide the force according to their respective plane (x and y thing, correct me if I'm wrong) and according to which, cylinder or the hanging mass, they're working on. Force on the hanging mass $$mg - T = ma$$ Force(Cylinder) on y $$N_f + f_w - Mg = 0$$ Force(Cylinder) on x $$T + f_f - N_w = Ma$$ There's also...

Similar threads

Back
Top