// Home / Documentation / Function Reference / NTRANDTRUNCNORM

# NTRANDTRUNCNORM

Returns truncated normal pseudo random number(s) based on Mersenne Twister Algorithm which has long period (219937-1), high order of equidistribution (623 dimensions).

## Syntax

NTRANDTRUNCNORM(

• Size,
• Min,
• Max,
• Mu,
• Sigma,
• Algorithm,
• Random seed1,
• Random seed2

)

#### Parameters

• Size is # of random numbers (Positive integer).
• Min is a lower limit of a support of the distribution $a$.
• Max is a upper limit of a support of the distribution $b$.
• Mu is a parameter the distribution $\mu$.
• Sigma is a parameter the distribution $\sigma\;(>0)$.
• Algorithm is a integer value that determines a method to generate uniform random number.
• 0: Mersenne Twister(2002)
• 1: Mersenne Twister(1998)
• 2: Numerical Recipes
ran2()
• Random seed1 is 1st. random seed.
• Random seed2 is 2nd. random seed.

## Remarks

• Parameters a and b must hold following relation: a < b
• The distribution has bounded support [a, b] (a < b)

## Example

• The example may be easier to understand if you copy it to a blank worksheet

How to copy an example

1. Create a blank workbook or worksheet.
2. Select the example in the Help topic.

Note  Do not select the row or column headers.

Selecting an example from Help

3. Press CTRL+C.
4. In the worksheet, select cell A1, and press CTRL+V.
5. To switch between viewing the results and viewing the formulas that return the results, press CTRL+` (grave accent), or on the Tools menu, point to Formula Auditing, and then click Formula Auditing Mode.

1
2
3
4
5
6
7

A B
Data Description
1 lower limit of support
4 upper limit of support
3 Value of parameter Mu
0.9 Value of parameter Sigma
Formula Description (Result)
=NTRANDTRUNCNORM(100,A2,A3,A4,A5,0) 100 truncated normal deviates based on Mersenne-Twister algorithm for which the parameters above

Note The formula in the example must be entered as an array formula. After copying the example to a blank worksheet, select the range A7:A106 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER.