## Andrews Curves

Posted on Thu 22 March 2018 in misc • 4 min read

Posted on Thu 15 February 2018 in misc • 1 min read

## Animated Heart in Python

Posted on Mon 08 February 2016 in misc • 3 min read

## Expectation Maximisation in Python: Coin Toss Example

Posted on Fri 13 November 2015 in misc • 5 min read

## Expectation Maximisation with Python : Coin Toss¶

This notebook implements the example, I consider a classic for understanding Expectation Maximisation.

Notations:

\begin{align*} \theta_A &= \text{Probability of a Heads showing up given the coin tossed is A}\\ \theta_B &= \text{Probability of a Heads showing up given the coin tossed is B}\\ \end{align*}

## Entropy and Uniform Distribution

Posted on Sun 18 October 2015 in misc • 1 min read

To show $$\sum p_i\log(p_i) = p$$

Consider $$H = -\sum p_i log(p_i) = log(n)$$

Consider weighted AM-GM for $$p_i$$:

$$(\prod \frac{1}{p_i}^p_i)^\frac{1}{\sum p_i} \leq \sum \frac{1}{p_i} \times p_i = n$$

Take log both sides:

$$\sum p_i \log(\frac{1}{p_i}) \leq \log(n … ## A frequent inequality Posted on Wed 09 September 2015 in misc • 2 min read$$ \frac{x-1}{x} \leq \ln(x) \leq x-1 \forall\ x>0 

Consider $$f(x)=\ln(x)-\frac{x-1}{x}$$

$$f'(x) = \frac{1}{x} - \frac{1}{x^2} = \frac{x-1}{x^2}$$

Now consider the following two cases:

## Short Proof

Never took a course on measure theory, so avoiding that route:

Let.

$$R = g(X)$$

$$S = h(Y)$$

Also define,

## Solution

As posted on stackexchange

## Solution

We just follow the definition:

$$P(Y<X) = \int_{-\infty}^{\infty}f_X(x)dx \int_{-\infty}^{x}f_Y(y)dy$$

$$P(Y <X) = \int F_X(y)f_X(x)dx$$

## [Proof]Weighted AM-GM

Posted on Mon 18 May 2015 in misc • 1 min read

We make use of Jensen’s Inequality and the fact that $$log(x)$$ is a concave function:

For concave f: $$f(\frac{\sum a_ix_i}{\sum a_i}) \geq \frac{\sum a_i f(x_i)}{\sum a_i}$$

$$f=log(X)$$

\(log(\frac{\sum a_ix_i}{\sum a_i}) \geq \frac{\sum a_i log(x_i)}{\sum …