Random Sample Generator

Generate random samples using various sampling methods

Sampling Method

Parameters

Options

Help

Simple Random Sampling

Each member of the population has an equal probability of being selected. This is the most basic form of random sampling.

Use case: When the population is homogeneous and you want every member to have an equal chance of selection.

Example: Selecting 100 random customers from a database of 10,000 customers.

Systematic Sampling

Select every kth element from the population after a random starting point. The interval k is calculated as: k = population_size / sample_size.

Use case: When you have an ordered list and want to ensure even coverage across the entire population.

Example: Selecting every 10th person from a list of 1,000 people to get a sample of 100.

Stratified Sampling

Divide the population into homogeneous subgroups (strata) and randomly sample from each stratum proportionally.

Use case: When the population has distinct subgroups and you want to ensure each subgroup is adequately represented.

Example: Sampling from different age groups, ensuring each age group is represented proportionally in the sample.

Output Format
  • Sample Indices: Zero-based indices of selected elements (e.g., [0, 5, 12, ...])
  • Sample Size: Actual number of samples generated
  • Sampling Rate: Percentage of population sampled
  • Distribution Chart: Visual representation of sample distribution across population
Random Seed

Using a random seed allows you to reproduce the same sample. This is useful for:

  • Reproducible research and analysis
  • Debugging and testing
  • Sharing methods with colleagues who need the same sample

Note: The same seed with the same parameters will always produce the same sample.