A country uses coins with values of 1 peso, 2 pesos, 5 pesos, and 10 pesos and bills with values of 5 pesos, 10 pesos, 20 pesos, 50 pesos, and 100 pesos as its currency. Find a recurrence relation for the number of ways to pay a bill of n pesos if the order in which the coins and bills are paid matters.

Respuesta :

Answer:

An = A(n−1) + A(n−2) + 2 A(n−5) + 2 A(n−10) + A( n−20) + A(n−50) +A (n−100)  

Step-by-step explanation:

given data

coins currency values = 1 peso, 2 pesos, 5 pesos, and 10 pesos and bills with values of 5 pesos, 10 pesos, 20 pesos, 50 pesos, and 100 pesos

solution

we take here 1 pays a certain amount of pesos n

so we get here recurrence relation that is express as here

when here 1 pays

To pay 1 peso                 so then n-1 peso

To pay 2 peso                so  then n-2 peso,  when n≥2

To pay 5 peso                so then n-5 peso,  when n≥5

To pay 10 peso               so then n-10 peso,  when n≥10

To pay 5 peso bill           so then n-5 peso,   when n≥5

To pay 10 peso bill         so then n-10 peso,   when n≥10

To pay 20 peso bill         so then n-20 peso,  when n≥20

To pay 50 peso bill         so then n-50 peso,  when n≥50

To pay 100 peso bill       so then n-100 peso,  when n≥100

so that here we take A(o) = 1

and we take here  n-1, n-2, n-3, n-4  ........ are subscript of A when we take patterns for every part of recurrences

so recurrence relation

A(n) = A(n-1) + A(n-2) + A(n-5) + A(n−10) + A(n-5) + A(n-10) + A(n−20) + A(n−50) + A(n−100)

simpyfy it we get

An = A(n−1) + A(n−2) + 2 A(n−5) + 2 A(n−10) + A( n−20) + A(n−50) +A (n−100)    for n≥101