## 10 March 2013

### Algorithms

An algorithm is a formula used in computing science and mathematics. This formula is used for step-by-step calculations or reasoning.

I have recently become attached to a Facebook game called Candy Crush Saga and for the first time ever have actually bought Facebook credits to advance in the game. The interesting thing I've noticed is that when you buy special parts in the game (exploding candies, or candies that eliminate all of one color) the rest of the game board is fairly easy. Easy compared to not buying the special stuff I think. If I don't spend any money (and those credits are purchased with real money) the game boards are almost impossible to complete in the required number or moves.

And this led me to think: is there an algorithm that creates an easier overall game board if the user inputs Facebook credits? Conversely, is there an algorithm that creates much more difficult boards when the user is not inputting credits? If so, is this to influence people to spend money?

Another algorithm that I've been turning over in my mind is the Tim Horton's Roll Up The Rim contest. Each coffee in sizes small, medium, large, and extra large have a rim that you roll up. Under the rim is the prize or 'please play again' message. So far I have won three free coffees and S has won nothing (and he's had 23 cups so far). The prizes range from free donuts or coffees to one of 40 Rav4 vehicles. What I wonder is: are the prizes divided by coffee size or not?

Did Timmies calculate the percentage of popularity of size and distribute the prizes accordingly, or by total number of rims printed? Did they write the algorithm to print the prizes under (a guess of) 2 million rims regardless of size or did they take the two million possible winners and divide it according to popularity of size? As an example: let's say the most popular size is large and it sells 60% of all coffees. Does the algorithm then print 60% of the possible prizes under large cups only? So are my chances of winning any prize better if I choose the most unpopular size of small instead of large?

And will I ever stop gagging at the idea of drinking another cup of coffee? Will I ever like coffee again?

#### 1 comment:

Chantelle said...

I think that the makers of Candy Crush have done exactly what you've described: made it so that you have to spend money to get through the levels. It seems kind of shady that they did that, doesn't it?