<!--
{
  "availability" : [
    "iOS: 9.0.0 -",
    "iPadOS: 9.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.11.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "GameplayKit",
  "identifier" : "/documentation/GameplayKit/GKGaussianDistribution/init(randomSource:mean:deviation:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "GameplayKit"
    ],
    "preciseIdentifier" : "c:objc(cs)GKGaussianDistribution(im)initWithRandomSource:mean:deviation:"
  },
  "title" : "init(randomSource:mean:deviation:)"
}
-->

# init(randomSource:mean:deviation:)

Initializes a Gaussian random distribution with the specified mean and deviation, using the specified source randomizer.

```
init(randomSource source: any GKRandom, mean: Float, deviation: Float)
```

## Parameters

`source`

A randomizer that produces raw random values for use by the distribution. A randomizer is any object implementing the [`GKRandom`](/documentation/GameplayKit/GKRandom) protocol, which can be a random source algorithm such as the [`GKARC4RandomSource`](/documentation/GameplayKit/GKARC4RandomSource) class or another random distribution.

`mean`

The mean value of the distribution (also called the *expected value* or *median*).

`deviation`

The standard deviation of the distribution (also called *sigma*).

## Return Value

A new random distribution.

## Discussion

Using this initializer creates a Gaussian distribution whose range is determined by the specified `mean` and `deviation` values. The [`lowestValue`](/documentation/GameplayKit/GKRandomDistribution/lowestValue) property of the newly created distribution is set to three deviations below the mean (`lowest = mean - 3 * deviation`) and the [`highestValue`](/documentation/GameplayKit/GKRandomDistribution/highestValue) property is set to three deviations above the mean (`highest = mean + 3 * deviation`).

A random distribution works by mapping the values produced by the `source` randomizer to the range and characteristics specified by the distribution. Multiple distributions can share the same source, with the side effect that retrieving a random value through one distribution affects the sequence of random numbers produced by the source.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)