Saturday, March 15, 2014

Not updating this blog anymore

I am not active on this blog anymore. So, if anyone of you is interested in maintaining this blog for educational purpose, please drop a comment and I will contact you.

Tuesday, March 15, 2011

Latex

ExampleLaTeX codeResult
Polynomial {tex}a^2+b^2=c^2{/tex} {tex}a^2+b^2=c^2{/tex}
Quadratic formula {tex}x={-b\pm\sqrt{b^2-4ac} \over 2a}}{/tex} {tex}x={-b\pm\sqrt{b^2-4ac} \over 2a}}{/tex}
Tall parentheses and fractions {tex}2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right){/tex} {tex}2 = \left( \frac{\left(3-x\right) \times 2}{3-x} \right){/tex}
{tex}S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}{/tex} {tex}S_{\text{new}} = S_{\text{old}} - \frac{ \left( 5-T \right) ^2} {2}{/tex}
Integrals \int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy{/tex} \int_a^x \!\!\!\int_a^s f(y)\,dy\,ds = \int_a^x f(y)(x-y)\,dy{/tex}
Summation {tex}\sum_{m=1}^\infty \sum_{n=1}^\infty \frac{m^2\,n} {3^m\left(m \,3^n+n \,3^m\right)}{/tex} {tex}\sum_{m=1}^\infty \sum_{n=1}^\infty \frac{m^2\,n} {3^m\left(m \,3^n+n \,3^m\right)}{/tex}
Differential equation {tex}u'' + p(x)u' + q(x)u = f(x),\quad x>a{/tex} {tex}u'' + p(x)u' + q(x)u = f(x),\quad x>a{/tex}
Complex numbers {tex}|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z){/tex} {tex}|\bar{z}| = |z|, |(\bar{z})^n| = |z|^n, \arg(z^n) = n \arg(z){/tex}
Limits {tex}\lim_{z\rightarrow z_0} f(z)=f(z_0){/tex} {tex}\lim_{z\rightarrow z_0} f(z)=f(z_0){/tex}
Integration with limits and fractions {tex}\int\limits_{ -\infty }^{a} \frac{e^{-(x-\mu)/s}} {s(1+e^{-(x-\mu)/s})^2} \,dx = {1 \over 1+e^{-(a-\mu)/s}}{/tex} {tex}\int\limits_{ -\infty }^{a} \frac{e^{-(x-\mu)/s}} {s(1+e^{-(x-\mu)/s})^2} \,dx = {1 \over 1+e^{-(a-\mu)/s}}{/tex}
Continuation and cases {tex}f(x) =
\begin{cases}
1 & -1 \le x < 0 \\
\frac{1}{2} & x = 0 \\
1 - x^2 & \mbox{otherwise}
\end{cases}{
/tex}
{tex}f(x) =
\begin{cases}
1 & -1 \le x < 0 \\
\frac{1}{2} & x = 0 \\
1 - x^2 & \mbox{otherwise}
\end{cases}{
/tex}
Prefixed subscript {tex}{}_pF_q(a_1, \dots, a_p;c_1, \dots, c_q;z) \\ ~\qquad = \sum_{n=0}^\infty \frac {(a_1)_n \cdots (a_p)_n}{(c_1)_n \cdots (c_q)_n} \frac {z^n}{n!}{/tex} {tex}{}_pF_q(a_1, \dots, a_p;c_1, \dots, c_q;z) \\ ~\qquad = \sum_{n=0}^\infty \frac {(a_1)_n \cdots (a_p)_n}{(c_1)_n \cdots (c_q)_n} \frac {z^n}{n!}{/tex}

Tuesday, March 1, 2011

Asymptotic growth of function (Comparision)

Rules for comparing asymptotic growth of functions
1)f(n) < g(n) if





2) if f(n) < g(n)  then 1/g(n) < 1/f(n)

Ordering functions according to their asymptotic growth

1) nα < nβ 
whenever β>α
Examples
n1.2 < n2
n0.02 < n0.2

2) 1 < log(log n) < log n < nε < nC < nlog n < Cn < nn < CCn
where 0 < ε < 1 and C > 1
because  f(n)/g(n) --> infinity  as n --> infinity  for each f(n) < g(n)
Examples
nlog n < 2n
log n < n0.0001
nn < 22n

3)Using the reciprocal rule in above hierarchy we can deduce that
1/nε < 1 / log n 
1/nε < 1
and so on

4) log n!  <  n log n

5)2n  <  en  <  n!  < 22n

Reference
Concrete Mathematics, Graham Knuth Pattasnik
Algorithms, Cormen   Leiserson   Rivest