I have two matrix
x={{2, 3, 4}, {3, 4, 5}, {4, 5, 6}};
probability={{0.09, 0.09, 0.12}, {0.09, 0.09, 0.12}, {0.12, 0.12, 0.16}};
Now I want to add up corresponding position probability. for example,
$\Pr(x=3)=0.09+0.09$
$\Pr(x=4)=0.12+0.09+0.12$
I tried Position
k = Position[x, 3];
(* {{1, 2}, {2, 1}} *)
but they can not directly use
x[[k]]
Which command should I use?