You are presented with 12 marbles. You are told that 11 of them are identical, but one of them is either lighter or heavier than the others. You have a pair of scales - the old-fashioned sort that will only tell you whether the items placed on one end are heavier than, lighter than or the same mass as the items placed on the other end. You are allowed to use the scales three times, and no more.
How do you identify which marble is the odd one out, and whether it is lighter or heavier than the others?