---
title: "Section 4.1: PDFs and CDFs"
author: "name"
output: pdf_document
---

# Probability Density Functions (pdf)

### Example

Suppose $f_{Y}(y)=4y^{3}$, $0\leq y\leq 1$. Is this a valid probability distribution? 




## Definition 4.3: Continuous random variable

### Example
Let $X$ be a random variable with the following p.d.f.
$$
f(x)=\{
\begin{array}{cc}
\frac{2}{3}x^{-1/3}& { for 0<x<1,}\\
0& {otherwise}.
\end{array}
$$

Compute P$(X\leq 8/27)$.


### You try it
Do both by hand, and using R. Don't forget to write your code down in these notes. 

a. Suppose $f_{Y}(y)=4y^{3}$, $0\leq y\leq 1$. Find $P(0\leq Y\leq\frac{1}{2})$. 

b. For the random variable $Y$ with pdf $f(y)=\frac{2}{3}+\frac{2}{3}y$ for $0\leq y\leq 1$, find $P(\frac{3}{4}\leq Y\leq 1)$.

# Cumulative distribution function (cdf)

### Example
Find the cdf for the random variable $Y$ for the following pdf:
$$
f_{Y}(y)=4y^{3}
$$

for $0\leq y\leq 1$. 




Calculate $P(0\leq Y \leq 1/2)$ using $F_{Y}(y)$.


### Example
A random variable $Y$ has CDF as follows:

$$
F(y)=\{
\begin{array}{cc}
0& for y<0\\
ln(y)&1\leq y\leq e\\
1&e<y\\
\end{array}
$$


a. Find $P(Y<2)$




b. Find $P(2<Y\leq 2\frac{1}{2})$


c. Find $P(2<Y<2\frac{1}{2})$



d. $f(y)$



### You try it

a. The cdf for a random variable $Y$ is defined by the following: 

$$
F(y)= \Bigg\{
\begin{array}{cc}
0 & \mbox{for } y<0\\
4y^{3}-3y^{4} & 0\leq y\leq 1\\
1 & y > 1
\end{array}
$$

Find $P(\frac{1}{4}<Y<\frac{3}{4})$. 


b. Suppose $F(y)=\frac{1}{12}\left(y^{3}+y^{2}\right)$, $0\leq y\leq 2$. Find $f(y)$.

$\frac{d}{dy}F(y)=\frac{1}{12}\left(3y^{2}+2y\right)$

c. In a certain country, the distribution of a family's disposable income, $Y$, is described by the pdf $f(y)=ye^{-y}$, $y\geq 0$. Find $F(y)$.


