Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Write all binary strings of length 4 (start with 0000 and end with 1111) in a

ID: 3195105 • Letter: 1

Question

1. Write all binary strings of length 4 (start with 0000 and end with 1111) in a column and do the following (a) (b) (c) (d) Explain why the number of binary strings of length 4 is 16 What would be the number of binary strings of length 7? On the rightside of each binary string of length 4 write ml = #(1's in the string) Use (c) to count the number of binary strings for each value of m1 = 0, 1, , 4; what do these numbers correspond to in terms of C(.., .)?. (e) What is the sum of C(., )'s you obtained in (d)? (f) Write the subsets of positions 1, 2, 3, and 4 to the left of each binary string of length 4 2. Complete the equations below by filling-in the parts "....": C(n, m) = -=--XCL ). . , m(m -1)(m-2)-1 (m-1)(m -2)1 3. Use the final equation for C(n, m) obtained in Problem 2 to compute successively C(5, 3), C(6, 4), and C(7, 5) starting from C(4, 2-6 4. Apply the symmetry property of C(n, m)'s to compute C(7, 2) using your results in Problem 3. Also, compute C(7, 2) using the formula for C(n, m) 5. Complete the equation C(n, m +)n2) m 6. Use the final equation in Probem 5 to determine the condition (involving n and m) so that C(n, m+1) > C(n, m) m(m-1)1 7 Fill-in the table below (where "T" means "true" and "F" means "false") to determine amount of the computation (#Comansons and #Assignments/done by the following code. I. if (x = y) max = x; Test and/or assignment 2= 3 (F) Line# #Comparisons #Assignments 31(1) (2) 0 What is the average #Comparisons and average #Assignments? What is wrong in the following codes for computing max of x and y, and how to correct the problem(s)? if (x y) max =x; I. if (x y) max = x;

Explanation / Answer

We experts are permitted by Chegg to solve only 1 question so if you need help on the rest of the questions which aren't solved by me then you can repost them.

1. 0000

0001

0010

0011

0100

0101

0110

0111

1000

1001

1010

1011

1100

1101

1110

1111

(a) Number of binary strings which can be represented using n digits is equal to 2n and since n here is 4, 24 = 16

(b) Number of binary strings for length 7 would be 27 = 128

(c) 0000 m=#(0)

0001 m=#(1)

0010 m=#(1)

0011 m=#(2)

0100 m=#(1)

0101 m=#(2)

0110 m=#(2)

0111 m=#(3)

1000 m=#(1)

1001 m=#(2)

1010 m=#(2)

1011 m=#(3)

1100 m=#(2)

1101 m =#(3)

1110 m=#(3)

1111 m=#(4)

(d) For m=0, number of strings = 1

For m=1, number of strings = 4

For m=2, number of strings = 6

For m=3, number of strings = 4

For m=4, number of strings = 1

(e) The sum of C(...,..) obtained in (d) is 1+4+6+4+1= 16

Please note: Since you haven't provided me with the meaning of C(..,..) function, I was unable to solve the (d) part completely and same applies for (f) part as well.