How can I make a function that creates a particular size 2D matrix that determines True
or False
if a random value between 0
and 1
is at or below a certain number? Below is what I have written but when I put in values all I get is a column of trues
.
initializeGrid[rows_Integer, columns_Integer, value_] :=
Module[{table, booleanTable},
table = Table[RandomReal[], {r, rows}, {c, columns}];
booleanTable = BooleanTable[x <= value, table];
Return[booleanTable]
]