practice problems pending
Q1. S1. Method 1: sum = 0 i = 1, j = 1:1, k = 1:1 Add 1 i = 2, j = 1, k = 1:1 Add 1 i = 2, j = 2, k = 1:2 Add 2 First iteration we added: 1 Second: (1+2) Third: (1+2+3) Nth: . (1+2+3...+n) Adding all we get: 1 + (1+2) + (1+2+3) .... + (1+...n) = 1*n + 2*(n-1) .... 1*n = (k=1:n)Sigma (k*(n-k+1)) = sigma(nk - k^2 + k) = (n+1)*[n(n+1)]/2 - n(n+1)(2n+1)/6 = n(n+1)(n+2)/6 Method 2: reduce it step by step: Triple sigma 1 = double sigma j = sigma i*(i+1)/2 then separate and do the sum. Q2. Find the sum of the products of every pair of the first n natural numbers. S2. 1*2 + 1*3 + 1*4 ... 1*n 2*3 + 2*4 ... 2*n ............................ (n-1)*n = (k = n:2)Sigma(k * {k*(k-1)/2} = 1/2[sigma(n^3) - 1 - sigma(n^2) + 1] = 1/2[sigma(n^3) - sigma(n^2)] simplify from here and get the answer.