Follow this blog by Email

Sunday, 14 July 2013

                        function(function(n))=...

Read this very interesting puzzle recently. It can be viewed from many different perspectives - mathematics, signal processing , computer science program; So whatever stream you are comfortable with, you can try to solve this one from that perspective and using the tools and concepts in that stream.

Implement a function h(n) as below:

h(h(n)) = -n

I was able to wrote a C programming language solution for it. 
Will post it here soon.

No comments: