# Segment 4

## Calculation Problems

1. Evaluate $\int_0^1\delta(3x-2)\,dx$

\begin{align} \int_0^1\delta(3x-2)\,dx  &= \int_0^1\delta(3(x-\frac{2}{3}))\,dx\\ &= \frac{1}{3}\int_0^1\delta(x-\frac{2}{3})\,dx\\ &= \frac{1}{3}  \end{align}

2. Prove $\delta(ax)=\delta(x)/a$

\begin{align} \int\delta(ax)\,dx &=\int\frac{1}{a}\delta(u)\,du\\ & (u=ax) \qquad (du=a\,dx) \implies dx=\frac{1}{a}du \\ &=\frac{1}{a}\implies \delta(ax)=\frac{1}{a}\delta(x) \end{align}

3. What is $P(A|S_BI)$ if the prior for $p(x)$ is a massed prior with half the mass at $x = 1/3$ and half the mass at $x = 2/3$?

\begin{align} P(A|S_BI) &= \int_x P(x|I)\,dx\\ &= \frac{1}{2}\frac{1}{1+\frac{1}{3}} + \frac{1}{2}\frac{1}{1+\frac{2}{3}}\\ &= \frac{1}{2}(\frac{3}{4} + \frac{3}{5})\\ &= 0.675 \end{align}

## Food for Thought Problems

1. With respect to Problem 3, since $x$ is a probability, how can choosing $x = 1/3$ half the time, and $x = 2/3$ the other half of the time be different from choosing $x=1/2$ all the time?

This probability is not linear.

## Class Activity

1. Discrete - Expected value

1. $E[Y] = E[X_1 + X_2] = E[X_1] + E[X+2] = 7$
2. $E[M] = E[\frac{1}{2} X_1 + X_2] = \frac{1}{2}(E[X_1] + E[X+2]) = 3.5$
3. $E[Z] = E[X_1X_2] = E[X_1]E[X_2] = 3.5^2 = 12.25$
4. $E[U] = \frac{(11\cdot 1+9\cdot 2+7\cdot 3+5\cdot 4+3\cdot 5+1\cdot 6)}{36} = \frac{91}{36}$
5. $E[V] = \frac{(11\cdot 6+9\cdot 5+7\cdot 4+5\cdot 3+3\cdot 2+1\cdot 1)}{36} = \frac{161}{36}$

2. Continuous - Expected value

1. $\int_0^\infty re^{-rx}\,dx = 1$
2. $\int_0^\infty xre^{-rx}\,dx = \frac{1}{r}$

3. Parsing Text

Refer to Expected and continuous