3. Let P(n) be the proposition that: for all k, with 1 k n, (C)=(-1)+(**) (a)...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
3. Let P(n) be the proposition that: for all k, with 1 k n, (C)=(-1)+(**) (a) Prove that P(n) holds for all n 1. (Note: it is possible to do this without using induction) (10 marks) We can compute (") from the formula given in lectures, however this can often require computing unnecessarily large numbers. For example, (15) 253338471349988640 which can be expressed as a 64-bit integer, but 100! is larger than a 512-bit integer. We can, however, make use of the equation above to compute (") more efficiently. Here are two algorithms for doing this: chooseRec(n,k): if k=0 or k=n: return 1 else: chooseRec(n-1,k-1) y: chooseRec(n-1,k) return z+y chooselter(n,k): Let C be a nxn array for m=1 ton: C[m][0]=C[m][m]=1 for j 1 to m-1: Cm Cm-1][1] +C[m-11 return C[n][k] Let free(n,k) be the running time for chooseRec(n, k), and let ter(n) be the running time for chooselter(n, k). Let Tree(n) maxosks free(n,k) and Tier(n) maxosks fiter (n. k) (so Tec(n) free(n, k) for all k, and likewise for Ther(n)). (b) Give an asymptotic upper bound for Tec(n). Justify your answer. (c) Give an asymptotic upper bound for Tier (n). Justify your answer. (10 marks) 3. Let P(n) be the proposition that: for all k, with 1 k n, (C)=(-1)+(**) (a) Prove that P(n) holds for all n 1. (Note: it is possible to do this without using induction) (10 marks) We can compute (") from the formula given in lectures, however this can often require computing unnecessarily large numbers. For example, (15) 253338471349988640 which can be expressed as a 64-bit integer, but 100! is larger than a 512-bit integer. We can, however, make use of the equation above to compute (") more efficiently. Here are two algorithms for doing this: chooseRec(n,k): if k=0 or k=n: return 1 else: chooseRec(n-1,k-1) y: chooseRec(n-1,k) return z+y chooselter(n,k): Let C be a nxn array for m=1 ton: C[m][0]=C[m][m]=1 for j 1 to m-1: Cm Cm-1][1] +C[m-11 return C[n][k] Let free(n,k) be the running time for chooseRec(n, k), and let ter(n) be the running time for chooselter(n, k). Let Tree(n) maxosks free(n,k) and Tier(n) maxosks fiter (n. k) (so Tec(n) free(n, k) for all k, and likewise for Ther(n)). (b) Give an asymptotic upper bound for Tec(n). Justify your answer. (c) Give an asymptotic upper bound for Tier (n). Justify your answer. (10 marks)
Expert Answer:
Related Book For
Discrete Mathematics and Its Applications
ISBN: 978-0073383095
7th edition
Authors: Kenneth H. Rosen
Posted Date:
Students also viewed these programming questions
-
Give Correct ANSWERS Human-Computer Interaction (a) If you had been one of the original inventors of the WIMP interface, and engineers on the technical team had been sceptical about the advantages...
-
Developments in Technology Light is incident from air on the end face of a multimode optical fibre at angle of incidence as shown below. n n 1 2 The refractive indices of the core and cladding are...
-
The following data show the curb weight, horsepower, and -mile speed for 16 popular sports and GT cars. Suppose that the price of each sports and GT car is also available. The complete data set is as...
-
Two ions with the same velocity and mass but different charges enter the magnetic field of a mass spectrometer. One is singly charged (q = +e) and the other is doubly charged (q = + 2e). Is the...
-
There are five variables in the dataset, and all are included in the scatterplot matrix shown in Figure 2.102. The graph shows scatterplots for each pair of quantitative variables, with the Type...
-
Reconsider the data from Problem 4. Management has expressed some concern over the life of the project and the impact of possible early termination. As a result, you have developed additional data...
-
Ferraro, Inc. established a share-appreciation rights (SAR) program on January 1, 2010, which entitles executives to receive cash at the date of exercise for the difference between the market price...
-
Consider the closed system with mass-action rate constants as shown. Suppose the rate constants are (in min-1) k = 0.05, kg = 0.7, k2= 0.005, and k4 = 0.4. ki k3 A B C k2 ka (a) Construct a...
-
On 1/1/2013, the Aluminum Sectors Operator Company purchased 90% of the shares of Al-Fayhaa Plastic Industries Company by issuing 30,000 shares of its shares, knowing that the nominal value of the...
-
What are the fundamental distinctions between the processes of meiosis and mitosis?
-
9. What does the following method do? (You may assume that the elements in q are ref- erences to the objects of the class IntElement.) public static void mystery (Queueclass q) { StackClass s= new...
-
9. 0) or yes Two people, A and B, are deciding whether to put effort into producing a public good or not. Each person, i, can either choose no effort ( S; = effort (S = 1). The total public good...
-
Why should a buyer be concerned with monitoring and managing supplier quality performance? Why is it important for a buyer to be a good customer? How can a buyer become a good customer to a supplier?...
-
Give a discussion on the following: Why is the current focus of the encryption debate on end-to-end encryption, meaning encrypted data securely transmitted from one user's device that can only be...
-
Why is Germany so successful at international trade?
-
For the given transfer function: Vo(s) / Vi(s) = (s^2C^2R^2 + 1) / (s^2C^2R^2 + 4sCR + 1) Assumiing that 1/(CR) = 120 PI so write the matlab code to find the magnitude plot
-
A running mountain lion can make a leap 10.0 m long, reaching a maximum height of 3.0 m. a. What is the speed of the mountain lion just as it leaves the ground? b. At what angle does it leave the...
-
The moon completes one (circular) orbit of the earth in 27.3 days. The distance from the earth to the moon is 3.84 10 8 m. What is the moons centripetal acceleration?
-
A soccer player takes a free kick from a spot that is 20 m from the goal. The ball leaves his foot at an angle of 32, and it eventually hits the crossbar of the goal, which is 2.4 m from the ground....
Study smarter with the SolutionInn App