brain
tamnd's digital brain — notes, problems, research
41641 notes
Let F(t)=G(e^t)=\sum_{k\ge 0} p_k e^{kt}.
Let $G_n(z) = (q + pz)^n$ be the generating function of the binomial distribution, where $p+q=1$, $q=1-p$, $0<p<1$.
Let G_n(z)=\prod_{k=2}^{n}\frac{z+k-1}{k} be the probability generating function in Eq.
Let $X[1],\ldots,X[n]$ be independent uniform draws from a set of $M$ objects.
Let $X[1],X[2],\ldots,X[n]$ be chosen independently from a set of $M$ distinct elements, each of the $M^n$ sequences being equally likely.
Let the sample space consist of all sequences $(X[1],X[2],\ldots,X[n])$ with each $X[k]$ chosen independently from a set of $M$ distinct elements.
Let $G(z)=\sum_k p_k z^k$ be a probability generating function with $G(1)=1$.
Let $X_1,\ldots,X_n$ be independent trials with $\Pr(X_i=\text{head})=p$ and $\Pr(X_i=\text{tail})=q=1-p$.
Let $X[1],X[2],\ldots,X[n]$ be a random sequence containing exactly $m$ distinct values.
The distribution in Fig.
From (4) with $k=0$, p_{n0}=\frac{1}{n}p_{n-1,-1}+\frac{n-1}{n}p_{n-1,0}.
Let $\prec$ be a relation on a set $S$ satisfying properties (i)–(iii) of the exercise, so that $S$ is well-ordered by $\prec$.
Let G(z)=\sum_{k} p_k z^k, \qquad G(1)=\sum_k p_k=1.
For Algorithm M, the number of times step M4 is executed is the random variable $A$, whose distribution satisfies the results of Section 1.
Let the original Algorithm E be augmented so that at the beginning of every execution of each step E1, E2, E3, and E4, the operation $T \leftarrow T + 1$ is performed, with $T = 0$ initially.
The solution must be rebuilt because the central issue is not a norm estimate but the fact that the _text’s intended generalization of Algorithm E is not a Euclidean algorithm in_ $\mathbb{Z}[\sqrt{2}...
A correct solution must avoid any assumption that Floyd verification conditions are decidable by semantic truth tables.
The previous solution failed because the proposed identity was incorrect.
We prove by induction on integers $n \ge 10$ that 2^n > n^3.
Let $P(n)$ denote the statement that n^3 = (n^2 - n + 1) + (n^2 - n + 3) + \cdots + (n^2 + n - 1).
Let $P(n)$ be the statement $(1 - a)^n \ge 1 - na$ for a fixed real number $a$ satisfying $0 < a < 1$, and for all positive integers $n$.
Let $P(n)$ denote the statement that every integer $n>1$ can be written as a product of one or more prime numbers, where a prime number is considered a product consisting of itself alone.
Let $P(n)$ denote the statement $F_n \ge \phi^{,n-2}$ for all positive integers $n$, where $F_0 = 0$, $F_1 = 1$, $F_{n+1} = F_n + F_{n-1}$, and $\phi = (1 + \sqrt{5})/2$.
Before step E4, equations (6) state that $a' m + b' n = c,$ $a m + b n = d.$ Step E2 supplies integers $q$ and $r$ such that $c = qd + r.$ After step E4, the updated variables are
Let $S_n = n^2 - (n-1)^2 + (n-2)^2 - \cdots + (-1)^{n-1} 1^2$ for positive integers $n$.
Let $C_1=(Q_1,I_1,\Omega_1,f_1)$ and $C_2=(Q_2,I_2,\Omega_2,f_2)$.
The argument attempts a strong induction proof of the statement $P(n): a^{\,n-1}=1$ for all positive integers $n$, with $a>0$.
Let S_n = \frac{1}{1 \times 2} + \frac{1}{2 \times 3} + \cdots + \frac{1}{(n - 1)n}.
To extend induction from positive integers to nonnegative integers, the starting point is shifted from $1$ to $0$.
Let $T_5$ denote the average number of executions of step E1 of Algorithm E when the second input is fixed as $n=5$ and the first input $m$ ranges uniformly over the integers $1,2,3,4,5$.
An algorithm in the sense of Section 1.
Let $m$ be fixed and let $f(m,n)$ denote the number of executions of step E1 of Algorithm E starting from input $(m,n)$, $n\ge 1$.
The flaw in the previous solution is not merely a mistake in the proof, but an incorrect encoding of Euclid’s subtraction step.
Let the variables $m$ and $n$ at the beginning of a general execution of step E1 be those currently held by Algorithm E.
A replacement operation of the form $x \leftarrow y$ is trivial when it merely copies a value without participating in any further computation inside that step.
Apply Algorithm E to the integers $m = 6099$ and $n = 2166$.
Let the initial values be $a_0, b_0, c_0, d_0$ and the final required configuration be $a = b_0$, $b = c_0$, $c = d_0$, $d = a_0$.
Let a triangle $ABC$ be required to be similar to a fixed acute triangle $A_1B_1C_1$ with correspondence $A \leftrightarrow A_1$, $B \leftrightarrow B_1$, $C \leftrightarrow C_1$, and suppose that the…
We are given a fixed point on a 2D grid representing where we currently stand inside a mansion. Along with it, we are given a list of other points scattered across the plane. The task is to identify which of these points is closest to our position using Euclidean distance.
We are given a grid where each cell behaves like a terrain type in a small maze. The traveler starts from exactly one cell marked S and must reach a unique exit cell marked E. Movement is allowed in the four cardinal directions, and each move costs one unit of time.
We are given a building modeled as an undirected graph where rooms are nodes and doors are edges. Harry starts in a specific room and wants to reach any of several exit rooms. At the same time, there are multiple ghosts placed in fixed rooms.
We are given several types of candy. Each type has a fixed number of pieces available and a fixed tastiness per piece.
We are given a row of buildings indexed from left to right, where each building contains a certain number of students. Freddy always starts from the first building and can only move forward in order.
We are given a sequence of characters consisting only of 0, 1, and 2. We want to choose a contiguous segment of this sequence such that within that segment, the number of 2 characters does not exceed a given limit k.
The expression factorises as
We are given a binary string representing a row of lanterns, where each position is either 0 or 1. In a single operation, we choose any contiguous segment and flip every bit inside it, turning 0 into 1 and 1 into 0.
We are given a line of houses arranged in a row. Each house has a deadline, measured in minutes from the start, after which Alice can still reach it but will not receive candy if she arrives exactly at that time or later.
The maze is a small grid where each cell behaves like a terrain type that affects how Sam can move. Some cells are freely passable, some are blocked, and some impose a resource constraint: Sam may need to collect candy corns to pass through certain obstacles.
We are given a line segment of integer positions from 0 to n. Several students initially occupy positions between 1 and n−1. Each student independently chooses a direction, left toward 0 or right toward n, each with probability 1/2.
The task is to determine which exit rooms in a building are safe for Harry to reach given that ghosts are also moving through the same building at the same speed. We can view the house as an undirected graph where rooms are nodes and doors are edges.
We are given several types of candy, where each type has a limited supply and a fixed tastiness per piece. Charlie can eat candy over a limited number of days, but each day comes with two constraints: he cannot exceed a fixed number of candies per day, and he is not allowed to…
We are given a grid of lowercase letters with $n$ rows and $m$ columns. From this grid, we are interested in selecting any two consecutive rows and any two consecutive columns. Each such choice defines a $2 times 2$ submatrix.
There is a pile of $n$ stones and two players who alternate turns, with Alice moving first. On each move a player removes some positive number of stones from the pile. The size of a move is restricted in two ways.
We are given two binary-like sequences of equal length. Each position contains a 31-bit non-negative integer, and at every index we are allowed to swap the two values in that position any number of times. After performing swaps, we end up with two new sequences.
We are given two sets of points on a number line. One set represents luggage items, each sitting at some integer position. The other set represents people standing in front of a conveyor belt, also at integer positions.
We are given a turn-based game with a single evolving state: a combat strength value and a cumulative damage value. Initially the strength is some fixed value $a0$, and damage starts at zero. There are $n$ rounds, and in each round we must choose exactly one of two actions.
Let $AB$ be the unique edge of the tetrahedron exceeding $1$, while all other edges do not exceed $1$.
A group of n people goes to a restaurant, and each person has a personal spending limit. This limit already includes the cost of transportation to the restaurant, and any additional spending inside the restaurant must keep their total expenditure within their limit.
We are given a random string of length $n$, built independently character by character from the lowercase alphabet. Each position is assigned letter $i$ with probability $pi$.
We are generating $n$ independent random strings, each of length $m$, where every character is chosen uniformly from the 26 lowercase English letters.
We are given a list of heights and are allowed to reorder them arbitrarily into a line. For any fixed arrangement, every contiguous segment contributes a cost equal to the difference between the tallest and the shortest person inside that segment.
We are given an $n times m$ grid of students standing in a rectangle. Each cell either contains a student or is empty. From this initial configuration, an operation is applied repeatedly, where each operation “compresses” the arrangement according to one of four commands.
We are given a string $S$ of length $n$. From this string, a second much larger string is constructed recursively.
The quantity to be maximized is the distance to the nearest vertex among $A,B,C,D$ over the parallelogram.
We are given a collection of points on a 2D plane, and we want to enclose all of them inside a rectangle whose sides are aligned with the coordinate axes. Among all such axis-aligned rectangles, we are asked to find the one with the smallest possible area.
We are given a tree with a value written on every node. Each query picks two nodes, defining a unique simple path between them. Along that path we look at the sequence of node values and count how many times each value appears.
We are given a single string and we are allowed to choose exactly one cut position that splits it into a left part and a right part. For each cut, we look at the two resulting strings and ask whether each one can be rearranged into a palindrome.
We are given a static array of integers, and we are asked to look at every contiguous subarray. For each subarray, we compute the greatest common divisor of all elements inside it, and then we sum all of those gcd values across all subarrays.
We are given a tree with $n$ nodes, where each node has a small integer value $ai$. Each query selects two nodes $u$ and $v$, and we consider the unique simple path between them.
We are asked to construct an array of length $n$, where every element lies between $1$ and $m$, with a global restriction on its subarrays.
Each input string in the list can be thought of as a very short sequence of characters, at most length six. For every query string, we are asked whether it can be formed by deleting some characters from at least one of these stored strings without changing the order of the…
We are given a tree with up to a very large number of nodes, where each node has a small integer value between 1 and 70. Each query gives two nodes, and we look at the unique simple path between them. Along this path, we multiply all node values together.
We are working with a binary string that represents a line of tables, where each position is either flipped or not flipped. The string changes only through direct point updates: a query of type 1 toggles a single position from 0 to 1 or from 1 to 0.
We are given two integers. One represents the cost of a single sandwich, and the other represents how much money Juan has available. Juan wants to spend his money only on full sandwiches and give them to friends, where each friend receives exactly one sandwich.
We are given a balanced parentheses sequence of length $2n$. Every position in this sequence is a bracket, and every opening bracket is matched with exactly one closing bracket, forming a tree-like nesting structure.
We are given a single short string representing a friend’s name. Regardless of what this string is, we must always output the same fixed word.
We are given a line of $n$ cells connected like a simple path, so from any cell $i$ you can move only to $i-1$ or $i+1$ if those exist. A token starts on a chosen cell, and that cell is immediately marked as visited. Two players alternate moves, starting with Ahmad.
We start with a collection of stones labeled from 1 to n. All stones are present initially. Then a random process runs for exactly n steps. At each step, one of the remaining stones is chosen uniformly at random and removed permanently.
We are given several circles on a 2D integer grid, each defined by a center point and a radius. After reading all circles, we receive a sequence of query points. For each query point, we must count how many of the given circles contain or touch that point.
We are given two arrays of the same length. The second array is fixed, but the first array can be permuted arbitrarily. After choosing a permutation of the first array, each position pairs one value from the first array with one value from the second array.
We are given several independent test cases. In each test case, we receive a list of integer values, where each value represents the power of a soldier.
We are given an array of positive integers. The task is to split it into several consecutive non-empty segments. Each element must belong to exactly one segment, so every valid solution corresponds to a full partition of the array into contiguous blocks.
We are given several independent scenarios where a horse starts at position 0 and moves only in the positive direction along a line. Along this line there are food dishes placed at distinct positions. Each dish requires some fixed amount of time to eat once the horse reaches it.
We are given multiple independent test cases. Each test case consists of several pairs of integers. For each pair $(a, b)$, we compute a value defined as $a^b$.
We are maintaining a dynamic set of integers where elements are inserted and deleted one operation at a time. After every update, we need to compute how “fragmented” the set is when viewed on the number line.
We are given a row of tiles numbered from 0 up to n, and a cat starts at tile 0. From any tile i, the cat can jump forward to any tile j as long as j is strictly ahead and does not exceed k steps away, meaning 1 ≤ j − i ≤ k.
We are given a collection of items, each item has two values, a and b. From these items we must choose exactly k distinct indices i1 < i2 < ... < ik. The score of a chosen sequence is the sum of the selected a-values minus the maximum b-value among the selected elements.
We are given a directed or undirected weighted graph for each test case, together with a designated start node and a target node.
We are given a sequence that describes cumulative gcd information of another hidden array. For each position $i$, the value $bi$ equals the gcd of the first $i$ elements of an unknown array $a$.
Take triangle $ABC$ and choose coordinates so that area ratios can be computed explicitly without relying on any assumed affine factorization.
We are given several directed graphs, each described by nodes and directed edges. A directed edge from one node to another means you can travel only in that direction.
We are given several independent test cases. In each test case, there is a list of strings, and we want to count ordered pairs of distinct indices such that when we concatenate the first string with the second, the resulting string reads the same forward and backward.
We are given several independent experiments. In each experiment, there is a reference integer $D$ that represents the DNA of a specific cat, and a list of other cats represented by integers $ai$. Each integer encodes genetic traits as bits.
We are given several independent test cases. In each test case, we are shown a line of contestants, each carrying a balloon of some color represented by an integer.
We are given a tree where each node carries an integer value. For every unordered pair of nodes $u, v$, we look at the unique simple path between them. On that path we define two quantities: the number of nodes on the path, and the gcd of all node values along the path.
The task describes a very simple qualification rule for a contest. Each test case gives a single integer representing how many distinct balloons a team has robbed. A team qualifies if and only if it has robbed at least 8 different balloons.
We are given a base string s. For each query, we are also given another string t, but the twist is that t is not fixed in order. We are allowed to permute its characters arbitrarily, and we want to know whether some substring of s can be rearranged to match t.
We are given several independent scenarios. In each scenario, there are $n$ movies, each with a fixed ticket price. The goal is to watch all movies exactly once. Normally, watching a movie requires paying its individual ticket cost.
We are given several test cases. Each test case describes a sequence of items arranged in a fixed order. Every item has an ID and a color. From this sequence, we want to select a subsequence of items while preserving the original order.
We are given several test cases. In each test case there is an array of items. Each item has two attributes: a value a[i] and a weight-like parameter b[i].