This shows you the differences between two versions of the page.

Both sides previous revision Previous revision Next revision | Previous revision | ||

cs-401r:assignment-2 [2014/09/12 08:27] ringger |
cs-401r:assignment-2 [2014/09/24 15:22] (current) cs401rPML Updated labeling of sub-problems and/or problem options. |
||
---|---|---|---|

Line 1: | Line 1: | ||

- | = Bayes Nets = | + | = Probability Theory = |

== Objectives == | == Objectives == | ||

Line 10: | Line 10: | ||

== Exercises == | == Exercises == | ||

- | Show your work. Be clear and concise. '''This assignment must be typed.''' | + | Show your work. Be clear and concise. '''This assignment must be typed.''' |

- | === Bayes Net === | + | # [10 points] Prove that the relationship we call ''conditional independence'' is symmetric. In other words, Prove either (option a) or (option b) (since they are equivalent), and apply the same [[Proofs|standard of proof]] as in assignment 1: |

+ | #* (option a) $P(X | Y, Z) = P(X | Z)$ if and only if $P(Y | X, Z) = P(Y | Z)$ | ||

+ | #* (option b) $P(X, Y | Z) = P(X | Z) \cdot P(Y|Z)$ if and only if $P(Y, X | Z) = P(Y | Z) \cdot P(X | Z)$ | ||

+ | #** (in other words, the "given $Z$" stays the same, while $X$ and $Y$ trade places). | ||

+ | # [20 points: 10 points each] (based on exercise 2.2 in Koller and Friedman) Independence: | ||

+ | #* (2.1) Prove that for binary random variables $X$ and $Y$, the event-level independence $(x^0 \bot y^0)$ implies random-variable independence $(X \bot Y)$. Use the usual standard of proof. | ||

+ | #* (2.2) Give a counterexample for nonbinary variables. | ||

+ | # [20 points] Consider how to sample from a categorical distribution over four colors. Think of a spinner with four regions having probabilities $p_{red}$, $p_{green}$, $p_{yellow}$, and $p_{blue}$. Write pseudo-code for choosing a sample from this distribution. | ||

+ | #* You may assume that you have access to a function that samples a uniform random variable with support [0,1]. | ||

+ | # [10 points] Does your pseudo-code scale to run efficiently on a distribution over ten thousand values? If not, rewrite it. If so, say why. | ||

+ | # [20 points] Implement your pseudo-code, choose values for the four probabilities on the spinner as parameters to your procedure, and run it 100 times, keeping track of how many times each color shows up. Give the results as a vector of counts over the four colors. | ||

+ | # [10 points] Normalize your count vector by 100. How does the result compare with your chosen parameters? | ||

- | [[http://nlp.cs.byu.edu/~plf1/cs401rpml/GraphicalModel.png|Model (open in a new tab)]] | ||

- | |||

- | # [10 points] Prove that the relationship we call ''conditional independence'' is symmetric. In other words, Prove either (a) or (b) (since they are equivalent), and apply the same [[Proofs|standard of proof]] as in assignment 1: | ||

- | #* (a) $P(X | Y, Z) = P(X | Z)$ if and only if $P(Y | X, Z) = P(Y | Z)$ | ||

- | #* (b) $P(X, Y | Z) = P(X | Z) \cdot P(Y|Z)$ if and only if $P(Y, X | Z) = P(Y | Z) \cdot P(X | Z)$ | ||

- | #** (in other words, the "given $Z$" stays the same, while $X$ and $Y$ trade places). | ||

- | Consider the graphical model (shown above) over five binary random variables: | ||

- | # [10 points] Factor the joint distribution represented by the entire model shown in the figure according to the explicit independence assumptions represented in the model. | ||

- | # [20 points] List the independence assumptions captured in the model (in the above figure) between the following pairs of random variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not. | ||

- | #* $L$ and $R$ | ||

- | #* $T$ and $R$ | ||

- | # [20 points] More independence: | ||

- | #* Assuming that the value of $L$ is known, list ''all'' independence relations between $T$ and other variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not. | ||

- | #* Assuming that the value of $S$ is known, list ''all'' independence relations between $T$ and other variables. Be sure to consider all of the cases in which the other variables in the model have known values and when they do not. | ||

- | # [10 points] Write the four entries and their values in the conditional distribution for $P(L=0 | M=m,S=s)$ (for $m \in \{0,1\}$ and $s \in \{0,1\}$). | ||

- | # [10 points] (a) Write an expression for the joint probability $P(T=1, R=0, L=0, M=0, S=1)$ in terms of the probabilities given in the model (use the symbolic forms). (b) Then compute the actual probability. | ||

- | # [10 points] Compute $P(T=1, R=0, L=0)$. Show your work. | ||

- | # [10 points] Compute $P(T=1 | R=0, L=0)$. Show your work. | ||

== Report == | == Report == |