# Midterm Exam Mon 28 Feb 2005

notice: five out of eight correct answers make a perfect score

1. Suppose a medicine to reduce fever is effective in 80% after the first dosis and costs \$1. A temperature reading of more than two degrees above normal six hours after taking the first dosis requires a visit to the doctor which costs \$10.
Clinical tests for a new fewer reducing medicine reported a success rate of 95% after taking the first dosis.
1. Under the same circumstances as above, is a cost of \$2 for the new medicine justified? (hint: compute the expected loss of having a fever for both medicines.)
2. What is a fair price for the new medicine, taking into account its higher quality? Considering only money, at which price would you buy the new medicine?
```                                                        +--------+
|    /20 |
+--------+
```
2. A man decides to participate in a 1,000 mile car race through the desert. Because of the rough terrain and excessive speed, tires have a life time normally distributed with an average of 600 miles and standard deviation of 200 miles.
The man starts the race with 4 new tires and takes 4 spare tires with him. Given the expected life span of the tires, will he be able to finish the 1,000 mile race?
1. Use Maple or MATLAB to set up a simulation to decide the odds of the man being able to finish the race.
2. Run the simulation 10,000 times and give the probability of reaching the finish.
```                                                        +--------+
|    /20 |
+--------+
```
3. Suppose we start with an empty savings account. At the last day of every month \$400 is deposited into the account. After the first deposit, 20% of the balance of the savings account is withdrawn at the first day of every month.
1. Set up the recursion relation for the balance B(n) at month n, after n deposits.
2. Solve the recursion for B(n).
3. In doing so, will we ever get rich? Is there a limit to B(n)?
```                                                        +--------+
|    /20 |
+--------+
```
4. A digital filter is causal, linear, and time-invariant.
1. Give the definition of a transfer function of a digital filter and illustrate with an example.
2. Show that a digital filter is entirely determined by the response of the unit impulse.
```                                                        +--------+
|    /20 |
+--------+
```
5. A boat rental company must place its orders for new boats for the next summer. There are three types of boats, depending on the number of seats, specified below:
```+-----------+-------------+-----------+---------+-----------+
| boat type |   storage   |  purchase | rental  |   need    |
|  #seats   |     area    |    cost   |  price  | for boats |
+-----------+-------------+-----------+---------+-----------+
|     1     | f(1)=2 ft^2 | c(1)=\$122 | p(1)=\$5 |  n(1)=20  |
|     2     | f(2)=3 ft^2 | c(2)=\$130 | p(2)=\$7 |  n(2)=15  |
|     3     | f(3)=4 ft^2 | c(3)=\$150 | p(3)=\$9 |  n(3)=10  |
+-----------+-------------+-----------+---------+-----------+
```
Boat i requires f(i) square feet to store, costs c(i) dollars to purchase and can be rented at p(i) dollars a trip. Our constraints are as follows. We need at least n(i) boats of type i, but have only 400 square feet to store the boats and our budget is limited to \$10,000.
1. Denote by x(i) the number of boats we will order of type i. Set up the linear programming model to determine the optimal composition of the fleet which maximizes the profit from renting, subject to our constraints.
2. Formulate the dual problem as a minimization linear-programming problem.
3. Solve the dual problem with MATLAB. Give the solution to the original problem.
```                                                        +--------+
|    /20 |
+--------+
```
6. Sample u(t) = cos(2*pi*t) at intervals T = 1/8, as input u(k) = cos(2*pi*k/8), k=0,1,... to the filter y(k) = a*u(k) + b*u(k+1) + c*u(k+2), with three parameters: a, b, and c.
Determine the parameters a, b, and c
• (i) to change the frequency of the original signal, i.e.: y(k) = u(k+1), and
• (ii) to suppress the signal v(t) = cos(3*2*pi*t).
1. Set up the system of linear equations we need to solve to find a, b, and c, using 8 samples each for the conditions (i) and (ii). (hint: use MATLAB or Maple.)
2. Use MATLAB or Maple to solve this overconstrained linear system.
```                                                        +--------+
|    /20 |
+--------+
```
7. Suppose we have \$100,000 to invest. We have two options. Either we could deposit the amount in an account which would yield us 7% each year in interest; or we could buy a house and make it available for rental. Assume the value of the house increases with 5% each year and the house yields \$8,000 a year in rent (after deducting taxes and upkeep costs).
1. Which option is better on the short run (a couple of years)? What if we can keep the house for 20 years? Which option is then better?
2. Calculate the number of years when both options have the same return. What is your advice? If we buy, how long should we keep the house?
```                                                        +--------+
|    /20 |
+--------+
```
8. Consider a market with demand q = 5 + 10/p and supply q = p^2 - 3.
1. Compute the equilibrium price and revenue for the producer.
2. Suppose the government gives the producer a subsidy of \$1 per item. Describe the effect of this subsidy to the supply, equilibrium price and revenue function.
3. Of every dollar the government spends on subsidy, how much goes to producer, and how much to the consumer?
```                                                        +--------+
|    /20 |
+--------+
```