« first day (4767 days earlier)      last day (442 days later) » 

 
6 hours later…
 
5 hours later…
 
3 hours later…
22:18
Hi. Welcome to stackoverflow. Number of permutations is definitely NOT M^N. For 2x2 matrix in your example, 2^2 = 4 is not 16 as you yourself have mentioned. Number of permutations is 2^(M*N). Also, this site is for programmers. math.stackexchange.com is much better suited for math questions. — NoShady420 23 secs ago

« first day (4767 days earlier)      last day (442 days later) »