Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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).
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Infrastructure For Medical Research In Databases

Authors: Thomas Heinis ,Anastasia Ailamaki

1st Edition

1680833480, 978-1680833485

More Books

Students also viewed these Databases questions

Question

Would you rather have higher pay or better benefits? Why?

Answered: 1 week ago

Question

If ( A^2 - A + I = 0 ), then inverse of matrix ( A ) is?

Answered: 1 week ago

Question

What is computer neworking ?

Answered: 1 week ago