Front Office Football Central  

Go Back   Front Office Football Central > Archives > FOFC Archive
Register FAQ Members List Calendar Mark Forums Read Statistics

Reply
 
Thread Tools
Old 01-20-2004, 11:04 PM   #1
Karim
College Starter
 
Join Date: Oct 2000
Location: Calgary
OT: Elementary Math Problem

The concept is simple. Payment is made that exceeds the bill. Determine the least amount of coins and bills required to make change.

Solving the problem isn't what I'm after as a recursive solution works. What I'm wondering is if there is a general formula that works regardless of the amount paid or the cost of the bill? Could it be done without introducing a new variable for each type of coin and bill?

Karim is offline   Reply With Quote
Old 01-20-2004, 11:17 PM   #2
Chubby
Grizzled Veteran
 
Join Date: Oct 2000
Location: Syracuse, NY
umm my head

As a cashier for 2 years in HS, I got to be pretty good at making change...
Chubby is offline   Reply With Quote
Old 01-20-2004, 11:22 PM   #3
ntndeacon
Pro Starter
 
Join Date: Apr 2003
Location: Alabama
Sounds like an optimmization problem to me. not sure how simple a general fomula would have to be.
ntndeacon is offline   Reply With Quote
Old 01-21-2004, 12:36 AM   #4
Draft Dodger
Coordinator
 
Join Date: Jan 2001
Location: Keene, NH
there's a flaw in my math somewhere - but the below excel formula works for many amounts

anyways, replace 'a1' with your amount and this will calculate the number of coins you need in most cases. not sure why some numbers don't work right...

C=INT(A1/0.25)+INT((A1-((INT(A1/0.25))*0.25))/0.1)+(INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1))/0.05))+(INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1)-((INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1))/0.05))*0.05))/0.01))
__________________
Mile High Hockey
Draft Dodger is offline   Reply With Quote
Old 01-21-2004, 01:21 AM   #5
Sun Tzu
Pro Starter
 
Join Date: Dec 2003
Location: In the thick of it.
Quote:
Originally Posted by Draft Dodger
C=INT(A1/0.25)+INT((A1-((INT(A1/0.25))*0.25))/0.1)+(INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1))/0.05))+(INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1)-((INT((A1-((INT(A1/0.25))*0.25)-((INT((A1-((INT(A1/0.25))*0.25))/0.1))*0.1))/0.05))*0.05))/0.01))

If any of you out there have been wondering if Draft Dodger is an Alien from outer space, I think you have your answer right there.
__________________
I'm still here. Don't touch my fucking bacon.
Sun Tzu is offline   Reply With Quote
Old 01-21-2004, 01:45 AM   #6
sterlingice
Hall Of Famer
 
Join Date: Apr 2002
Location: Back in Houston!
Quote:
Originally Posted by Sun Tzu
If any of you out there have been wondering if Draft Dodger is an Alien from outer space, I think you have your answer right there.

Looks a lot like the stuff I was messing with last night (lots of nested IFs). Then again, this just required a case statement in Excel to look prettier.
=IF($O2=17,D2*1.76,IF($O2=18,D2*1.53,IF($O2=19,D2*1.33,IF($O2=20,D2*1.21,IF($O2=21,D2*1.11,IF($O2=22,D2*1.1,IF($O2=23,D2*1.05,D2)))))))

SI
__________________
Houston Hippopotami, III.3: 20th Anniversary Thread - All former HT players are encouraged to check it out!

Janos: "Only America could produce an imbecile of your caliber!"
Freakazoid: "That's because we make lots of things better than other people!"


sterlingice is offline   Reply With Quote
Old 01-21-2004, 01:47 AM   #7
Karim
College Starter
 
Join Date: Oct 2000
Location: Calgary
Cool. Thanks, guys!
Karim is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump


All times are GMT -5. The time now is 10:25 PM.



Powered by vBulletin Version 3.6.0
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.