Counting question on bit strings - problem with using cases
up vote
2
down vote
favorite
How many bit strings of length 10 either begin with three 0s or end with two 0s?
I solved this question using cases but I do not seem to be getting the answer of $352$.
My attempt:
Consider two cases:
- Case 1: The string begins with three $0$s and does not end with two $0$s. There is only $1$ way to choose the first three bits, $2^5$ ways for the middle bits, and $3$ ways for the last two bits ($4$ ways to construct a string of two bits, minus $1$ way to make three $0$s). There are $2^5 cdot 3$ ways to construct strings of this type.
- Case 2: The string does not begin with three $0$s but ends with two $0$s. There are $2^3 - 1 = 7$ ways to choose the first three bits without three $0$s, $2^5$ ways for the middle bits, and $1$ way for the last two bits. There are $7 cdot 2^5$ ways to construct strings of this type.
By the rule of sum, there are $2^5 cdot 3 + 2^5 cdot 7 = 320$ ways to construct bit strings of length 10 either begin with three $0$s or end with two $0$s.
combinatorics discrete-mathematics
add a comment |
up vote
2
down vote
favorite
How many bit strings of length 10 either begin with three 0s or end with two 0s?
I solved this question using cases but I do not seem to be getting the answer of $352$.
My attempt:
Consider two cases:
- Case 1: The string begins with three $0$s and does not end with two $0$s. There is only $1$ way to choose the first three bits, $2^5$ ways for the middle bits, and $3$ ways for the last two bits ($4$ ways to construct a string of two bits, minus $1$ way to make three $0$s). There are $2^5 cdot 3$ ways to construct strings of this type.
- Case 2: The string does not begin with three $0$s but ends with two $0$s. There are $2^3 - 1 = 7$ ways to choose the first three bits without three $0$s, $2^5$ ways for the middle bits, and $1$ way for the last two bits. There are $7 cdot 2^5$ ways to construct strings of this type.
By the rule of sum, there are $2^5 cdot 3 + 2^5 cdot 7 = 320$ ways to construct bit strings of length 10 either begin with three $0$s or end with two $0$s.
combinatorics discrete-mathematics
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
How many bit strings of length 10 either begin with three 0s or end with two 0s?
I solved this question using cases but I do not seem to be getting the answer of $352$.
My attempt:
Consider two cases:
- Case 1: The string begins with three $0$s and does not end with two $0$s. There is only $1$ way to choose the first three bits, $2^5$ ways for the middle bits, and $3$ ways for the last two bits ($4$ ways to construct a string of two bits, minus $1$ way to make three $0$s). There are $2^5 cdot 3$ ways to construct strings of this type.
- Case 2: The string does not begin with three $0$s but ends with two $0$s. There are $2^3 - 1 = 7$ ways to choose the first three bits without three $0$s, $2^5$ ways for the middle bits, and $1$ way for the last two bits. There are $7 cdot 2^5$ ways to construct strings of this type.
By the rule of sum, there are $2^5 cdot 3 + 2^5 cdot 7 = 320$ ways to construct bit strings of length 10 either begin with three $0$s or end with two $0$s.
combinatorics discrete-mathematics
How many bit strings of length 10 either begin with three 0s or end with two 0s?
I solved this question using cases but I do not seem to be getting the answer of $352$.
My attempt:
Consider two cases:
- Case 1: The string begins with three $0$s and does not end with two $0$s. There is only $1$ way to choose the first three bits, $2^5$ ways for the middle bits, and $3$ ways for the last two bits ($4$ ways to construct a string of two bits, minus $1$ way to make three $0$s). There are $2^5 cdot 3$ ways to construct strings of this type.
- Case 2: The string does not begin with three $0$s but ends with two $0$s. There are $2^3 - 1 = 7$ ways to choose the first three bits without three $0$s, $2^5$ ways for the middle bits, and $1$ way for the last two bits. There are $7 cdot 2^5$ ways to construct strings of this type.
By the rule of sum, there are $2^5 cdot 3 + 2^5 cdot 7 = 320$ ways to construct bit strings of length 10 either begin with three $0$s or end with two $0$s.
combinatorics discrete-mathematics
combinatorics discrete-mathematics
asked Nov 25 at 0:22
holo
1588
1588
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
4
down vote
accepted
You are missing the strings that both begin with three zeroes and end with two zeroes.
And since there are five bits left that can be anything, you have $2^5=32$ of those, exactly the difference
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
add a comment |
up vote
2
down vote
$$underbrace{2^7}_{text{begin with three zeros}}+underbrace{2^8}_{text{end with two zeros}}-underbrace{2^5}_{text{double-count}} $$
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
4
down vote
accepted
You are missing the strings that both begin with three zeroes and end with two zeroes.
And since there are five bits left that can be anything, you have $2^5=32$ of those, exactly the difference
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
add a comment |
up vote
4
down vote
accepted
You are missing the strings that both begin with three zeroes and end with two zeroes.
And since there are five bits left that can be anything, you have $2^5=32$ of those, exactly the difference
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
add a comment |
up vote
4
down vote
accepted
up vote
4
down vote
accepted
You are missing the strings that both begin with three zeroes and end with two zeroes.
And since there are five bits left that can be anything, you have $2^5=32$ of those, exactly the difference
You are missing the strings that both begin with three zeroes and end with two zeroes.
And since there are five bits left that can be anything, you have $2^5=32$ of those, exactly the difference
answered Nov 25 at 0:24
Bram28
58.6k44185
58.6k44185
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
add a comment |
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
Ah. Well, I see that my problem involves not knowing that "either" also implied both in this context
– holo
Nov 25 at 0:34
1
1
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
@holo Yeah, sometimes we use ‘either .. or’ to indicate an exclusive disjunction, but that is not always the case. For example, if I say that I would like to be either rich or happy, obviously I would not mind being rich and happy.
– Bram28
Nov 25 at 0:39
add a comment |
up vote
2
down vote
$$underbrace{2^7}_{text{begin with three zeros}}+underbrace{2^8}_{text{end with two zeros}}-underbrace{2^5}_{text{double-count}} $$
add a comment |
up vote
2
down vote
$$underbrace{2^7}_{text{begin with three zeros}}+underbrace{2^8}_{text{end with two zeros}}-underbrace{2^5}_{text{double-count}} $$
add a comment |
up vote
2
down vote
up vote
2
down vote
$$underbrace{2^7}_{text{begin with three zeros}}+underbrace{2^8}_{text{end with two zeros}}-underbrace{2^5}_{text{double-count}} $$
$$underbrace{2^7}_{text{begin with three zeros}}+underbrace{2^8}_{text{end with two zeros}}-underbrace{2^5}_{text{double-count}} $$
answered Nov 25 at 0:28
David Peterson
8,56621935
8,56621935
add a comment |
add a comment |
Thanks for contributing an answer to Mathematics Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f3012277%2fcounting-question-on-bit-strings-problem-with-using-cases%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown