A selection of algorithms for computing the nth Fibonacci Number

A selection of algorithms for computing the nth Fibonacci Number

One of these algorithms even gets as fast as O(\log n)! Very impressive.

Advertisements

Weighing The Gold Coins (Brain Teaser)

image

You have 10 bags with 10 gold coins each. Nine bags have genuine coins that weigh 10g each, but one bag has fake coins that are only 9g each. Using a digital scale and only one weighing, how do you figure out which bag has the fake coins?

Post your answers in comments below!