# Difficulties with a stochastic variable

**URL:** <https://community.wolfram.com/t/difficulties-with-a-stochastic-variable/27084>\
**Category:** Questions\
**Tags:** statistics-and-probability\
**Created:** [June 18, 2026, 3:45pm UTC](https://community.wolfram.com/t/difficulties-with-a-stochastic-variable/27084 "2026-06-18T15:45:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vasholz](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/vasholz/32/42087_2.png) [@vasholz](https://community.wolfram.com/u/vasholz)\
**Post date:** [June 18, 2026, 3:45pm UTC](https://community.wolfram.com/t/difficulties-with-a-stochastic-variable/27084/1 "2026-06-18T15:45:12Z")

</div>

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/e48dc503-f0cc-43ba-8f8b-c46c149cc830)

---

<div class="post-metadata">

**Author:** ![gianlucagorni](https://avatars.discourse-cdn.com/v4/letter/g/ec9cab/32.png) [@gianlucagorni](https://community.wolfram.com/u/gianlucagorni)\
**Post date:** [June 18, 2026, 7:27pm UTC](https://community.wolfram.com/t/difficulties-with-a-stochastic-variable/27084/2 "2026-06-18T19:27:05Z")

</div>

Try giving the attribute `HoldFirst`:

```
SetAttributes[fivetries, HoldFirst]
fivetries[arg_] := Table[arg, 5]
fivetries@RandomReal[]

```

This way the `RandomReal` is evaluated last, after the `Table`.

---

<div class="post-metadata">

**Author:** ![mroge02](https://yyz1.discourse-cdn.com/wolfram/user_avatar/community.wolfram.com/mroge02/32/28775_2.png) [@mroge02](https://community.wolfram.com/u/mroge02)\
**Post date:** [June 19, 2026, 3:07pm UTC](https://community.wolfram.com/t/difficulties-with-a-stochastic-variable/27084/3 "2026-06-19T15:07:01Z")

</div>

`fivetries@Unevaluated@RandomReal[]` also works, but I would use `HoldFirst` or `HoldAll` as Gianluca shows.

Note `Attributes@Table` includes `HoldAll`, which is why the argument `RandomReal[]` in `Table[RandomReal[],5]` is not evaluated first; instead, it is evaluated when `Table[]` is ready to evaluate it.
