Skip to content
UoL CS Notes

Home

This website houses notes from my studies at the University of Liverpool. If you see any errors or issues, please do open an issue on this site's GitHub.

Lecture 8-2

COMP105 Lectures

List Recursion Examples In this section we will be re-implementing the built in functions for operating on lists. take take' 0 list = [] take' n [] = [] take' n (x:xs) = x : take' (n - 1) xs With the two base cases the program will end in...

Read More

Lecture 8-1

COMP105 Lectures

List Recursion Lists have a head and a tail. We use these command and pattern matching to recurse lists. Generally list recursions use the empty list [] as part of the base case. Consuming Lists sum' [] = 0 sum' (x:xs) = x + sum' xs The base case is...

Read More

Week 2 Summary

COMP109 Lectures

More Examples of Direct Proof $\forall\ n$ if $n$ is an integer then $n$ is rational. Proof: Suppose that $n$ is a particular but arbitrarily chosen integer. $n=\frac{n}{1}$ By definition of a rational number $\frac{n}{1}$ is rational. $\forall\ r$ and $s$, if $r,s$ are rational then $r+s$ is rational. Proof:...

Read More

Seminar 3

COMP107 Seminars

The seminar opened with a catch-up of the lectures that had been released during the week including: Systems Development Life-Cycle Requirement Elicitation Gathering information from people. Assignment An overview of the assignment requirements and materials provided. More effort should be put into accrediting team members in the meeting minutes.

Read More

Lecture 7-2

COMP105 Lectures

More Complex Recursion and Guards Multiple Base Cases Each base case represents a different stopping position: isEven 0 = True isEven 1 = False isEven n = isEven (n - 2) fibonacci 0 = 0 fibonacci 1 = 1 fibonacci n = fibonacci (n - 1) + fibonacci (n -...

Read More

Lecture 7-1

COMP105 Lectures

Recursion There is no such thing as a while loop in Haskell so you must use recursion to complete the same task. This links into Assignment 1 as it leans heavily on recursion. Factorial A recursive function is one that calls itself: factorial n = if n > 1 then...

Read More

Continuation of Week 1 Summary

COMP109 Lectures

Proving Existential Statements An existential statement is a statement in the form: \(\exists x\ Q(x)\) This means that there exists a value to which the function $Q(x)$ holds true. This may be under additional parameters. The easiest way to prove this is to find an $x$ that makes the function...

Read More

Week 1 Summary

COMP109 Lectures

Notion of Proof Types of Numbers Natural numbers $\mathbb{N}$ are whole numbers that start from 0. Integers are whole numbers including negatives. Rational numbers are any number that can be represented as fractions without a denominator of 0. Real numbers are any decimal number that can be presented on a...

Read More

Requirement Elicitation

COMP107 Lectures

The process of obtaining, through systematic research the requirements of a system form the various users, customers and other stakeholders. Needs a principle approach as it is often hard for users to articulate their need or their business problems. Any system that doesn’t meet the users need is neither useful...

Read More

System Analysis and Design

COMP107 Lectures

SAD seeks to understand what humans need to analyse data input or data flow systematically, process or transform data, store data, and output information in the context of a particular organisation or enterprise. Information - A Key Resource Information needs to be managed correctly. Managing computer-generated information differs from handling...

Read More