Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
. 2023 Jul 5;16(1):135.
doi: 10.1186/s13104-023-06396-x.

PyGellermann: a Python tool to generate pseudorandom series for human and non-human animal behavioural experiments

Affiliations

PyGellermann: a Python tool to generate pseudorandom series for human and non-human animal behavioural experiments

Yannick Jadoul et al. BMC Res Notes. .

Abstract

Objective: Researchers in animal cognition, psychophysics, and experimental psychology need to randomise the presentation order of trials in experimental sessions. In many paradigms, for each trial, one of two responses can be correct, and the trials need to be ordered such that the participant's responses are a fair assessment of their performance. Specifically, in some cases, especially for low numbers of trials, randomised trial orders need to be excluded if they contain simple patterns which a participant could accidentally match and so succeed at the task without learning.

Results: We present and distribute a simple Python software package and tool to produce pseudorandom sequences following the Gellermann series. This series has been proposed to pre-empt simple heuristics and avoid inflated performance rates via false positive responses. Our tool allows users to choose the sequence length and outputs a .csv file with newly and randomly generated sequences. This allows behavioural researchers to produce, in a few seconds, a pseudorandom sequence for their specific experiment. PyGellermann is available at https://github.com/YannickJadoul/PyGellermann .

Keywords: Animal cognition; Experimental psychology; Go/no-go; Psychometrics; Python; Randomization; Simple heuristics; Two-alternative forced-choice.

PubMed Disclaimer

Conflict of interest statement

The authors declare that they have no competing interests.

Figures

Fig. 1
Fig. 1
A Venn diagram shows how the set of Gellermann series is a strict subset of all possible binary sequences. Some exemplary sequences (in red) violate some of the criteria put forward by [7]. For instance, in red from top to bottom, the set of Gellermann series does not include the sequences (1) ABBAABABAA because it does not contain an equal number of As and Bs, (2) BAAAABBBAB as it contains 4 As in a row, (3) AAABABBBAB because it has only 1 B and in the first half of the sequence and only 1 A in the second, (4) ABABBBAABA because it contains 6 reversals, and (5) ABBBABAAAB as it provides an 80% correct response rate when responses follow a simple alternation pattern (i.e., ABABABABAB). On the contrary, the sequences AABBABAABB, AABABAABBB, AAABBABABB (in green) fulfill all criteria and are included in the nested set of Gellermann series
Fig. 2
Fig. 2
Monte Carlo estimates of the proportion of all binary sequences that meet all five of Gellermann’s criteria, in function of the length of the sequence. Since the proportion drops off exponentially and our implementation generates and tests balanced sequences (i.e., those with an equal number of As and Bs) uniformly at random, generating Gellermann series with many more than 100 elements quickly becomes infeasible
Fig. 3
Fig. 3
A screenshot of PyGellermann’s GUI shows the various options available to customise the generated series, as well as options to copy the generated series or save them as a table to a CSV file

Similar articles

Cited by

References

    1. Schluessel V, Duengen D. Irrespective of size, scales, color or body shape, all fish are just fish: object categorization in the gray bamboo shark Chiloscyllium griseum. Animal Cogn. 2015;18:497–507. doi: 10.1007/s10071-014-0818-0. - DOI - PubMed
    1. Erdsack N, Dehnhardt G, Hanke FD. Serial visual reversal learning in harbor seals (Phoca vitulina) Animal Cogn. 2022;25(5):1183–93. doi: 10.1007/s10071-022-01653-1. - DOI - PMC - PubMed
    1. Ortiz ST, Maxwell A, Hernandez A, Hansen KA. Does participation in acoustic experiments improve welfare in captive animals? A case study of three grey seals (Halichoerus grypus). bioRxiv. 2020:2020-08.
    1. Lazareva OF. Perceptual categorization in pigeons. In: Kaufman AB, Call J, Kaufman JCE, editors. Cambridge handbooks in psychology. Cambridge: Cambridge University Press; 2021.
    1. Ortiz ST, Maxwell A, Krasheninnikova A, Wahlberg M, Larsen ON. Problem solving capabilities of peach-fronted conures (Eupsittula aurea) studied with the string-pulling test. Behaviour. 2019;156(5–8):815–46. doi: 10.1163/1568539X-00003539. - DOI

LinkOut - more resources