The stream is built by concatenating hidden equal-length "words" back to back, with no pauses, stress cues or silence between them - the Saffran, Aslin & Newport (1996) design that showed 8-month-old infants can segment such a stream after only ~2 minutes of listening.
TP(B | A) = count(A → B) / count(A)
within a word: TP ≈ 1.0
across a word boundary: TP ≈ 1 / (nWords − 1)
Fixed vs. this build: the original 4-word version of this lab described the across-boundary probability as "≈ 1/4" (1 / nWords). That undercounts the effect of the "don't repeat the same word twice in a row" rule the language generator uses: with that rule active, the next word is drawn uniformly from the other nWords − 1 words, not all nWords of them. A quick numeric check (3,000-syllable runs) confirms the online learner converges to 1/(nWords−1), not 1/nWords - e.g. ≈0.33 for 4 words, ≈0.20 for 6 words, and exactly 1.0 (not 0.5) for 2 words, since with only two words the next one is forced. This build's ground-truth formula and the "2 hidden words" warning above both reflect the corrected value.
As each new syllable arrives, the simulator updates a running bigram table and computes the transitional probability from the previous syllable to the current one using only statistics accumulated so far - an online learner, just like an infant's brain. Whenever TP drops below the threshold τ, it inserts a segmentation boundary.
- Stream speed - how fast new syllables arrive.
- Boundary threshold τ - how big a TP dip must be before the learner commits to a boundary; too high and it over-segments, too low and words run together.
- Hidden words in language - how many distinct 3/4/6/2-syllable "words" the artificial language is built from; fewer words means a smaller, easier-to-learn vocabulary but a weaker (or, at 2 words, absent) statistical cue at boundaries.
- New Language - reshuffles which syllables form which hidden word and restarts learning from zero statistics.
- Segmentation accuracy - the fraction of detected boundaries that land on a real word edge, scored against the true, hidden word grid.
- Drag anywhere on the stream to scrub back through recently heard syllables without pausing playback; click "● live" to snap back to the leading edge.
This statistical-learning mechanism is one candidate explanation for how infants bootstrap word discovery before they know any actual words, and deficits in it are studied as a possible contributor to Specific Language Impairment and dyslexia.