Question: please write basic python codes for these 2 questions. Thank you 4. (12 pts.] Write a program that given the input m, b, c0, y0

 please write basic python codes for these 2 questions. Thank you

please write basic python codes for these 2 questions. Thank you

4. (12 pts.] Write a program that given the input m, b, c0, y0 prints the equation of the line perpendicular to the line y = mx +b through the point (x0, y0). Be sure to account for the possibility that m = 0. (Hint: the slope of a line perpendicular to a given line is the negative reciprocal of the slope of the given line, namely - 1/m. ) Test your program by computing the equation of the line perpendicular to y = 5x + 3 going through the point (12,1/2). 5. (12 pts.] Recall that for any positive integer n, n factorial is defined by n!= n(n-1). (n-2).....3.2.1. We can generalize this notion of factorial significantly. Given a real number r and positive integer m, we can define a generalized factorial of x of length m by [2]m = x(x - 1)(x - 2)... (x-m+1). Write a program that computes and prints [2]m for any given real mumber x and positive integer m. (Note, you can recover our standard notion of factorial by computing (n) for any positive integer n.) Use your program to compute the following: (15); (3.1)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!