Probability....!!

Go down

Probability....!!

Post  SwitchCase on Thu Sep 18, 2008 12:52 am

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!!!!

SwitchCase

Posts : 5
Join date : 2008-08-13

View user profile

Back to top Go down

Re: Probability....!!

Post  codecraft on Wed Oct 01, 2008 10:08 am

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!!
avatar
codecraft

Posts : 1
Join date : 2008-08-10

View user profile

Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum