> For the complete documentation index, see [llms.txt](https://ldevumd.gitbook.io/bittsy/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ldevumd.gitbook.io/bittsy/bittsy-basics/randomization-of-events.md).

# Randomization of events

Events can be specified to occur in a set order. However, there are also a number of aspects that can be selected randomly. These include the side of occurrence for an event (left vs. right) and the particular stimulus from a set. [Randomization](/bittsy/creating-protocols/selection-and-randomization.md) can occur WITH or WITHOUT replacement - that is, BITTSy will keep track of which items it has already selected, and can avoid reusing items until all have already been selected (without replacement), or can just pick entirely randomly each time regardless of what has already been selected (with replacement).   You can also [place limits](/bittsy/creating-protocols/selection-and-randomization.md#repeat-clauses) on the number of times the same thing can be re-selected (e.g., pick a side randomly, but don't present to the same side more than X times in a row).

Stimuli can also be arranged in [hierarchical sets](/bittsy/creating-protocols/tags/groups.md), with randomization occurring within sets. As an example, you could have pictures of `animals` which include `cats` and `dogs`, with multiple examples of each, and could tell BITTSy to select one of the two animal types randomly, then randomly order the presentations of all the different examples within that animal type before moving on to the other animal type.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ldevumd.gitbook.io/bittsy/bittsy-basics/randomization-of-events.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
