Sei sulla pagina 1di 6

visit www.mantul.

com for more mca assignments


visit www.mantul.com for more mca assignments

s
visit www.mantul.com for more mca assignments
visit www.mantul.com for more mca assignments

Hint:

Shortest path is = abdf

Question 3.

a) A palindrome is a word that reads the same whether read from right to left
or from the left to right, the word ROTOR, for example. Let be the number
of words of length n, not necessarily meaningful, which are palindromes.
We consider a single letter as a palindrome.

i)What are and?

ii)Set up a recurrence for .

iii)Check that

Is the solution to the recurrence?


(10 Marks)
visit www.mantul.com for more mca assignments

b) Show that a tree has at least 2 vertices of degree 1.


(5 Marks)

Case 2: v!= ui, for any i

v f u0,u1,….un a path of length (n+1)

There for T is not the longest path a contradiction.


visit www.mantul.com for more mca assignments

There for our assumption d(u0) > 1 is wrong

There fore d(u0) = 1

Hence we have more vertex of degree 1

So, T has at least two vertex of degree 1.

c) Raghu goes to a grocery shop and purchases grocery for Rs. 23. He has 3 five rupee coins, 4 two rupee
coins and 6 one rupee coins. In how many ways can he pay the shop keeper? Find a solution using
generating functions.
(5 Marks)

Hint:

there are three 5 Rs coin = 15 Rs.

4 two rupee coins = 8 Rs.

6 one rupee coins = 6 Rs.

Total 11 coins and worth Rs. 29.00

The general function is [ x10 + x15 ] ( x2 + x4 + x6 + x8 )( x + x2 + x3 + x4 + x5 + x6)the coefficient of x23 in the above
equation will give the solution

X10 .x8 . x5. = x23

X 15 .x8 = x23

X15 .x4 . x4 = x23

X15 .x2 .x6 = x23

X15 .x6. x2 = x23

There for ther are five way to pay Rs. 23

Potrebbero piacerti anche