Professional Documents
Culture Documents
CS-210 Assignment 3
Shabbir Kamal Student ID: 25100132
October 10, 2022
1 Question 2
P8
1. j=0 (2j+1 − 2j )
= 1 + 2 + 4 + 8 + 16 + 32 + 64 + 128 + 256
= 511
P5 P5
2. i=1 i2 + i=1 7
= 1 + 4 + 9 + 16 + 25 + 7 + 7 + 7 + 7 + 7
= 90
P4
3. i=1 (i2 + i)
= (1 + 1) + (4 + 2) + (9 + 3) + (16 + 4)
= 2 + 6 + 12 + 20
= 40
P4 P4
4. k=1 k2 + k=1 k
= 1 + 4 + 9 + 16 + 1 + 2 + 3 + 4
= 40
P4
5. i=0 (3i2 + 2i)
= (3(02 ) + 2(0)) + (3(12 ) + 2(1)) + (3(22 ) + 2(2)) + (3(32 ) + 2(3)) + (3(42 ) + 2(4))
= 0 + 5 + 16 + 33 + 56
= 110
P4 P4
6. 3 k=0 k2 + 2 k=0 k
= 0 + 3 + 12 + 27 + 48 + 0 + 2 + 4 + 6 + 8
= 110
P3000
7. k=111 k
= 495395
Pn
8. k=−n k
= 0
2 Question 4
1. General Rule : n2 + 2
N ext T hree T erms : 123, 146, 171
2. General Rule : 3 + 4n
N ext T hree T erms : 47, 51, 55
(2n)!
5. General Rule : n!∗2 n
6. GeneralRule : Only two digits exist in the series (0, 1). These digits appear alternatively in the
series. The digits repeat n times starting from 1.
The first term is 1 with nterm = 1 and hence is repeated only once
The second term is 0 (following the alternative pattern) with nterm = 2 and hence is repeated 2 times.
N ext T hree T erms : 0, 0, 0
n−1
7. General Rule : 22
N ext T hree T erms : 18446744073709551616, 340282366920938463463374607431768211456,
115792089237316195423570985008687907853269984665640564039457584007913129639936
3 Question 6
x (x − 1)
F ormula f or T riangular N umber : 2 , Tx−1 = (x − 1)th T riangular N umber
Let an = a x (x − 1)
2
x (x − 1)
=⇒ n = 2
=⇒ 2 n = x2 − x
=⇒ x2 − x − 2 n = 0
√
−b± b2 − 4 a c
U sing Quadratic F ormula : 2a
√
1± 1+8n
=⇒ x = 2
4 Question 7
P∞
Let S = i=0 i ri
P∞
S = 0(r)0 + i=1 i ri
P∞
S = i=1 i ri
S = r + 2r2 + 3r3 + 4r4 + ...
S = r + 2r2 + 3r3 + 4r4 + ...
2 3 4
S = (r + r + r + r + ... ) + r (r + 2r2 + 3r3 + ... )
P∞ i
∵ (r + r2 + r3 + r4 + ... ) = i=1 r
P∞
∵ r (r + 2r2 + 3r3 + ... ) = r i=0 i ri
P∞ i P∞
S = i=1 r + r i=0 i ri
P∞ i
S = i=1 r
+ rS
P∞ i
S − rS = i=1 r
P∞ i
S (1 − r) = i=1 r
P∞ a
∵ |r |≤ 1 =⇒ i=1 ri = 1−r