# ConductScience Y-Maze Spontaneous Alternation Calculator: method and validation record

This record fixes the calculation behind the free Y-Maze Spontaneous Alternation Calculator at https://conductscience.com/tools/y-maze-alternation-calculator, and the worked examples that check it.

## What the tool computes

From each animal's sequence of arm entries, typed or read from a tracking export:

- total entries, possible alternations (entries − 2) and alternations (three consecutive entries into three different arms);
- % alternation, with 50% as chance;
- same-arm returns;
- group means, SDs and SEMs of % alternation and total entries.

An animal with fewer than three entries has no % alternation.

## Files

| File | Contents |
| --- | --- |
| `METHODS.md` | Formulas, how arm entries are read, conventions, references, and changes from the page before this record |
| `cases.json`, `cases.csv` | The worked examples: inputs, expected outputs and where each expected answer comes from |
| `validation-report.json` | The engine's output for every case, pass or fail, and the SHA-256 of each engine file |
| `engine/` | The calculation source files the report fingerprints (when included) |
| `data_dictionary.csv` | Columns of `cases.csv` |
| `CITATION.cff`, `LICENSE`, `MANIFEST.json` | Citation metadata, licence, and byte count and SHA-256 of every file |

## How to cite

ConductScience. ConductScience Y-Maze Spontaneous Alternation Calculator [software]. 2026. https://doi.org/10.55157/csd.tool.ymaze.2026.001

In a methods section: "Spontaneous alternation was calculated as the number of consecutive entries into three different arms divided by the number of possible alternations (total entries − 2) × 100, using the ConductScience Y-Maze Spontaneous Alternation Calculator (https://doi.org/10.55157/csd.tool.ymaze.2026.001)."
