# Document for Julia 1.0.3 for rand! confuses me

**URL:** https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572
**Category:** New to Julia
**Created:** [January 12, 2019, 11:06pm UTC](https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572 "2019-01-12T23:06:45Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [January 12, 2019, 11:06pm UTC](https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572/1 "2019-01-12T23:06:45Z")

</div>

Look at the section for rand!  
in [Random Numbers · The Julia Language](https://docs.julialang.org/en/v1.0/stdlib/Random/#Random-generation-functions-1)

Why is the following “rng = MersenneTwister(1234);” giving me an error?

```julia
$ julia
               _
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.0.3 (2018-12-18)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> rng = MersenneTwister(1234);
ERROR: UndefVarError: MersenneTwister not defined
Stacktrace:
 [1] top-level scope at none:0

```

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [January 12, 2019, 11:18pm UTC](https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572/2 "2019-01-12T23:18:50Z")

</div>

The documentation you link is for the `Random` standard library. You need `using Random` to access these functions.

---

<div class="post-metadata">

### Author: ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)
#### Post date: [January 12, 2019, 11:21pm UTC](https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572/3 "2019-01-12T23:21:55Z")

</div>

The documentation should mention the code  
“using Random” at the very start just in case newbies reads it.

---

<div class="post-metadata">

### Author: ![Tero\_Frondelius](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tero_frondelius/32/7629_2.png) [@Tero\_Frondelius](https://discourse.julialang.org/u/Tero_Frondelius)
#### Post date: [January 13, 2019, 5:50am UTC](https://discourse.julialang.org/t/document-for-julia-1-0-3-for-rand-confuses-me/19572/4 "2019-01-13T05:50:00Z")

</div>

> [@StevenSiew](#):
>
> The documentation should mention the code  
> “using Random”

Please make a pull request. This is open source thus everyone can contribute.
