Entries tagged as card tricks

Tuesday, January 15. 2013

My interview contact had warned me that I would be asked about the complexity of my algorithms. I remember "big-O" notation, and I think I know how to calculate it, but just in case I checked online again. It really is pretty simple... as long as you don't get recursive. It's basically O(n) for loops, O(n*n) for embedded loops, and O(log n) if you can divide the problem up so you don't have to calculate every friggen' value. There are lots of resources online; you can find them by searching for "algorithm complexity".

You choose five cards from a standard 52-card deck. No forcing, no tricks: you honestly choose any five cards. You hand them to me; I pick one and hand it back to you. I re-order the remaining four cards and hand them, all face-down, to my wife, Eri. She looks at them and tells you what your card is.

No sleight-of-hand or other trickery is used. I encoded the suit and rank of your card entirely in the order of the four cards I handed to Eri.