Generate Binomial random counts

Create simulated values from a chosen probability model, with a fixed seed when you need to repeat the sample.

Guides · Worksheets and data tools · 4 min read

Example: nonconforming items per tray

Simulate 200 trays of 50 items. Each item has a supplied 4% probability of being nonconforming, independently of the other items.

Download the generator parameters (reference CSV)

This is the same example used in Help. The CSV lists the generator parameters for reference. Enter them manually on Inputs; importing the CSV does not configure the generator or provide measured observations.

1. Create the generator

In the sidebar, choose Data utilities, then Create Random Data. Name the analysis, select New blank worksheet and choose Create analysis. This worksheet receives the generated columns.

2. Set the generated variable

On Inputs, under Generated variables, enter nonconforming_per_tray in Column name and 200 in Number of observations. Choose Binomial in Distribution.

Enter 50 in Number of trials (n) and 0.04 in Probability of success (p). Here “success” means the counted event: a nonconforming item.

3. Set the seed and destination

Open Reproducibility and enter 42 in Random seed.

Check Worksheet output: the destination should be your analysis worksheet, with one new column. Generate once to reproduce this example. Each successful run appends new columns.

Create Random Data: Inputs with the example’s assignments and settings
The Binomial definition and seed 42 on Inputs. The worksheet receives one new column. View full-size image (opens in a new tab)

4. Generate data

Choose Generate data, then open Results. Open Worksheet to see the new columns.

5. Interpret results

  1. Check the generated output

    There is one new column, nonconforming_per_tray, with 200 values. These are simulated observations for practice, not measured production data.

  2. Read the model

    Each tray contains 50 item trials with the same 4% nonconformance probability. The model assumes independent item outcomes. These are practice assumptions, not findings about a production line.

  3. Read a generated row

    The first generated tray has 3 nonconforming items; the fifth has 0. Each value is a whole-number count from 0 through 50. It counts nonconforming items, not several defects on one item.

  4. Use the sample deliberately

    Use the generated columns to practise an analysis or explore the supplied model. Seed 42 repeats this sample with the same ordered definitions and calculation version. A blank seed requests a fresh sample. Running Generate data again appends columns; it does not replace the earlier output.

More details: read each result section

Complete result tables use six significant digits, as in Help.

Generation summary

The summary lists nonconforming_per_tray, its 200 valid values, the distribution and seed 42.

Calculated example output. Running a practice copy writes new columns to its independent worksheet.

Generation summary · 1 row
DefinitionOutput columnDistributionValid valuesSeed
nonconforming_per_traynonconforming_per_traybinomial20042

Captured generator parameters

Each tray contains 50 item trials with the same 4% nonconformance probability. The model assumes independent item outcomes. These are practice assumptions, not findings about a production line.

Captured generator parameters · 2 rows
DefinitionParameterValue
nonconforming_per_trayn50
nonconforming_per_trayp0.04

Generated values

All 200 generated rows are retained in generation order. The first generated tray has 3 nonconforming items; the fifth has 0. Each value is a whole-number count from 0 through 50. It counts nonconforming items, not several defects on one item.

Captured values in original row order. Exports retain full precision.

Generated values · 200 rows
Rownonconforming_per_tray
13
22
33
43
50
65
73
83
90
102
111
124
132
143
152
161
172
180
193
202
213
221
235
244
253
261
272
280
291
303
313
325
331
341
352
361
371
382
391
402
412
423
433
441
453
463
471
481
493
501
511
520
533
542
553
563
572
582
591
600
612
622
632
643
652
662
672
681
690
702
711
722
733
741
750
761
771
782
792
803
812
822
833
841
850
860
873
882
891
902
911
923
932
941
951
962
971
980
990
1005
1014
1023
1031
1045
1053
1063
1072
1081
1090
1104
1112
1121
1131
1142
1151
1163
1173
1183
1192
1202
1212
1222
1230
1242
1250
1262
1271
1281
1290
1302
1311
1324
1332
1341
1352
1360
1375
1382
1393
1400
1412
1422
1434
1442
1452
1461
1471
1482
1492
1500
1513
1524
1531
1542
1550
1562
1571
1582
1593
1603
1610
1624
1631
1640
1652
1661
1673
1683
1691
1705
1711
1722
1731
1744
1751
1760
1772
1786
1794
1803
1814
1824
1832
1841
1853
1862
1871
1880
1893
1901
1914
1921
1930
1943
1951
1961
1972
1984
1991
2001

6. Create a report

Keep Generation summary, Captured generator parameters and Generated values. Record the seed, the model and its units. Label the output as simulated practice data.

Choose Add to report from the completed run. Open Choose individual items and advanced options to select tables and charts, then choose Add to draft. Hidden items stay in the saved analysis.

Name the report and add the purpose of the study and your interpretation. Choose Save, review Preview, then use Export → Download HTML. The example below contains the full selected content, including results beyond one screen.

Complete native output for this Help example, including applicable tables, charts and run notes. Report numbers use the app’s displayed precision. Exported charts are static. On narrow screens, scroll wide charts and tables sideways.
View example report: Generate counts for 200 trays

We use Microsoft Clarity to understand how visitors use this website, including session recordings and heatmaps. You can use the website without accepting analytics.

Your choice is saved in this browser for six months. Privacy notice

Current choice: Not chosen.