Question

Exercise 1: Counting binary strings. Count the number of binary strings of length 10 subject to each of the following restrictions. There is only one binary string of length ten with no 1's: 00000000000. There are 2^{10} binary strings of length ten. How many integers in the range 1 through 140 are integer multiples of 2, 5, or 7?

Factors and multiples
ANSWERED
asked 2021-07-30
Exercise 1: Counting binary strings.
Count the number of binary strings of length 10 subject to each of the following restrictions.
There is only one binary string of length ten with no 1's: 00000000000. There are \(\displaystyle{2}^{{{10}}}\) binary strings of length ten. Therefore the number of binary strings of length ten with at least one 1 is \(\displaystyle{2}^{{{10}}}-{1}\).
(b)
The string has at least one 1 and at least one 0.
(c)
The string contains exactly five 1's or it begins with a 0.
Exercise 2: Counting integer multiples.
(b)
How many integers in the range 1 through 140 are integer multiples of 2, 5, or 7?

Answers (1)

2021-07-31
Step 1
The string has at least one 1 and at least one 0.
This removes the possibility of all one and all zeros
Thus number of binary strings is \(\displaystyle{2}^{{{10}}}-{2}\)
Step 2
The string contains exactly five 1's or it begins with a 0.
First digit is fixed as zero
In remaining 9 places Lets choose 5 places and place 1s there
Number of ways are \(\displaystyle{{C}_{{5}}^{{9}}}\)
126
Step 3
How many integers in the range 1 through 140 are integer multiples of 2, 5, or 7
There are 70 multiples of 2
23 multiples of 3 left
we have 9 multiples of 5 that have not yet been included.
Total is 102
0
 
Best answer

expert advice

Have a similar question?
We can deal with it in 3 hours

Relevant Questions

asked 2021-02-25
We will now add support for register-memory ALU operations to the classic five-stage RISC pipeline. To offset this increase in complexity, all memory addressing will be restricted to register indirect (i.e., all addresses are simply a value held in a register; no offset or displacement may be added to the register value). For example, the register-memory instruction add x4, x5, (x1) means add the contents of register x5 to the contents of the memory location with address equal to the value in register x1 and put the sum in register x4. Register-register ALU operations are unchanged. The following items apply to the integer RISC pipeline:
a. List a rearranged order of the five traditional stages of the RISC pipeline that will support register-memory operations implemented exclusively by register indirect addressing.
b. Describe what new forwarding paths are needed for the rearranged pipeline by stating the source, destination, and information transferred on each needed new path.
c. For the reordered stages of the RISC pipeline, what new data hazards are created by this addressing mode? Give an instruction sequence illustrating each new hazard.
d. List all of the ways that the RISC pipeline with register-memory ALU operations can have a different instruction count for a given program than the original RISC pipeline. Give a pair of specific instruction sequences, one for the original pipeline and one for the rearranged pipeline, to illustrate each way.
Hint for (d): Give a pair of instruction sequences where the RISC pipeline has “more” instructions than the reg-mem architecture. Also give a pair of instruction sequences where the RISC pipeline has “fewer” instructions than the reg-mem architecture.
asked 2021-05-17
How many bit strings of length seven either begin with two 0s or end with three 1s?
asked 2021-06-01
How many strings are there of four lowercase letters that have the letter x in them?
asked 2021-08-06
Fifty raffle tickets are numbered 1 through 50, and one of them is drawn at random. What is the probability that the number is a multiple of 5 or 7? Consider the following "solution": Since 10 tickets bear numbers that are multiples of 5 and 7 tickets bear numbers that are multiples of 7, we concluded the required probability is as follows.
\(\displaystyle{\frac{{{10}}}{{{50}}}}+{\frac{{{7}}}{{{50}}}}={\frac{{{17}}}{{{50}}}}\)
Is this the correct answer? (If so, enter yes. If not, enter the correct answer.)
...