Showing posts with label visualization. Show all posts
Showing posts with label visualization. Show all posts

Thursday, April 30, 2020

send email html content with inline image


  • preferred way:
    • script to generate html content with image encoded as base64 text
      • <img src='data:imag/png;base64,....'/>
      • base64.b64encode().decode("ascii") to get that ... string from image
    • single html file to include all the html and images, etc. 😀
    • cat that html and pipe to mutt -e "set content_type=text/html" to send the email

Tuesday, September 27, 2016

Conditional Probability - a visualization



No need to remember the formula.  Instead, understand it and u can derive it.

Looking at the diagram above, 

  • Omega is the entire probability space.  [rectangle]
  • Event A is a subset of Omega with probability of happening P(A). [left circle]
  • Event B is a subset of Omega with probability of happening P(B).  [right circle]
  • A intersect B is when A and B both happening. [middle ellipsis]


P(B|A) is 

  • conditional prob of B given A
  • ie knowing that A has happened, it is the chance of B happening


What does it really mean?

  1. knowing that A has happened -> the prob space has shrunk from Omega [rectangle] to P(A) [red circle]
  2. the chance of B happening left is A intersect B [middle ellipsis]
  3. note that we don't look at the rest of P(B) [outside of red circle] anymore, since it's outside of the realm of possibility knowing that A has happened.


Picturing the diagram in your mind, you will figure out that

  • Given A has happened, chance of B happening is [middle ellipsis] divided by [red circle]
  • ie P(B|A) = P(A intersect B) / P(A)



source:
https://courses.edx.org/courses/course-v1:MITx+6.008.1x+3T2016/courseware/1__Probability_and_Inference/conditioning_on_events/

Thursday, October 1, 2015