1. Take
the linear demand curve P = 100 – 2Qd, where P is the
price of the good and Qd is the quantity demand.
For two prices/quantities the midpoint formula for determining the price
elasticity of demand is givkl;len by , where the top part is
the average percent change in quantities and the bottom is average percent
change in prices, for two pairs of prices and quantities. Write a function that
inputs two prices, and then calculates the elasticity. Note that prices can’t less
than or equal to 0 or greater than 100 and if prices are input below or above
this range, the function should a print command stating the values are out of
range and then end.
2. Write
a function that inputs a list of numbers and a percentile value from 0 to 1 and
have the function return the element that is at that percentile (or greater
than). You can use this website for the steps https://www.indeed.com/career-advice/career-development/how-to-calculate-percentile
check out the step for “Follow these steps to calculate the kth percentile”
DON’T USE NUMPY
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
27 | 28 | 29 | 30 | 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |