Question: For this problem how would you write it in R ( a ) Padovan Sequence Like the Fibonacci sequence we learned in the class, the

For this problem how would you write it in R (a) Padovan Sequence
Like the Fibonacci sequence we learned in the class, the Padovan sequence is a sequence of integers P(n) defined by the initial values
P(1)=P(2)=P(3)=1,
and the recurrence relation
P(j)=P(j-2)+P(j-3).
We are to calculate the first 100 Padovan numbers. To do so, initialize a 1001 column vector p using matrix. The first three entities are the initial values defined above. Use a for loop to run j from 4 to 100, calculate P(j) and store them in p[j].
Save p in A15. dat using R's command
write.table(..., col.names=FALSE, row.names=FALSE).
(b) Iterative solution for 22
In Classwork 5, we discussed the Newton-Raphson method for finding the numerical value of 22. The Newton-Raphson method converges very quickly (known as 2nd order convergence). Below we try a (much) slower method (1st order convergence).
The iterative equation to be used in this problem is given by
xn=0.1xn-1+2xn-1+0.1
xn will approach 22 when n approaches .
Start from x1=1. Write an R program that finds 22, with a tolerance of 10-6.
Keep track of how many iterations, n?iter, that is needed to achieve the required tolerance. Save ni ter and the corresponding estimated value of 22 as a 12 row vector in A16. dat using the R's command write.table(..., col.names=FALSE, row.names=FALSE).
 For this problem how would you write it in R (a)

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!