Results 1 to 2 of 2

Math Help - MatLab- Find least number of coins using REM and FIX functions

  1. #1
    Newbie
    Joined
    Mar 2010
    Posts
    1

    Post MatLab- Find least number of coins using REM and FIX functions

    I have a matrix from 1 to 99 called ChangeDue. It represents change from 1 cent to 99 cents. I want to compute the number of quarters, dimes, nickels, and pennies that will equal the Change Due using the least number of coins.

    I want to use the FIX and REM functions. If i do fix(ChangeDue/25) i will get a matrix of the number of quarters that can be used up to 99 cents. Similarly, fix(ChangeDue/1) will give me the number of pennies that can be used.

    So I can I combine finding pennies, nickels, dimes and quarters into one process to give me least number of coins possible?
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Grand Panjandrum
    Joined
    Nov 2005
    From
    someplace
    Posts
    14,972
    Thanks
    4
    Quote Originally Posted by stimulisrk View Post
    I have a matrix from 1 to 99 called ChangeDue. It represents change from 1 cent to 99 cents. I want to compute the number of quarters, dimes, nickels, and pennies that will equal the Change Due using the least number of coins.

    I want to use the FIX and REM functions. If i do fix(ChangeDue/25) i will get a matrix of the number of quarters that can be used up to 99 cents. Similarly, fix(ChangeDue/1) will give me the number of pennies that can be used.

    So I can I combine finding pennies, nickels, dimes and quarters into one process to give me least number of coins possible?
    Use the greedy algorithm. Also look at the wording of this; it is not clear what this ChangeDue matrix is or contains.

    CB
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Replies: 2
    Last Post: March 12th 2011, 12:15 PM
  2. Find Coins of Each Type
    Posted in the Algebra Forum
    Replies: 2
    Last Post: October 7th 2010, 09:00 AM
  3. Matlab prime number with no built in functions
    Posted in the Math Software Forum
    Replies: 1
    Last Post: March 24th 2010, 01:41 PM
  4. If 4 coins are tossed, find the probabilities
    Posted in the Statistics Forum
    Replies: 2
    Last Post: September 28th 2009, 04:12 PM
  5. number of coins
    Posted in the Algebra Forum
    Replies: 1
    Last Post: June 20th 2007, 10:25 AM

Search Tags


/mathhelpforum @mathhelpforum