Archive for the ‘Algorithm’ Category

The cashier didn’t use a greedy algorithm!

2007 February 3

I just bought a Rp. 3,000 bread at Mirota Kampus. It’s a twelve slices plain bread that I use for three breakfasts. I gave Rp. 50,000, and the change was perfectly Rp. 47,000.

However, it is interesting that the cashier didn’t use a greedy algorithm. First she picked a Rp. 20,000, then two Rp. 10,000s, then a Rp. 5,000, and lastly two Rp. 1,000s. I swear that there are still piles of Rp 20,000s, so she could’ve gave me 2 x Rp. 20,000 + Rp. 5,000 + 2 x Rp. 1,000 as greedy algorithm would dictate.

I could imagine the cause…

Mirota Kampus Cashier Job Vacancy

We are looking for individuals with the following qualifications:

  • Female
  • Aged 17-25
  • Attractive looking
  • Honest, hard-working, and not greedy