Hacker News new | past | comments | ask | show | jobs | submit login
Gray code at the pediatrician's office (plover.com)
48 points by eru on Oct 24, 2009 | hide | past | favorite | 8 comments



I don't think I had seen gray code shown graphically like that before. It reminded me of something like a cross between a Cantor Set and Feigenbaum Attractor, which are conveniently shown side by side here:

http://en.wikipedia.org/wiki/List_of_fractals_by_Hausdorff_d...


Gray code is beautiful.

If you like numbering systems, you should read the book `Purely functional datastructures' by Chris Okasaki. The book has nice chapters on the link between number systems and data structures.

Or see the lecture on Skew Binary Numbers (http://www.cl.cam.ac.uk/teaching/2004/IntroFuncProg/lecture0...) to get tho flavour.

(The PhD thesis on which it is based is available at http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf)


I'll check it out, thanks.


http://news.ycombinator.com/item?id=667689

It's an interesting article, and worth a repost.


Converting between gray code and binary is even easier than stated: take the XOR of adjacent bits. That's it.


That's the same as stated in the article: Obviously the XOR only changes stuff, when there's at least one 1 involved.


The link of the post leads just to all posts on math from Mark Plover's blog. Here is the link to the specific article in the title (so future viewers don't get confused):

http://blog.plover.com/math/gray-codes.html


Thanks. I did not think about the permanent link first.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: