[solved] – Question 9059

The Pascale triangle holds coefficients in the series expansion of (1 + x)n, where n = 0, 1, 2, … The top of this triangle, for n = 0, 1, 2, is shown here
1
1 1
1 2 1
Write MATLAB function t = pasctri(n) that generates the Pascal triangle t up to the level n.
Remark. Two-dimensional arrays in MATLAB must have the same number of columns in each row. In order to avoid error messages you have to add a certain number of zero entries to the right of last nonzero entry in each row of t but one. This t = pasctri(2).

t =
1 0 0
1 1 0
1 2 1
is an example of the array t for n = 2.

Expert Answer


[solved] – Question 9060

1. The Legendre polynomials Pn(x), n = 0, 1, … are defined recursively as follows

nPn(x) = (2n-1)xPn -1 – (n-1)Pn-2(x), n = 2, 3, … , P0(x) = 1, P1(x) = x

a) Write MATLAB function P = LegendP(n) that takes an integer n (the degree of Pn(x)) and returns its coefficient stored in the descending order of powers.
b) Plot all Legendre polynomials Pn(x), n = 0, 1, …,6 over the interval [-1,1] in one figure.

Expert Answer


[solved] – Question 9063

3. With considering the following algorithm for computing pi:

I. Set a = 1, b = 1/sqrt(2), t = 1/4 and x = 1

II. Repeat the following commands until the difference between a and b is within some desired accuracy:

y = a
a = (a + b)/2
b = sqrt(b*y)
t = t – x*(y – a)^2
x = 2*x

III. From the resulting values of a, b and t, an estimate of pi is

Pi_est = ((a + b)^2)/(4*t)

How many repeats are needed to estimate pi to an accuracy of 1e-8? 1e-15?

Expert Answer


[solved] – Question 9069

Create a c# console application to enter the name and mark of students using a 2d array

Expert Answer


[solved] – Question 90691

Carry out the modification, discussed in Exercise 7, to the PARSE program of Chapter 10.
That is, make it possible to parse expressions containing floating-point numbers.
Combine the classes from Exercise 7 with the algorithms from PARSE. You’ll need to
operate on pointers to tokens instead of characters. This involves statements of the kind
Number* ptrN = new Number(ans);
s.push(ptrN);
and
Operator* ptrO = new Operator(ch);
s.push(ptrO);

Expert Answer


[solved] – Question 9070

dicuss tcp/ip, ipx/spx and netbeui

Expert Answer


[solved] – Question 9071

order the rows of the matrix B (m, n) in non-decreasing elements of the k-th column.please solve it using c and not c++

Expert Answer


[solved] – Question 9072

write using c.In a disordered array of k(m) is the matching items from each group of identical items will leave only one remaining, and removing pursing an array to the beginning

Expert Answer


[solved] – Question 90723

Students at a local middle school volunteered to sell fresh baked cookies to raise funds to increase the number of computers for the computer lab. Each student reported the number of boxes he/she sold.

Write a program that will ask as input the number of volunteers, the name of the volunteer, and the number of boxes sold by the volunteer. the the program produces as output the total number of boxes of cookies sold, the total revenue generated by selling the cookies, and the average number of boxes sold by each student

Expert Answer


[solved] – Question 90779

The following data has been collected by a technician:
Gas volume: V=0.8 m^3
Gas pressure: p=160 kPa
Compression index: n=1.4
Pressure/volume relationship: pV^n=C
Work done = ∫(V1)^(V2) pdV

Evaluate C

Calculate the work done in compressing the nitrogen from 0.8 m^3 to 0.6 m^3 using:
integral calculus
Simpson’s rule
the mid-ordinate rule

Expert Answer