aspose file tools*
The moose likes Programming Diversions and the fly likes correct change for a bus fare. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "correct change for a bus fare." Watch "correct change for a bus fare." New topic
Author

correct change for a bus fare.

Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
This is one I found in an old math book (you can tell by the cost of a bus ride). I never did find the answer (only even questions were in the back of the book). Maybe someone can figure it out.
A man gets on a bus without the 5 cent fare and hands the driver a one dollar bill. The drive says he can not make change for a dollar, but if the passenger had a five dollar bill, then he could change that. How could this happen.
fred rosenberger
lowercase baba
Bartender

Joined: Oct 02, 2003
Posts: 11411
    
  16

don't know the answer, but here are a few thought...
1) did there used to be different denominations of coins minted (i don't think so, but it never hurts to ask)? what country is this in, and what coins do they have? for example, in Canada, there is a $2 coin, but in the U.S. there is not.
2) also, if the man only has $1, he's owed $0.95. but if the man has a $5, he could be owed $4.95 OR $5.95 (if he gives the driver both bills).
3) if we work all in pennies, we're looking at 95 and 495.
prime factorization of 95 is 5 * 17
prime factorization of 495 is 3 * 3 * 5 * 11
prime factorization of 595 is 5 * 7 * 17
i don't know if any of these help, but it's something to play with.
[added another thought]
[ March 19, 2004: Message edited by: fred rosenberger ]

There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
Are we in the US? With standard denominations?


Spot false dilemmas now, ask me how!
(If you're not on the edge, you're taking up too much room.)
Bob Travis
Greenhorn

Joined: Mar 20, 2004
Posts: 1
The driver might have only 99-cent pieces available for change....
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
The country is the United States.
There was a 3 cent coin before the Civil war. It was made of silver and about the size of a dime. In fact, that was its demize, too many people confused it with a dime. I would be surprised if any of them were in circulation in the 1950's, the likely publishing date for the math book.
1) did there used to be different denominations of coins minted (i don't think so, but it never hurts to ask)? what country is this in, and what coins do they have? for example, in Canada, there is a $2 coin, but in the U.S. there is not.

.01, .05, .10, .25, .50, 1.00, 2.00 are the only currency that I can think of(the last two being bills). Of course there were mills (.001 - red plastic, .005 - green plastic , .010 - purple , .025 - gray tin :confused : ). But these seem unlikely for this situation.
[ March 21, 2004: Message edited by: Sonny Pondrom ]
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
I suppose you could contend that "breaking a five" is different than "giving change for the bus fare". So, for instance, there are many ways in which the driver could give correct change to "break a fiver" without having the ability to give exactly 95 cents.
Yuriy Grechukhin
Ranch Hand

Joined: Jan 16, 2004
Posts: 41
Originally posted by Sonny Pondrom:
Of course there were mills (.001 - red plastic, .005 - green plastic , .010 - purple , .025 - gray tin :confused : ). But these seem unlikely for this situation.
[ March 21, 2004: Message edited by: Sonny Pondrom ]

Mills? Haven't heard of them. Can you tell more (this is not relation to the question, just curiousity )?


The sword of destiny has two blades, one of them is you.
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
Originally posted by Bert Bates:
I suppose you could contend that "breaking a five" is different than "giving change for the bus fare".

Yes, getting change for a five would not help pay the 5 cent fare.
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
Originally posted by Yuriy Grechukhin:

Can you tell more (this is not relation to the question, just curiousity )?

In the 1950's, at least in the St. Louis area, sales taxes were low.
Very low. As a result, store owners would collect taxes as low as 1/1000 dollars. Your change could include plactic coins the size of a quarter with differing values (red, green, and other colors were used for .001, .005 and up). 10 red mills = 2 green = 1 penny.
I may be recalling some of this incorrectly.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8829
    
    5
well, this would work if we still had 3 cent pieces... you can do 4.95 in three cent pieces alone - but you can't do 95 cents if all you have is 3 cent pieces...
Yuriy Grechukhin
Ranch Hand

Joined: Jan 16, 2004
Posts: 41
May be 15-cent coins?
4.95 is divisible by .15, but 1.95 is not...
I couldn't find any info whether U.S. ever had 15 cent coins, but apparently Bahamas do
http://www.centralbankbahamas.com/bank_coins.lasso
Sonny Pondrom
Ranch Hand

Joined: Jun 05, 2001
Posts: 128
Originally posted by Yuriy Grechukhin:
May be 15-cent coins?

Definately the right answer in the Bahamas. In the US, it is probably the 3 cent coin (but 5 times as many) ;-)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: correct change for a bus fare.