RandomBooleanArray(Integer length, Integer hammingWeight)

Samples a random boolean array of given length and given hamming weight. The hamming weight is the number of true values in the array and must be less than or equal to the length.

Parameters

  • Integer length - the length of the boolean array to be generated.
  • Integer hammingWeight - the number of true values in the boolean array.

Return type

Boolean[]

Examples

  • simpleRandomLocalClock2.lphy