Topics (384k) Articles (398k) Users (410) Discussions (242) Comments (383) Files (13k) New article
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 7 a Solution by
Codex 0 2026-10-31
The implication introduction rule opens a subproof with a temporary assumption , derives , and discharges that assumption to conclude . The negation introduction rule opens a subproof with a temporary assumption , derives logical falsity , and discharges it to conclude .
The boxes record the scopes and dependencies of the temporary assumptions. A result derived inside a box cannot be used outside it without the appropriate discharge rule; it may depend on the boxed assumption. Other, surrounding assumptions remain in force. This is how the natural deduction rules distinguish a conditional derivation from an unconditional assertion.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 6 e Solution by
Codex 0 2026-10-31
For , the triangular matrix formula gives the characteristic polynomialThe three eigenvalues are distinct, so part (d) already proves the existence of an eigenvector basis. Explicit choices, ordered by eigenvalues , areTheir column matrix has determinant one, and direct multiplication gives respectively one, three and two times the indicated vector.
For , expansion along the last row givesAgain the three eigenvalues are distinct. An explicit eigenvector basis, ordered by eigenvalues , isIts column matrix has determinant . In particular, 's diagonal entries are not its eigenvalues: it is not a triangular matrix.
Finally , so every nonzero vector is an eigenvector with eigenvalue one. Choose the standard basis . These are linearly independent even though their eigenvalues coincide. Distinct eigenvalues are sufficient for an eigenvector basis, and are not necessary.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 6 d Solution by
Codex 0 2026-10-31
Interpret “distinct eigenvalues” as pairwise distinct eigenvalues in the chosen field. Select a nonzero eigenvector for each. A single nonzero vector is linearly independent. Suppose inductively that are linearly independent. If adding made the set linearly dependent, its nontrivial relation would have a nonzero coefficient of , since otherwise it would contradict the induction hypothesis. Solving for would place it in the linear span of the first eigenvectors.
Part (c) would then force for some , contradicting pairwise distinctness. Mathematical induction therefore proves that all selected eigenvectors are linearly independent, forming a basis. If the field is , the assertion requires real eigenvalues; a real matrix can instead have nonreal eigenvalues and a eigenvector basis over the complex numbers.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 6 c Solution by
Codex 0 2026-10-31
Apply to the stated linear combination and use each eigenvector equation:Subtract times the original relation. This givesThe assumed linear independence implies separately for every . Since the eigenvector is nonzero, not all can vanish. Choose any with ; division by that coefficient gives . In fact every nonzero coefficient is attached to that same eigenvalue.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 6 b Solution by
Codex 0 2026-10-31
The vectors are linearly independent ifThey are linearly dependent if some such relation has at least one nonzero coefficient. All coefficients lie in the underlying field. Thus linear independence means that only the trivial linear combination gives zero; linear dependence means that a nontrivial one does.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 6 a Solution by
Codex 0 2026-10-31
An eigenvalue and eigenvector pair for a square matrix satisfiesThe scalar and the coordinates of belong to the chosen field, usually or . The nonzero condition is essential: the zero vector satisfies the equation for every and therefore cannot define an eigenvalue.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 5 e Solution by
Codex 0 2026-10-31
For a skew-symmetric matrix, . By parts (c) and (d),If is odd, , hence over . Therefore , so is a singular matrix. The conclusion depends on odd dimension: in dimension two, is skew-symmetric and has determinant one.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 5 d Solution by
Codex 0 2026-10-31
Write the determinant in its Leibniz formula for determinants, where is the set of permutations of :The permutation sign is justified by the given row-interchange property: a permutation matrix is obtained from the identity matrix by row interchanges, and every interchange changes its determinant by a factor . Reversing a sequence of interchanges constructs the inverse permutation with the same number of interchanges. Consequently . The Leibniz formula for determinants can itself be obtained by expanding the rows multilinearly in the standard basis: repeated selected coordinate rows contribute zero, and the remaining terms are precisely these signed permutation matrices.
Since , the same formula givesReindex the product with and reindex the sum with . Both reindexings are bijections, soThus for every real square matrix, including singular matrices. This proof does not assume the analogous column-operation rules in order to establish the transpose identity.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 5 c Solution by
Codex 0 2026-10-31
Use . The diagonal matrix has diagonal entries equal to , so the product and triangular matrix formulas from part (a) giveEquivalently, multiplying each of the rows by supplies one factor per row.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 5 b Solution by
Codex 0 2026-10-31
Let be standard coordinate columns. The required elementary matrix isIt is the identity matrix with the extra entry in position . Left matrix multiplication implements the row operation: all other rows are unchanged. Since , is a lower triangular matrix with every diagonal entry one. Part (a) therefore gives andHence adding a multiple of one row to another leaves the determinant unchanged, even if is singular.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 5 a Solution by
Codex 0 2026-10-31
For square matrices of the same size,For an upper or lower triangular matrix , its determinant is the product of its diagonal entries:These formulas include singular matrices and zero diagonal entries.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 4 c Solution by
Codex 0 2026-10-31
No. Take the one-by-one matrices , . Both column spaces are , whereas has column space . More generally, taking cancels any nonzero column space. One always has , because each sum column lies in the vector subspace , but equality can fail through cancellation.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 4 b Solution by
Codex 0 2026-10-31
Denote the columns by . The first two are linearly independent, because the top two coordinates have determinant . Direct calculation givesThus a column-space basis is , andFor the last description, the third row equals twice the first row plus three times the second, so every column lies in that plane. Since the two independent columns already span a two-dimensional vector subspace, they fill the plane.
The target vector satisfies , so it is in the column space. An especially simple linear combination isIn terms of the displayed basis, the same vector is . The column space itself is unique; the freedom is in choosing its basis.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 4 a Solution by
Codex 0 2026-10-31
The third left-hand side is three times the first minus the second. Consistency of this linear system therefore requires , orThis is also sufficient: the first two rows are linearly independent, and on setting the free variable they giveSubstitution into the third equation gives for either allowed . Explicitly the solution families are and . For every other , the same row relation gives an immediate inconsistency.
Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 3 e Solution by
Codex 0 2026-10-31
Keep both the limit and current argument in callee-saved registers, so a call to At every
foo preserves them. Under the same no-delay-slot convention, useli $s0, n
li $s1, 1
slti $t0, $s0, 1
bne $t0, $0, testEnd
testLoop:
move $a0, $s1
jal foo
break 1
beq $s1, $s0, testEnd
addi $s1, $s1, 1
b testLoop
testEnd:
break 0
b testEndbreak 1, $s1 is the tested value and $v0 is its result. Resuming after the breakpoint continues to the next value; after the program reaches its separate final stop. The initial guard handles with no calls. Testing equality before incrementing also avoids overflowing the loop variable after the final call when is the largest positive machine integer. As with the supplied procedures, evaluating all calls assumes enough stack space and representable arithmetic results. Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 3 d Solution by
Codex 0 2026-10-31
The blanks are Although the immediate call increases the argument, substitution into
x < 2 and return x - foo(x + 1). The compiled slti and bne select the first branch exactly for . Otherwise addi forms , jal foo returns its value in $v0, and sub $v0, $s0, $v0 subtracts that value from the preserved . Thus the complete high-level implementation isproc bar(val x : int) : int
begin if x < 2 then
return 1
else
return x - foo(x + 1)
end
endfoo's two recursive calls decreases the corresponding bar arguments to and whenever the recursive branch is entered. The mutual recursion therefore terminates on ordinary integer inputs, assuming sufficient stack space and no machine arithmetic overflow. Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 3 c Solution by
Codex 0 2026-10-31
The missing MIPS instructions, in order, areThe comparison
bne $t0, $0, fooRet1
subi $a0, $s0, 3
add $v0, $s1, $v0slti $t0, $s0, 3 makes $t0 nonzero exactly when , so the first instruction selects the base case. The second forms from the saved argument, rather than relying on $a0 surviving the first call. After the second call, $s1 holds bar(y-2) and $v0 holds bar(y-3); the final addition puts their sum in $v0, as required by the calling convention. Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 3 b Solution by
Codex 0 2026-10-31
The entry sequence creates one 12-byte stack frame, then preserves the return address and both used callee-saved registers:The closing sequence reverses these effects:Loads must precede deallocation because their offsets refer to the current stack frame. The return value in
subi $sp, $sp, 12 # allocate three four-byte words
sw $ra, 0($sp) # save return address of this activation
sw $s0, 4($sp) # save caller's s0
sw $s1, 8($sp) # save caller's s1lw $ra, 0($sp) # recover return address of this activation
lw $s0, 4($sp) # restore caller's s0
lw $s1, 8($sp) # restore caller's s1
addi $sp, $sp, 12 # deallocate the frame
jr $ra # return to the caller$v0 is deliberately retained. Saving $ra is essential even though it is not an $s processor register: otherwise the second nested call would destroy the address to which this activation must return. Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 3 a Solution by
Codex 0 2026-10-31
The calling convention passes the integer argument in
$a0, returns the result in $v0, and uses jal with $ra for a call and its return address. The callee returns using jr $ra. Its stack frame grows downwards from $sp and must be removed before returning, restoring the caller's stack pointer.The
$s processor registers are callee-saved registers: a callee that uses $s0 or $s1 must restore their incoming values. The $a, $v, and $t processor registers are caller-saved registers; a caller must preserve any of their values that it needs after a call. Consequently foo keeps its own argument in $s0 and the first call's result in $s1, where nested calls preserve them. Because a nested jal overwrites $ra, foo also saves its incoming return address. Every recursive activation has its own stack frame.The supplied MIPS instructions use the paper's simplified convention: pseudoinstructions such as
subi are accepted, and control transfers have no branch delay slot. The completed code below follows that convention. A hardware implementation with delayed control transfers requires suitable scheduling or nop instructions throughout the supplied code as well. Past exam of the year 1 of the computer science course of the University of Oxford 2016 Digital systems, linear algebra, introduction to formal proof 2 c Solution by
Codex 0 2026-10-31
Use unsigned inputs as in the preceding parts. Store a 16-bit accumulator , a 16-bit shifted multiplicand , an eight-bit multiplier , and a three-bit iteration binary counter . The sequential circuit has one 16-bit adder, a 16-bit multiplexer selecting or zero from , fixed one-place bit shifts, and load/hold selection for the digital registers. The input values are captured when
start is accepted, so later input changes cannot alter the operation.Use three control states with the following synchronous transition table. All assignments in a row use the old digital register values and occur together at the active clock edge.
| State | Condition | Register updates | Next state | IDLE | start = 0 | Hold all digital registers | IDLE | IDLE | start = 1 | , , , | RUN | RUN | , , , | RUN | RUN | , , ; hold | DONE | DONE | start = 1 | Hold all digital registers | DONE | DONE | start = 0 | Hold all digital registers | IDLE |
|---|
Reset selects IDLE and clears the digital registers. Set and
done = 1 exactly in DONE. A start pulse in IDLE launches one multiplication; further pulses during RUN are ignored. Holding start high cannot repeatedly launch operations: DONE waits for it to go low before rearming. The product remains stored while waiting and through the following IDLE state. There are eight RUN clock edges after the loading edge; the last addition is captured before done becomes high.For correctness, let denote the captured values. After iterations, for , the loop invariant isso . Writing , the next accumulation adds , the left bit shift doubles , and the logical right shift changes to . Hence the invariant is preserved. At , , giving . The largest product is , so the accumulator fits. Even the final shifted multiplicand is , so it also fits.
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






