Professional Documents
Culture Documents
st
1 Sem. 2014-15, Logic in Computer Science (CS F214)
Tutorial #4
In-Class Exercise:
Using mathematical induction, prove the following:
Q1. 1 + 3 + 5 + ...... + r = n2, for all n>0, where r is an odd integer and n is the number of terms in the
sum. [Note: r = 2n-1].
Q2. For any given number X : X is divisible by 3 if and only if r(X) is divisible by 3.
where r(X) is value of the reverse of X treated as a binary string (with no leading zeroes)
e.g. if X is 10 (decimal) i.e. 1010 (binary) then r(X) is 0101 (binary) i.e. 5 (decimal)
e.g. if X is 19 (decimal) i.e. 10011(binary) then r(X) is 11001 (binary) i.e. 25 (decimal)
Take-Home Exercise:
Using mathematical induction, prove the following:
Q2.