Question: PLEASE USE MATHLAB .m 8. Pascal's triangle is an arrangement of numbers such that each row is equivalent to the coefficients of the binomial expansion

PLEASE USE MATHLAB

PLEASE USE MATHLAB .m 8. Pascal's triangle is an arrangement of numbers

.m 8. Pascal's triangle is an arrangement of numbers such that each row is equivalent to the coefficients of the binomial expansion of (x + y)(p-1), where p is some positive integer more than or equal to 1. For example, (x + y)2 = 1x2 + 2xy + 1y2 so the third row of Pascal's triangle is 1 2 1. Let Rm represent the m-th row of Pascal's triangle, and Rm(n) be the n-th element of the row. By definition, Rm has m elements, and Rm (1) = Rm (n) = 1. The remaining elements are computed by the following recursive relationship: Rm (i) = Rm-1(i 1)+Rm-1(i) for i = 2, ..., m - 1. The first few rows of Pascal's triangle are depicted in the following figure. You may assume that m is a strictly positive integer. The output variable, row, must be a row vector. 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 1 5 10 10 5 1 Write a function with header [row] = myPascalRow (m) where row is the m-th row of the Pascal triangle. You may assume that m is a strictly positive integer. Test Cases: >> R = myPascal Row (1) R = 1 >> R = myPascalRow (2) R = 1 1 >> R = myPascal Row (3) R = 1 2 1 N

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!