Quiz 1 solutions

Problem 1

Which of the following outcomes has the highest probability? Why?

1) The outcome has three 1's and three 6's.

There are ((6!)/(3! 3!)) ways to order three 1' 
      s and three 6' s and each roll has a probability of (1/6) 
      so the answer is:

P[1] =  ((6!)/(3! 3!)) ((((1/6)))^6)  // N

2) The outcome has the sequence {1,2,3,4,5,6}.

P[1, 2, 3, 4, 5, 6]  =  ((((1/6)))^6)  // N

3) The sum of the results of the six rolls is greater than 19, given that the  sum of the first five rolls is 15.

P[19 | 15]  =  P[5  or 6] = (1/6)  +  (1/6)  =  
          (1/3)

Problem 2

\(TraditionalForm\`p\_xy\ \((x, 
          y)\)\  = \ \(1\/\(8  π\)\) e\^\(-\(\(x\^2\  + \ y\^2\  + \ 6  x\  - \ 2  y\  + \ 10\)\/8\)\)\)

a) What type of distribution is (Subscript[p, xy])(x, y)?

(Subscript[p, xy]) (x, 
        y) was supposed to be a Gaussian distribution,  
    but the coefficient in the quiz was (1/(4  π)),  
    and the exponent was positive,  
    which makes it integrate to a value not equal to 1,  
    therefore it was not a pdf.

b) Are x and y independent?

Yes, they are independent. This can be shown by showing that p(x)p(y) = p(x,y).

\(TraditionalForm\`\(1\/\(8  π\)\) e\^\(-\(\(x\^2\  + \ y\^2\  + \ 6  x\  - \ 2  y\  + \ 10\)\/8\)\)\  = \ \((\(1\/\@\(8  π\)\) e\^\(-\(\(x\^2\  + \ 6  x\  + \ 9\)\/8\)\))\)\ \((\(1\/\@\(8  π\)\) e\^\(-\(\(y\^2\  - \ 2  y\  + \ 1\)\/8\)\))\)\)

c) Are x and y correlated?

No, x and y are not correllated. If random variables are independent, they are uncorrelated.

d) What are the mean and variance values of x?

By inspection of part (b)

(Subscript[μ, x])  =  -3
((Subscript[σ, x])^2)  =  4

Problem 3

a) The area under each triangle must equal 1. Both triangles have the same base, b = 2. Therefor k = 1 for both pdfs.
b) The decision point will be where they intersect at 2.5. Everything less than 2.5 will be classified as from (Subscript[ω, 1])and everything greater than 2.5 will be classified as (Subscript[ω, 2]).
c) Sketch a graph that indicates the Bayes error from the classifier in (b). Mark the important points.

tops  =  
        ListPlot[{{0,  0.5},  {5,  0.5}},  PlotJoined  ->  True,  
          PlotStyle  ->  RGBColor[0, 1, 0], 
          DisplayFunction  ->  Identity];
errtop  =  
      ListPlot[{{0,  0.25},  {5,  0.25}},  PlotJoined  ->  True,  
        PlotStyle  ->  RGBColor[0, 1, 1], 
        DisplayFunction  ->  Identity]; 
    decision  =  
      ListPlot[{{2.5,  0},  {2.5,  0.75}},  
        PlotJoined  ->  True,  
        PlotStyle  ->  RGBColor[1, 0, 1], 
        DisplayFunction  ->  Identity]; 
    dist1  =  
      Graphics[{RGBColor[1, 0, 0], 
          Polygon[{{1, 0},  {3, 0}, {2, 0.5}}]}];
dist2  =  
        Graphics[{RGBColor[0, 0, 1],  
            Polygon[{{2, 0}, {4, 0}, {3, 
                  0.5}}]}];
err  =  
        Graphics[{RGBColor[1, 1, 0], 
            Polygon[{{2, 0}, {3, 0}, {2.5, 0.25}}]}];

Show[tops, dist1, dist2, err, errtop, decision, 
        DisplayFunction -> $DisplayFunction,  
        AxesLabel  -> {"x", "p(x|ω)P(ω)"},  
        Ticks  ->  {{0, 1, 2, 2.5, 3, 4}, {0, 0.25, 
              0.5}}];

Green Line -> Top of triangles
Cyan Line -> Top of Error triangle
Magenta Line -> Decision Boundary
Red Triangle -> p(x | (Subscript[ω, 1]))P((Subscript[ω, 1]))
Blue Triangle -> p(x | (Subscript[ω, 2]))P((Subscript[ω, 2]))
Yellow Triangle -> Bayes Error

d) Bayes error=(1/2)·1·(1/4) = (1/8).

Problem 4

a) (Subscript[p, U])is a pdf, so the volume enclosed by it must equal 1, therfore k = 1/3.
b) The θ's are independent because it is a uniform distribution. The θ's must each cover all the data in the data set.

θ1 + 0.5 = 0.23 (xmax)
θ1 - 0.5 = -0.62 (xmin)
θ2 + 1.5 = 3.72 (ymax)
θ2 - 1.5 = 0.99 (ymin)

0.23 - 0.5 ≤ θ1 ≤ -0.62 + 
        0.5
3.72 - 1.5 ≤ θ2 ≤ 0.99 + 1.5