# International Trade II: 
Specific Factors

The specific factors model generalizes the Ricardian model in two ways. It 
allows for variation in the input/output ratios, and it introduces additional inputs.
This model treats some (one in our illustration) of its inputs as specific to a 
given industry and others (one in out illustration) of the inputs as mobile 
across industries. As before, this exercise set considers two industries,
labeled manufacturing (M) and food (F). Labor is employed in both. Capital
is specific to manufacturing, and land is specific to food production.

## Production Technologies

Create two production functions, both of the Cobb-Douglas variety.
Let M = LM^(3/4)*K^(1/4) and F = sqrt(LF*T), where M and F are the quantities
produced, LM and LF are the amounts of labor employed in each sector
(LM + LF = L, a constant), K is the amount of capital employed in manufacturing,
and T is the amount of land employed in food production. 

kill(all)$ fpprintprec:5$ ratprint:false$
M(LM,K):= LM^(3/4)*K^(1/4); F(LM,L, T):=sqrt((L-LM)*T);

Graph the total product of L function in M. On a separate graph, draw the 
average product and marginal product curves. Let L range from 0 to 1000.
Let L = 1000, K = 256, and T = 64. 

/*Input. Execute (ctrl-enter) for results */
[L0,K0,T0]: [1000,256,64]$
wxdraw2d(  explicit(M(LM,K0),LM,1,100) );

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="LM",ylabel="M",key="Total Product of L ",
 explicit(M(LM,K0),LM,0,L0))$
wxdraw2d(xlabel="LM",ylabel="M per unit of LM",
 yrange=[0,2],key="Average Product of L ",
 explicit(M(LM,256)/LM,LM,0,L0),key="Marginal Product of L ",
 explicit(diff(M,LM),LM,0,L0))$

To define this country's production-possibilities curve, solve
for LM in terms of M and insert the resulting expression into
the F( ) function. 

/*Input. Execute (ctrl-enter) for results */
assume(M>0,LM>0)$
Msoln: solve(M(LM,K0) = M,LM);

F(rhs(Msoln[3]),L,T); Fppc(M,L,T):= ''%;

Use explicit( ) to draw the production possibilities curve.

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="M",ylabel="F",key="PPC",
 explicit(Fppc(M,L0,T0),M,0,M(1000,K0)   )
)$

Alternatively, the PPC could be drawn using the parametric option. Do so.

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="M",ylabel="F",key="PPC",
 parametric(M(LM,K0),F(LM,1000,T0),LM,0,1000    )
)$

## Consumption without Trade

We introduce demand into this market in any of  four ways. We
could derive the supply curve of M, as a function of pm/pf, the
relative price and then add an ad hoc demand curve. Alternatively,
we can insert a "community" preference function. Finally, we can
just state a price that would occur absent international trade. Either 
of these three options is equally ad hoc. We use the third, simplest one.

A fourth option would be to specify the utility functions of the owners
of L, K, and T  and then solve the entire system, as is done in the 
general equilibrium model in the text. 

Start with p = pM/pF = 1/2. Let pF = 1 throughout, so that total product 
has a market value of p*M + F.  Use find_root to determine the value of M0 at which
the PPC's slope is -1/4. Substitute this value into PPC to determine F.
Label these values Meq0 and Feq0. Also, determine the GDP and label the value GDP0.

/*Input. Execute (ctrl-enter) for results */
Meq0: find_root(-diff(Fppc(M,L0,T0),M)=1/4,M,1,700);
/* -diff generates a positive value that is set equal to p */
Feq0: float(Fppc(Meq0,L0,T0));
GDP0: Meq0/4 + Feq0;

Copy one of the PPC graphs from above, paste it in the next cell, and add
the iso-value curve for GDP0.

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="M",ylabel="F",yrange=[0,GDP0],
 key="PPC", explicit(Fppc(M,L0,T0),M,0,M(L0,K0)),
 color=red, key="Iso-value curve for GDP0",
 explicit(GDP0 - M/4,M,0,4*GDP0),
 color=black,line_width=1,line_type=dots,key="Autarkic Quantities",
 points_joined=true, points([  [0,Feq0],[Meq0,Feq0],[Meq0,0] ])
)$

Determine the amount of labor that is required to produce Meq0 units by
setting M(LM, K0) - Meq0 = 0 and solving for LM. 

Then determine the marginal products of L in M production and in F production. 
Confirm that the marginal product of L in M production is twice the marginal product 
of labor in F production, implying that the values of the marginal products are equal.

Define VMPLeq0 : MPLFeq0; (remember that the price of F is set equal to 1).

/*Input. Execute (ctrl-enter) for results */
LMeq0: find_root(M(LM,K0)-Meq0,LM,1,L0);
MPLMeq0: subst(LM=LMeq0,diff(M(LM,K0),LM)); 
MPLFeq0: subst(LM=LMeq0,-diff(F(LM,L0,T0),LM));
MPLFeq0/MPLMeq0;  VMPLeq0:MPLFeq0$

Take the derivative of LM^(3/4)*K^(1/4) with respect to K and evaluate this 
expression when LM = LMeq0 and K = K0. Assign the name VMPKeq0 to this
value divided by 4.

Do the same for T = T0 and assign the name VMPTeq0 to the resulting
value (the expression here is sqrt(LF*T).

/*Input. Execute (ctrl-enter) for results */
diff(M(LM,K),K); VMPKeq0:subst([LM=LMeq0,K=K0],%)/4;
diff(sqrt(LF*T),T);  VMPTeq0: subst([LF=L0-LMeq0,T=T0],%);

Determine the income for suppliers of labor, capital, and land. Sum these to 
generate the GDP. Check this value by summing the market values of the two
products.

/*Input. Execute (ctrl-enter) for results */
[YLeq0,YKeq0,YTeq0]: [VMPLeq0*L0, VMPKeq0*K0, VMPTeq0*T0];
GDP0 : YLeq0+YKeq0+YTeq0;
Check0: Meq0/4 + Feq0;

## International Trade

Open the economy to international trade, where pM = 1/2.
Solve the system again with -diff(PPC,M0)-1/2=0. Determine the
resulting M, Meq1, and F, Feq1. 

/*Input. Execute (ctrl-enter) for results */
Meq1: find_root(-diff(Fppc(M,L0,T0),M)=1/2,M,1,700);
Feq1: float(Fppc(Meq1,L0,T0));
GDP1: Meq1/4 + Feq1;

Determine the new allocation of labor and the resulting marginal
products of labor in M and F, and the VMP of labor in both.

/*Input. Execute (ctrl-enter) for results */
LMeq1: find_root(M(LM,K0)-Meq1,LM,1,L0)$
MPLMeq1: subst(LM=LMeq1,diff(M(LM,K0),LM))$
MPLFeq1: subst(LM=LMeq1,-diff(F(LM,L0,T0),LM))$
MPLFeq1/MPLMeq1$    
VMPLeq1:MPLFeq1$
matrix(["Labor in M","MPL in M", "MPL in F", 
  "MPL ratio","Common VMPL"],
 [LMeq1, MPLMeq1,MPLFeq1, MPLFeq1/MPLMeq1,VMPLeq1 ]);

Determine the new VMP values for K and T.

/*Input. Execute (ctrl-enter) for results */
diff(LM^(3/4)*K^(1/4),K); VMPKeq1: subst([LM=LMeq1,K=256.0],%)/2;
diff(sqrt(LF*T),T);  VMPTeq1: subst([LF=1000-LMeq1,T=64],%);

Determine the new income levels and the new GDP. 

/*Input. Execute (ctrl-enter) for results */
[YLeq1,YKeq1,YTeq1]: [VMPLeq1*L0, VMPKeq1*K0, 
   VMPTeq1*T0]; /* comparison*/ [YLeq0,YKeq0,YTeq0];
GDP1 : YLeq1+YKeq1+YTeq1;
Check1: Meq1/2 + Feq1;

The results above show that income for L and K suppliers increase, 
as stated in F units, and T suppliers' income level falls. The price
of M has increased, so the numbers above overstate the real income
increase. Available information does not allow determination of the
exact effects of this change on real incomes. We could produce a
price index based on the initial consumption bundle to get some 
notion. 

An alternative, examined below, is to posit a utility function for each
income earner and determine how utility levels change.

Before looking at this, graph the PPC and the new consumption possibilties
line

/*Input. Execute (ctrl-enter) for results */
wxdraw2d(xlabel="M",ylabel="F",line_width = 2, 
 key="PPC", explicit(Fppc(M,L0,T0),M,0,M(L0,K0)),
 color=red, key="Iso-value curve for GDP1",
 explicit(GDP1 - M/2,M,0,2*GDP1),
 color=black,line_width=1,line_type=dots,key="Autarkic Quantities",
 points_joined=true, points([  [0,Feq1],[Meq1,Feq1],[Meq1,0] ]),
 color=green, points([  [0,Feq0],[Meq0,Feq0],[Meq0,0] ])
)$

## Preferences

Suppose that preferences can be adequately represented by the
Cobb Douglas utility function adequately represents preferences.
For a function like u = M^a*F(1-a), (any order-preserving tranformation
of this function can be used)  the parameter a defines the fraction of income 
spent on the good.

Suppose that this economy consists of a large number (in this case the 
number equals 1000 + 256 + 64) of price-taking consumers who have 
identical tastes. Then each consumer spends the same fraction of income on M. 
Determine the fraction of income spent on M absent trade. [The assumption
of identical tastes could be replaced by others. For example, laborers could
have one utility function, capital owners a second function, and land owers
a third function. The analysis would be become more complex, but as long as 
the functions are tractable the analysis would follow lines developed here.]

/*Input. Execute (ctrl-enter) for results */
a0: (Meq0/4)/GDP0;

Assume that each of the 1000 units of labor is owned 
by one consumer, that each of the 256 units of capital
is owned by one person, and that each of the 64 units
of land is owned by one person. No one owns more than
one type of resources. Determine each person's utility level
in the absence of international trade. 

Each person spends a0*Y on M, so the number of units is
4*a0*Y, where Y is the supplier/consumer's income level. The
income level is income for the group divided by the number of 
people in the group (1000, 256, or 64). Each consumer's utility
level is M^a0*F^(1-a0).

/*Input. Execute (ctrl-enter) for results */
[MLeq0,MKeq0,MTeq0]:[YLeq0*a0*4/1000,YKeq0*a0*4/K0,
                     YTeq0*a0*4/L0];
[FLeq0,FKeq0,FTeq0]:[YLeq0*(1-a0)/1000,YKeq0*(1-a0)/K0,
                     YTeq0*(1-a0)/L0];
[uL0,uK0,uT0]: [MLeq0^a0*FLeq0^(1-a0),
      MKeq0^a0*FKeq0^(1-a0),MTeq0^a0*FTeq0^(1-a0)];

Determine the utility levels when px = 1/2. Confirm that L and K suppliers 
enjoy utility increases, but T owners' utility falls.

/*Input. Execute (ctrl-enter) for results */
[MLeq1,MKeq1,MTeq1]:[YLeq1*a0*2/1000,YKeq1*a0*2/K0,
                     YTeq1*a0*2/L0];
[FLeq1,FKeq1,FTeq1]:[YLeq1*(1-a0)/1000,YKeq1*(1-a0)/K0,
                     YTeq1*(1-a0)/L0];
[uL1,uK1,uT1]: [MLeq1^a0*FLeq1^(1-a0),
      MKeq1^a0*FKeq1^(1-a0),MTeq1^a0*FTeq1^(1-a0)];
/* For comparison*/ [uL0,uK0,uT0];

Determine how much money would have to be transferred to T owners in order
return them to their pre-trade utility level.

/*Input. Execute (ctrl-enter) for results */
float(solve(
  MTcomp^a0*(MTcomp*(1/2)*(1-a0)/a0)^(1-a0) - uT0,MTcomp));
[MTcomp1: rhs(%[1]), FTcomp1:MTcomp1*(1/2)*(1-a0)/a0];
MTcomp1^a0*FTcomp1^(1-a0);
[FTcomp1+(1/2)*MTcomp1 - YTeq1/T0, TotalComp1 : T0*FTcomp1];

Given that the fraction of GDP that is spent on M is a0, whatever the price,
determine how much M this country consumes and how much it exports.
Do the same for F. Confirm that 2 units of M are exported per unit of F 
imported.

/*Input. Execute (ctrl-enter) for results */
Mconsumed: 2*a0*GDP1; 
Mexported: Meq1 - %;
Fconsumed: (1-a0)*GDP1;
Fimported: % - Feq1;
MperF : Mexported/Fimported;