.. title: Engineering Probability Class 22 Mon 2021-04-19
.. slug: class22
.. date: 2021-04-19
.. tags: class
.. link: 
.. description: 
.. type: text
.. has_math: true

.. sectnum::
.. contents:: Table of contents
..


Mathematica
----------------

#. Commands are ended with **shift-enter**.
#. Integrate[x^n, x]
#. Sum[x^2,{x,0,l}]
#. Manipulate[Integrate[x^n, x], {n, 0, 10, 1}]
#. Binomial[10,5]
#. f[x\_]:=Exp[-x^2/2]
#. f[x1\_ , x2\_ , x3\_ ] := Exp[- (x1 ^ 2 + x2 ^ 2 - Sqrt[2] (x1 x2) + x3 ^ 2 / 2) / (2 Pi Sqrt [Pi])]
#. square wave, aka uniform probability distn.
   
   s[x\_ ] := If[x > 0 && x < 1, 1, 0]

   The pdf is a conditional, which is messy to work with by hand.
   
#. Sum of 2 uniform:
   
   s2[x\_ ] := Integrate[s[y] × s[x - y], {y, - Infinity, Infinity}]

   Plot it: triangle.

#. Sum of 4 uniform.....

#. Now try this on exponential distn.   
   
Mathematica on Gaussians
------------------------

#. NormalDistribution[m,s] is the abstract pdf.

#. get functions of it thus:

   #. PDF[NormalDistribution[m,s][x]]

   #. CDF ...

   #. Mean, Variance, Median ..

#. MultinormalDistribution[{mu1, mu2}, {{sigma11, sigma12}, {sigma12, sigma22}}] (details later).   





Textbook material
-----------------

Continuing Chapter 7.



How to make money from probability
----------------------------------

#. `Cracking the Scratch Lottery Code <https://www.wired.com/2011/01/ff-lottery/>`_  

#. https://www.inquirer.com/philly/news/16_schemes_lottery_legend_Joan_Ginther_likely_didnt_use.html
