Given a n*n matrix where when we travel horizontally(i.e from one column to another) the starting probablity to reach a point initially is 90% and eventually it keeps reducing by half. When we traverse vertically the probablity initially is 50% and eventually it keeps reducing by half. Find the total probablity to traverse the given path.
Path: (0 1) -> (0 2) -> (1 2) -> (2 2) -> (2 1)
90% 45% 22.5%
Input : [ (0,0) (0 1) (0 2) 50%
(1,0) (1 1) (1 2) 25%
(2,0) (2 1) (2 2) ] 12.5%
For e.g : Probability to travel from 0,1 -> 0,2 is 22.5%, for 0,2 -> 1,2 is 25 % , from 1,2 to 2 2 is 12.5% and so on.