1.1 Functions Given by Formulas

Example 1.1

The function is G(a,s,p) = 0.8a+1.25s+4.25p, where a is the number of apples, s is the number of sodas, and p is the number of pizzas purchased.  G is measured in dollars.

G[a_,s_,p_]:= 0.8a+1.25s+4.25p;

Part 1

G[4,2,3]

So 4 apples, 2 sodas, and 3 pizzas will cost a total of $18.45

Part 2

G(2,6,1) is the cost of purchasing 2 apples, 6 sodas, and 1 pizza

Part 3

G[2,6,1]

So the cost of purchasing 2 apples, 6 sodas, and 1 pizza is $13.35

Example 1.2

The function M(P,r,t) = (((Pr(1+r))^t)/((((1+r))^t)-1)) is used to calculate the monthly payments made if you borrow P dollars at a monthly interest rate of r (as a decimal) and you wish to pay it off in t months.

M[P_,r_,t_]:= ((P*r*(((1+r))^t))/((((1+r))^t)-1))

Part 1

M[7800,0.0067,48]

The monthly payments needed when borrowing $7800 at a monthly interest rate of 0.67% to be paid off after 48 months is $48.

Part 2

M[5000,0.0058,36]

Functional notation is M(5000,0.0058,36) and the resulting value is $154.29 dollars as the monthly payment.

Exercise 1

Here C(t) = 5.40 + 0.22t is the average cost of a movie theatre ticket (measured in dollars) t years since 2000.

Cfunc[t_]:=5.40+0.22*t

Part a.

C(9) is the average price of a movie ticket 9 years after 2000 (thus, in 2009)

Part b.

Functional notation for the average price of a movie ticket in 2012 is C(12), and is computed to be $8.04, as seen below.

Part c.

Cfunc[12]

Exercise 5

The predicted adult weight W of a puppy (in pounds) can be estimated if we know the puppy’s weight w (in pounds) at age a (in weeks old) by the formula W(a,w) = 52(w/a).

W[a_,w_]:= 52*w/a

Part a.

We want to know the estimated adult weight W of the puppy if we know the weight is w=6 lbs at a=14 weeks.  In function notation this would be W(14,6) We calculate it below to be approximately 22.3 lbs

Part b.

W[14,6]

N[%]