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))
As shown in Figure 1, when \(\alpha\)
increases, the amount of \(\frac{\partial
y}{\partial x}\) decreases. Meaning that as we change x, we
observe less altranation in y.
For \(\alpha=1\) \[\begin{equation} \frac{\partial y}{\partial x}=\frac{-500}{(x-\alpha)^{-2}}=\frac{-500}{(x-1)^{-2}} \end{equation}\] For \(\alpha=10\) \[\begin{equation} \frac{\partial y}{\partial x}=\frac{-500}{(x-10)^{-2}} \end{equation}\] We can also look at \(MRS_{x,y}\): \[\begin{equation} MRS_{x,y}=\frac{MU_x}{MU_y}=\frac{y}{x+\alpha} \end{equation}\] Based on MRS equation, as \(\alpha\) increases, the ratio of marginal value of the x to marginal value of y gets smaller, meaning prefers to buy goods y rather than x as the good y bring them more happiness.
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.
We write the budget line equation as follows: \[I=P_xx+P_yy\] Substituting values for \(P_x\), \(P_y\), and \(I\): \[y=50-x\] As a result the intercept is 50 (x = 0,y = 50) and the slope of budget line is -1. The intercept is 50 for x = 50, and y = 0.
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))
Based on Figure 2, the individual can afford anything below and on the budget line (\(0\leq x\leq 50\) and \(0\leq y\leq 50\)). Anything on the right side of the budget line (above the budget line) is not affordable for the individual due to their income (\(x>50\)and all any y or \(y>50\) and any x).
As shown in Figure 2, the budget line cuts the line of \(\bar u\) two times as a result, achieving \(\bar u=500\) is possible, however as the indifference curve and budget line do not have similar slope in these point, the utility function is not at it’s maximum.
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?
alphas <- seq(0, 10, by = 0.1)
n <- length(alphas)
x_star <- numeric(n)
y_star <- numeric(n)
for (k in seq_along(alphas)) {
a <- alphas[k] # this is alpha, not an index
f <- function(x) (50 - x) * (x + a)
opt <- optimize(f, c(0, 50), maximum = TRUE)
x_star[k] <- opt$maximum
y_star[k] <- 50 - x_star[k]
}
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)
If the answer is correct, the F.O.C should be equal for x and y (\(MU_x=MU_y\)): \[MU_x=\frac{\partial u(x,y)}{\partial x}=y\] \[MU_y=\frac{\partial u(x,y)}{\partial y}=x+\alpha\] For example my results for \(\alpha=0.1\) are \(x^*=24.95\) and \(y^*=25.05\): \[MU_x=y=25.05\] \[MU_y=x+0.1=24.95+0.1=25.05\] Figure 3 shows consistent results with Task 1-b. As \(\alpha\) grows, the ratio of marginal value of x to y gets smaller which indicates the individual’s preference for y. Similarly, we observe in Figure 3 as \(\alpha\) increases, x decreases and y increases.