Create a graph illustrating the indifference curve corresponding to \(\bar u=500\) for the case when \(\alpha=1\) and \(\alpha =10\) include the following in the description of your figure:
the slope of each indifference curve and an explanation of how 𝛼 impacts the indifference curve
an explanation (that references your graph) of how this might impact the consumer’s consumption of x and y.
\[u(x,y) = xy + \alpha y\] \[\begin{equation} \bar u = 500 \Rightarrow xy+\alpha y=500 \end{equation}\] For \(\alpha=1\): \[\begin{equation} xy+y=500 \Rightarrow y = \frac{500}{x+1} \end{equation}\] For \(\alpha=10\): \[\begin{equation} xy+10y=500 \Rightarrow y = \frac{500}{x+10} \end{equation}\]
# Defining alpha vector for plotting simplification
alphas <- c(1,10)
# Defining resolution (number of x values in the (x_min,x_max) and minimum and maximum values of x
num <- 600
x_max <- 100
x_min <- 0.0001
# Defining x and y matrices (x is a vector)
# expand.grid, makes a grid with x and y values for plotting
# mutate adds another column for y to our data frame
curve_df <- expand.grid(x = seq(x_min, x_max, length.out = num), alpha = alphas) |>
mutate(y = 500 / (x + alpha),
label = paste0("alpha = ", alpha))
Create another graph which includes the indifference curve for \(\alpha=1\) from the previous task and adds the individual’s budget line when \(P_x=2\), \(P_y=2\) and \(I=100\). Include the following in the description of your figure:
The slope of the budget line and its intercepts with the x and y axis.
Describe, referencing your graph, which combinations (at these price and income levels) the individual can/can’t afford of x and y.
Based on your graph and given these prices and income, can the consumer achieve \(\bar u=500\)? Explain why/why not.
px <- 2; py <- 2; I <- 100
alpha2 <- 1
x_bl <- seq(0, I/px, length.out = 201)
bl_df <- tibble(x = x_bl, y = (I - px*x)/py)
ic_df <- tibble(x = seq(0.001, 100, length.out = 600)) |>
mutate(y = 500 / (x + alpha2))
## Warning: Using `size` aesthetic for lines was deprecated in ggplot2 3.4.0.
## ℹ Please use `linewidth` instead.
## This warning is displayed once every 8 hours.
## Call `lifecycle::last_lifecycle_warnings()` to see where this warning was
## generated.
Create a graph that illustrates how the optimal combination of x and y changes depending on the value of \(\alpha\). Specifically, illustrate the optimal x and y for \(\alpha\) ranging from 0 to 10. Include the following in the description of your figure:
An overview of the code you used to generate the solution to the problem at each level of \(\alpha\) (i.e., “your simulation”).
Presumably you used R to solve \(x^*\) and \(y^*\). Pick a level of \(\alpha\) (not \(\alpha=1\)) How do you know the answer that R gave you is correct? (hint: think FOC)
Is your graph consistent with what you indicated for Task 1-b?
Budget: \(2x + 2y = 100 \iff x + y = 50\). Intercepts: \((50,0)\) and \((0,50)\). Slope: \(dy/dx = -p_x/p_y = -1\).
Affordable vs not. Combinations on or below the budget line (in the nonnegative quadrant) are affordable; points above it are not. The line itself exhausts the budget.
Can the consumer reach \(u=500\)? Yes. We need some \((x,y)\) with \(2x+2y\le 100\) and \(xy + 1\cdot y = 500\Rightarrow y=500/(x+1)\). Substituting into the budget: require \(x + 500/(x+1) \le 50\). The left side is minimized when \(1 - 500/(x+1)^2 = 0\Rightarrow x+1=\sqrt{500}\), giving \(x\approx 21.36\), \(y\approx 22.36\), and cost \(2(x+y) = 2\times 43.72 \approx 87.4 \le 100\). Hence \(u=500\) is attainable (indeed, there is slack; the optimum will deliver \(u>500\)).
We solve \[ \max_{x,y\ge 0} \; u(x,y) = xy + \alpha y \quad \text{s.t.} \quad 2x + 2y = 100. \]
FOC solution (analytic). Using \(y=50-x\), maximize \(f(x)= (50-x)(x+\alpha)\). Then \[ f'(x) = 50 - 2x - \alpha = 0 \;\Rightarrow\; x^*(\alpha) = \tfrac{50 - \alpha}{2},\quad y^*(\alpha) = 50 - x^*(\alpha) = \tfrac{50 + \alpha}{2}. \] SOC: \(f''(x)=-2<0\Rightarrow\) a maximum. For \(\alpha\in[0,10]\), \(x^*\in[20,25]\), \(y^*\in[25,30]\), satisfying nonnegativity.
alpha_grid <- seq(0, 10, by = 0.1)
opt_df <- tibble(alpha = alpha_grid,
x_star = (50 - alpha)/2,
y_star = (50 + alpha)/2,
u_star = x_star * y_star + alpha * y_star)
head(opt_df, 5)