Monday, 20 May 2013

PERMUTATION AND COMBINATION


ii)Permutation

Definition : arrangement that can be made by taking some or all of a number of things,

Formula :nP ͬ = n!/(n-r)!

n,r : non negative integers (r <= n)

r : size of the each permutation

n : size of set from which elementsare permuted

! : factorial operator

 Question :

If you have 6 new year greeting cards and you want send them to 4 of your friends, in how many ways can this be done?

Solution :

We have to find number of permutation of 4 objects out of 6 objects. This number is 6P4 = 6(6-1)(6-2)(6-3) = 6*5*4*3 = 360

Therefore, cards can be sent in 360 ways

6P4 = 6! / (6-4)!

iii)Combination

Definition :

 A combination is a selection of some or allof a numberof different object. It is an un-ordered collection of unique sizes,

Formula : nC ͬ = nP ͬ /r!

n,r : non negative integers (r <= n)

r : size of the each permutation

n : size of set from which elementsare permuted

! : factorial operator

 Question :

In a box, there are 5 black pens, 3 white pens and 4 red pens. In how many ways can 2 black pens, 2 white pens and2 red pens can be chosen?

Solution :

No of ways of choosing 2 black pens from 5 black pens

5C2=5P2/2!=5*4/1*2=10

No of ways of choosing 2 white pens from 3 white pens

3C2=3P2/2!=3*2/1*2=3

No of ways of choosing 2 red pens from 4 red pens

4C2=4P2/2!=4*1/1*2=6

Therefore, it can be chosen by 10*3*6=180 ways



Sunday, 19 May 2013


Addition principle

 
If we have a ways of doing something and b ways of doing another thing and can not do both at the same time, then there are a + b ways to choose one of the actions.

 
Example

A woman has decided to shop at one store today, either in the north part of town or the south part of town. If she visits the north part of town, she either shop at a mall, a furniture store, or a jewelry store (3 ways). If she visits the south part of town, then she either shop at a clothing store or a shoe store (2 ways).

 

There are 3+2=5 possible shops the woman could end up shopping at today.

 

 
Multiplication Principle

 
If there are a ways of doing something and b ways of doing another thing, then  a · b ways of  doing both actions.

 
Example

 
When you order pizza, first choose the type of crust: thin or deep dish (2 choices). Next, choose the topping: cheese, pepperoni, or sausage (3 choices).

 
Using the rule of product, you know that there are 2 × 3 = 6 possible combinations of ordering a pizza.

 

 
Example 2

How many different license plates can be made if each plate contains a sequence of three

uppercase English letters followed by three digits?

 
There are 26 choices for each of the three uppercase English letters and ten choices for
each of the three digits. There are a total of 26 • 26 • 26 • 10 • 10 • 10 = 17,576,000 possible license plates.

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.