Please read before you get to the code. So that you understand the basics before you try to come up with an example or code.
As the example you have given we would not need map reduce directly,
you can make an example out of it however for your understanding, however it will be much more complex compared to wordcount example
Gartner says :Bigdata will be most advanced analytics products by 2015 !
Time to Become Big data architect by learning Hadoop(Developer,
Mahout, Splunk,R etc) from scratch to expert level