Skip to content

Fundamentals ​

Basic Logic Inference ​

  1. P→Q,P⟹Q
  2. P→Q,¬Q⟹¬P
  3. P∨Q,¬P⟹Q
  4. P(or Q)⟹P∨Q
  5. P,Q⟹P∧Q
  6. P∧Q⟹P(or Q)
  7. P∨Q→R⟹(P→R)∧(Q→R)

Equivalence ​

Equality Problem Find the equivalence of equality problem :

  1. a=b⟺a≤b∧b≤a, reduce the equality problem to a pair of inequality problems.
  2. a=b⟺a⋅1=b⟺a⋅(c⋅c−1)=b, introducing multiplication by identity.

Inequalitiy Problem Find the equivalence of inequality problem :

  1. a≤b⟺¬(a>b), reduce the inequality problem to its negation.
  2. a≤b⟺a≤c∧c≤b, reduce the inequality problem to a pair of inequalities with an intermediate value c.

Counting ​

Counting Multisets

Definition : Multiset is a special kind of set where elements are allowed to appear more than once.


Given a multiset with n elements, the number of ways to choose k elements from it is given by the formula:

(n+k−1k)

Proof : This is a typical example of star-and-bars problem, which is a combinatorial method used to determine the number of ways to place k indistinguishable items into n distinguishable bins. There are k+n−1 positions in total, in which k positions are chosen to place the items, and the remaining n−1 positions are used as dividers between the bins.


Counting Permutations of Multisets

Given a multiset with n elements, where the element i appears ni times (i=1,2,…,k), the number of distinct permutations of the multiset is given by the formula:

n!n1!n2!⋯nk!

Pigeonhole Principle

Definition : If n items are put into m containers, with n>m, then at least one container must contain more than one item. On the contrary if n≤m, it is possible that each container contains at most one item.


Example : Choose 6 distinct numbers from 0−9, then exists a pair of numbers whose sum is 9.

Proof :

  1. divide 0−9 into five buckets containing (0,9),(1,8),(2,7),(3,6),(4,5) separately.
  2. By the pigeonhole principle, since we are choosing 6 numbers and there are only 5 buckets, at least one bucket must contain at least two chosen numbers.
  3. The two numbers in the same bucket sum to 9.

Combinatorial Proof

(n+1k)=(nk−1)+(nk)

Proof : The left-hand side describes the number of ways to choose k elements from a set of n+1 elements. We can split this combinatorial problem into two sub-cases:

  1. The first item of the set is chosen. Then we only need to choose the remaining k−1 elements from the remaining n elements, which can be done in (nk−1) ways.
  2. The first item of the set is not chosen. Then we need to choose all k elements from the remaining n elements, which can be done in (nk) ways.

How to Prove Conditional Statements ​

Regardint statement P→Q, there are several common methods to prove it.

Direct Proof ​

Methodology of direct proof

The methodology of direct proof involves assuming the premise P is true and then using logical reasoning and known facts to show that the conclusion Q must also be true. The steps are as follows:

  1. write down the line of premise P in the proof.
  2. write down the line of conclusion Q in the proof, left the middle part empty.
  3. fill in the middle part with logical reasoning and known facts to connect P to Q, in practice the process is not always straightforward from top to bottom, and it may jump between up and down until the connection happens in the middle of somewhere.

Using Cases

Given statement P, we want to prove Q. If the statement P can be splitted into several cases, typically if P=P1∨P2, then we can prove Q by considering each case separately:

  1. Consider the first case P1. Prove that P1→Q.
  2. Consider the second case P2. Prove that P2→Q.
  3. Both cases hold, then we have P=(P1∨P2)→Q

This is a basic technique in direct proof, often referred to as proof by cases, which can be formulated as:

(P∨Q)→R⟹(P→R)∧(Q→R)

Contrapositive Proof ​

Proof by Contradiction ​

Published with GitHub Pages.