🎓How I Study AIHISA
📖Read
📄Papers📰Blogs🎬Courses
💡Learn
🛤️Paths📚Topics💡Concepts🎴Shorts
🎯Practice
📝Daily Log🎯Prompts🧠Review
SearchSettings
How I Study AI - Learn AI Papers & Lectures the Easy Way

Concepts12

Groups

📐Linear Algebra15📈Calculus & Differentiation10🎯Optimization14🎲Probability Theory12📊Statistics for ML9📡Information Theory10🔺Convex Optimization7🔢Numerical Methods6🕸Graph Theory for Deep Learning6🔵Topology for ML5🌐Differential Geometry6∞Measure Theory & Functional Analysis6🎰Random Matrix Theory5🌊Fourier Analysis & Signal Processing9🎰Sampling & Monte Carlo Methods10🧠Deep Learning Theory12🛡️Regularization Theory11👁️Attention & Transformer Theory10🎨Generative Model Theory11🔮Representation Learning10🎮Reinforcement Learning Mathematics9🔄Variational Methods8📉Loss Functions & Objectives10⏱️Sequence & Temporal Models8💎Geometric Deep Learning8

Category

🔷All∑Math⚙️Algo🗂️DS📚Theory

Level

AllBeginnerIntermediate
⚙️AlgorithmIntermediate

Modular Arithmetic Pitfalls

Modular arithmetic is about working with remainders, but programming languages often return negative remainders, so always normalize with (a % MOD + MOD) % MOD.

#modular arithmetic#modular inverse#fermats little theorem+12
⚙️AlgorithmIntermediate

Overflow Prevention Techniques

Integer overflow happens when a computed value exceeds the range of its type; in C++ this silently wraps for unsigned and is undefined for signed, so prevention is crucial.

Advanced
Filtering by:
#modular arithmetic
#overflow prevention
#long long
#__int128
+11
∑MathIntermediate

Derangements

A derangement is a permutation with no element left in its original position, often written as !n or D(n).

#derangement#subfactorial#inclusion-exclusion+11
∑MathIntermediate

Inclusion-Exclusion Principle

The Inclusion-Exclusion Principle (IEP) corrects overcounting by alternately adding and subtracting sizes of intersections of sets.

#inclusion-exclusion#derangements#surjections+12
∑MathIntermediate

Stars and Bars

Stars and Bars counts the ways to distribute n identical items into k distinct bins using combinations.

#stars and bars#combinatorics#binomial coefficient+12
∑MathIntermediate

Modular Arithmetic Basics

Modular arithmetic is arithmetic with wrap-around at a fixed modulus m, like numbers on a clock.

#modular arithmetic#mod#modulo c+++12
∑MathIntermediate

Modular Inverse

A modular inverse of a modulo m is a number a_inv such that a × a_inv ≡ 1 (mod m).

#modular inverse#extended euclidean algorithm#fermats little theorem+12
∑MathIntermediate

Fermat's Little Theorem

Fermat's Little Theorem says that for a prime p and integer a not divisible by p, a^{p-1} ≡ 1 (mod p).

#fermat's little theorem#modular inverse#binary exponentiation+11
∑MathIntermediate

Fast Exponentiation

Fast exponentiation (binary exponentiation) computes a^n using repeated squaring in O(log n) multiplications.

#binary exponentiation#fast power#modular exponentiation+11
∑MathIntermediate

Chinese Remainder Theorem

The Chinese Remainder Theorem (CRT) reconstructs an integer from its remainders modulo pairwise coprime moduli and guarantees a unique answer modulo the product.

#chinese remainder theorem#crt#modular arithmetic+12
⚙️AlgorithmIntermediate

String Hashing (Polynomial Hash)

Polynomial string hashing encodes a string as a base-p number modulo a large prime, letting us compare substrings in O(1) after O(n) preprocessing.

#string hashing#polynomial hash#rolling hash+12
🗂️Data StructureIntermediate

DSU with Weighted Edges

A DSU with weighted edges (also called a potential or difference-constraint union-find) maintains relative values between elements while still supporting near-constant-time merges and finds.

#dsu#union-find#weighted edges+11