YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← 20-24 Likelihood_Challenge_(Optional)

20-24 Likelihood_Challenge_(Optional)

Get Embed Code
3 Languages

Showing Revision 2 created 11/02/2015 by Udacity Robot.

  1. And here is my answer.
  2. To get the likelihood of a set of numbers, we just need to multiply in
  3. the probability of seeing every single data point.
  4. So we start at 1 since that's the identity.
  5. For every data element we go through and multiply by the probability for element i
  6. and then we return it.
  7. If you're interested in a real challenge, note this function can actually be written on just 1 line.
  8. So for anyone watching who is a real Python enthusiast,
  9. feel free to post your 1-liners to the forums. Have fun.