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 2015 Digital systems, linear algebra, introduction to formal proof 7 a i Solution by
Codex 0 2026-10-31
In natural deduction, conjunction introduction combines derivations of and under the available assumptions into . Disjunction elimination takes and two subproofs of the same conclusion , one assuming and the other assuming , and concludes . Implication introduction takes a subproof deriving from a temporary assumption , and concludes .
The rectangular boxes mark the scopes of temporary assumptions. The disjunction elimination rule discharges its two case assumptions, while the implication introduction rule discharges the antecedent assumption. Other surrounding assumptions remain in force; intermediate results depending on the boxed assumptions cannot be exported arbitrarily. Schematically,Here the square brackets designate the assumptions discharged by the corresponding inference rule.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 8 c iii Solution by
Codex 0 2026-10-31
Choose fresh arbitrary eigenvariables . Under , use the equality elimination rule to transport to . For the reverse direction, first derive by the symmetry derivation above. In full natural deduction form:All temporary assumptions are discharged before either universal quantifier introduction rule application, so both eigenvariable conditions hold. No premises remain:
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 8 c ii Solution by
Codex 0 2026-10-31
For transitivity of first-order equality, take to be . The equality elimination rule applied to and givesFor symmetry of first-order equality, first obtain by the equality introduction rule. Now take to be and substitute using :These choices of formula show exactly which occurrence is replaced, so neither argument assumes the property it is establishing.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 8 c i Solution by
Codex 0 2026-10-31
The equality introduction rule is reflexivity, with no premise. The equality elimination rule is substitution of equal first-order terms into a first-order formula:The indicated substitution must be capture-avoiding substitution in first-order logic: the first-order terms must be free for the replaced variable. One can designate a particular argument occurrence by choosing appropriately; the rule does not demand replacing every occurrence of an identical-looking term in a formula.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 8 a ii Solution by
Codex 0 2026-10-31
The dot after gives it scope over the following implication: read the premise as . Choose a fresh arbitrary eigenvariable . A natural deduction proof isAt line 6, is free in no undischarged assumption, so the universal quantifier introduction rule is valid.
The proposed variant is not derivable in a sound first-order logic. For a countermodel, use the two-element domain , interpret both predicates as , and assign the free variable the value 0. Then is true, as is under the assignment, but is false at element 1. The premise's bound and the conclusion's free have different scopes.Attempting to generalize from in the variant would violate the eigenvariable condition, because remains free in the undischarged assumption .
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 8 a i Solution by
Codex 0 2026-10-31
Apply the negation introduction rule to an assumed existential statement and the existential quantifier elimination rule with a fresh witness :The eigenvariable condition holds: is absent from the surrounding premise, the existential assumption and the exported conclusion . Its local assumption is discharged before the final negation introduction rule.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 7 d ii Solution by
Codex 0 2026-10-31
First obtain by a double-negation elimination, then obtain by the negation introduction rule. The following natural deduction proof uses only the printed rules, with denoting the logical falsity elimination rule:Reiteration only reuses an available line within its scope. In particular, the unused temporary assumption on line 11 is legitimately discharged by the implication introduction rule.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 7 d i Solution by
Codex 0 2026-10-31
Put and . Use the printed implication elimination rule, negation elimination rule, negation introduction rule, double-negation elimination and implication introduction rule:Line 1 is the given premise; the argument actually establishes the conclusion without needing it, since line 2 supplies its own copy of . Introducing and discharging this separate temporary assumption preserves the exact printed conclusion.
Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 3 b iv Solution by
Codex 0 2026-10-31
Execute this MIPS instruction fragment twice, once with equal operands and once with unequal operands, and observe whether its conditional branch is taken:Use
beq $t0, $t1, hit
sll $zero, $zero, 0
sll $zero, $zero, 0
hit:
sll $zero, $zero, 0$t0=7,$t1=7 for the first test and $t0=7,$t1=8 for the second. All padding instructions are explicit harmless MIPS instructions. In the pictured single-cycle model, the next program counter after beq is either hit or the sequential address. The branch target is deliberately different from the next sequential instruction. The extra padding also keeps a branch delay slot harmless if a test fixture uses an implementation with one, although the pictured model itself has none.A healthy
zero line reports the first subtraction as zero and the second as nonzero. A line stuck at zero prevents both branches, while a line stuck at one forces both branches. ThereforeObserve the branch decision or execution trace itself; an alleged unconditional beq used to skip result-recording code would also be affected by the fault. Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 3 b iii Solution by
Codex 0 2026-10-31
Again use independent externally initialized MIPS instruction tests. First preset The normal result, also obtained with
$t0=7, $t1=5, and executeadd $t2, $t0, $t1ALUSrc stuck at zero, is 12. If the line is stuck at one, the second ALU operand is the sign-extended low 16 instruction bits. For this exact instruction they encode rd=10, shift amount zero and function , giving . The erroneous result is therefore .For the second test, preset Normally, and with
$s0=L, $t3=4, memory at to 37 and memory at to 99, with both words valid and aligned. Executelw $t3, 0($s0)ALUSrc stuck at one, the address is and the result is 37. With the line stuck at zero, the second ALU operand is the old $t3=4, so the load reads 99 from . Thus Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 3 b ii Solution by
Codex 0 2026-10-31
A writing MIPS instruction distinguishes a line stuck at zero. With A healthy line or a line stuck at one produces
$t0=7, $t1=5, $t2=99, executeadd $t2, $t0, $t1$t2=12; a line stuck at zero leaves $t2=99.To distinguish normal operation from stuck at one, execute a normally nonwriting MIPS instruction. The following functional test uses the usual concrete controller choice The ALU computes . Here
MemToReg=0 during sw, selecting the ALU result on the write-data bus. Prepare $t0=37 and $s0=L-16384, for an aligned writable address , then executesw $t0, 16384($s0)rt is register 8 ($t0), and immediate also puts 8 into bits . Thus either value of the otherwise irrelevant RegDst selects $t0. With a healthy RegWrite, $t0 remains 37. With RegWrite stuck at one and the specified write-data selection, the unwanted register file write changes $t0 to . Combining the two independent observations givesController qualification. The source diagram does not specify values of otherwise irrelevant control outputs during a store.
MemToReg is a don't-care condition when RegWrite=0; its chosen implementation matters when that enable line is faulty. The functional test above explicitly fixes this convention instead of assuming that all implementations resolve it identically. A manufacturing fixture can also observe the register file write-enable directly while executing add followed by sw: the expected pairs are normally, stuck at zero, and stuck at one. This second observation does not depend on unused write-data controls or on whether an unwanted write happens to repeat an old value. Past exam of the year 1 of the computer science course of the University of Oxford 2015 Digital systems, linear algebra, introduction to formal proof (resit) 3 b i Solution by
Codex 0 2026-10-31
Run the following two MIPS instruction tests separately from externally prepared states, and inspect the register file after the indicated instruction. External preparation is useful in a manufacturing test: code that initializes processor registers through the very control line being tested need not work. Assume the one potentially faulty line is
RegDst; all other lines work normally.For the first test, preset The encoded
$t0=7, $t1=5, $t2=99, and executeadd $t2, $t0, $t1rt is $t1, while rd is $t2. A healthy line or a line stuck at one writes 12 into $t2. A line stuck at zero instead writes 12 into $t1, leaving $t2=99.For the second test, preset The zero immediate makes instruction bits zero. A healthy line or a line stuck at zero writes 37 into
$t3=4, $s0=L, and the aligned memory word at to 37, then executelw $t3, 0($s0)$t3; a line stuck at one attempts to write the MIPS zero register, leaving $t3=4. The MIPS zero register ignores attempted writes. Thus, recording the first test's $t2 and the second test's $t3, Past exam of the year 1 of the computer science course of the University of Oxford 2014 Imperative programming 1 b ii Solution by
Codex 0 2026-10-31
There are candidate values in and exactly occurrences there. If , thenThus the pigeonhole principle givesThis conclusion does not assert that every value on the lower side is present; duplicates may leave both sides deficient.
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Imperative programming 1 b i Solution by
Codex 0 2026-10-31
Take an integer pivot . There are possible values in but only occurrences of such values in the whole array. When , the pigeonhole principle givesRepeated values do not invalidate the argument: they can only reduce the number of distinct values represented by those occurrences. The other side might also contain a missing value.
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Functional programming, design and analysis of algorithms 3 d iii Solution by
Codex 0 2026-10-31
A list unfold needs an explicit state describing the unvisited work. Use a list of pending rose trees, with the next tree first. Emit that tree's root label, and replace it by its children followed by the remaining pending trees:
dftU :: RTree a -> [a]
dftU t = unfold null label advance [t]
where
label :: [RTree a] -> a
label (Node x _ : _) = x
advance :: [RTree a] -> [RTree a]
advance (Node _ children : rest) = children ++ restThe boxed state transition is , with output . The stopping test prevents either helper from being applied to
[].The loop invariant is that concatenating the depth-first traversals of the pending trees gives exactly the unproduced output. Removing the next root emits its first label; replacing that tree by its children preserves the remainder of that preorder traversal. Adding children at the front realizes an explicit-stack depth-first tree traversal; placing them at the end would give a different visiting order. The first states for the source example have roots
[1], [2,5,6], [3,4,5,6], [4,5,6], [5,6], [6], [7], []. Past exam of the year 1 of the computer science course of the University of Oxford 2014 Functional programming, design and analysis of algorithms 3 d ii Solution by
Codex 0 2026-10-31
The child results supplied by the tree fold are already their depth-first traversals. Prepend the current label to their list concatenation:
dftF :: RTree a -> [a]
dftF = foldRTree visit
where
visit :: a -> [[a]] -> [a]
visit x childLists = x : concat childListsThus . Substituting the equation for the tree fold gives exactly the recursive preorder traversal equation from part (i), proving equality by structural induction on a finite rose tree.
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Functional programming, design and analysis of algorithms 3 d i Solution by
Codex 0 2026-10-31
dft :: RTree a -> [a]
dft (Node x ts) = x : concatMap dft tsThis is preorder traversal:The Haskell concatMap function preserves child order and finishes each child subtree before moving to the next. A leaf yields its singleton label; the source example yields
[1,2,3,4,5,6,7]. Past exam of the year 1 of the computer science course of the University of Oxford 2014 Discrete mathematics, continuous mathematics and probability 9 b ii Solution by
Codex 0 2026-10-31
Let be the head indicator random variable for toss . These are independent and identically distributed random variables with a Bernoulli distribution of parameter , so , , and . Taking makes . The preceding Chebyshev's inequality bound givesThe endpoints are included because this event is exactly .
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Discrete mathematics, continuous mathematics and probability 9 b i Solution by
Codex 0 2026-10-31
By linearity of expectation and independence,For , apply Chebyshev's inequality at threshold and take the complementary event:If , every almost surely, so almost surely and the bound holds directly. This handles the zero-threshold case without applying Chebyshev's inequality at an inadmissible threshold.
Past exam of the year 1 of the computer science course of the University of Oxford 2014 Discrete mathematics, continuous mathematics and probability 9 a iv Solution by
Codex 0 2026-10-31
The logarithm is strictly increasing, so . Since almost surely,Thus the logarithm of a Pareto random variable has an exponential distribution with rate . Its probability density function value at the single endpoint can be chosen arbitrarily without changing the law.
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





