# What is the difference between rand and sample?

**URL:** <https://discourse.julialang.org/t/what-is-the-difference-between-rand-and-sample/52297>\
**Category:** General Usage\
**Tags:** question\
**Created:** [December 23, 2020, 9:53pm UTC](https://discourse.julialang.org/t/what-is-the-difference-between-rand-and-sample/52297 "2020-12-23T21:53:00Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [December 24, 2020, 9:15am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-rand-and-sample/52297/8 "2020-12-24T09:15:48Z")

</div>

Personally I think that using `StatsBase.sample` for MCMC is bad style (“punning”).

---

_[View the full topic](https://discourse.julialang.org/t/what-is-the-difference-between-rand-and-sample/52297)._
