Embedded regex flags
Explains embedded regex flags like (?i) and Python version compatibility issues with global modifiers in regular expressions.
John D. Cook provides expert consulting in applied mathematics and data privacy, helping clients from tech, biotech, and legal industries—including Amazon, Google, Microsoft, and Amgen—solve complex problems efficiently.
53 articles from this blog
Explains embedded regex flags like (?i) and Python version compatibility issues with global modifiers in regular expressions.
Explores refined mathematical bounds for the remainder term in alternating series, relevant for numerical computing.
Explores Langford's problem: arranging two copies of numbers 1-n so that k numbers separate the two k's, with solutions for n ≡ 0 or 3 mod 4.
Testing AI's ability to generate Lilypond code from sheet music images, with mixed and often inaccurate results from Grok and ChatGPT.
Explores the simplification of sin(arccos(x)) and its extension to complex numbers, discussing branch cuts and analytic continuation.
Using SymPy to simplify hyperbolic expressions and exploring domain-specific simplification nuances.
Explores why Mathematica doesn't simplify sinh(arccosh(x)) as expected, delving into branch cuts and complex function definitions.
Explains a trigonometric composition table and provides Python code to verify the identities.
Discusses verifying mathematical identities using point-checking, Python, and formal methods, relating to programming and proofs.
Explores the evolution from simple logistic regression to modern AI, comparing model complexity, data requirements, and the surprising effectiveness of large neural networks.
Explores the challenges of getting consistent, reliable answers from AI models like ChatGPT due to prompt sensitivity and hidden variables.
Discusses the reliability challenges and lack of provable correctness guarantees in current AI systems, despite their productivity benefits.
Explores how small delays affect differential equations, comparing behavior with and without delays using mathematical analysis and examples.
Explains the bash shell shortcut ~- as a handy alternative to $OLDPWD for referencing the previous working directory.
Explains how to manipulate file extensions in bash scripts using shell parameter expansion, with a LaTeX to SVG conversion example.
A technical guide implementing Wagon's algorithm in Python to solve x² + y² = p for large primes, using quadratic residues and a modified Euclidean algorithm.
Explains how to compute a square root of -1 modulo a prime p, using number theory and Python code examples.
Explains an algorithm for finding a non-square modulo a prime, with Python code and examples from cryptography.
Explores Fermat's theorem on expressing primes as sums of two squares, comparing Gauss's formula with a more efficient computational algorithm.
Explains the orthogonal Procrustes problem: finding a rotation matrix to align one matrix with another using SVD, with Python code.