Question: R studio a) Get a sequence of x-values, and compute the y-values ofeach of the two functions for those x-values (b) You should now have


R studio

a) Get a sequence of x-values, and compute the y-values ofeach of the two functions for those x-values

(b) You should now have two vectors for y1 and y2. Combine thex-values, and the two sets of y-values into a matrix, and displaythe top and bottom of the matrix. If we find the x-value for whichthe difference between y1 and y2 is really small. we would find thepoint of intersection.

c) Compute a vector that contains the absolute value of thedifference between y1 and y2. The abs function will help with this.Display the minimum absolute difference between y1 and y2. Youshould get a positive value that is pretty darned small, like 10^?5; unfortunately not 0. 

(d) Have R display the value of x that gives the smallestabsolute difference between y1 and y2. You should not type anyactual numbers for x in your code anywhere. You need to be a bitcreative here. I used the min function, the [ ] method of accessingelements of vectors, and the == comparison operator for thisy1 = Y2 1 3e 5 1 20 -1/5 and In(x + 2) 

y1 = Y2 1 3e 5 1 20 -1/5 and In(x + 2)

Step by Step Solution

3.36 Rating (146 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

librarySciViews ac110 for i in seq1101 y1c02expx5 y2c005lnx... View full answer

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 Programming Questions!