Fiveable
Fiveable

RANDOM

Definition

RANDOM is a function often used in College Board pseudocode that generates random numbers within specified ranges. It takes two arguments - the lower bound and upper bound of the range - and returns a randomly selected value within that range, inclusive.

Analogy

RANDOM is like picking an item at random from a box filled with numbered balls. If you specify the range from 4 to 5, it's like reaching into the box and selecting either ball number 4 or ball number 5.

Related terms

Function: In programming, a function is a reusable block of code that performs a specific task. The RANDOM function is an example of such functionality.

Argument: An argument refers to the values provided to a function when calling it. In this case, the lower bound (4) and upper bound (5) are arguments passed to the RANDOM function.

Range: A range defines the limits within which values can vary. In this context, specifying '4, 5' sets the range for the RANDOM function to generate values between 4 and 5 inclusive.

collegeable - rocket pep

Are you a college student?

  • Study guides for the entire semester

  • 200k practice questions

  • Glossary of 50k key terms - memorize important vocab



© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.


© 2024 Fiveable Inc. All rights reserved.

AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.