Answered step by step
Verified Expert Solution
Question
1 Approved Answer
USE R Suppose a is from 1 to 100, and a function F can be calculated as below, we sum up 1/i where i is
USE R
Suppose a is from 1 to 100, and a function F can be calculated as below, we sum up 1/i where i is from a to 100.
F(a) = sum from i=a to 100 1/ i
(a) Write a function called Myfunction to input a (a should be from 1 to 100) and output F(a), when a is out of bound, print Out Of Boundary.
(b) Use your function to find F(a) when a is 10,50,100 and 150.
(c) Make a scatter plot which use a as x-axis, F(a) as y-axis, and add a straight line to show the trend.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started