Assignment 3 CS-GY 6003 INET Spring 2022 Due date: 11:55pm on April 15th 2022 on Gradescope. Instructions: Write or type out your solutions and hand in on Gradescope before the deadline. Justify your...

1 answer below »
I need a top grade for this Graduate Level Discrete Maths.


Assignment 3 CS-GY 6003 INET Spring 2022 Due date: 11:55pm on April 15th 2022 on Gradescope. Instructions: Write or type out your solutions and hand in on Gradescope before the deadline. Justify your answers! Question 1: Counting . (a) 5 points Use a combinatorial argument to prove each of: (4n)! 22n · n! · n! = ( 4n 2n ) (2n− 1)2(2n− 3)2(2n− 5)2 . . . (1) (b) 4 points Use pascal’s triangle to prove( n + 1 r + 1 ) = n∑ k=r ( k r ) (c) 3 points Use Pascal’s identify to prove that: 22n = 2 [( 2n 0 ) + ( 2n 1 ) + ( 2n 2 ) + ( 2n 3 ) + . . . + ( 2n n− 1 )] + ( 2n n ) Question 2: Number Theory . (a) 4 points Let p = 4567 and q = 113. Pick a public key e where 86 ≤ e ≤ 94. Encode the message m = 100 and show how it is successfully decoded. (b) 3 points Suppose that in mod m we determine that the inverse of x is y. Explain why xk has an inverse in mod m for any k ≥ 1. What is the inverse of x3? (c) 5 points Solve the following for x in mod 397. Show your work without using a calculator. 203963 + x ≡ 2402 mod 397 (d) 5 points Use CRT to find a value of 0 ≤ x < 3393000="" that="" satisfies="" the="" following="" congruences:="" 2x="" ≡="" 15="" mod="" 29="" 19x="" ≡="" 100="" mod="" 1000="" x="" ≡="" 52="" mod="" 117="" (e)="" 5="" points="" use="" crt="" to="" solve="" the="" following="" for="" 0="" ≤="" x="">< 899="" .="" you="" must="" find="" all="" 4="" distinct="" solutions="" in="" that="" range.="" x2="" ≡="" 33="" mod="" 29="" x2="" ≡="" 66="" mod="" 31="" 1="" (f)="" 5="" points="" determine="" integers="" s="" and="" t="" such="" that="" 5744s="3260t" mod="" 4="" (g)="" 6="" points="" for="" each="" of="" the="" following,="" solve="" for="" x="" or="" prove="" that="" there="" is="" no="" solution:="" •="" 6x="" +="" 5="" ≡="" 20="" mod="" 91="" •="" 13x="" +="" 2="" ≡="" 20="" mod="" 91="" •="" 7x="" +="" 2="" ≡="" 23="" mod="" 91="" (h)="" 6="" points="" •="" update="" the="" solution="" to="" problem="" 14="" in="" set="" 11="" so="" that="" power(x,a,n)="" returns="" the="" value="" of="" xa="" mod="" n,="" where="" 0="" ≤="" a="">< n is an integer. • write a procedure fastexp(x,a,p) which determines the value of xa mod p where p ≥ 2 is a prime number. your procedure can assume that a ≥ 0 and n ≥ 1, which are both integers. your solution must use fermat’s last theorem, and may call power(x,a,n) from above. question 3: recurrence relations: . (a) 6 points • let f (n), n ≥ 1 be the fibonacci sequence defined in class. used the closed-form solution of the fibonacci sequence to find f (15). does this give you the exact same value as if you compute f (15) using the recurrence? explain why or why not. • define a sequence g(n) , n ≥ 1 as follows: let g(1) = 5 and g(2) = 8, and g(n) = g(n− 1) + g(n− 2) for n ≥ 3. what is the closed-form solution for g(n)? justify your answer. . (b) 6 points a child is building a tower out of a total of n blocks. let r of those blocks be red, and the remaining blocks are blue. the child builds a tower using all of the blocks. suppose that the tower is built with no adjacent red blocks. let b(n, r) be the number of ways to build such a tower. write a recursive definition for b(n, r), where n ≥ 0, and 0 ≤ r ≤ n. include your base cases. what is the solution to this recurrence? use your recurrence to solve for b(6, 2) and b(7, 4), and verify they are correct using your solution to the recurrence. (c) 5 points solve the following recurrence and prove your result is correct using induction: a0 = 1 a1 = 1 an = 4an−2 + 1 for n ≥ 2 (d) 4 points solve the following recurrence: an = 5an−2 − 4an−4 for n ≥ 4 a0 = 0, a1 = 1, a2 = 1, a3 = 1 (e) 5 points suppose we are given a rod of length n. we can cut rod into pieces in such a way that each piece length is a natural number of size at least 1. there are many ways to cut the rod. for example, if n = 5, we could cut it into pieces of size 1, 2, 2 or 4, 1 etc. write a recursive definition for p (n, k) which is the number of ways to cut a rod of length n where the maximum size of the pieces is k. your definition 2 is for n ≥ 1 and k ≥ 1. you do not need to solve the recurrence. use your recurrence to solve for p (7, 7) and p (7, 2). (f) 5 points a child is building a tower out of red, black, and green blocks. the red and black blocks have size 1 and the green block has size 2. a tower of height n is built using a sequence of the colored blocks, with the condition that no red blocks are adjacent. write a recursive definition t (n), n ≥ 1, for the number of possible towers of height n. you do not need to solve the recurrence. question 4: recursive procedures . (a) 6 points recall that in week 6 we considered the problem of distributing n identical items into k unlabelled groups. in this problem, you must write a recursive procedure called numberpartitions(n, k) that returns the number of ways of distributing n identical pennies into k piles, where each pile has at least 1 penny. the piles are not labelled, so the only thing that matters is the number of coins in each pile. your procedure must function properly for n ≥ 1 and 1 ≤ k ≤ n. use your procedure to verify the output for n = 8 and k = 4. (b) 6 points consider a making a postage of n cents using stamps of size 2, 3 and 4. suppose we must use at least one of each stamp denomination. write a recursive procedure called printpostage(n) that prints out a set of stamps that create a postage of size n. you must determine the correct base case and ensure that your recursive procedure handles that correctly. if no postage is possible, your procedure must print “no postage”. your procedure must handle all inputs of n ≥ 0. for example: findpostage(25) outputs stamps 4, 4, 4, 4, 4, 3, 2. there are other options possible, but just one correct option must be printed. (c) 6 points recall problem 4(c) from assignment 2. consider a new version of this problem where the bills have denominations 1, 5, 52, 53, . . .. as in the previous assignment, you owe your friend a debt of n dollars. you must transfer a set of bills between you and your friend in such a way that the debt is repaid. in this case, a bill denomination may be used at most two times. write a recursive procedure called printbills(n) that returns a list of the necessary bills, for n ≥ 0. the list should include positive numbers for bills you give your friend, and negative numbers for bills your friend gives you. for example, if n = 21, the output list should be [52,−5, 1]. for n = 32, the output list should be [25, 5, 1, 1]. *note: this is not a course on data-structures. so you may assume that you can create an empty list with the pseudo-code “x = list()” and use the following operations: -add elements to the list using x.add(25) -update/access element at index i using x[i] -determine the length using x.length(). 3 n="" is="" an="" integer.="" •="" write="" a="" procedure="" fastexp(x,a,p)="" which="" determines="" the="" value="" of="" xa="" mod="" p="" where="" p="" ≥="" 2="" is="" a="" prime="" number.="" your="" procedure="" can="" assume="" that="" a="" ≥="" 0="" and="" n="" ≥="" 1,="" which="" are="" both="" integers.="" your="" solution="" must="" use="" fermat’s="" last="" theorem,="" and="" may="" call="" power(x,a,n)="" from="" above.="" question="" 3:="" recurrence="" relations:="" .="" (a)="" 6="" points="" •="" let="" f="" (n),="" n="" ≥="" 1="" be="" the="" fibonacci="" sequence="" defined="" in="" class.="" used="" the="" closed-form="" solution="" of="" the="" fibonacci="" sequence="" to="" find="" f="" (15).="" does="" this="" give="" you="" the="" exact="" same="" value="" as="" if="" you="" compute="" f="" (15)="" using="" the="" recurrence?="" explain="" why="" or="" why="" not.="" •="" define="" a="" sequence="" g(n)="" ,="" n="" ≥="" 1="" as="" follows:="" let="" g(1)="5" and="" g(2)="8," and="" g(n)="g(n−" 1)="" +="" g(n−="" 2)="" for="" n="" ≥="" 3.="" what="" is="" the="" closed-form="" solution="" for="" g(n)?="" justify="" your="" answer.="" .="" (b)="" 6="" points="" a="" child="" is="" building="" a="" tower="" out="" of="" a="" total="" of="" n="" blocks.="" let="" r="" of="" those="" blocks="" be="" red,="" and="" the="" remaining="" blocks="" are="" blue.="" the="" child="" builds="" a="" tower="" using="" all="" of="" the="" blocks.="" suppose="" that="" the="" tower="" is="" built="" with="" no="" adjacent="" red="" blocks.="" let="" b(n,="" r)="" be="" the="" number="" of="" ways="" to="" build="" such="" a="" tower.="" write="" a="" recursive="" definition="" for="" b(n,="" r),="" where="" n="" ≥="" 0,="" and="" 0="" ≤="" r="" ≤="" n.="" include="" your="" base="" cases.="" what="" is="" the="" solution="" to="" this="" recurrence?="" use="" your="" recurrence="" to="" solve="" for="" b(6,="" 2)="" and="" b(7,="" 4),="" and="" verify="" they="" are="" correct="" using="" your="" solution="" to="" the="" recurrence.="" (c)="" 5="" points="" solve="" the="" following="" recurrence="" and="" prove="" your="" result="" is="" correct="" using="" induction:="" a0="1" a1="1" an="4an−2" +="" 1="" for="" n="" ≥="" 2="" (d)="" 4="" points="" solve="" the="" following="" recurrence:="" an="5an−2" −="" 4an−4="" for="" n="" ≥="" 4="" a0="0," a1="1," a2="1," a3="1" (e)="" 5="" points="" suppose="" we="" are="" given="" a="" rod="" of="" length="" n.="" we="" can="" cut="" rod="" into="" pieces="" in="" such="" a="" way="" that="" each="" piece="" length="" is="" a="" natural="" number="" of="" size="" at="" least="" 1.="" there="" are="" many="" ways="" to="" cut="" the="" rod.="" for="" example,="" if="" n="5," we="" could="" cut="" it="" into="" pieces="" of="" size="" 1,="" 2,="" 2="" or="" 4,="" 1="" etc.="" write="" a="" recursive="" definition="" for="" p="" (n,="" k)="" which="" is="" the="" number="" of="" ways="" to="" cut="" a="" rod="" of="" length="" n="" where="" the="" maximum="" size="" of="" the="" pieces="" is="" k.="" your="" definition="" 2="" is="" for="" n="" ≥="" 1="" and="" k="" ≥="" 1.="" you="" do="" not="" need="" to="" solve="" the="" recurrence.="" use="" your="" recurrence="" to="" solve="" for="" p="" (7,="" 7)="" and="" p="" (7,="" 2).="" (f)="" 5="" points="" a="" child="" is="" building="" a="" tower="" out="" of="" red,="" black,="" and="" green="" blocks.="" the="" red="" and="" black="" blocks="" have="" size="" 1="" and="" the="" green="" block="" has="" size="" 2.="" a="" tower="" of="" height="" n="" is="" built="" using="" a="" sequence="" of="" the="" colored="" blocks,="" with="" the="" condition="" that="" no="" red="" blocks="" are="" adjacent.="" write="" a="" recursive="" definition="" t="" (n),="" n="" ≥="" 1,="" for="" the="" number="" of="" possible="" towers="" of="" height="" n.="" you="" do="" not="" need="" to="" solve="" the="" recurrence.="" question="" 4:="" recursive="" procedures="" .="" (a)="" 6="" points="" recall="" that="" in="" week="" 6="" we="" considered="" the="" problem="" of="" distributing="" n="" identical="" items="" into="" k="" unlabelled="" groups.="" in="" this="" problem,="" you="" must="" write="" a="" recursive="" procedure="" called="" numberpartitions(n,="" k)="" that="" returns="" the="" number="" of="" ways="" of="" distributing="" n="" identical="" pennies="" into="" k="" piles,="" where="" each="" pile="" has="" at="" least="" 1="" penny.="" the="" piles="" are="" not="" labelled,="" so="" the="" only="" thing="" that="" matters="" is="" the="" number="" of="" coins="" in="" each="" pile.="" your="" procedure="" must="" function="" properly="" for="" n="" ≥="" 1="" and="" 1="" ≤="" k="" ≤="" n.="" use="" your="" procedure="" to="" verify="" the="" output="" for="" n="8" and="" k="4." (b)="" 6="" points="" consider="" a="" making="" a="" postage="" of="" n="" cents="" using="" stamps="" of="" size="" 2,="" 3="" and="" 4.="" suppose="" we="" must="" use="" at="" least="" one="" of="" each="" stamp="" denomination.="" write="" a="" recursive="" procedure="" called="" printpostage(n)="" that="" prints="" out="" a="" set="" of="" stamps="" that="" create="" a="" postage="" of="" size="" n.="" you="" must="" determine="" the="" correct="" base="" case="" and="" ensure="" that="" your="" recursive="" procedure="" handles="" that="" correctly.="" if="" no="" postage="" is="" possible,="" your="" procedure="" must="" print="" “no="" postage”.="" your="" procedure="" must="" handle="" all="" inputs="" of="" n="" ≥="" 0.="" for="" example:="" findpostage(25)="" outputs="" stamps="" 4,="" 4,="" 4,="" 4,="" 4,="" 3,="" 2.="" there="" are="" other="" options="" possible,="" but="" just="" one="" correct="" option="" must="" be="" printed.="" (c)="" 6="" points="" recall="" problem="" 4(c)="" from="" assignment="" 2.="" consider="" a="" new="" version="" of="" this="" problem="" where="" the="" bills="" have="" denominations="" 1,="" 5,="" 52,="" 53,="" .="" .="" ..="" as="" in="" the="" previous="" assignment,="" you="" owe="" your="" friend="" a="" debt="" of="" n="" dollars.="" you="" must="" transfer="" a="" set="" of="" bills="" between="" you="" and="" your="" friend="" in="" such="" a="" way="" that="" the="" debt="" is="" repaid.="" in="" this="" case,="" a="" bill="" denomination="" may="" be="" used="" at="" most="" two="" times.="" write="" a="" recursive="" procedure="" called="" printbills(n)="" that="" returns="" a="" list="" of="" the="" necessary="" bills,="" for="" n="" ≥="" 0.="" the="" list="" should="" include="" positive="" numbers="" for="" bills="" you="" give="" your="" friend,="" and="" negative="" numbers="" for="" bills="" your="" friend="" gives="" you.="" for="" example,="" if="" n="21," the="" output="" list="" should="" be="" [52,−5,="" 1].="" for="" n="32," the="" output="" list="" should="" be="" [25,="" 5,="" 1,="" 1].="" *note:="" this="" is="" not="" a="" course="" on="" data-structures.="" so="" you="" may="" assume="" that="" you="" can="" create="" an="" empty="" list="" with="" the="" pseudo-code="" “x="list()”" and="" use="" the="" following="" operations:="" -add="" elements="" to="" the="" list="" using="" x.add(25)="" -update/access="" element="" at="" index="" i="" using="" x[i]="" -determine="" the="" length="" using="" x.length().="">
Answered 2 days AfterApr 07, 2022

Answer To: Assignment 3 CS-GY 6003 INET Spring 2022 Due date: 11:55pm on April 15th 2022 on Gradescope....

Rajeswari answered on Apr 10 2022
91 Votes
Assignment 3 CS-GY 6003 INET Spring 2022
The above is equivalent to proving
=*
Right side first factor is selecting 2n from 4n objects.
Left side denominator is (by using one 2 to multiply with one number)
= (1.2.3.4….(2n))^2 (be
cause all odd numbers upto to 2n are on right side and all even numbers in first term of right side
=
Hence right side is nothing but
Thus proved
Q no2
Here p and q are prime
We write n =pq =516071
The element e belongs to {86,87….94}
E=89 since this is prime we have gcd of (89, 4566, 112) =1
So public message is e =89 and n = 516071
The private key will be the inverse of 89 in Z_515958
There decoding they factorise 516071 into 113 and 4567 (i.e. two big primes)
The receiver determines the inverse of e modulo (p-1)(q-1)
(p-1) (q-1) = 4566*112 =511392
Set up a division problem where a is larger than b.
a ÷ b = c with remainder R. Do the division. Then replace a with b, replace b with R and repeat the division. Continue the process until R = 0.
511392 ÷ 89 = 5745 R 87    (511392 = 5745 × 89 + 87)
89 ÷ 87 = 1 R 2    (89 = 1 × 87 + 2)
87 ÷ 2 = 43 R 1    (87 = 43 × 2 + 1)
2 ÷ 1 = 2 R 0    (2 = 2 × 1 + 0)
When remainder R = 0, the GCF is the divisor, b, in the last equation. GCF = 1
Taking reverse
89(-252823)+ 44*511392 =1
Inverse is coefficient of 89 i.e. -252923
Hence private key is d = -252923
S= 100^89 = 100^89 mod 516071 =(483929)^33*100mod 516071 = 123673
The receiver would do s^d and decode it.
Given that inverse of x is y. i.e. x*y = 1 mod m
Or m-1 is divisible by xy. This is possible only if gcd (x,m)=1
For any k>1, x^k will never have any common factor with m. Since (x^k, m) have gcd 1, we get x^k also definitely has an inverse
For x^3, gcd (x^3,m) =1
There exists integers s and t such that s*x^3+t*m=1
We already have x*s1+t1*m =1
Subtracting s1(x^3-x) +m(t-t1) =0
Or s1(x^3-x) = 0 mod m.
Or x is the inverse of x^3
We have 2^9 = 512 and 2^9 mod 397 = 115 mod 297
Hence
X=285-20^3963
2x = 15 mod 29
i.e 2x = {….-14, 15, 44, 73, 102,….}
For x to be an integer we have to select only even numbers on right
i.e. x ={…-7, 22, 51,…}
Or x = 22 mod 29 = (22,51,80, …3392993)
19x = 100 mod 1000 = {-900, 100, 1100, 2100,…….17100, …36100,…,55100,…}
Only 17100 is the least integer divisible by 19
Hence x = {…,900, 1000, 1100,1200,…}
X=0 mod 100
Since x square cannot be...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here