Phantom Bird Blog
website·Indexed 29 days ago
https://phantombird.netlify.appA personal knowledge base and blog covering a wide range of technical and academic topics, including operating system development (OS series covering paging, IDT, and memory allocation), mathematics, Olympiad in Informatics (OI), physics, chemistry, and front-end development with VuePress.
What's inside Phantom Bird
- Re-rooting DP is used when a problem requires calculating a result for every node in a tree acting as the root. Instead of running a full DP for each node (which takes O(n^2)), this technique leverages the fact that moving the root from node $u$ to an adjacent node $v$ only changes the DP values for $u$ and $v$. By traversing the tree and 'transferring' the root, all results can be computed in linear time.
Overview of the Gosper Algorithm for Summation
The Gosper algorithm is used to find a hypergeometric closed-form sum for a sequence $t(k)$. A sequence $t(k)$ is considered a hypergeometric term if the ratio $\frac{t(k+1)}{t(k)}$ is a rational function of $k$ (a ratio of two polynomials). The goal of the algorithm is to find another hypergeometric sequence $T(k)$ such that $t(k) = T(k+1) - T(k)$. If such a $T(k)$ exists, the sum can be calculated as $\sum_{k=1}^{n} t(k) = T(n+1) - T(1)$.Overview of Rerooting DP (Change-Root DP)
Rerooting DP is used when a problem requires calculating a result for every node in a tree acting as the root. Instead of running a full DP for each node ($O(n^2)$), this technique leverages the fact that moving the root from node $u$ to an adjacent node $v$ only changes the DP values of $u$ and $v$. By traversing the tree and 'transferring' the root, all answers can be computed in $O(n)$ time.Overview of Gosper's Summation Algorithm
Gosper's algorithm is used to determine if a hypergeometric sequence $t(k)$ (where $t(k+1)/t(k)$ is a rational function of $k$) has a hypergeometric anti-difference $T(k)$ such that $t(k) = T(k+1) - T(k)$. If such a $T(k)$ exists, the sum of the sequence can be computed as $\sum_{k=1}^{n} t(k) = T(n+1) - T(1)$.Understand the Geometric Product in Geometric Algebra
The geometric product is a fundamental multiplication operation for vectors that satisfies the distributive and associative laws. Unlike the dot product (which results in a scalar) or the cross product (which is limited to 3D/7D), the geometric product allows for algebraic operations on geometric objects across any dimension. For any vector $\mathbf{v}$, the product of the vector with itself is defined as $\mathbf{v}^2 = |\mathbf{v}|^2$.Mathematical Gomoku Game Rules and Winning Conditions
Mathematical Gomoku is played on a grid $S = {(x,y) \mid x,y \in {1,2,\dots,n}}$. Two players, F (first move) and T (second move), take turns marking unoccupied points. A player wins if they place $m$ distinct pieces $P_1, P_2, \dots, P_m$ such that:
- All $m$ pieces lie on the same straight line.
- For all $i \in {1, 2, \dots, m-1}$, the distance between consecutive pieces $|P_i P_{i+1}| \le \sqrt{2}$.
If all points in $S$ are occupied without a winner, the game is a draw. The game state $T(n,m)$ is defined as:
- $1$ if F has a winning strategy.
- $-1$ if T has a winning strategy.
- $0$ if neither has a winning strategy (draw).
Understand the cause of concentric rings in the End
The End's terrain height is determined in 8x8 blocks. The game calculates the distance from the center using the formula $\sqrt{\lfloor x/8 \rfloor^2 + \lfloor z/8 \rfloor^2}$. Because these calculations use 32-bit integers, they are subject to overflow. When the result of $\lfloor x/8 \rfloor^2 + \lfloor z/8 \rfloor^2$ overflows into a negative value, the square root operation fails, resulting in a ring of void. Terrain is normal when the overflow result is positive and void when it is negative.Understand the Geometric Product and its properties
The geometric product is a multiplication for vectors that satisfies the distributive and associative laws. For any vector $\mathbf{v}$, it is defined such that $\mathbf{v}^2 = |\mathbf{v}|^2$.
Key properties include:
- Anti-commutativity: For orthogonal vectors $\mathbf{i}$ and $\mathbf{j}$, $\mathbf{i}\mathbf{j} + \mathbf{j}\mathbf{i} = 0$ (or $\mathbf{i}\mathbf{j} = -\mathbf{j}\mathbf{i}$).
- General Anti-commutativity: If an $r$-grade multivector $\mathbf{u}$ and an $s$-grade multivector $\mathbf{v}$ overlap in $k$ dimensions, then $\mathbf{v}\mathbf{u} = (-1)^{rs-k} \mathbf{u}\mathbf{v}$.
Use the modified my-exam-zh LaTeX package
The
my-exam-zhpackage is a modified version of the originalmy-exampackage. Its usage is identical to the original package, with the following specific additions and changes:- New Symbol: Added
\tpito provide a Times New Roman π, serving as an alternative to the upright π inunicode-math. - Customizable Secrecy Header: The
\secretcommand allows modification of the 'Top Secret' (绝密) header to mitigate legal risks. - Notice Spacing: The default spacing for the
\noticeenvironment has been reduced by2pt.
- New Symbol: Added
Represent 2D vectors using complex numbers
A 2D vector $\mathbf{a}$ can be represented as a complex number $a \in \mathbb{C}$, where the real part corresponds to the x-component and the imaginary part corresponds to the y-component: $\mathbf{a} = (\text{Re}(a), \text{Im}(a))$. The complex conjugate $a^*$ is denoted as $\bar{a}$, and the argument is $\alpha = \arg a$.Understand Dual Conic Sections for Line-Conic Positional Analysis
A dual conic section $\Gamma'$ is formed by the envelope of the polar lines of all points on a conic section $\Gamma$ with respect to a reference conic $C$ (usually the unit circle $x^2 + y^2 = z^2$). The positional relationship between a point $P$ and $\Gamma$ is equivalent to the positional relationship between the polar line $l$ of $P$ and the dual conic $\Gamma'$.Understand Vue.js Single File Component (SFC) structure
Vue components are typically written in.vuefiles consisting of three main blocks:<template>for the HTML structure,<script setup>for the JavaScript logic using the Composition API, and<style scoped>for CSS styles that only apply to the current component.<template> <!-- HTML Template --> </template> <script setup> /* JavaScript Logic */ </script> <style scoped> /* Scoped CSS */ </style>