# Thread: Any kind of advice and help is more than welcomed

1. ## Any kind of advice and help is more than welcomed

I AM A DUMMY, PLEASE MAKE IT SIMPLE- Thanx

You have an (arbitrary) set of coins C which have integer values. The only restrictions on C are:
a) All the coins have positive integer values
b) C must contain the coin of value 1

The problem to be solved is to specify the minimum number of coins which can be used to make up a given amount of change.

For example suppose that C = {1, 3, 7, 10} and you are asked to make up 25. You can do this in various ways:

10 + 10 + 3 + 1 + 1
10 + 10 + 1 + 1 + 1 + 1 + 1
10 + 7 + 7 + 1
7 + 7 + 7 + 3 + 1
…….and so on…….

As it turns out the solution 10+7+7+1 is optimal in this case.

I need to build two different solutions to the giving change problem:

•simple greedy algorithm (always take the largest coin available)
•stochastic search (take coins at random)

ANY IDEA HOW TO START.

2. I AM A DUMMY, PLEASE MAKE IT SIMPLE
Well the simplest way would be using for loops and if statements.

Make an array for your coin set.

You could do something like this

Code:
```#define PENNY  0
#define NICKEL 1
#define DIME   2

int Change[3] = {1, 5, 10};```
Then you would use a loop and keep checking values.

you could say "if change[dime] + change[dime] is > than the value, try change[dime] + change[nickel]"

Thats the easiest way I can think of.

3. Ok... I will try this one. Thanks alot. I let you know.