# Distribution of results for r.int

**URL:** <https://cl.desmos.com/t/distribution-of-results-for-r-int/4954>\
**Category:** Questions\
**Tags:** validation, correctness\
**Created:** [June 15, 2023, 2:20pm UTC](https://cl.desmos.com/t/distribution-of-results-for-r-int/4954 "2023-06-15T14:20:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TeacherLearner](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/teacherlearner/32/245_2.png) [@TeacherLearner](https://cl.desmos.com/u/TeacherLearner)\
**Post date:** [June 15, 2023, 2:20pm UTC](https://cl.desmos.com/t/distribution-of-results-for-r-int/4954/1 "2023-06-15T14:20:20Z")

</div>

When I create randomized practice, I use r.int to select a problem parameter. In the CL, I generate a new value of r.int on each screen. But I often find that the activity seems to have used the same value of r.int between successive screens of the activity. This seems to be especially true if a student logs into the activity and clicks “next” many times very rapidly in order to generate all the screens within a very short period of time.

Does this make sense, based on how r.int works? And if so, what would be some ways to guarantee that r.int is producing a wider range of values?

As an example, you could navigate to screen 1 of this activity:

> **[2 Translating verbal expressions • Activity by Kevin Hall](https://classroom.amplify.com/activity/64886fffd20fb2bb743fabe4)**
>
> Students practice translating algebraic expressions that are given verbally into their simplified form. Problems involve: 
> 
> \- sum
> \- difference 
> \- more than 
> \- less than 
> \- product, 
> \- quotient, as well as  
> \- area of a rectangle, and
> \- perimeter of a...

Then click through to the last screen _very fast_ and click on “check my answers”. Then navigate backwards through the activity, and you’ll see that a single answer choice (A, B, C, or D) was over-represented in the correct answer choices.

For example, if you click through the screens so quickly that screens 4, 5, and 6 never actually appear on the screen before it shows screen 7, then does it use the same value of r.int for screens 4, 5, and 6?

---

<div class="post-metadata">

**Author:** ![Daniel\_Grubbs](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/daniel_grubbs/32/719_2.png) [@Daniel\_Grubbs](https://cl.desmos.com/u/Daniel_Grubbs)\
**Post date:** [June 15, 2023, 5:22pm UTC](https://cl.desmos.com/t/distribution-of-results-for-r-int/4954/2 "2023-06-15T17:22:43Z")

</div>

In an initial graph, you could create a list of target unique values shuffle that list based on r.int from your CL. Then, you can use the order of elements in the list progressively in each screen to avoid using the same values again…  
In CL…

```auto
number(`s_{eed}`): r.int(1,20)
value= this.number(`L_{ist}[1]`)

```

In graph… _[sample](https://www.desmos.com/calculator/y2lfop8rmg)_

```auto
L_ist= shuffle([1...10], s_eed)

```

In screens following, in the CL set the L\_ist to the one from graph1, and whatever value you want changed to the next element in the list.

```auto
numberList(`L_{ist}`): graph1.numberList(`L_{ist}`)
value= this.number(`L_{ist}[2]`)

```

---

<div class="post-metadata">

**Author:** ![TeacherLearner](https://yyz1.discourse-cdn.com/flex031/user_avatar/cl.desmos.com/teacherlearner/32/245_2.png) [@TeacherLearner](https://cl.desmos.com/u/TeacherLearner)\
**Post date:** [June 16, 2023, 1:58pm UTC](https://cl.desmos.com/t/distribution-of-results-for-r-int/4954/3 "2023-06-16T13:58:42Z")

</div>

This is a good idea. Thank you. I did not even know about the “shuffle” command in Desmos graphs!
