# NTRANDTRIANGULAR

Returns triangular pseudo random number(s) based on Mersenne Twister Algorithm which has long period (2^{19937}-1), high order of equidistribution (623 dimensions).

## Syntax

**NTRANDTRIANGULAR**(

*Size,**Min,**Max,**Mode,**Algorithm,**Random seed1,**Random seed2*

)

#### Parameters

is # of random numbers (Positive integer).**Size**is a lower limit of a support of the distribution .**Min**is a upper limit of a support of the distribution .**Max**is a mode of the distribution .**Mode**is a integer value that determines a method to generate uniform random number.**Algorithm**- 0: Mersenne Twister(2002)
- 1: Mersenne Twister(1998)
- 2: Numerical Recipes

ran2()

is 1st. random seed.**Random seed1**is 2nd. random seed.**Random seed2**

## Remarks

- Parameters must hold the following relation: a < c < b
- The distribution has bounded support [a, b]

## Example

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

How to copy an example

- Create a blank workbook or worksheet.
- Select the example in the Help topic.
**Note**Do not select the row or column headers.Selecting an example from Help

- Press CTRL+C.
- In the worksheet, select cell A1, and press CTRL+V.
- 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

A B Data Description 1 Lower limit of support 3 Upper limit of support 1.4 Mode of the distribution Formula Description (Result) =NTRANDTRIANGULAR(100,A2,A3,A4,0) 100 triangular 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 A6:A105 starting with the formula cell. Press F2, and then press CTRL+SHIFT+ENTER.

- Download sample excel sheet
- See tutorial video

## See also

- NTTRIANGULARDIST
- NTTRIANGULARINV
- NTTRIANGULARKURT
- NTTRIANGULARMEAN
- NTTRIANGULARMOM
- NTTRIANGULARPARAM
- NTTRIANGULARSKEW
- NTTRIANGULARSTDEV
- Triangular distribution
- Choice of the random number generator algorithm
- Why I always see the same result even if I input formula into multiple cell?