Random Integer Matrix Generator

Generate a rectangular integer matrix with explicit dimensions and inclusive cell bounds.

Description

Generate a rectangular matrix with independently sampled integer entries and verified row and column counts.

A matrix is a rectangular row-and-column array. Discrete uniform sampling selects integer values within specified bounds; a matrix-valued output repeats that selection across its cells.1

The result contains matrix as an array of rows, plus rows and columns. The input bounds are inclusive, unlike the default upper-exclusive interval used by some external random-number APIs. The implementation here uses its own arithmetic rather than NumPy.

When to use Random Integer Matrix Generator

Use it for integer-matrix exercises or numeric array fixtures with explicit dimensions and entry bounds.

How to use Random Integer Matrix Generator and understand its results

  1. Enter integer rows and columns from 1 through 64.
  2. Enter safe-integer minimumValue and maximumValue with minimum no greater than maximum, then run.
  3. Read matrix in row-major order and check the returned dimensions before passing it to another operation. Use moderate value ranges when exact discrete sampling is important.
entry = minimumValue + floor(randomDraw × (maximumValue − minimumValue + 1))

One draw per cell consumes rows × columns draws, with both bounds intended to be inclusive.

The implementation builds each row from independently sampled cells, then calls the matrix-dimensions tool and returns its verified row and column counts. No symmetry, sparsity, or diagonal condition is imposed.

json
{
  "input": {
    "rows": 3,
    "columns": 4,
    "minimumValue": -9,
    "maximumValue": 9
  },
  "randomDraw": 0.25,
  "output": {
    "columns": 4,
    "matrix": [
      [
        -5,
        -5,
        -5,
        -5
      ],
      [
        -5,
        -5,
        -5,
        -5
      ],
      [
        -5,
        -5,
        -5,
        -5
      ]
    ],
    "rows": 3
  }
}

A 1 × 1 matrix is valid. Equal bounds make every entry constant but still consume a draw for each cell. Reversed bounds, dimensions outside 1–64, noninteger bounds, and invalid draws fail.

Limitations and assumptions

The default source is Math.random; no seed input or cryptographic entropy guarantee is provided. Repeated runs may select the same result, and the distribution depends on the random source.

No rank, invertibility, symmetry, positive-definiteness, uniqueness, or nonzero-count property is guaranteed. Rectangular shapes are allowed.

Although the endpoints must be safe integers, a very wide interval can make range-width arithmetic exceed exact integer precision. Floating-point rounding can distort sampling near the limits; moderate bounds avoid this issue.

Alternative or Complementary methods

Use the symmetry generator for a mirrored square matrix or the dimensions tool to inspect an array you already have.

References

  1. NumPy Reference: Generator.integers — NumPy Developers

Similar or alternative tools

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies