Computing - Latex
Computing - Latex
This work is a report on the class activity relative to Pascal triangle and my personal observations.
k = 0: 1
k = 1: 1 1
k = 2: 1 2 1
k = 3: 1 3 3 1
k = 4: 1 4 6 4 1
k = 5: 1 5 10 10 5 1
k = 6: 1 6 15 20 15 6 1
k = 7: 1 7 21 35 35 21 7 1
k = 8: 1 8 28 56 70 56 28 8 1
k = 9: 1 9 36 84 126 126 84 36 9 1
k = 10: 1 10 45 120 210 252 210 120 45 10 1
OBSERVATIONS:
i Diagonal Property:
b) the second diagonal from left and from right are set of natural numbers.
1
c) The third diagonal from left and from right contains 1,3,6,10,15,21,...these are triangular numbers. Tri-
angular numbers dot representation indicates a pattern that forms a triangle.for each time a row is
added, the amount of dot increase.
d) the sum of two consecutive numbers in the third diagonal from left and from right is a square number.
consider the third diagonal from left that contains the elements; 1,3,6,10,15,21,28,36,45 for this triangle
written up to row ten, It can clearly be shown below that consecutive sum is a square number
1+3=4
3+6=9
6 + 10 = 6
we can see that they are all square numbers,if we continued with the addition, our sum will all be square
numbers.
ii Horizontal Property:
b) The sum of the elements in each row is 2n where n the number of row example:
row 0 : 1 = 20
row one : 1 + 1 = 2 = 21
row two : 1 + 2 + 1 = 4 = 22
row three : 1 + 3 + 3 + 1= 8 = 23
we can see that powers of two correspond to the row number.
k
X n
(a + b)k = ax bk−x
k
x=0
k
k
X n
(1 + 1) = 1x 1k−x
k
x=0
given that x and k are real numbers, then using one as their base, we obtained 1, therefore we have:
k
k
X n
(2) =
k
x=0
we can see that coefficient of the pascal triangle which is the combination of the given row and the
position of the element sum to a power of 2.
c) considering a given row, the corresponding element are result of 11n , where n is the row number
for instance : row 3 : 113 = 1331 = 1 3 3 1, the elements of row 3.
2
d) The sum of element in the odd position(Boxed) is equal to the sum of elements in the even posi-
tion(circle)
1 + 6 + 1 (even position from 0) = 4 + 4 (odd position) = 8
1 1
1 2 1
1 3 3 1
1
4 6
4 1
n:N
n:Z
a[0, i] is an array of Z
if a[i, j] ∈ a[0, n) then, M ax : a[i] ≥ a[j], ∀i,j ∈ a[0, n]
3
return(largest)
end largest element
ii. The pseudo for average
a = array of N
n = number of elements sum = 0
sum = sum x[i]
i=i+1
average = sum
n
end
iii. The pseudo median
a[i] = elements in the array are sorted
if a[i] is odd,
median = text a n+1
2
else:
a[ n ]+a[ n+2 ]
median = 2 2 2