The standard normal distribution is a special case of the normal distribution. It occurs when a normal random variable has a **mean of 0** and a **standard deviation of 1**. The normal random variable of a standard normal distribution is called a **standard score** or a **z score**.

A conversion from Normally distributed to Standard Normally distributed value occurs via the formula,

Z = (X - u) / s where:Z= value on the standard normal distributionX= value on the original distributionu= mean of the original distributions= standard deviation of the original distribution

**Code –**

`// Java code to demonstrate the naive method ` `// of finding Z-value ` ` ` `import` `java.io.*; ` `import` `java.util.*; ` ` ` `class` `SDN { ` ` ` `public` `static` `void` `main(String[] args) ` ` ` `{ ` ` ` ` ` `// initialization of variables ` ` ` `double` `Z, X, s, u; ` ` ` `X = ` `26` `; ` ` ` `u = ` `50` `; ` ` ` `s = ` `10` `; ` ` ` ` ` `// master formula ` ` ` `Z = (X - u) / s; ` ` ` ` ` `// print the z-value ` ` ` `System.out.println(` `"the Z-value obtained is: "` `+ Z); ` ` ` `} ` `} ` |

*chevron_right*

*filter_none*

**Output –**

the Z-value obtained is: -2.4

**Generating a Random Standard Normal Function – Using nextGaussian() in Java :**

The **nextGaussian()** method is used to get the next random, Normally distributed double value with mean 0.0 and standard deviation 1.0.

Declaration :public double nextGaussian()Parameters :NAReturn Value :The method call returns the random, Normally distributed double value with mean 0.0 and standard deviation 1.0.Exception :NA

The following example shows the usage of java.util.Random.nextGaussian():

**Code –**

`// Java code to demonstrate the working ` `// of nextGaussian() ` `import` `java.util.*; ` ` ` `public` `class` `NextGaussian { ` ` ` ` ` `public` `static` `void` `main(String[] args) ` ` ` `{ ` ` ` ` ` `// create random object ` ` ` `Random ran = ` `new` `Random(); ` ` ` ` ` `// generating integer ` ` ` `double` `nxt = ran.nextGaussian(); ` ` ` ` ` `// Printing the random Number ` ` ` `System.out.println(` `"The next Gaussian value generated is : "` `+ nxt); ` ` ` `} ` `} ` |

*chevron_right*

*filter_none*

**Output –**

The next Gaussian value generated is : -0.24283691098606316

Attention reader! Don’t stop learning now. Get hold of all the important Java and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready.

## Recommended Posts:

- Program to find Normal and Trace of a matrix
- Program to implement standard error of mean
- Program to implement standard deviation of grouped data
- Find normal at a given point on the curve
- Length of the normal from origin on a straight line whose intercepts are given
- Game Theory (Normal form game) | Set 2 (Game with Pure Strategy)
- Game Theory (Normal-form game) | Set 3 (Game with Mixed Strategy)
- Game Theory (Normal-form Game) | Set 4 (Dominance Property-Pure Strategy)
- Game Theory (Normal-form Game) | Set 5 (Dominance Property-Mixed Strategy)
- Game Theory (Normal-form Game) | Set 6 (Graphical Method [2 X N] Game)
- Game Theory (Normal-form Game) | Set 7 (Graphical Method [M X 2] Game)
- Set in C++ Standard Template Library (STL)
- Mathematics | Mean, Variance and Standard Deviation
- Given N and Standard Deviation, find N elements
- Variance and standard-deviation of a matrix
- Calculate the IST : Indian Standard Time
- Random number generator in arbitrary probability distribution fashion
- Minimum and maximum number of N chocolates after distribution among K students
- Cake Distribution Problem
- Distribution of a Number in Array within a Range

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.