Counting Methods: Understanding 8-Bit String Patterns

  • Thread starter ptex
  • Start date
  • Tags
    Counting
In summary, there are a total of 64 different 8-bit strings that have either the second or the fourth bit 1.
  • #1
ptex
42
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
  • #2
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:
  • #3
Why 2? Because we are talking about 2 bits?
 
  • #4
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. :)
 
  • #5
Thank you I will ponder this for a few and try a few more problems. Again thank you.
 

FAQ: Counting Methods: Understanding 8-Bit String Patterns

What are counting methods and why do scientists use them?

Counting methods refer to the different techniques and strategies used in scientific research to accurately quantify and measure data. Scientists use these methods to analyze and interpret data, make predictions, and test hypotheses.

What are the different types of counting methods?

There are several types of counting methods, including basic counting, permutation, combination, and probability. Basic counting involves simply counting the number of individual items or events. Permutation is used to determine the number of ways to arrange a set of items. Combination is used when the order of items does not matter. Probability is used to calculate the likelihood of a certain event occurring.

How do scientists choose which counting method to use?

The choice of counting method depends on the type of data being analyzed and the research question being addressed. Scientists carefully consider the characteristics of their data and the goals of their research to determine the most appropriate counting method.

What are some common mistakes to avoid when using counting methods?

Some common mistakes to avoid when using counting methods include not considering all possible outcomes, double-counting, and using the wrong counting method for the given data. It is important for scientists to carefully plan and check their calculations to ensure accuracy.

How can counting methods be applied in real-life situations?

Counting methods are widely used in a variety of fields, including biology, chemistry, physics, and economics. They can be applied to analyze data and make predictions in real-life situations such as population growth, weather forecasting, market trends, and genetic inheritance.

Similar threads

Replies
10
Views
2K
Replies
4
Views
3K
Replies
23
Views
982
Replies
10
Views
4K
Replies
14
Views
2K
Replies
22
Views
2K
Back
Top