# gell_like()

## Introduction

In two-alternative discrimination tasks, researchers typically randomize the placement of the rewarded stimulus to prevent systematic responses to irrelevant stimuli, ensuring that learning curves reflect chance performance.

One method to accomplish this is by employing random numbers generated from a discrete binomial distribution to construct a ‘full random training schedule’ (FRS). However, the use of FRS may inadvertently result in sporadic but extended sequences of biased training, known as ‘input biases,’ which can lead to the emergence of biased responses (‘output biases’).

As an alternative approach, a ‘Gellerman-like training schedule’ (GLS) can be implemented. GLS mitigates most input biases by restricting the occurrence of rewards in the same location for more than three consecutive trials. The history of past rewards associated with choosing a specific discriminative stimulus influences the likelihood of selecting that stimulus in subsequent trials.

This function implements a Gellerman-like series based on Herrera & Treviño (2015). The algorithm samples from a binomial distribution and imposes two restrictions:

- No more than 3 consecutive values of 0s or 1s.
- The number of trials 0 or 1 must be the same for a given n.

## Example

    set.seed(420)

    example_series <- gell_like(16)

    example_series

    ##  [1] 1 1 0 0 0 1 0 0 1 1 1 0 0 0 1 1

Note: it is important to consider that n has to be an even number so that there are the same amount of trials for each alternative.

## References

Herrera, D., & Treviño, M. (2015). Undesirable choice biases with small differences in the spatial structure of chance stimulus sequences. PLoS One, 10(8), e0136084.