Home #1 Mathematics In how many ways we can change an euro?
In how many ways we can change an euro? PDF Print E-mail
Written by Administrator   
Tuesday, 19 August 2008 15:51

The Euro (The European Currency) includes the following coins: 1¢, 2¢, 5¢, 10¢, 20¢ and 50¢.

In how many ways we can exchange 1 €?

 

The solution is completely equivalent to the solution for the dollar. However, because we have 2¢ coin, there are more combination.

I am listing here a BASIC program to solve this issue:

10 DIM C(20), P(100,20)
20 READ A,B
30 READ C9
40 FOR J=1 TO C9
50      READ C(J)
60 NEXT J
90 DATA 5,100
91 DATA 6,1,2,5,10,20,50
100 LET N=INT(B/A)
110 FOR I=0 TO N
120     LET P(I,1)=1
125 NEXT I
130 FOR J=2 TO C9
140     LET C = C(J)
150     FOR I=0 TO N
160     LET T=I*A
170     LET S=0
180     FOR X=0 TO T STEP C
190         LET T1 = T - X
200         LET S = S + P(T1/A,J-1)
210     NEXT X
220     LET P(I,J) = S
230   NEXT I
240 NEXT J
300 FOR J=1 TO C9
310    PRINT TAB(6*J); C(J);
320 NEXT J
330 PRINT
340 FOR I=1 TO N
350   PRINT I*A
360   FOR J = 1 TO C9
370       PRINT TAB(6*J); P(I,J);
380   NEXT J
390   PRINT
395 NEXT I
399 END

There are 4562 possibles ways to change 1 Euro, using 1¢, 2¢, 5¢, 10¢, 20¢ and 50¢

Данильченко Юрий отзывыотопление многоквартирного домаржд перевозки грузовsupport iqoption comнасосные станции водоснабженияспецпредложения морские круизыудилище купитьинструменты пиарскульптурирование лицасамый классный смартфонthe life of childless people is shorterбуковель дом аренда
Last Updated on Saturday, 23 August 2008 09:38