Name

  1. Consider the following revenue function:

\[R(Q) = 5,000Q - 25Q^{2} \] Use the 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))
}

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 quantity and level of profits when profits are maximized. Use the QUAD function to solve for these values.

# Fill in the values for a,b, and c for your expression for profits in the line below here.
# Profit = -25Q^2 + 4000Q - 400

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.
#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.

Because profits include costs it is not the case that revenues and costs are maximized at the same quantity. Often times the level of output that maximizes revenue does not maximize profit.

  1. The following code chunk contains the functions we developed in class for the time value of money. Use these functions to answer the next questions.
FV_fun <- function(PV,r,t) {
  FV <- PV*(1+r)^t
  print(FV)
}


PV_fun <- function(FV,r,t) {
  PV <- FV/((1+r)^t)
  print(PV)
}


r_fun <- function(FV,PV,t) {
  r <- ((FV/PV)^(1/t))-1
  print(r)
}


t_fun <- function(FV,PV,r) {
  t <- log(FV/PV)/log(1+r)
  print(t)
}
  1. If you currently save $10,000 at a 7% interest rate for 5 years, what is the future value of your investment?
FV_fun(10000,.07,5)
## [1] 14025.52
  1. You determine that you will need about $5 million dollars to retire in 40 years. If you expect an 8% annual return, what present value do you currently need to reach this amount?
PV_fun(5000000,.08,40)
## [1] 230154.7
  1. How much time would it take for an investment to double if the annual rate of return is 10%? (Hint: It doesn’t matter what the PV and FV are as long as FV/PV = 2. That could be 1000 and 2000 or 200 and 400. Pick values accordingly. )
t_fun(20,10,.10)
## [1] 7.272541
  1. We want to create a plot of the annual rate of return against time assuming that your investment has doubled. Fixed parameter values will be PV = 100 and FV = 200. Create a variable tm (for time) starting at 0, ending at 40, and by = 1. Plot the annual rate on the vertical axis and tm on the horizontal axis. Before you start, remove the # in front of the variable names.
FV <- 200 #Future Value
PV <- 100 #Present Value
tm <- seq(from = 0, to = 40, by = 1)#Time variable sequence
rate <- r_fun(FV,PV,tm) #Use r_fun 
##  [1]        Inf 1.00000000 0.41421356 0.25992105 0.18920712 0.14869835
##  [7] 0.12246205 0.10408951 0.09050773 0.08005974 0.07177346 0.06504109
## [13] 0.05946309 0.05476608 0.05075664 0.04729412 0.04427378 0.04161601
## [19] 0.03925923 0.03715504 0.03526492 0.03355778 0.03200828 0.03059554
## [25] 0.02930224 0.02811383 0.02701805 0.02600448 0.02506421 0.02418956
## [31] 0.02337389 0.02261144 0.02189715 0.02122661 0.02059591 0.02000161
## [37] 0.01944064 0.01891028 0.01840809 0.01793188 0.01747969
plot(rate ~ tm,type = "l")