Question: ( a ) Write a Python function which has the single argument n and returns the sum of the natural logarithms of the first n
a Write a Python function which has the single argument and returns
the sum of the natural logarithms of the first natural numbers.
b Use the function you wrote in part a to calculate the sum of the
natural logarithms of the first natural numbers.
c Write a Python function which returns the minimum value of such
that
for some given number
d Use the function you wrote in part c to find the minimum number of
terms needed such that the sum of the logarithms is greater than
e A student has written the following code to calculate the real roots of
the quadratic equation where and are real, or
return a message if there are none.
def solvequadratic abc:
disc bc
if disc then:
return There are no real solutions to your equation
else
solsmall bsqrtdisca
sollarge bsqrtdisca
return solsmall, solarge
Explain the errors in this code, and correct them to produce a working
function. Use your corrected code to find the real roots, if any, of
and
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
