Here are some of the problems I proposed and were used in CMI’s STEMS CS paper, which is my university’s annual open book exam for high school and undergraduate students in India. I was one of the STEMS CS subject heads in 2026 and 2025 edition.
Link to the paper and solutions
STEMS CS 2025
Objectives
-
A natural number is called nice if its base representation has all non-zero digits and forms a palindrome. Find the number of nice numbers less than which are divisible by .
-
You are given 2 disjoint directed paths of length 2025 and 2027. From each vertex out of these 2 paths, add one edge to any vertex on the other path. Find the number of such graphs which do not contain any directed cycle.

-
In the following figure, each cell stores a value of 0 or 1. Each cell which is not in the bottom layer has value 1 if between the two cells directly below it, the value in the one to the left is smaller than the value on the right. Otherwise, the cell has value 0. Determine the expected value of the topmost cell if each cell in the bottom layer is independently chosen to be or with equal probability. Express your answer as where is the expected value in reduced form.

-
A directed graph with edges colored from to is a complete semi-automaton on colors if every vertex has exactly one outgoing edge of each color. A word is a finite sequence of colors, and its run vertex from a vertex is a vertex such that there exists edges such that and the color of the word is the color of , . A word is anti-synchronizing if, for any pair of distinct vertices and , the run vertices from and are distinct. Find the number of complete semi-automata on 4 colors and 5 vertices that have at least one non-empty anti-synchronizing word and give the answer modulo 99.
Subjectives
Matrix filling problem
Find all , for which it is possible to fill an matrix with entries from such that the following two conditions are satisfied: There are exactly distinct entries in each row and column. No contiguous sequence of length horizontally or vertically is monotonically increasing or decreasing.
STEMS CS 2026
Grid Coloring
Consider a square grid, divided into four Quarters, each of which are further subdivided into Regions as shown in . Now, Anusha chooses to infect each region with probability. If a Region is chosen to be infected, then she randomly colors one of the cells contained in the region with uniform probability.
We call a particular coloring of the grid nice if we can find a connected region consisting of white cells surrounded on all sides by colored cells. For example, is nice, while is not.
What is the probability that after the infection process is completed, the grid is nice?

Noughts and Crosses
You are given an matrix , where each cell is either ⭕ or ❌, and for some . The center of the matrix is the pivot at . The top-left cell is indexed as , and the bottom-right cell as . A layer of the board is defined for each integer , where the -th layer consists of the set of cells such that:
The board is called AWESOMEE if, for every , all four corners of the -th layer contain the same value (either ⭕ or ❌).
Operations
You can perform the following operations to modify the matrix:
- Layer Rotate: Rotate any layer clockwise, shifting its elements in a circular manner.
- Half Diagonal Shift: You can select any half-diagonal (where ) and cycle shift the elements of that diagonal tow
- ards the pivot. A half-diagonal consists of the cells , consists of the cells , and so on.
Objective
Your task is to find a strategy that minimizes the total number of operations (Layer Rotates and Half Diagonal Shifts) needed to make the board AWESOMEE, where the board satisfies the condition that for all layers , the four corners of the -th layer are equal.

Get the DAG back
Given , a Directed Acyclic Graph (DAG), we define the graph in the following way: it contains all the vertices and edges of , and if there is a path of non-zero length from to in , then we add an edge from to in .
Describe an efficient algorithm which, when given a directed graph , decides if there exists a DAG such that , and if so, outputs .
Discarded problems
Cyclic MEX
It was not used because it is solvable by chatGPT :(. Otherwise, it could have been a good P1 on both the papers.
Given integers , (even), , let . A ring with compartments, is indexed to (the indices are considered modulo ). It is filled as follows:
- For to :
- Select an index such that for all to are empty.
- Fill these compartments with . This ensures is completely filled.
- Arc: A contiguous subsegment of .
- Ugliness: The MEX (minimum excluded value) of the integers in an arc.
- Total Ugliness: The sum of ugliness over all arcs of size . Find a way to minimise the total ugliness of .