how many number of states do we require for evaluating a string which has odd count of 0's odd count of 1's even count of 2'sa.14b.16c.4d.8
Question
How many states do we require for evaluating a string which has:
- odd count of
0
s - odd count of
1
s - even count of
2
s?
Options:
- a. 14
- b. 16
- c. 4
- d. 8
Solution
To evaluate a string which has an odd count of 0's, an odd count of 1's, and an even count of 2's, we need to consider all possible combinations of these conditions.
Step 1: For the odd count of 0's, we need 2 states: one for when the count is even (initial state), and one for when the count is odd.
Step 2: Similarly, for the odd count of 1's, we also need 2 states: one for when the count is even (initial state), and one for when the count is odd.
Step 3: For the even count of 2's, we only need 2 states: one for when the count is even (initial state), and one for when the count is odd.
Step 4: Since these conditions can occur in any combination, we need to consider all possible combinations of these states. This gives us a total of 2 (for 0's) * 2 (for 1's) * 2 (for 2's) = 8 states.
So, the correct answer is (d) 8.
Similar Questions
How many states does a binary counter with n flip-flops have?a.nb.2nc.2^nd.n + 1
Read a number from the user. Check whether it is odd or even using lambda function and print the output as either ODD or EVEN. Sample Input5Sample OutputODD
How many 3-digit odd numbers exist, with no repetition? Ex: 871 counts, but 777 does not.
How many numbers can be formed using all the digits 1, 2, 3, 4, 3, 2, 1 such that even digits alwaysoccupy even plac
17. The state of being '1’ or '0’.Group of answer choicesBinary stringBitsParityBytes
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.