| Example | LaTeX code | Result | |
|---|---|---|---|
| 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 15, 2011
Latex
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
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
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
Tuesday, February 15, 2011
Symbolic logic - First order predicate logic
Implication
premise --->consequence
p-->q
p q -->
------------
0 0 1
0 1 1
1 0 0
1 1 1
used terms to express this are
1)p is sufficient for q //
2)q is necessary for p
2)q if p
3)q whenever p
4)p only if q
Converse is q-->p
contrapositive is -q --> -p
Biconditional p <--> q true when truth values same for p and q
statements like ' if and only if ' or 'p is necessary and sufficient for q'
Conjunction
A and B
Exclusive disjunction
(p Ú q) · ~(p · q) either p is true or q is true but not both
A compound proposition that is always true is Tautology and
which is always false is Contradiction
p and q are logically equivalent if p <---> q is tautology that is p and q have same truth values
Quantifiers
statement like for all x or for every x
equivalent to P(x1) and P(x2) and P.........(xn) where xi is universe of discourse
Everything is
Everything is beautiful
∀y F(y)
Nothing is
Nothing is beautiful
∀y ¬ F(y)
statement like there is an x such that or there is at least one x such that
equivalent to P(x1) or P(x2) ... p(xn)
Consider predicate F(y) which is true if y is beautiful
something is
existential quantifiers tell that there is something or some y for which F(y) is true
something is beautiful
∃y F(y)
something is not
something is not beautiful
there is some y which is not beautiful
∃y ¬ F(y)
Nothing is
Nothing is beautiful
It is not the case that something is beautiful
¬∃y F(y)
that is negation of something becomes nothing
Everything is
everything is beautiful
It is not the case that something is not beautiful
¬∃y ¬ F(y)
Property of connectives
1)A -> B <===> -B -> -A
2)A->B <==> -A or B
3)∀y (P(y) and Q(y)) = ∀P(y) and ∀Q(y)
not true for OR that is universal quantification is not distributive over OR operator
4)∃y (P(y) OR Q(y)) = ∃y P(y) OR ∃y Q(y)
not true for AND that is existential quantification is not distributive over AND
Law of quantification
Distributive law
∀x (P(x) and Q(x)) <==> ∀xP(x) and ∀xQ(x)
∃x (P(x) or Q(x)) <==> ∃y P(x) or ∃y Q(x)
∀xP(x) or ∀xQ(x) ==> ∀x (P(x) or Q(x))
∃x (P(x) and Q(x)) ==> ∃y P(x) and ∃y Q(x)
example
∀x P(x) means (P(a) and P(b))
∃x P(x) means P(a) or P(b)
The best way to understand the distributive property is to expand the symbol ∀ and ∃ into basic definition of AND and OR
Consider p(x) be cube(x) and q(x) be small(x) then
1)∀x cube(x) or ∀x small(x) ==> ∀x (cube(x) or small(x))
we can write the same as
Lhs: ( cube(a) and cube(b) ) or ( small(s) and small(t) )
these is true when either there exist two cubes a and b or two small objects s and t
Rhs: (cube(a) or small(a)) and (cube(b) or small(b))
if Lhs is true then this is also true because its true when either a and b is cube or small
but the reverse of the implication says that if a is cube and b is small then lhs should be true but it is not so not bidirectional
Quantifier Independence
∀y∀x F(x,y) <==>∀x∀y F(x,y)
∃y∃x F(x,y) <==>∃x∃y F(x,y)
∃y∀x F(x,y) ==>∀x∃y F(x,y)
but not ∀x∃y F(x,y) ==>∃y∀x F(x,y)
Translating statement in predicate logic
1) Barber Paradox
the statement says "Barber shaves those residents who donot shave themselves"
∃y ∈ S : Barber(y) ∧ (∀x ∈ S : (Shaves(y, x) ↔ ¬Shaves(x, x)))
here paradox because when x=y then it can never be true
remember to check for extreme cases always
2)
i) Some A's are B's
there exist some x that is both A and B
∃x(A(x) & B(x))
ii)Some A's are not B's
ther exist some x that is A and is not B
∃x(A(x) & ¬B(x))
iii)All A's are B's
for all x if it is A then it is B
∀x(Ax → Bx)
iv)No A's are B's
It is not the case that there exist some x that is A and is also B
¬∃x(Ax & Bx)
for all x if it is A then it is not B
∀x(Ax → ¬Bx)
3)implication we use with universal quantification and with existential quantification we use and connective
example S: Some lions don't drink coffee
L(x) : x is lion
P(x) : x is pet
D(x) : x drinks coffee
S1: ∃x (L(x) → P(x)) is wrong
S2 : ∃x (L(x) AND P(x)) is correct
4)statement involving : and, but, moreover, however,although, and even though are conjunction
5)unless means disjunction
http://www.earlham.edu/~peters/courses/log/transtip.htm
www.niu.edu/~gpynn/205_11_handout.pdf
premise --->consequence
p-->q
p q -->
------------
0 0 1
0 1 1
1 0 0
1 1 1
used terms to express this are
1)p is sufficient for q //
2)q is necessary for p
2)q if p
3)q whenever p
4)p only if q
Converse is q-->p
contrapositive is -q --> -p
Biconditional p <--> q true when truth values same for p and q
statements like ' if and only if ' or 'p is necessary and sufficient for q'
Conjunction
A and B
Exclusive disjunction
(p Ú q) · ~(p · q) either p is true or q is true but not both
A compound proposition that is always true is Tautology and
which is always false is Contradiction
p and q are logically equivalent if p <---> q is tautology that is p and q have same truth values
Quantifiers
Universal Quantification
proposition function P(x) is true for all values of x in the universe of discoursestatement like for all x or for every x
equivalent to P(x1) and P(x2) and P.........(xn) where xi is universe of discourse
Everything is
Everything is beautiful
∀y F(y)
Nothing is
Nothing is beautiful
∀y ¬ F(y)
Existential Quantification
there exists an element x in the universe of discourse such that P(x) is truestatement like there is an x such that or there is at least one x such that
equivalent to P(x1) or P(x2) ... p(xn)
Consider predicate F(y) which is true if y is beautiful
something is
existential quantifiers tell that there is something or some y for which F(y) is true
something is beautiful
∃y F(y)
something is not
something is not beautiful
there is some y which is not beautiful
∃y ¬ F(y)
Nothing is
Nothing is beautiful
It is not the case that something is beautiful
¬∃y F(y)
that is negation of something becomes nothing
Everything is
everything is beautiful
It is not the case that something is not beautiful
¬∃y ¬ F(y)
Property of connectives
1)A -> B <===> -B -> -A
2)A->B <==> -A or B
3)∀y (P(y) and Q(y)) = ∀P(y) and ∀Q(y)
not true for OR that is universal quantification is not distributive over OR operator
4)∃y (P(y) OR Q(y)) = ∃y P(y) OR ∃y Q(y)
not true for AND that is existential quantification is not distributive over AND
Law of quantification
Distributive law
∀x (P(x) and Q(x)) <==> ∀xP(x) and ∀xQ(x)
∃x (P(x) or Q(x)) <==> ∃y P(x) or ∃y Q(x)
∀xP(x) or ∀xQ(x) ==> ∀x (P(x) or Q(x))
∃x (P(x) and Q(x)) ==> ∃y P(x) and ∃y Q(x)
example
∀x P(x) means (P(a) and P(b))
∃x P(x) means P(a) or P(b)
The best way to understand the distributive property is to expand the symbol ∀ and ∃ into basic definition of AND and OR
Consider p(x) be cube(x) and q(x) be small(x) then
1)∀x cube(x) or ∀x small(x) ==> ∀x (cube(x) or small(x))
we can write the same as
Lhs: ( cube(a) and cube(b) ) or ( small(s) and small(t) )
these is true when either there exist two cubes a and b or two small objects s and t
Rhs: (cube(a) or small(a)) and (cube(b) or small(b))
if Lhs is true then this is also true because its true when either a and b is cube or small
but the reverse of the implication says that if a is cube and b is small then lhs should be true but it is not so not bidirectional
Quantifier Independence
∀y∀x F(x,y) <==>∀x∀y F(x,y)
∃y∃x F(x,y) <==>∃x∃y F(x,y)
∃y∀x F(x,y) ==>∀x∃y F(x,y)
but not ∀x∃y F(x,y) ==>∃y∀x F(x,y)
Translating statement in predicate logic
1) Barber Paradox
the statement says "Barber shaves those residents who donot shave themselves"
∃y ∈ S : Barber(y) ∧ (∀x ∈ S : (Shaves(y, x) ↔ ¬Shaves(x, x)))
here paradox because when x=y then it can never be true
remember to check for extreme cases always
2)
i) Some A's are B's
there exist some x that is both A and B
∃x(A(x) & B(x))
ii)Some A's are not B's
ther exist some x that is A and is not B
∃x(A(x) & ¬B(x))
iii)All A's are B's
for all x if it is A then it is B
∀x(Ax → Bx)
iv)No A's are B's
It is not the case that there exist some x that is A and is also B
¬∃x(Ax & Bx)
for all x if it is A then it is not B
∀x(Ax → ¬Bx)
3)implication we use with universal quantification and with existential quantification we use and connective
example S: Some lions don't drink coffee
L(x) : x is lion
P(x) : x is pet
D(x) : x drinks coffee
S1: ∃x (L(x) → P(x)) is wrong
S2 : ∃x (L(x) AND P(x)) is correct
4)statement involving : and, but, moreover, however,although, and even though are conjunction
5)unless means disjunction
http://www.earlham.edu/~peters/courses/log/transtip.htm
www.niu.edu/~gpynn/205_11_handout.pdf
Labels:
predicate,
quatifier,
symbolic logic
Subscribe to:
Posts (Atom)