I want to use nearest neighbor retrieval algorithm with my CBR application.What is the calculation that I can use ?

What is the calculation to check the similarity between problem case and the cases which are stored in case base.

I can't understand the calculation.I'm not good in mathematics.Please give me some examples to understand that.pls...