All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Probability
Cubic Lattice (Posted on 2024-07-03) Difficulty: 3 of 5
In an infinite cubic lattice with points separated in x, y and z axis by one unit, a random walk starts from (0, 0, 0). Any of the 6 possible directions is equally likely at each step.

What is the probability of a return to the origin after 2*N moves?

No Solution Yet Submitted by K Sengupta    
No Rating

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution | Comment 1 of 3
Run all the possibilities through 8 moves. Only even number of moves can result in a return to the origin.

clearvars
global move psn hits tot

move=[0 0 1; 0 1 0; 1 0 0; 0 0 -1; 0 -1 0; -1 0 0];
hits=zeros(1,10); tot=zeros(1,10);
psn=[0 0 0]; accum = 0;
addon(1)
for i=2:2:8
  accum = accum+hits(i)/tot(i);
  fprintf('%2d %6d %7d %15.13f %15.13f\n',i,hits(i),tot(i),hits(i)/tot(i),accum);
end

function addon(wh)
global move psn hits tot
   for dir=1:6
     savepsn=psn;
     psn=psn+move(dir,:);
     if mod(wh,2)==0
       tot(wh)=tot(wh)+1;
       if isequal(psn,[0,0,0])
         hits(wh)=hits(wh)+1;
       end
     end
     if wh<8
       addon(wh+1);
     end
     psn=savepsn;
   end
end

                                             cumulative
2*n numerator  denominator   probability     probability
 
 2       6          36     0.1666666666667 0.1666666666667
 4      90        1296     0.0694444444444 0.2361111111111
 6    1860       46656     0.0398662551440 0.2759773662551
 8   44730     1679616     0.0266310871056 0.3026084533608
 
 The numerators are in A002896 in the OEIS and denominators 6^(2*n).


  Posted by Charlie on 2024-07-04 07:31:17
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (5)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information