# Production Possibilities

## A Production Possibilities Function

Suppose that a simple economy produces two goods and has this production-
possibilities "curve": y = min(10-x, 20-3x). Write this funcion using the
functional notation y(x):= . Evaluate the function for these values of
x: x=2, x=5, x=8.

/*Input. Execute (ctrl-enter) for results */
y(x):=min(10-x,21-3*x);  [y(2),y(4),y(6)];
/* or */
[xList: makelist(2*i,i,1,3), map(y,xList)];

Apply Maxima's solve command to each of the two terms inside the 
equation in order to determine that the maximum quantity of x is 
7 and the maximum quantity of y is 10.

/*Input. Execute (ctrl-enter) for results */
solve(10-x,x); solve(21-3*x,x);

Graph the production possibilities function over the range for which 
both x and y are nonnegative. At which value of x does the kink seem 
to occur?

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(explicit(y(x),x,0,7))$

Use solve to determine the exact value at which the kink occurs.
Assign this value the name x_kink. Be sure to assign the name to
the value and not the expression that solve produces.

/*Input. Execute (ctrl-enter) for results */
solve(10-x=21-3*x,x);     x_kink: rhs(%[1]);
/*By the way: alternative graph*/ 

wxdraw2d(xlabel="x",ylabel="y",points_joined=true,
key="PPC",points([ [0,y(0)],[x_kink,y(x_kink)],[7,y(7)] ]))$

Use find_root to determine the apprioximate value at which the 
kink occurs. 

/*Input. Execute (ctrl-enter) for results */
find_root(10-x=21-3*x,x,0,7);

Define an opportunity cost function as follows: 
   oc(x) := if x< x_kink then 1 else 3.

/*Input. Execute (ctrl-enter) for results */
ocx(x):=if x<= x_kink then 1 else 3$

Use makelist to create a list named xList, with contains integer 
values of x from 0 through 7 at intervals of 0.5.

/*Input. Execute (ctrl-enter) for results */
xList: makelist(.5*i,i,0,14);

Create a list of y values for the xList values. Name this list 
yList.  To do this, map y(x) onto xList.

/*Input. Execute (ctrl-enter) for results */
yList: map(y, xList);

Use the  matrix command to create a table of x and y values, using 
values in xList and yList. 
Optional: Add names to the table, using the cons command. 
Optional: Transpose the matrix to create a two-column table.

/*Input. Execute (ctrl-enter) for results */
transpose(matrix(cons("x",xList),cons("y",yList)));

Use draw2d's points command to plot the 8 points defined by
xList and yList. Make the points circles.  Joint the points.
Label the axies"x" and "y". 

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="x",ylabel="y",point_type=circle,
 points_joined=true,points(xList,yList))$

## Opportunity Cost of x

Draw the ocx(x) function. Set the yrange to [0, 5], and label the 
axes "x" and "y per unit of x". Add a title, "y given upper unit of 
x gained".

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(yrange=[0,5],title="y given up per unit of x gained",
xlabel="x",ylabel="y per unit of x",
explicit(ocx(x),x,0,7))$