R studio a) Get a sequence of x-values, and compute the y-values ofeach of the two functions
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 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 this