236 - Tutorial Manual PDF
236 - Tutorial Manual PDF
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
236CSM-3
Tutorial Manual
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Course Syllabus
SYLLABUS AND SCHEDULE FOR THEORY COURSE
Chapter No.
Week Topic Text Reference
& Page No.
3-4 Chapter-2
Basic Counting Principles, Counting methods, Sum rules, and Applied
Product rules, Permutation and Combinations, Binomial Combinatorics by Page 13-20,
Expression. Fred S. Roberts
Pages 40-62
15 Revision
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
(a) A = {2, 4, 6, 8} (b) B = {3, 9, 27, 81} (c) C = {1, 4, 9, 16, 25}
7. Write down the union and intersection of the following pairs of sets:
9. Show by Venn diagrams the relationship between the following pairs of sets:
5. p ∩ (q ∩ r)
6. r ∩ ( q ∩ p)
7. (p U q) ∩ (r ∩ q)
4. Solve using the addition principle. 2x + 5 < x+4. The solution set is {x|x< ?}
Assignment I
(a) D = {x : x = 3p, p ∈ W, p ≤ 3}
(b) E = {x : x = a2, a ∈ N, 3 < a < 7}
(c) F = {x : x = n/(n + 1), n ∈ N and n ≤ 4}
(d) G = {x : x ∈ N, 3x - 2 < 5}
(a) C = {x : x is a multiple of 5}
(b) D = {x : x is a factor of 30}
(c) P = {x : x ∈ Z, x < -1}
(d) The set of all letters in the English alphabet
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
6. Write down the union and intersection of the following pairs of sets:
8. Show by Venn diagrams the relationship between the following pairs of sets:
10. From the given Venn diagram, find the following sets:
(i) A
(ii) B
(iii) A ∪ B
(iv) A ∩ B
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercise
1. In how many ways the word HOLIDAY can be rearranged such that the letter I
will always come to the left of letter L?
2. There are 6 people who will sit in a row but out of them Ronnie will always be left
of Annie and Rachel will always be right of Annie. In how many ways such
arrangement can be done?
3. In how many different ways can the letters of the word 'LEADING' be arranged in
such a way that the vowels always come together?
4. In how many different ways can the letters of the word 'CORPORATION' be
arranged so that the vowels always come together?
5. Abdur Rahman has a 5-digit pass code to access his e-mail account. The code is
made up of the even digits 2, 4, 6,8, and 0. Each digit can be used only once. How
many different pass codes could Abdur Rahman have?
Assignment -II
1. A father, mother, 2 boys, and 3 girls are asked to line up for a photograph.
Determine the number of ways they can line up if
a. There are no restrictions
b. The parents stand together
c. The parents do not stand together
d. All the females stand together
2. In how many ways can the letters of the word 'LEADER' be arranged?
3. How many 3-digit numbers can be formed from the digits 2, 3, 5, 6, 7 and 9,
which are divisible by 5 and none of the digits is repeated?
4. In how many different ways can the letters of the word 'DETAIL' be arranged
in such a way that the vowels occupy only the odd positions?
5. How many 4-letter words with or without meaning, can be formed out of the
letters of the word, 'LOGARITHMS', if repetition of letters is not allowed?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Problems
1. In how many different ways can the letters of the word 'MATHEMATICS' be
arranged so that the vowels always come together?
2. A password consists of two letters of the alphabet followed by three digits chosen
from 0 to 9. Repeats are allowed. How many different possible passwords are
there?
3. How many permutations of 3 different digits are there, chosen from the ten digits
0 to 9 inclusive?
4. How many permutations of 4 different letters are there, chosen from the twenty
six letters of the alphabet (repetition is not allowed)? Or A password consists of
four different letters of the alphabet. How many different possible passwords are
there?
5. In how many different ways can the letters of the word 'ALGORITHM' be
arranged in such a way that the vowels occupy only the odd positions, and in how
many ways word 'COMPUTER' be arranged so that the vowels always come
together?
6. In how many different ways can the letters of the word 'LEADING' be arranged in
such a way that the vowels always come together?
7. Ellie want to change her password which is ELLIE9 but with same letters and
number. In how many ways she can do that?
8. Determining the number of ways a selection from a set can be made when the
order does not matter.
A tray contains 4 different cookies. (Let the set {A, B, C, D})
a. How many ways can you select and arrange 3 cookies from the tray?
b. How many ways can you select 3 cookies from the tray if order doesn’t matter?
c. How are the answers to questions a. and b. related?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercise
1. A license plate begins with three letters. If the possible letters are A, B, C, D and
E, how many different permutations of these letters can be made if no letter is
used more than once?
2. A zip code contains 5 digits. How many different zip codes can be made with the
digits 0–9 if no digit is used more than once and the first digit is not 0?
3. In how many ways can the letters in the word "HELLO" be arranged where the L's
are together?
4. How many ways can the letters in the word 'PARALLEL" be arranged if the
letters P and R are together?
5. How many different arrangements can be made using two of the letters of the
word TEXAS if no letter is to be used more than once?
Assignment III
1. 10 students have appeared in a test in which the top three will get a prize. How
many possible ways are there to get the prize winners?
2. How many different words can be formed with the letters of the word ‘SUPER’
such that the vowels always come together?
3. Find the number of different words that can be formed with the letters of the word
‘BUTTER’ so that the vowels are always together.
4. A special type of password consists of four different letters of the alphabet, where
each letter is used only once. How many different possible passwords are there?
5. A question paper consists of 10 questions divided into two parts A and B. Each
part contains five questions. A candidate is required to attempt six questions in all
of which at least 2 should be from part A and at least 2 from part B. In how many
ways can the candidate select the questions if he can answer all questions equally
well?
Problems
1. A committee of 5 members has to be chosen from 25 members in an organization.
Find out how, many different combinations are possible.
3. In how many ways we can choose 3 books from a set of 5 books. Number of
books to choose from =n=5 and Number of letters to choose =r=3
4. Among a set of 5 black balls and 3 red balls, how many selections of 5 balls can
be made such that at least 3 of them are black balls
5. How many 4 digit numbers that are divisible by 10 can be formed from the
numbers 3, 5, 7, 8, 9, 0 such that no number repeats?
6. 16 teams enter a competition. They are divided up into four Pools (A, B, C and
D) of four teams each. Every team plays one match against the other teams in its
Pool. After the Pool matches are completed:
7. From a group of 7 men and 6 women, five persons are to be selected to form a
committee so that at least 3 men are there on the committee. In how many ways
can it be done?
8. A box contains 2 white balls, 3 black balls and 4 red balls. In how many ways can
3 balls be drawn from the box, if at least one black ball is to be included in the
draw?
Exercise
1. Find the values of 14C5, 10C8 and C(7, 2).
2. Find the number of ways of selecting 9 balls from 6 red balls, 5 white balls and 5
blue balls if each selection consists of 3 balls of each color?
3. In a deck of 52 cards, there are 4 aces. A combination of 5 cards have to be made
in which there is exactly one ace?
4. In how many ways can one select a cricket team of eleven from 17 players in
which only 5 players can bowl if each cricket team of 11 must include exactly 4
bowlers?
5. If 4 men are to be selected from 6 men and 3 women are to be selected from 5
women, how many ways can these people be arranged in a line if
a) There is no restriction?
b) The four men remain together?
c) A man is at the beginning of the line?
d) A man is at the beginning of the line and a woman is at the end of the line?
e) The men and women alternate?
Assignment IV
Determine n if
The Library of Science Book Club offers three books from a list of 42. If you
circle three choices from a list of 42 numbers on a postcard, how many
possible choices are there?
Problems
1. Find the coefficient of x9y3 in the equation of (2x-3y)12
Exercise
Assignment V
5. At Scrabble the letters QWYPKGDZXBM are left in the bag. In how many
3. Two coins are tossed, find the probability that two heads are obtained.
Note: Each coin has two possible outcomes H (heads) and T (Tails).
4. Two dice are rolled, find the probability that the sum is
a) equal to 1
b) equal to 4
c) less than 13
5. A die is rolled and a coin is tossed, find the probability that the die shows an
odd number and the coin shows a head.
6. Two cards have been drawn from the deck of 52 cards without replacing the
first one back. Find the probability of getting first card as king and second
card as queen
7. If a card is drawn at random from a deck of 52, what is the probability that it is
an ace?
8. Suppose a coin is tossed 5 times. What is the probability that there will be at
least 2 heads?
9. Calculate the probability of getting a) two heads or three heads and b) two
heads or two tails in six tosses of a coin.
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercise
1. A card is drawn at random from a deck of cards. Find the probability of
getting the 3 of diamond.
4. The blood groups of 200 people are distributed as follows: 50 have type A
blood, 65 have B blood type, 70 have O blood type and 15 have type AB
blood. If a person from this group is selected at random, what is the
probability that this person has O blood type?
5. A die is rolled and a coin is tossed, find the probability that the die shows an
odd number and the coin shows a head
Assignment VI
1. A die is thrown. Describe the following events:
a. A: a number less than 7
b. B: a number greater than 7
c. C: a multiple of 3
d. D: a number less than 4
e. E: an even number greater than 4
f. F: a number not less than 3
Also find AUB, AB, BUC, EF
4. When two dice are rolled, find the probability of getting a greater number on
the first die than the one on the second, given that the sum should equal 8
5. 4 six-sided dice are rolled. What is the probability that the numbers they show
are all different?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
2. A bag contains 12 white and 18 black balls. Two balls are drawn in succession
without replacement. What is the probability that first is white and second is
black?
4. A bag contains 21 toys numbered 1 to 21. A toy is drawn and then another toy
is drawn without replacement. Find the probability that both toys will show
even numbers
5. There are 10 counters in a bag: 3 are red, 2 are blue and 5 are green.
The contents of the bag are shaken before Maxine randomly chooses one
counter from the bag. What is the probability that she doesn't pick a red
counter?
6. A die is thrown once. What is the probability that the score is a factor of 6?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercises
There are three pink pencils, two blue pencils, and one green pencil. If one pencil
is picked randomly, what is the theoretical probability it will be blue?
If each section in each spinner is the same size, what is the probability of getting a
black truck?
Assignment VII
of the five edges of the pentagon. What is the probability that the number it
lands on is odd?
2. Each of the letters of the word MISSISSIPPI are written on separate pieces
of paper that are then folded, put in a hat, and mixed thoroughly.
One piece of paper is chosen (without looking) from the hat. What is the
probability it is an I?
3. A fair coin is tossed three times. What is the probability of obtaining one
Head and two Tails? (A fair coin is one that is not loaded, so there is an equal
chance of it landing Heads up or Tails up.)
5. The die has 8 equal faces marked with the numbers 1 to 8. If the die is
thrown once, what is the probability that the face that lands uppermost has a
prime number?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
2. 51 numbers are chosen from the integers between 1 and 100 inclusively. Prove
that 2 of chosen integers are consecutive.
4. Suppose that 4 cards labeled 1 to 4 are placed randomly into 4 boxes also labeled
1 to 4, one card per box. What is the probability that no card gets placed into a box
having the same label as the card?
5. If you have 7 pairs of parentheses then how many valid groups of them one can
make using catalan numbers?
5
6. Find
4
Exercise
1. Find the number of ways of putting 5 letters in the envelope in such a way that
no letter is being put in the right envelope.
2. Suppose that a professor has graded 4 tests for 4 students – student A, student
B, student C, and student D. However, the professor mixed up the tests when
handing them back, and now none of the students has the correct test. How
many ways could the professor have mixed them all up in this way?
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
8
4. Find
4
Assignment VIII
1. Given n letters and n addressed envelopes, in how many ways can the letters
be placed in the envelopes so that no letter is in the correct envelope?
2. How to use the Catalan numbers to count the number of rooted binary trees
with n internal nodes
12
5. Find
4
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
1
4. Expand
(1 5 x) 2
5. Write the probability Generating function for throw a die and toss a two coin?
Exercise
1. What is the generating function for the sequence 1, 4,6 4,1
1 x
2. Expand
(1 5 x) 2
3. Write the probability Generating function for throw two die and toss a coin?
Assignment IX
1. Write the Generating function for 1,-1,1,-1,1,-1,1….
3. Add
1 5x
5. Expand
(1 5 x) 2
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Problems
1. Expand
2. Let's say you are sorting mail, you have 5 letters from a credit card company,
one for each person and 5 mailboxes on the wall. How many ways are there
for every person to not receive the incorrect offer from the credit card
company? Assuming every offer is tailored to each individual.
3. Find a sequence of n = 4 parentheses that is not well-formed and a sequence
that is well-formed.
4. Find the well-formed sequences of parentheses of length 2n = 6.
5. A rooted binary tree is a tree with one root node, where each node has either
zero or two branches descending from it. A node is internal if it has two nodes
coming from it. How many rooted binary trees are there with n internal
nodes?
Exercise
1. Write the sequence for 2,0,2,0,2,0…
2. Calculate C10 ? (using Catalan numbers)
3. Calculate D9 (using Deranagments)
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Assignment X
1. Explain the concept of Polygon Triangulation?
3. Prove that the sum of the degrees of the vertices of any finite graph is even
with example
4. Find the indegree and outdegree of all vertex of following graph
5. Write the adjacent vertex and adjacent edges of all in the following graph
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercises
1. Find the Complement of given graph
4. In the following graph find the path, open walk, closed walk, trial
Assignment XI
1. Find the degree of every vertex of this graph. When two lines cross, but there
isn’t a dot, that does not count as a vertex, so this graph has only 6 vertices
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
4. From the following graph try to find the shortest path between all cities
2. For the following graph find U,, and Complement of two graphs
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
G: G':
b)
a) A snow plow starts at vertex 0 and must return to vertex 0 using a route
which visits each edge at least once and repeats a minimum number of
edges. Find such a route and how many repeated edges does it have?
Assume that the edges all have the length, say length 1.
b) Repeat doing question a. under the assumption that vertical edges have
length 1, horizontal edges have length 5, and the "diagonal edges" have
length 3.
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Exercise
What is the shortest route from 0 to 3? What is the shortest route from 0 to 8?
(Route length is the sum of the weights of the edges in the route. When no
weight is assigned to an edge the weight is assumed to be 1.)
2.
3. Draw the tree, If a coin is tossed and the number cube is rolled simultaneously
then the probability of getting head on the coin and the number 4
4. Draw a tree for following problem, A box has 1 red ball, 1 green ball and 1
blue ball, 2 balls are drawn from the box one after the other, without replacing
the first ball drawn. Use the tree diagram to find the number of possible
outcomes for the experiment
King Khalid University Lab Manual
Subject : Combinatorial
College of Computer Science
Analysis of Computer
Computer Science Program
Subject Code 236CSM-3
Assignment XII
1. The given two graphs G = (V1, E1) and G' = (V2, E2), Find (i) G U G',
(ii) G G', (iii) G G'
4. Identify the distance of each vertex from starting node by assuming each edge
has value 1.