Thursday, 9 May 2013


1) Give the definition and example for each of the following term:

a) Euler Path

     -Euler Path is a path in the graph that passes each edge only once.

       Example:

 



 

    b) Euler Circuit

     -Euler Circut is a path in the graph that passes each edge only once and return back to its original position.

Example :





 

2)  Determine what are the properties that differentiate between (a) and (b) in Question 1?

         -Degree of Nodes: Number of Edges on a vertex

          -Euler Path existence: not have more than 2 vertices of odd-degree nodes exist in the graph.

          -Euler Circuit existence: no odd-degree nodes exist in the graph.

 

3) What are the algorithm or step by step to determine (a) and (b) in    Question 1

        -Choose a random vertex

        -Pick an arbitrary edge joined to another vertex and mark the edge.

       -Marked edges cannot be passed again. The above procedure is repeated until all edges are  covered.

 

4) Give the definition and example for each of the following term:

           a) Hamilton Path

                -A path visits each vertex of a graph once and only once.

            Example :

 

           

  b) Hamilton Circuit

                  -Hamilton circuit is a cycle in an undirected graph which visits each vertex exactly once and   also returns to the starting vertex.

Example :

 



 


Question 5.

Hamilton Path – a simple path that passes  through EVERY VERTEX ONCE.

Hamilton Circuit – a simple circuit that passes through EVERY VERTEX EXACTLY ONCE.

 

Question 6.

Nearest Neighbor Algorithm

 1. Choose a starting vertex. (Let take D as starting vertex)

2. The next vertex chosen is the one “nearest” (smallest weight) that has not been visited.  If tie choose one.  Mark the edges covered as they are added to the path.

3. If all vertices have not been visited then repeat step 2 otherwise return to the start.   

     

 

Wednesday, 8 May 2013


4. a) Hamilton Path  is  a  simple path in a graph that passes

        through every vertex exactly once.
 
Example:
Ghas a Hamilton path, a, b, c, d
 
 
b) Hamilton Circuit  is a simple circuit in a graph that passes    through every vertex exactly once.

 
Example:

G has a Hamilton circuit: a, b, c, d, e, a
 
 

Graph Theory



1. a) An Euler path is a trail in a graph which visits every edge exactly once.

 
Example:

The graph G has an Euler path, a, c, d, e, b, d, a, b.



 
 
 
 
 
 
 
 
 
 
 
b) An Euler circuit is a trail which starts and ends on the

     same vertex.

 

Example:

The graph G has an Euler circuit, a, e, c, d, e, b, a.
 
 

Monday, 25 March 2013

What do you show in the basis step and what do you show in the inductive step when you use (ordinary) mathematical induction to prove that a property involving an integer n is true for all integers greater than or equal to some initial integer?

  • Basis step
    • Show that p(n) is true
  • Inductive step
    • Show that any integer k greater or equal n0, if P(k) is true, then P(k+1) is true
Example
  • Prove that for any natural number n,   0 + 1 + ... + n = n( n + 1 )/2
    • Basis step:
    • If n = 0, then LHS = 0, RHS = 0 * (0+1) = 0
    • LHS (0) = RHS (0)
    • Inductive step:
    • LHS à n + 1 = 0 + 1 + … + n + (n + 1) = (0 + 1 + … + n) + (n + 1)
    • n(n + 1)/2 + (n + 1) – using induction hypothesis
    • (n + 1)(n + 2)/2 – factoring (n + 1)
    • LHS = RHS for n + 1

What is the inductive hypothesis in a proof by (ordinary) mathematical induction?

  • Inductive hypothesis is the assumption in inductive step that statement hold for some n.
  • In order to perform the inductive step, one must assumes the inductive hypothesis and then uses this assumption to prove the statement for n + 1.
  • Inductive hypothesis indicates in three ways:
    • by explicit mention in the text
    • by inserting acronym IH over an equal sign or a sign for an inequality
    • by specify the inductive hypothesis as the reason for a step in a multi-line display


Use (ordinary) mathematical induction to construct proofs involving various kinds of statements such as formulas, divisibility properties and inequalities


Formulas:

Show that if n is a positive integer,

1 + 2+…..+=  n(n+1)
                                2

Solution:
Let P(n) be the proposition that the sum of the first n positive integers, 1+2+…+n=n(n+1)/2. We must do two things to prove that P(n) is true for n = 1, 2, 3, . . .
Show that P(1) is true and that the conditional statement P(k) implies P(k + 1) is true for k = 1, 2, 3,…..

BASIS STEP:
P(1) is true, because 1 =  1(1+1)
                                                 2

INDUCTIVE STEP:

1 + 2+· · ·+k =  k(k+1)
                               2

Show that P(k + 1) is true,
1 + 2+· · ·+k + (k + 1) = (k+1)[(k+1)+1]
                                                    2
                                         
                                     = (k+1)(k+2)
                                                2

Add k + 1 to both sides of the equation in P(k),

1+2+....+k+(k + 1)= k(k+1)
                                   2       +(k+1)
                            

                            = k(k+1)+2(k+1)
                                         2
                            = (k+2)(k+1)
                                       2
This last equation shows that P(k + 1) is true under the assumption that P(k) is true. This completes the inductive step. We have completed the basis step and the inductive step, so by mathematical induction we know that P(n) is true for all positive integers n.
 1 + 2+· · ·+n =n(n + 1)/2 for all positive integers n have proven.


Divisibility properties

Proposition:
For any integer n≥1, 7n - 2n is divisible by 5.        
Proof :

1) Basis step:
The statement is true for n=1:                                                      
                                   71 – 21 = 7 - 2 = 5 is divisible by 5.
2) Inductive step:
Assume the statement is true for some k≥1                              
                                                            (inductive hypothesis) ;


P(k):                7k - 2k is divisible by 5.                                                 
            Then 7k - 2k = 5a   for some aÃŽZ                               

 We need to show:

P(k+1):7k+1 - 2k+1 is divisible by 5.                                                                
             7k+1 - 2k+1 = 7·7k - 2·2k = 5·7k + 2·7k - 2·2k
                                    = 5·7k + 2·(7k - 2k)  =  5·7k + 2·5a           
                                    = 5·(7k + 2a) which is divisible by 5.                         

Show that it is true for k+1.                                                     
P(n) is true by induction.   


Inequalities

Theorem:
 For all integers n≥5,    n2 < 2n.                         

Proof (by induction):

1) Basis step:
                        The statement is true for n=5:                             
                                                            52 =25 < 32 = 25.

2)Inductive step:

Assume the statement is true for some k≥5 ;                        

P(k):                          k2 < 2k.                                              

We need to show:  
P(k+1):                 (k+1)2 < 2k+1.                                                              

             (k+1)2 = k2+2k+1 < k2 +2k                
                                           < 2k + 2k                        
                                           = 2·2= 2k+1.
                                   
Show that it is true for k+1 .                                          
Thus, P(n) is true by induction.

Monday, 18 March 2013


Sequences – Definition of Sequence
• Sequence is a list of number of objects in a special order.
Example:
3, 5, 7, 9, …… is a sequence starting at 3 and increasing by 2 each time.
• A sequence is a (finite or infinite) set of numbers.
Example problem involving Sequence
Problem Number One:
If the first three terms of an arithmetic sequence are 2, 6 and 10, find the 40th term.
To solve the problem we use this formula for finding the nth term of an arithmetic sequence.
An = A + (n - 1) d
Where, An = is the nth term, in the case of our problem it is the 40th term
A = the first term of the sequence, in our problem it is 2.
n = number of terms, in our problem it is 40.
d = the interval of the terms, or the difference of the next term from the previous term,
to get d; d = 6 - 2 = 4.
Now, it is time to substitute the values to the formula for solving nth term where the 40th term is to be solved.
An = 2 + (40 - 1) 4
An = 2 + (39) 4
An = 2 + 156
An = 158.
The 40th term of the arithmetic sequence is 158.

Problem Number Two:
If the first term of an arithmetic sequence is -3 and the eighth term is 11, find d and write the first 10 terms of the sequence.
In this problem,
A = -3 n = 8 A8 = 11
If these values are substituted in the formula for An, we have
11 = -3 + (8 - 1) d
11 = -3 + 7d
14 = 7d
d = 2
The first ten terms are -3, -1, 1, 3, 5, 7, 9, 11, 13, 15


Arithmetic Progression

  • A sequence in which the difference between any two successive terms is constant is called an arithmetic sequence @ arithmetic progression.
  • The constant difference is called the common difference.
  • Denoted by d.



Geometric Progression

  • A sequence in which the ratio of every pair of successive terms is constant is called a geomatric sequence @ geometric progression
  • The constant ratio is called the common ratio.
  • Denoted by r.








List down the principle of mathematical induction.

To prove that P(n) is true for all positive integers n, where P(n) is a propositional function

11)   verify that P(1) is true.

22)   Show that the conditional statement P(k) → P(k + 1) is true for all positive 
integers k. The technique that we’ve used in the above example to determine if all the values are true or not, is called mathematical induction. 






Template proof by mathematical induction

1.express to be proved in the form “for all n ≥ b, P(n) for integer b


2.write “Basic Step”. 



Show that P(b) is true,take the correct value of b used is used.


3.write word “Inductive Step”



4.state clearly the inductive hypothesis in the “ assume that p(k) is true for an arbitrary



fixed integer k ≥ b ”


5.proved under assumption that inductive is true



Write P(k + 1) says



6.prove P(k + 1),make assumption P(k)

,

Make sure proof is valid for all integer k with k ≥ b

,
taking care proof work for small value of k, including k = b



7.conclusion of the induction step, saying “ this complete the inductive step”



8.namely that by mathematical induction P(n) is true for all integer n ≥ b







Use of Sequence in Computer Programming


Example:

First of all, we need to write a  program. 




The output should looks like this.
The output of  product is presented in sequence form.


Use of Sequence in Computer Programming

Example:

First of all, we need to write a  program.

 

 

 

 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
The output should looks like this.
The output of  product is presented in sequence form.