Name

  1. Consider the following revenue function:

\[R(Q) = 5,000Q - 25Q^{2} \] Use the provided quad function to find the roots, the quantity that maximizes revenue, and the maximum revenue.

QUAD <- function(a,b,c) {
  possol <- (-b+sqrt(b^2-4*a*c))/(2*a)
  negsol <- (-b-sqrt(b^2-4*a*c))/(2*a)
  vertex <- -b/(2*a)
  optval <- a*(vertex^2) + b*vertex + c
  print(paste0("Positive Root = ",possol))
  print(paste0("Negative Root = ", negsol))
  print(paste0("Vertex = ",vertex))
  print(paste0("Max Value = ",optval))
}


## 5000Q - 25Q^2

QUAD(-25,5000,0)
## [1] "Positive Root = 0"
## [1] "Negative Root = 200"
## [1] "Vertex = 100"
## [1] "Max Value = 250000"
  1. The cost function for the firm is:

\[ C(Q) = 1000Q + 400\]

Find an expression for profits for the firm (Hint: \(\pi = R(Q) - C(Q)\)) and determine the break-even quantities,the quantity level when profits are maximized, and the value of profits at the maximum. Use the QUAD function to solve for these values.

\[ -25Q^{2} + 4000Q - 400\]

# Fill in the values for a,b, and c for your expression for profits in the line below here.
# Profit = aQ^2 + bQ + c


QUAD(-25,4000,-400)
## [1] "Positive Root = 0.10006257824728"
## [1] "Negative Root = 159.899937421753"
## [1] "Vertex = 80"
## [1] "Max Value = 159600"
  1. Plot the profit function from a quantity starting at 0 and ending at 160. The increments should be 5 units. The variable q is provided to you to use for your plot.
#Plot profits
q <- seq(from = 0, to = 160, by = 5)

profit <- -25*q^2 + 4000*q - 400

plot(profit ~ q, type = "l")

  1. Discuss if profits and revenues are both maximized at the same quantity. Explain why this may or may not be true.

No. Revenues don’t take into account costs. Profits are most likely not maixmized where revenue is maximized.

  1. Read in the data from the Apple and S&P 500 Data link available on Moodle. Plot the value Apple returns on the y-axis against S&P 500 returns on the x-axis. We want to create a scatter plot for this example so do not add type = “l”. Describe the relationship between these two variables.
stock <- read.table("https://raw.githubusercontent.com/tjdevine/EC255/refs/heads/main/stock_returns.txt",header=TRUE)

names(stock)
## [1] "SP500_RET" "AAPL_RET"
trend <- lm(AAPL_RET ~ SP500_RET, data = stock)
plot(AAPL_RET ~ SP500_RET, data = stock)
abline(trend, col = "red")

trend
## 
## Call:
## lm(formula = AAPL_RET ~ SP500_RET, data = stock)
## 
## Coefficients:
## (Intercept)    SP500_RET  
##    0.007007     1.354915