Discord

Checklist VsOSh AI 2026 Regional Stage, Tour 1 (mathematics) · F task

NLP

Compute the expected waiting time until the substring "ML" appears in a word generated by a first-order Markov chain over letters.

  • Probability (Markov chains)
  • Russian original · English translation

The task

A language has the alphabet {A, D, E, I, L, M, N, S, T}. The word starts as "DS", and at each step one letter is appended; its choice depends only on the current last letter: after A — M or D; after E or I — T, S or M; after T or M — L or N; after N or D — A or I; after S or L — E, I or D (each option equally likely).

Find the expected number of steps (appended letters) until the substring "ML" first appears.

Abridged and translated by SOTA from the official Russian materials. The official statement has the exact rules, and it wins wherever this summary differs.

In English

This task was published in Russian. SOTA translated its 3 files into English on 16 September 2026. Only the words changed in the notebooks: markdown, code comments, messages and printed output. The code, file names and paths are the original's, so a translated notebook runs with the original data.

Read the task statement in English 294 words

NLP

English translation by SOTA – AI Community of the Russian original. Organisers who would like this translation removed can email [email protected].

All-Russian School Olympiad in Informatics 2025–2026, Regional Stage, Grades 9–11
“Artificial Intelligence” profile, Tour 1, 17 January 2026
Task F

Points for the task: 50
Answer submission format: entering the answer
Number of attempts: 10
Submission that counts: the last one

Statement

Petya is studying a language whose alphabet consists of the letters

{A,D,E,I,L,M,N,S,T}.\{A, D, E, I, L, M, N, S, T\}.

Initially, the word DSDS is written.

Then, at each step, one more letter is appended to the word on the right.

The choice of the new letter depends only on the last letter of the current word.

The rules for appending a new letter are as follows:

  • If the last letter is AA, one of {M,D}\{M, D\} is appended with equal probability.
  • If the last letter is EE or II, one of {T,S,M}\{T, S, M\} is appended with equal probability.
  • If the last letter is TT or MM, one of {L,N}\{L, N\} is appended with equal probability.
  • If the last letter is NN or DD, one of {A,I}\{A, I\} is appended with equal probability.
  • If the last letter is SS or LL, one of {E,I,D}\{E, I, D\} is appended with equal probability.

Petya is a very keen gambler. He is waiting for the substring MLML to appear in the string. Find the expected number of steps (that is, of appended letters) needed for this to happen.

Output format

Round the answer to 2 decimal places, using a point as the decimal separator.

Scoring

An exact match of the answer: 50 points.

Test results are not available during the tour.

Translated by SOTA. The Russian original is the official version and wins wherever the two differ. The statement is translated from the tour's PDF paper; the official editorial is a single notebook covering all tasks of the tour. If you organise this olympiad and would like the translation removed, email [email protected] and we will take it down.

At a glance

You get
Statement only.
You submit
A number rounded to 2 decimal places (decimal point).
Scoring
Answer entry; 50 points for an exact match; 10 attempts, the last one counts; results hidden during the tour.
Rules
  • Python may be used, or the problem may be solved purely mathematically.
Format
Regional stage, Tour 1, 17 January 2026; grades 9–11; individual; 300-minute tour (Moscow procedure); answers entered in Yandex Contest.

Details

Year
2026, Regional venues across Russia (in person)
Round
Regional Stage, Tour 1 (mathematics) · F task
Language
Russian; English translation by SOTA
License
Not stated by the source