Discrete Structures207510 marksNumerical: modulo arithmetic and recursionProving Correctness of Recursive Algorithms
Compute the values. 3 mod 4 , 7 mod 5, -5 mod 3 , 11 mod 5 and -8 mod 6Write down the recursive algorithm to find the value of bnb^nbn and prove its correctness using induction.[5+5]
Compute the values. 3 mod 4 , 7 mod 5, -5 mod 3 , 11 mod 5 and -8 mod 6Write down the recursive algorithm to find the value of bnb^nbn and prove its correctness using induction.[5+5]
(a) Computing Modular Values For an integer $a$ and positive integer $d$, we write $a \bmod d = r$ where $$a = d \cdot q + r, \qquad 0 \le r < d.$$ The remainder $r$ must be non-negative and strictly less than $d$, so for negative $a$ we take $q = \lfloor a/d \rfloor$ (the floor). --- $$3 = 4 \cd...