Represent the two sides of the marriage problem as the parts of a bipartite graph, with an edge for each allowed pairing. A matching is a set of edges with no common endpoint; a complete matching of covers every vertex in . When the two parts have equal size it also covers , giving a perfect matching.
Hall's marriage theorem gives the exact finite-graph criterion:
Here is the set of right-side neighbours of . Necessity follows because distinct matched vertices of need distinct neighbours; Hall's theorem supplies sufficiency.
Multiplying the system by turns it into . For nonsingular , compute the transformed right side and solve the upper triangular system by back substitution. Orthogonal transformations preserve Euclidean lengths and do not amplify errors in that transformation.
If is singular,
Since , at least one diagonal entry of is zero. The resulting triangular system must then be checked for consistency and any free variables, rather than applying divisions by zero.
Apply part (b) to the first column of , using an orthogonal reflection to zero all entries below the first. Next apply a Householder reflection to the trailing subvector of the second column, embedded as so it leaves the first row and the zeros already created intact. Continue similarly through the columns. If a trailing column subvector is zero, skip that step.
The product of these embedded orthogonal matrices sends to an upper triangular matrix . Write that product as ; its transpose is also orthogonal. Hence
The argument uses no inverse of and therefore includes singular matrices.
Let and choose when , otherwise . Set , which is nonzero because . Compute
Thus the reflecting term in is exactly , giving
Its first coordinate is nonzero and all remaining coordinates vanish. The choice of sign also avoids subtracting nearly equal vectors when the first component is large.
For nonzero , the Householder transformation is
The rank-one matrix is symmetric and satisfies . Consequently and . Thus the matrix is symmetric and orthogonal; geometrically it reflects the component along and fixes its perpendicular hyperplane.
By part (c), the best degree-at-most-two polynomial is odd, so it must be . Orthogonality to gives
Therefore
Its error is automatically orthogonal to the even basis functions by parity, and the chosen coefficient makes it orthogonal to , so part (b) verifies optimality.
For odd , define . It is another polynomial in . Changing variables , and using evenness of the weight , gives . Thus is also a best polynomial. Uniqueness from part (b) gives , proving
Equivalently, the even component of a candidate is orthogonal to the odd residual and can only increase the squared error.
If the error is orthogonal to , then for any ,
proving sufficiency. Conversely, if minimizes, perturb it to for any real . The squared error becomes
A minimum at forces the linear coefficient to vanish, proving necessity.
For existence, choose the basis . Its Gram matrix is positive definite because is the squared norm of the nonzero polynomial with coefficients . Thus is invertible, and the normal equations have a solution, giving an orthogonal residual and therefore a minimizer. The Pythagorean identity shows any other minimizer differs by a polynomial of zero norm, so it is equal to the first. Hence the best polynomial exists and is unique.
The best polynomial minimizes the weighted squared error among all polynomials of degree at most :
The given inner product is positive definite on continuous functions despite the weight vanishing at zero: a continuous nonzero function is nonzero on an interval containing nonzero points, so its weighted square integral is strictly positive.
Put and . The normal law of the estimator gives . The fitted and residual Gaussian projections are orthogonal and hence independent, so this quantity is independent of . Their ratio therefore has Student's t-distribution:
If is its upper quantile, rearranging its central probability event gives
This interval has exact coverage under the given normal linear model, rather than merely large-sample coverage.
Let . The usual unbiased error-variance estimator is
Indeed the residual is the orthogonal projection of onto the -dimensional complement of the design column space, giving and expected RSS equal to . The maximum-likelihood estimator instead divides RSS by ; the unbiased divisor above is the one used for the exact t-interval in part (d).
Write . Since , the estimator is . Therefore
Its expectation proves unbiasedness. It is also jointly normal, being an affine transformation of the normal error vector.
The normal-error log-likelihood, for fixed variance, is a constant minus . Differentiating the squared residual gives the normal equations . Since has full column rank, is positive definite and the squared residual is strictly convex in . Hence the unique minimizer, and thus the maximum-likelihood estimator, is
Profiling over the unknown positive variance does not change the residual-minimizing value of .
The generalized likelihood ratio compares the constrained maximum from part (b) with the unrestricted maximum from part (a). Taking minus twice its logarithm gives
The unrestricted model has free parameters; the independence model has . Thus the asymptotic null distribution is , with four degrees of freedom. The supplied value gives
Therefore reject independence at the 5% level, but not at the 1% level. There is evidence of an association between the two classifications. The fitted expected counts are all about nine or larger, so the usual chi-squared approximation has no very small expected cells here.
Under the product constraint the log-likelihood separates:
Maximizing the two simplex problems independently gives and . Hence
The fitted expected cell counts under independence are consequently .
Ignoring the multinomial coefficient, the likelihood is . Maximize with . A Lagrange multiplier gives ; summing the resulting gives . Thus
Because every count is positive, the log-likelihood is strictly concave on the interior simplex and this solution is its unique maximum.

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!
We have two killer features:
  1. 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-calculus
    Articles 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/derivative
  2. 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.
    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.
  3. https://raw.githubusercontent.com/ourbigbook/ourbigbook-media/master/feature/x/hilbert-space-arrow.png
  4. Infinitely deep tables of contents:
    Figure 6.
    Dynamic article tree with infinitely deep table of contents
    .
    Descendant pages can also show up as toplevel e.g.: ourbigbook.com/cirosantilli/chordate-subclade
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