Read all carefully and use matlab to answer
Problem 3.7 Pascal's triangle, shown below, is a method for visualizing the binomial coefficients *. These coefficients may be written as (nk?),n?Ckr? or C(n,k) where n is the row number and k is the column number (starting with n=0 and k=0 ). Left-aligned Pascal's triangle (as an array) One way to calculate each binomial coefficient is to add the two numbers above it. That is: - C(0,0)=1 (by definition) - For row n (where n?1 ): C(n,1)=1 - C(n,k)=C(n?1,k?1)+C(n?1,k) for k={2,3,…,n} - C(n,k)=0 for all other values (that is, for k>n ) Write a MATLAB code to create an array containing Pascal's triangle (left-aligned) for rows n=0 to n=10 using nested FOR loops, then display the array. (Hint: Remember that array indices in MATLAB start at 1. You will have to adjust the formulas in your code to account for this.) *These coefficients show up frequently in probability and in polynomials. For example, when expanding (x+y)5=x5+5x4y+10x3y2+10x2y3+5xy4+y5 the coefficients of the terms after expanding are the binomial coefficients for n=5. Or, suppose we purchase bolts where each bolt has a 1 in 20000 chance of being faulty. If we select 5000 bolts at random, the probability that exactly k bolts are faulty is P(k faulty )=C(5000,k)?(200001?)k?(2000019999?)5000?k?100% Pascal's triangle is named for 17th -century French mathematician Blaise Pascal, but the triangle had already been in use for several centuries in several parts of the globe (including Europe) before Pascal's time.