Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Extend the original example by a matrix with matrix dimensions , so . The Catalan number counts all possible groupings. Their scalar multiplication costs areThe optimum is , with cost . Enumeration makes a useful check here, but dynamic programming reaches the same answer by solving ten integer intervals, including the four single-matrix base cases:For example, . The three final-split candidates for the full matrix product supply a compact certificate:The first candidate already uses the better grouping of ; the worse need not be reconsidered at the top level. This is how optimal substructure lets the table represent all five possibilities with only three final candidates.
Read , which separates from . Then separates from , and separates from . This recursion stops at every , returning the corresponding matrix name. Combining the returned expressions recovers , rather than only its cost. Every recursive call uses a shorter integer interval, establishing algorithm termination; a tied minimum may choose any attaining split. The recovered binary tree has leaves and internal nodes, so reconstruction takes steps. Its attraction is the separation between an enormous family of groupings and a small set of reusable dynamic programming states.
Let have matrix dimensions , where are positive integers. For , define as the minimum scalar multiplication cost of the contiguous matrix product . The endpoints of an integer interval identify a dynamic programming state. A single matrix needs no matrix multiplication, giving the base case . At the final matrix multiplication, split after :The two subproducts have matrix dimensions and , regardless of their internal grouping. The recurrence relation adds their optimal costs and the final scalar multiplication cost.[ref]
Lecture 21: Dynamic Programming III. 6.006 Introduction to Algorithms, Fall 2011 by Massachusetts Institute of Technology, 6.006 course staff; Lecture 21: Dynamic Programming III, printed p. 2, Parenthesization: final split, recurrence and zero one-matrix base case; notes use half-open indices
Why is this optimal substructure? For a chosen final split , replacing either subproduct's grouping by a cheaper one leaves its matrix dimensions and exact matrix product unchanged, so it decreases the whole cost by the same amount. Therefore an optimal grouping can use optimal groupings on both sides. Conversely, each candidate in the recurrence relation joins two achievable groupings. Mathematical induction on , starting with the single-matrix base case, proves that the minimum is achievable and no grouping is cheaper.
There are also overlapping subproblems: while evaluating the different final splits of , the cases and both request the cost of . Recursion without reuse recomputes this answer; memoization or a dynamic programming table stores it once. Fill the table by increasing length , so both dependencies are ready. Record an attaining split alongside each cost.[ref]
Lecture 21: Dynamic Programming III. 6.006 Introduction to Algorithms, Fall 2011 by Massachusetts Institute of Technology, 6.006 course staff; Lecture 21: Dynamic Programming III, printed p. 2, Parenthesization: increasing substring size, cubic time and parent pointers
The dynamic programming table has cost entries. For length , there are entries and possible splits, so the exact number of candidate evaluations isUnder the unit-cost assumption that arithmetic operations, comparisons and access to stored costs each take constant time, this gives time complexity and space complexity , using Big O notation. These bounds concern choosing a grouping from the matrix dimensions; they exclude the subsequent matrix multiplication work. If the dimensions or costs require arbitrarily long integers, their arithmetic and storage costs must also be counted.
For matrix dimensions and , ordinary matrix multiplication computes matrix entries, each using scalar multiplications. Thus its cost is scalar multiplications, with additions if each sum starts from its first term. Here we minimize only the scalar multiplication count, using this dense matrix multiplication rule throughout. The counts describe arithmetic operations, rather than measured elapsed time; matrix multiplication methods that exploit structure or use faster formulas require a different cost rule.
Take matrices , , with matrix dimensions , , . Both groupings produce a matrix product, but their intermediate matrix dimensions differ:The second grouping first compresses into a matrix, avoiding the intermediate matrix . The saving is scalar multiplications, although both groupings use exactly two matrix multiplications. This is why counting only matrix multiplication operations hides the interesting choice.
The same matrix product can require 3840 or 780 scalar multiplications
. Original binary trees for the three-matrix example. Leaves keep in the same order. Each internal node gives its resulting matrix dimensions and the local scalar multiplication cost; adding those costs gives the total. Details.Associativity permits these regroupings in exact arithmetic; commutativity is neither assumed nor generally true for matrix multiplication. Swapping and here would even make their matrix product undefined. In floating-point arithmetic, round-off error can make the two groupings yield different computed matrix entries; the cost optimum alone does not guarantee the smallest numerical error.
Project documentation with no individual byline.
Online text: matplotlib.org/3.10.7/gallery/scales/log_demo.html
Cited passages: Convenience functions semilogx, semilogy, and loglog; Logarithms with other bases; Dealing with negative values.
Math 221, Matrix Computations, Fall 2023 Notes for Ma221 Lecture 15, Dec 1, 2023 by
Codex 0 2026-10-18
Lecture notes in Math 221, Matrix Computations, Fall 2023, dated 1 December 2023 in the heading. No explicit author byline or institutional authorship is established. The University of California, Berkeley EECS faculty website hosts the notes; James Demmel is the course instructor. The lecture date is distinct from any publication or revision date.
Cited passages: PDF p. 1 heading and opening left/symmetric transformations; PDF p. 1, Preconditioned CG algorithm and equivalent symmetric system; PDF p. 1, goals (1) and (2), M = I and M = A comparison, example (1) Jacobi preconditioning; PDF p. 2, example (3) triangular factor solves; Course homepage, title and Instructor section, web lines 2–14.
Math 221, Matrix Computations, Fall 2009 Notes for Ma221 Lecture 21, Nov 10 2009 by
Codex 0 2026-10-18
Lecture notes in Math 221, Matrix Computations, Fall 2009, dated 10 November 2009 in the heading. The page has no explicit author byline. James Demmel is the verified course instructor; the University of California, Berkeley EECS faculty website hosts the notes. No separate publication date or institutional authorship is asserted.
Cited passages: Basic iterative methods, splitting and recurrence (*); spectral-radius lemmas and convergence-for-all-starts theorem; Jacobi and Gauss-Seidel component loops; strict row diagonal dominance, Theorem 1 and proof; 1D Dirichlet Poisson matrix and sine eigenvectors.
Additional cited passages: opening solver building blocks; Gauss-Seidel component loop, splitting, ordering remark and red-black scheduling; Theorem 1, strict row diagonal dominance; Theorem 3, SOR convergence for symmetric positive-definite matrices with the ω = 1 specialization. The lecture date and instructor association above remain distinct from author bylines and publication dates.
In Mass spectra and isotopes by Francis William Aston, printed pp. 10–12, Fig. 1, Francis William Aston describes successive electric and magnetic deflections in one plane, with opposite senses. This geometry focuses a range of ion speeds; it does not require the straight-through cancellation of a velocity selector.
The reason compensation is possible follows from the Lorentz force. In a short region of length , a small electric deflection angle has magnitude : the transverse acceleration acts for a time , and the deflection angle is the acquired transverse velocity divided by . A short magnetic region of length gives , since the magnetic force already contains one factor of speed. Slower ions therefore receive a disproportionately larger electric deflection.
An original local approximation makes the focusing idea explicit. At fixed mass-to-charge ratio, replace each region by a small angular kick and include the drift distances in two positive constants and . With , write the detector coordinate asChoosing the geometry and fields so that eliminates the first-order speed sensitivity. Indeed,A fractional speed error then contributes only at order in this approximation. This is a local thin-kick explanation, not Aston's exact pole geometry, focal-plane equation, or a prediction of its measured mass resolution. Finite slit widths, initial directions, and field boundaries still matter. Unlike a velocity selector, focusing can collect nearby speeds into a narrow image instead of discarding all but a narrow accepted range.
Successive opposite deflections in an early mass spectrograph, compared with a chosen velocity selector and magnetic analyzer
. Top: functional schematic of the sequence described by Francis William Aston; colored paths indicate one mass-to-charge ratio at nearby speeds. Paths use the local thin-kick illustration, and dimensions and plate orientation are not a reconstruction. Bottom: an independently chosen teaching geometry has overlapping selector fields followed by a separate semicircular magnetic path. Both diagrams show positive ions; the Thomson charge-to-mass experiment gives the corresponding negative-electric charge example. Details. Pinned article: Introduction to the OurBigBook Project
Welcome to the OurBigBook Project! Our goal is to create the perfect publishing platform for STEM subjects, and get university-level students to write the best free STEM tutorials ever.
Everyone is welcome to create an account and play with the site: ourbigbook.com/go/register. We belive that students themselves can write amazing tutorials, but teachers are welcome too. You can write about anything you want, it doesn't have to be STEM or even educational. Silly test content is very welcome and you won't be penalized in any way. Just keep it legal!
Intro to OurBigBook
. Source. We have two killer features:
- topics: topics group articles by different users with the same title, e.g. here is the topic for the "Fundamental Theorem of Calculus" ourbigbook.com/go/topic/fundamental-theorem-of-calculusArticles of different users are sorted by upvote within each article page. This feature is a bit like:
- a Wikipedia where each user can have their own version of each article
- a Q&A website like Stack Overflow, where multiple people can give their views on a given topic, and the best ones are sorted by upvote. Except you don't need to wait for someone to ask first, and any topic goes, no matter how narrow or broad
This feature makes it possible for readers to find better explanations of any topic created by other writers. And it allows writers to create an explanation in a place that readers might actually find it.Figure 1. Screenshot of the "Derivative" topic page. View it live at: ourbigbook.com/go/topic/derivativeVideo 2. OurBigBook Web topics demo. Source. - local editing: you can store all your personal knowledge base content locally in a plaintext markup format that can be edited locally and published either:This way you can be sure that even if OurBigBook.com were to go down one day (which we have no plans to do as it is quite cheap to host!), your content will still be perfectly readable as a static site.
- to OurBigBook.com to get awesome multi-user features like topics and likes
- as HTML files to a static website, which you can host yourself for free on many external providers like GitHub Pages, and remain in full control
Figure 2. You can publish local OurBigBook lightweight markup files to either OurBigBook.com or as a static website.Figure 3. Visual Studio Code extension installation.Figure 5. . You can also edit articles on the Web editor without installing anything locally. Video 3. Edit locally and publish demo. Source. This shows editing OurBigBook Markup and publishing it using the Visual Studio Code extension. - Infinitely deep tables of contents:
All our software is open source and hosted at: github.com/ourbigbook/ourbigbook
Further documentation can be found at: docs.ourbigbook.com
Feel free to reach our to us for any help or suggestions: docs.ourbigbook.com/#contact








