Q.a
Optional Extra Points (20 points) (a) [5 points Suppose that k and n are integers with 1 Sk
Problem 5 5.a Consider the following identity. For all positive integers n and k with n 2k, (n choose k) + (n choose k-1) = (n+1 choose k). This can be demonstrated either algebraically or via a story proof. To prove the identity algebraically, we can write (n choose k) + (n choose k-1) = n!/[k!(n-k)!] + n!/[(k-1)!(n-k+1)!] = [(n-k+1)n! + (k)n!]/[k!(n-k+1)!] [n!(n+1)/k!(n-k+1)!] = (n+1 choose k). Which of the following is a story proof of the identity? Consider a...
Please help me :) #5. Ms. Lee is famous for her parties in the Seoul area. In each four-year administration she throws k parties, set m tables at each party and seats n people at each table. She makes a list of mn influential people at the start of the four year period and invites them to every party. Her tables are all distinct from cach other (teak, oak, cherry, etc.) and k S m. It is rumored that her...
Please send me solutions for the above five questions. The questions are based on Pigeonhole Principle. 3. A shop contains twelve samples of read shirts, seven samples of white shirts, and N samples of blue shirts. Suppose that the smallest K such that choosing K samples from the collection guarantees that you have six samples of the same color of shirt is K-15. What is N? 4. Show that among any n1 positive integers not exceeding 2nthere must be integer...
9. [10 points) Consider the following algorithm: procedure Algorithm(n: positive integer; ddd: distinet integers) for k:=1 to n-1 for 1-1 to n-k print(k, I, di,da...-1,dn) if ds dti then interchange dy and d (a) Assume that this algorithm receives as input the integer n 6 and the input sequence 하하하하하하, Miss ^-ruteae rehen i12|3141516 Fill out the table below: ds ds (b) Assume that the algorithm receives the same input values as in part a). Once the algorithm finishes, what...
9. (5 points) Please describe an algorithm that takes as input a list of n integers and finds the number of negative integers in the list. 10. (5 points) Please devise an algorithm that finds all modes. (Recall that a list of integers is nondecreasing if each term of the list is at least as large as the preceding term.) 11. (5 points) Please find the least integer n such that f() is 0(3") for each of these functions f()...
Question 9 (10 points) Suppose an array of integers is considered "special" if it contains more multiples of 3 than multiples of 5. Note that the same number may be both a multiple of 3 and a multiple of 5. For example, the array {3, 15, 10] is not special because it contains two multiples of 3 (3, 15) and also two multiples of 5 (15, 10). Write a method that takes an array of integers as a parameter and...
(20 points) You are given an array A of distinct integers of size n. The sequence A[1], A[2], ..., A[n] is unimodal if for some index k between 1 and n the values increase up to position k and then decrease the reminder of the way until position n. (example 1, 4, 5, 7, 9, 10, 13, 14, 8, 6, 4, 3, 2 where the values increase until 14 and then decrease until 1). (a) Propose a recursive algorithm to...
17. Consider the following algorithm: procedure Algorithm(n: positive integer; di,d2.. ,dn: distinct integers) for 1 to n-1 for 1 to n-k if ddi+ then interchange di and di+ print(k, I, d,ddn-1, dn) (a) |3 points Assume that this algorithm receives as input the integer-6 and the corresponding input sequence 41 36 27 31 17 20 Fill out the table below ds (b) 1 point Assume that the algorithm receives the same input values as in part a). Once the algo-...
5. Suppose P(m,n) means “m>n”, where the universe of discourse for m and n is the set of POSITIVE integers. Find the truth value of each statement and explain your answer. NOTE: This is NOT exactly the same as the practice test. (a) (2 points) VxP(x,5) (b) (2 points) Vx3yP(x,y) (c) (2 points) ExWyP(x,y)
1. Consider the function h:Z+ +Z+ defined by h(n) = l{k e Z+ : k|n}l. The bars around the set mean that we are taking the size of the set. Thus h(n) is the number of positive divisors of n. (a) Make a table of values for h(n) for 1 sn < 10. Write one or two sentences describing how you found the values in the table. (b) Find the value of h(90). Explain how you found your answer. (c)...