Generate up to the seventh and nineth rows of the Pascal triangle.
Pascal triangle starts with two initial rows: the 0th row and the 1st row. They are
All entries in any row are numbered from 0.
The rule to construct the 2nd row is following. Put 1 as the 0th entry, calculate the 1st entry as the sum of 1+1, where each "1" is taken from previous row, then put 1 as the 2nd entry. Thus, Pascal triangle containing 3 rows is
Any other row starts with 1 and ends with 1. Any other entry within a row lying "between" and "below" two entries of upper row is the sum of the two entries. Thus, the 3rd row is 1, 1+2, 2+1, 1. Triangle containing 4 rows is
Consequently the 4th row is 1, 1+3, 3+3, 3+1, 1.
Continuing up to ninth row construct Pascal triangle.
Comments
Leave a comment