I would like to generate a matrix whose dimension is L^2 and whose entries can be only in a finite set but in random positions in the matrix.
such as
M[b_]:=RandomReals[{0,b},{L,L}]
where b is an integer. However the latter gives random values in the range 0 to b, while I want only entries that can be only 0 or b....namely several b distributed randomly in the matrix and all the other elements 0.
Is this possible?