\(E(y_{1})=0.8(230)+0.2(100)-100(1+i)\)

With 80% probability, Felipe succeeds with the consulting firm and earns $230, and 20% probability that he fails and earns $100.  Regardless of results, he will have to repay Cristina the $100 plus interest.

\(E(y_{2})=0.2(500)+0.8(60)-100(1+i)\)

With 80% probability, Felipe fails with the taco truck and earns $60, and 20% probability that he succeeds and earns $500.  Regardless of results, he will have to repay Cristina the $100 plus interest.

\(E(\pi_{2})=E(\pi_{1})=(1+i)100-(1+0.1)100\)

If Cristina invests in Felipe's business, she will get her $100 back plus interest, minus the opportunity cost of what she could have invested in.
library("ggplot2")
Ey1 <- function(i) {
    0.8*(230)+0.2*(100)-100*(1+i)}
Ey2 <- function(i) {
    0.8*(60)+0.2*(500)-100*(1+i)}
Ep <- function(i) {
    (1+i)*100-(1+0.1)*100}

ggplot(data.frame(x=c(0, 2)), aes(x=x)) + 
  geom_path(aes(colour="red"), stat="function", fun=Ey2) +
  geom_path(aes(colour="blue"), stat="function", fun=Ey1) +
  geom_path(aes(colour="black"), stat="function", fun=Ep) +
  scale_colour_identity("Function", guide="legend", 
                        labels = c("Epi", "Ey1", "Ey2")) +
  theme(legend.text=element_text(size = 8.5)) +
  ggtitle("Figure 1: Credit Market under Standard Debt Contract") +
  labs(x="i", y="Expectations") +
  theme(plot.title=element_text(size=10, face="bold")) +
  theme(axis.title.x=element_text(face="italic", size=9.5)) +
  theme(axis.title.y=element_text(size=9.5))

plot of chunk unnamed-chunk-1