--- title: "Puzzle of the Month" type: "article" slug: "puzzle-of-the-month" url: "http://localhost/article/puzzle-of-the-month/" markdown_url: "http://localhost/article/puzzle-of-the-month.md" published_at: "2026-11-03T17:31:40+00:00" modified_at: "2026-11-03T17:31:41+00:00" featured_image: url: "http://localhost/wp-content/uploads/2022/04/20230809-041332.jpg" excerpt: "I have a bag of 100 coins, containing penny, dime and half-dollar denominations. Total value is $5 (five dollars). Write a program for our computers to find how many of each type of coin??? Solution of the Puzzle of the Month We will assume the bag to contain x pennies, y dimes and z halfdollars.…" post_tag: - name: "Full Text" slug: "fulltext" taxonomy: "post_tag" url: "http://localhost/tag/fulltext/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" - name: "Type-in program" slug: "type-in-program" taxonomy: "post_tag" url: "http://localhost/tag/type-in-program/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "Cedric Bastiaans" slug: "bastiaans-cedric" taxonomy: "indiv" url: "http://localhost/indiv/bastiaans-cedric/" publication: "Time Designs Magazine" publication_r: id: 10277 title: "Time Designs Magazine" type: "periodical" url: "http://localhost/periodical/time-designs-magazine/" authors: "Cedric R. Bastiaans" volume: "3" issue: "6" issues_articles: - id: 26784 title: "Time Designs Magazine v3 n6" type: "issue" url: "http://localhost/issue/time-designs-magazine-v3-n6/" pages: "11, 14" pubdate: "September/October 1987" archive_link: false volumeissue: "v3n6" --- # Puzzle of the Month I have a bag of 100 coins, containing penny, dime and half-dollar denominations. Total value is $5 (five dollars). Write a program for our computers to find how many of each type of coin??? ### Solution of the Puzzle of the Month We will assume the bag to contain x pennies, y dimes and z halfdollars. There can not be less than 10 pennies (the total value of the bag would never come to an even $5). For the same reason, x can only increment by 10 and the maximum for x is 90. The number of dimes is limited to 44 so as to leave room for 10 pennies and 1 half-dollar. And it would still not be a solution, since there would be only 55 coins to total $5! In a similar reasoning, z can not be more than 9 and probably much less. Thus we write the following program: ``` 10 FOR X=10 TO 90 STEP 10 20 FOR Y=1 TO 44 30 FOR Z=1 TO 9 40 REM SUM: LET S=X+Y+Z 50 REM VALUE: LET V= X+10*Y+50*Z 60 IF S=100 AND V=500 THEN PRINT X;" PENNIES"';Y;" DIMES"';Z;" HALFDOLLARS" 70 NEXT Z 80 NEXT Y 90 NEXT X 100 STOP ``` In about a minute, your TS2068 will print the answer: ``` 60 pennies = $0.60 39 dimes = $3.90 1 half$ = $0.50 ------------------- 100 coins = $5.00 ```