background preloader

Logic

Facebook Twitter

Practical Foundations of Mathematics. Group theory book. Pyke - python AI. Delightful Puzzles " Reflections. 1. Chameleons — On an island live 13 purple, 15 yellow and 17 maroon chameleons. When two chameleons of different colors meet, they both change into the third color. Is there a sequence of pairwise meetings after which all chameleons have the same color? 2. Pebble Piles — You are given three piles with 5, 49 and 51 pebbles respectively. Two operations are allowed: (a) merge two piles together or (b) divide a pile with an even number of pebbles into two equal piles. Is there a sequence of operations that would result in 105 piles with one pebble each? 3. 4. 5. 6. 7. 8. 9. 10. 11.

There is an unmarked grave and two tall oak trees. A party of sailors reached the island. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. f(f(x)) = -x — Is it possible to write a function int f(int x) in C that satisfies f(f(x)) == -x? 34. A perfect in-shuffle of a deck of 52 cards is defined as follows. 35. 36. 37. 38. Google Top Interview Puzzles Part - 1. SKI combinator calculus. SKI combinator calculus is a computational system that may be perceived as a reduced version of untyped lambda calculus. It can be thought of as a computer programming language, though it is not useful for writing software. Instead, it is important in the mathematical theory of algorithms because it is an extremely simple Turing complete language. All operations in lambda calculus are expressed in SKI as binary trees whose leaves are one of the three symbols S, K, and I (called combinators).

In fact, the symbol I is added only for convenience, and just the other two suffice for all of the purposes of the SKI system. Although the most formal representation of the objects in this system requires binary trees, they are usually represented, for typesetability, as parenthesized expressions, either with all the subtrees parenthesized, or only the right-side children subtrees parenthesized. Informal description[edit] The evaluation operation is defined as follows: I returns its argument: Ix = x Iβα.