Probability....!!
2 posters
Page 1 of 1
Probability....!!
You are given a value n.
This represents nXn Chess Board.
Im sure you all know how a knight moves on a chess board.
You will be given a starting position for the knight (x,y)
With 1,1 being the bottom left corner.
Now, a knight can jump over other pieces and can thus make J number of jumps.
Given n, x,y, J
Find the probability that after J jumps the knight is still on the Board.
(The knight is said to be outside a board, if a jump causes it to move out of the nXn grid)....
Happy Codin!!!!
This represents nXn Chess Board.
Im sure you all know how a knight moves on a chess board.
You will be given a starting position for the knight (x,y)
With 1,1 being the bottom left corner.
Now, a knight can jump over other pieces and can thus make J number of jumps.
Given n, x,y, J
Find the probability that after J jumps the knight is still on the Board.
(The knight is said to be outside a board, if a jump causes it to move out of the nXn grid)....
Happy Codin!!!!
SwitchCase- Posts : 5
Join date : 2008-08-13
Re: Probability....!!
well...
i think the solution will be like this..
For the nXn board for every point we find the probability of stayin on board if the knight was at that position...
Therefore there will be an array of nXn.
For each jump the probability will get added up since.. the knight can jump to point 1 OR point 2 OR.... so on.
Thus there will be Jump no. of boards...!!
To solve this we will need a JUMP X n X n matrix...
For jump =0, we will fill the initial probability and for every consecutive possible jumps we will keep adding it.
The final ans. will be the reqd probability!!
i think the solution will be like this..
For the nXn board for every point we find the probability of stayin on board if the knight was at that position...
Therefore there will be an array of nXn.
For each jump the probability will get added up since.. the knight can jump to point 1 OR point 2 OR.... so on.
Thus there will be Jump no. of boards...!!
To solve this we will need a JUMP X n X n matrix...
For jump =0, we will fill the initial probability and for every consecutive possible jumps we will keep adding it.
The final ans. will be the reqd probability!!
codecraft- Posts : 1
Join date : 2008-08-10
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum