Professional Documents
Culture Documents
National University of Computer and Emerging Sciences Lahore Campus
National University of Computer and Emerging Sciences Lahore Campus
Lahore Campus
MT 217: Discrete Structures
(a) Three men with different nationalities and with different jobs live in consecutive houses on a
street. They have different favorite drinks and their house colors are different too. Given the
following clues, who lives in the blue house and what is the profession of the Pakistani?
The Bangladeshi does not drink water. The Indian is a doctor. Tea is drunk in the green house.
The engineer lives in the house on the extreme left. Green house is located on the extreme right.
Water is drunk in the middle house. The businessman lives in the red house.
(b) Write the quantification “There exists a unique x such that P(x)” using universal and existential
quantifications and logical operators.
(c) Prove that at least one of the real numbers a1, a2 , …, an is greater than or equal to the average of
these numbers. What kind of proof did you use?
_______________________________
(b) Solve the recurrence relation in part (a).What is the Big-O complexity of your solution?
(c) Prove the correctness of your solution for part (b) using induction. (Note that your solution to part
(b) is a function of n which tells how many steps the algorithm takes to sort n numbers)
_______________________________
For a change the government decides to start high-speed bullet trains among some of the cities of
Pakistan. For that a new rail track is needed. The following figure shows the cities to be connected using
the new bullet train track and the distances (in kilometers) among them.
60 Swabi
180
Peshawar
250 Rawalpindi
Sargodha 320
Gujranwala
200
60 70
Lahore
Faisalabad
110
a) Find an optimal network of rail tracks connecting every city in the figure above such that the total
length of the tracks on that network is the minimum.Which method will you use?
b) Which route should be taken to travel between Peshawar and Lahore such that the total distance
on that route is the minimum.Which method will you use?
_______________________________
THE END