Use this R-Markdown file to answer the following questions.
Revenue and Cost functions for a firm are provided below. Profits
are defined as revenues minus costs \(R(q) -
C(q)\).
\[\begin{align*}
R(q) & = (100 - q)q \\
C(q) & = 25q
\end{align*}\]
Q = 0 and Q = 75
Below
Profit Max where Q = 3705, Profit = 1406.25
\[ \pi = 75q -q^{2}\]
QUAD2 <- function(a,b,c) {
pos_sol <- (-b+sqrt(b^2-4*a*c))/(2*a)
neg_sol <- (-b-sqrt(b^2-4*a*c))/(2*a)
vertex <- -b/(2*a)
opt_val <- a*(vertex^2) + b*vertex + c
print(pos_sol)
print(neg_sol)
print(vertex)
print(opt_val)
}
QUAD2(-1,75,0)
## [1] 0
## [1] 75
## [1] 37.5
## [1] 1406.25
q <- sequence(101, from = 0, by = 1)
rev <- (100-q)*q
cost <- 25*q
profit <- 75*q - q^2
plot(rev~q,type = "l")
lines(cost~q,type = "l")
FV <- 2000000
PV <- 100000
t <- 30
r <- log(FV/PV)/t
r
## [1] 0.09985774
9.98%
Using the rule of 70, approximately how long would it take for an investment to double with a
You are able to secure $100,000 in retirement savings by your 30th Birthday. You would like that sum to double six times in the next 30 years. Use this information to answer the following questions.
val <- 100000*(2^6)
r <- 6*log(2)/30
val
## [1] 6400000
r
## [1] 0.1386294
\(Value = 6,400,000\) \(Return = 13.85\%\)
There is a link to the data set ”C02.txt” available on Moodle. Use this link to answer the following questions.
0.004571
The end of 2014 or beginning of 2015
co2 <- read.table("https://raw.githubusercontent.com/tjdevine/EC255/refs/heads/main/co2.txt",header=TRUE)
plot(CO2 ~ year, data = co2,type = "l")
lnco2 <- log(co2$CO2)
trend <- lm(lnco2 ~ co2$year)
trend
##
## Call:
## lm(formula = lnco2 ~ co2$year)
##
## Coefficients:
## (Intercept) co2$year
## -3.219904 0.004571
plot(lnco2 ~ co2$CO2, type = "l")
abline(trend, col = "red")