a more cleaner brute force...not passing the probability to the recursive calls....
this leads to a cleaner DP implementation.
finally ...solved after long reading...
learnt how to format in java as we do in c++.