Hi, how would I improve the speed of finding probability of the occurency of each variable in a 2-dimenstional array? I am now currently using 4 for loops, it worked fine for small arrays like 3x3, but big one like 400x400, the program just basically runs on forever.

for example:
Code:
          int array[3][3]={
          {1,1,1},
          {2,1,3},
         {3,1,2}
         };

        probability for array[0][0]=5/9;
                      array[1][0]=2/9; and so...
Any suggestions or tips will be appreciated!