Theory Of Computation Archives - https://www.theoryofcomputation.co/tag/theory-of-computation/ Science of Computer Thu, 27 Sep 2018 19:42:03 +0000 en-US hourly 1 https://wordpress.org/?v=6.7.1 https://i0.wp.com/www.theoryofcomputation.co/wp-content/uploads/2018/08/cropped-favicon-512x512-2.png?fit=32%2C32&ssl=1 Theory Of Computation Archives - https://www.theoryofcomputation.co/tag/theory-of-computation/ 32 32 149926143 Proof Techniques Mathematical Preliminaries Part 1 https://www.theoryofcomputation.co/proof-techniques-mathematical-preliminaries/ Thu, 27 Sep 2018 19:42:03 +0000 https://www.theoryofcomputation.in/?p=255 Proof techniques in mathematical preliminaries is a sequence of mathematical statements that form an argument to show that a theorem is true. The statements in the proof of a theorem include axioms (assumptions about the underlying mathematical structures), hypotheses of the theorem to be proved, and previously proved theorems. The main question is “How do...

The post Proof Techniques Mathematical Preliminaries Part 1 appeared first on .

]]>
Proof techniques in mathematical preliminaries is a sequence of mathematical statements that form an argument to show that a theorem is true.

The statements in the proof of a theorem include axioms (assumptions about the underlying mathematical structures), hypotheses of the theorem to be proved, and previously proved theorems. The main question is “How do we go about proving theorems?” This question is similar to the question of how to solve a given problem. Of course, the answer is that finding proofs, or solving problems, is not easy: otherwise life would be dull!

There is no specified way of coming up with a proof, but there are some generic strategies that could be of help. Here, we review some of these strategies. Here are some useful tips:

  1. Read and completely understand the statement of the theorem to be proved. Most often this is the hardest part.
  2. Sometimes, theorems contain theorems inside them. For example, “Property A if and only if propery B”, requires two statements:
    • If property A is true, then property B is true ( A ⇒ B).
    • If property B is true, then property A is true ( B ⇒ A).

    Another example is the theorem “Set A equals set B”. To prove this, we need to prove that A ⊆ B and B ⊆ A. That is, we need to show that each element of set A is i

  3. Try to divide the theorems into multiple simple cases that either prove the facts or tautology of the case.
  4. Try to write down the proofs once you have it. This is to ensure the correctness of your proof. Often, mistakes are found at the time of writing.
  5. Finding proofs takes time, we do not come prewired to produce proofs. Be patient, think, express and write clearly and try to be precise as much as possible.

Proof Strategies

Direct proofs

Theorem 1: If n is an odd integer, then n2 is odd as well.

Proof. An odd positive integer n can be written as n = 2k + 1, for some integer k ≥ 0. Then

n2 = (2k+1)2 = 4k2 + 4k + 1 = 2(2k2 + 2k) + 1.

Since (2k2 + 2k) is even and “even plus one is odd”, we can conclude that n2 is odd.

 

Theorem 2: Let G = ( V, E ) be a graph. Then sum of the degrees of all vertices is an even integer, i.e.,

v∈V deg(v)

is even.

Proof. If you do not see the meaning of this statement, then first try it out for few graphs. The reason why the statement holds is very simple: Each edge contributes 2 to the summation (because an edge is incident on exactly two distinct vertices).

 

Constructive Proofs

This technique not only shows the existence of a certain object, it actually gives a method of creating it. Here is how a constructive proof looks like:

Theorem 4: There exists an object with property Ρ.

Proof. Here is the object: […]

And here is the proof that the object satisfies property Ρ: […]

Here is an example of a constructive proof. A graph is called 3-regular,  if each vertex has degree three.

 

Theorem 5: For every even integer n ≥ 4, there exists a 3-regular graph with n vertices.

Proof. Define

V = {0,1,2,3,….,n – 1},

and

E = { {i,i+1}: 0 ≤ i ≤ n – 2 } ∪ {{n-1,0}} ∪ {{i,i+n/2} : 0 ≤ i ≤ n/2 – 1 }.

Then the graph G = (V, E)  is 3-regular.

Convince yourself that this graph is indeed 3-regular. It may help to draw the graph for , say , n = 8 .

 

Nonconstructive proofs

In a nonconstructive proof, we show that a certain object exists, without actually creating it. Here is an example of such a proof:

Theorem 6: There exist irrational numbers x and y such that xy is rational.

Proof. There are two possible cases.

Case 1: √2√2 ∈ Q .

In this case, we take x = y = √2. In Theorem 9 Part 2 of this article, we will prove that √2 is irrational.

Case 2: √2√2 ∉ Q.

In this case, we take x = √2√2 and y = √2. Since

xy = (√2√2)√2 = √22 = 2,

the claim in the theorem follows.

Observe that this proof indeed proves the theorem, but it does not give an example of a pair of irrational number and x and y such that xy is rational.

 

Read Also: Mathematical Preliminaries of Theory of Computation

 

 

The post Proof Techniques Mathematical Preliminaries Part 1 appeared first on .

]]>
255
Non Deterministic Finite Automata https://www.theoryofcomputation.co/non-deterministic-finite-automata/ Sun, 12 Aug 2018 17:16:03 +0000 https://www.theoryofcomputation.in/?p=105 Non Deterministic Finite Automata (NDFA) If, for each pair of states and possible input chars, there is a unique next state (as specificed by the transitions), then the FA is deterministic (DFA). Otherwise, the FA is non deterministic finite automata (NDFA). What does it mean for an FA to have more than one transition from...

The post Non Deterministic Finite Automata appeared first on .

]]>
Non Deterministic Finite Automata (NDFA)

If, for each pair of states and possible input chars, there is a unique next state (as specificed by the transitions), then the FA is deterministic (DFA). Otherwise, the FA is non deterministic finite automata (NDFA).

What does it mean for an FA to have more than one transition from a given state on the same input symbol? How do we translate such an FA into a program? How can we “goto” more than one place at a time?

Conceptually, a nondeterministic FA can follow many paths simultaneously. If any series of valid transitions reaches an accepting state, they we say the FA accepts the input. It’s as if we allow the FA to “guess” which of several transitions to take from a given state, and the FA always guesses right.

We won’t attempt to translate an NDFA into a program, so we don’t have to answer the question “how can we goto more than one place at a time”. Instead, we can prove that every NDFA has a corresponding DFA, and there is a straightforward process for translating an NDFA into a DFA. So, when given an NDFA, we can translate it into a DFA, and then write a program based on the DFA.

Definition of Non Deterministic Finite Automata

NFA is similar to DFA except following additional features:

1. Null (or ε) move is allowed i.e., it can move forward without reading symbols.
2. Ability to transit to any number of states for a particular input.
However, these above features don’t add any power to NFA. If we compare both in terms of power, both are equivalent.

Due to above additional features, NFA has a different transition function, rest is same as DFA.

δ: Transition Function
δ:  Q X (∑ U ϵ ) --> 2 ^ Q.

As you can see in transition function for any input including null (or &epsilon), NFA can go to any state number of states.

Non Deterministic Finite Automata

Example of an NDFA

An NDFA to accept strings containing the word “main”:

-> s0 -m-> s1 -a- > s2 -i-> s3 -n-> (s4)
-> s0 -any character-> s0

This is an NDFA because, when in state s0 and seeing an “m”, we can choose to remain in s0 or go to s1. (In effect, we guess whether this “m” is the start of “main” or not.)

If we simulate this NDFA with input “mmainm” we see the NDFA can end up in s0 or s1 after seeing the first “m”. These two states correspond to two different guesses about the input: (1) the “m” represents the start of “main” or (2) the “m” doesn’t represent the start of “main”.

  -> s0 -m-> s0
        -m-> s1

On seeing the next input character (“m”), one of these guesses is proven wrong, as is there is no transition from s1 for an “m”. That path halts and rejects the input. The other path continues, making a transition from s0 to either s0 or s1, in effect guessing that the second “m” in the input either is or is not the start of the word “main”.

  -> s0 -m-> s0 -m-> s0
                -m-> s1
        -m-> s1

Continuing the simulation, we discover that at the end of the input, the machine can be in state s0 (still looking for the start of “main”), s1 (having seen an “m” and looking for “ain”), or s4 (having seen “main” in the input). Since at least one of these states is an accepting state (s4), the machine accepts the input.

  s0 -m-> s0 -m-> s0 -a-> s0 -i-> s0 -n-> s0 -m-> s0 
  				           -m-> s1
             -m-> s1 -a-> s2 -i-> s3 -n-> s4
     -m-> s1

The post Non Deterministic Finite Automata appeared first on .

]]>
105