3 ms·
Hashing functions are cool and all, but let's talk about that groovy "Cocktail Oracle" he invented. It's basically a clever physical representation of bitwise a
by munificent 9y ago
Hashing functions are cool and all, but let's talk about that groovy "Cocktail Oracle" he invented. It's basically a clever physical representation of bitwise arithmetic.
The oracle works with bit strings all of the same length. Each bit position represents a single cocktail.
Each ingredient card is a bit string. Each bit is 1 (opaque) if the ingredient is needed for the cocktail at that bit position.
You take all the ingredients you have and discard their bitstrings ("turn down their cards"). Then you or together the remaining bitstrings of all of the ingredients you don't have (look through their overlapping cards). In other words, not having an ingredient forbids certain cocktails. Any bit positions that remain zero (transparent all the way through to the key card on the back showing the names of the cocktails at each position) are cocktails that you have enough ingredients to make.
Using opacity to represent bitwise "or" is pretty clever. Turning down the ingredient cards you don't have is really clever. I kind of want to make one of these now.
- Sniffnoy 9y agoI mean this is really about set operations; thinking of it in terms of bits and integers doesn't really add anything.
- munificent 9y agoThe mechanics do matter because it's fundamentally a mechanical device.
- Sniffnoy 9y agoWhat about it involves thinking of elements as bits and sets as whole numbers? I'm not seeing it. Everything you just described is just a physical representation of sets and operations on sets. I don't see any step where elements are mapped to powers of 2 and added up (unless you for some reason insist on thinking that way of aggregating elements into a set), nor any step where a number is broken into bits (again, unless you for some reason insist on thinking that way of breaking a set into its elements).
- munificent 9y ago> What about it involves thinking of elements as bits and sets as whole numbers? I said bitwise arithmetic, not binary numbers. :) > Everything you just described is just a physical representation of sets and operations on sets. Sure, and how is the set represented and its operations implemented? In the Oracle, each set is represented by a bitmask with a bit position for each element in the set. Set operations are implemented as bitwise operations on those bitmasks.
- spenczar5 9y agoI’m more used to bits than sets, so it worked for me. People have different backgrounds.
- theoh 9y agoSee https://en.wikipedia.org/wiki/Zygalski_sheets https://en.wikipedia.org/wiki/Zygalski_sheets for a similar system.