2024-01-22 10:12:47

This commit is contained in:
Isaac Shoebottom
2024-01-22 10:12:48 -04:00
parent 8cf1b5ba3b
commit ecba3cbcf8
78 changed files with 82766 additions and 0 deletions

View File

@ -0,0 +1,49 @@
Strings and languages:
- An alphabet is a finite set of symbols, such as {1,2,3} or {0,1}
- A string is an alphabet $\sum$ is a finite sequence of symblols from $\sum$, for example 010010 and 10010101 are strings over the alphabet {0,1}
- A languge is a set of strings
- L1 = {00, 01, 10, 11}
- L2 = {a^n | n is an integer non-negative}
Notation: a to the power of n just means a repeated n times
Examples
$L_8 = \{a^m b^n | m,n \in \mathbb{z}^{nonneg}\}$
So valid strings would be
aaabbb, aaabbbb, ab, abb
$L_9 = \{a^n b^n | n \in \mathbb{z}^{nonneg}\}$
So valid strings would be
aabb, ab, aaaabbbb, aaaaaabbbbbb
$L_{11} = \{w \in \{a, b\}^* | \text{The number of "a"s is equal to the number of "b"s}\}$
This would include everything that L9 includes, but allows for the alphabet can be out of order
You can also written this as
$L_{11} = \{w \in \{a, b\}^* | n_a(w) = n_b(w)\}$
You can extend the repetition notation (exponent) to include multiple symbols by wrapping it in parentheses
Example:
$L_{12} = \{(ab)^n | n \in \mathbb{z}^{nonneg}\}$
This means we need to be careful as
$L_{13} = \{ab^n | n \in \mathbb{z}^{nonneg}\}$
is different, as L12 is asking for repetition of ab, while L13 is assigning a prefix of a and repetition of b
$L_{14} = \{a^i b^j c^k | i,j,k \in \mathbb{z}^{nonneg}, j = 2i + 3k\}$
So this means that for any number of "a"s and "c"s, the number of "b"s is predetermined if you have selected your "a"s and "c"s
Intro to functions and relations
Informally, a function (f) descrives an input output situation (A -> B)
For every input element a in A, there is exactly one ouput element b in B
f maps a to b
A is the domain of f
B is the co-domain of f

View File

@ -0,0 +1,52 @@
Lecture Topic: Functions
For every input element $a \in A$ there is exactly one output element $b \in B$
Jargon:
- f maps a to b
- the image of a under f is b
functions are one-to-one (or injective):
$\forall x,y \in A, x \neq y \rightarrow f(x) \neq f(y)$
or in other terms
$\forall x,y \in A, x = y \rightarrow f(x) = f(y)$
Example:
$f(x) = x^2$ is not one to one
Proof by counter example:
$x = -1$ and $y = 1$ are two integers in the domain that $x=y$ but $f(-1)$ and $f(1)$ are both equal to 1, so it is not one to one
To prove a function is one to one, it is a little more tricky, and needs to be general, for example:
Let x and y be any arbitrary elements of the domain where f(x) = f(y)
So it follows that x and y are equal (x = y)
Example for a real function: $g(x) = 3x - 11$
Real Numbers
Let x and y be any real number such that $g(x) = g(y)$. We will show that $x = y$
Since we know that g(x) = g(y), it means that $3x - 11 = 3y - 11$
Add 11 to both sides: $\therefore 3x = 3y$
Divide both sides by 3: $\therefore x = y$
Important to note: The definition (domain and co-domain) can change if a function is one to one, for example the square function on all integers vs all positive integers
To prove that a function A -> B is onto:
- Let be represent and arbitrary element in the co-domain B
- We want to find an element a in the domain and show that f(a) = b
Example:
Real Numbers, $f(x) = 5x + 2$ is onto
Proof: Let b be any arbitrary real number (we want to find a real number a and show that f(a) = b)
A through process might follow that, I want a value a such that f(a) = b, I want $5a + 2 = b$, then $5a = b - 2$, then $a = \frac{b - 2}{5}$
So, let $a = \frac{b - 2}{5}$ , which is a real number. Then plug this back into the function
$f(a) = f(\frac{b - 2}{5}$) (Substitution)
$= 5\frac{b-2}{5}+2$ (Definition of f)
$= (b-2) +2)$ (Algebra)
$=b$ (Algebra)
Beginning of proving a function is not onto:
Find some specific co-domain element b and show that there is no domain element that could map to b

View File

@ -0,0 +1,61 @@
Lecture Topic: Functions & Relations
When a function is onto, it means that the entire co-domain of a function is the range of the function
Proving a function is not onto:
Just prove for any element b in the co-domain B and show that b cannot be equal to f(a) for any a in the domain.
Example: $g: \mathbb{R} \rightarrow \mathbb{R}, g(x) = x^2 + 10$ is not onto
Proof:
For example, choose the element $-1$ from the co-domain $\mathbb{R}$
Consider any domain element $a$
The function will square $a$, and $a^2 \geq 0$ (because no squares are negative reals)
Then $a^2 + 10 \geq 10$, so this means that $-1$ is not in the co-domain
$\therefore$ The function is not onto
You can also use a proof by contradiction by saying that:
$g(a) = -1$
$\therefore a^2 + 10 = -1$
$\therefore a^2 = -11$
Squares of a real number cannot be negative, so the function is not onto
A function is not always numbers:
Example: Favourite UNB Course : S -> C
Where S is all students and C is all courses
What would have to be true for this to be one to one or onto?:
- One to one:
- Onto:
# Relations:
A binary relation R on two sets A and B is a subset of $A \times B$
- e.g. S = all students, C = all students, s is any given student, c is any given course
- Relation: HasTaken: for (s, c) s has taken c
- Relation Aplus: for (s,c) s got A+ in c
A relation can be between the same set, for example the set of A = {John, Jane, Bill, Sue, Mary, Betty}, we can define a relation that is the relationship between who loves who $A \times A$
- e.g. (John, Jane)
A binary relation $R \subseteq A \times A$ is also called an equivalence relation if the following conditions hold:
- reflexive: $\forall a \in A, (a,a) \in R$
- symmetric: $\forall a,b \in A, (a,b) \in R \rightarrow (b,a) \in R$
- transitive: $\forall a,b,c \in A, [(a,b) \in R \wedge (b,c) \in R] \rightarrow (a,c) \in R$
Example:
$G = \{(x,y) | x \in \mathbb{R}, y \in \mathbb{R}, x > y\}$
Is G reflexive? (Is is true that every real number is relation to itself)
No, because we can show that $(5,5) \notin \mathbb{R}$ because $5 \ngtr 5$
Is G symmetric? (Is it the case that whenever $(a,b) \in G, (b,a)$ will also be in G)
No, for example $(10,3) \in G$ because $10 > 3$ but $(3, 10) \notin G$ because $3 \ngtr 10$
Is G transitive? (Is it true that whenever (a,b) and (b,c) are in G, (a,c) will also be in G)
Yes, let a,b,c be any real numbers where $(a,b) \in G$ and $(b,c) \in G$
Since $(a,b) \in G$, we know that $a > b$
Since $(b,c) \in G$, we know that $b > c$
Then $a > b > c$, so that means that $a > c$, so also $(a,c) \in G$

View File

@ -0,0 +1,59 @@
Lecture Topic: Bandwidth and Data Rate
Analog: x(t)
Discrete: x(n)
Digital: from formula, range / set, bit sequence
Bandwidth:
$x(t) = \sum^{\infty}_{k=-\infty}A_k cos(2\pi f_k + \phi_k)$
Fourier series
Shannon Theorem:
For a Gaussian channel the data rate that can be achieved over a channel of a given bandwidth satisfies
$R \leq B_w log_2(1+\frac{S}{N}) \triangleq C$
R = Achievable data rate (bps)
$B_w$ = Channel bandwidth in Hz
S/N = Signal to noise ratio (SNR)
S = Signal power, N = noise power
Internet Architecture:
- Network Edge
- End systems: Host apps, not only computers and mobile devices but also wearables, sensors and large servers
- Access Networks: (Last hop, last mile), Connect end systems to the first router (aka edge router)
- Network Core:
- Packet switches: Routers, link layer switches
A hierarchical look at A network of network:
- Hosts connect to the internet via access ISPs, residential, cooperate ISPs, university ISPs, cellular data ISPs.
- Access ISPs in turn are interconnected through regional ISPs and tier 1 ISPs
(Diagram in slides)
Internet Access and Physical Media:
- Wired
- Dial up
- DSL
- Cable
- Fibre Optics
- Ethernet
- Wireless
- WiFi
- Cellular
- Satellite
Wired media: EM waves are guided along a solid medium (twisted pair copper, coaxial cable, fibre optics)
Wireless media: EM waves propagate through the air (Different electromagnetic spectrum/frequency bands)
Dial-Up:
Use existing telephony infrastructure
- Low Speed (56k)
- Can't use phone and internet at the same time (not always present)
- Modems modulate and demodulate data over phone lines
DSL:
Digital Subscriber Line
(Slides went fast)

View File

@ -0,0 +1,53 @@
Lecture Topic: Network Edge & Internet Access Technologies
Bandwidth and Data Rate recap:
The data rate cannot exceed the capacity of the bandwidth of a given channel, this is where the formula $R \leq B_w log_2(1+\frac{S}{N}) \triangleq C$ comes from
Doubling the data rate means that you need a bandwidth that has at least as much capacity to handle the new data rate
Internet Access Technologies:
- DSL:
- Using Frequency Division Multiplexing (FDM) it caries digital data through phone lines
- Example: Voice 0-4 kHz, Upstream 4-50 kHz, Downstream 50 kHz-1 MHz
- Twisted Pair Cable Wire:
- Constitute a fine antenna
- Cancel out cross talk and produce less radiation
- A number of pairs are bundled together in a cable
- Used in telephone systems, unheralded twisted pair (UTP) for local area networks, computer networks within a building (Ethernet)
- Data Rate: 10Mbps - 10Gbps
- Cable:
- Use cable TV companies existing cable infrastructure
- Hybrid fibre coaxial (HFC) access network
- Coaxial cables are shared to reach individual homes
- Fibre optics connect neighbourhood level junctions to CMTS
- Asymmetric 40Mbps - 1.2Gbps downstream, 30Mbps - 100Mbps upstream
- Data/TV are transmitted at different frequencies over shared cable
- At the home, splits the signals into TV and Internet signals
- Coaxial Cable
- More complex structure
- Better performance
- Excellent noise immunity because cable is very shielded
- Can span longer distances
- Bandwidth is close to 1 Ghz
- Data rates are higher than other technologies, 100s Mbps per channel
- Fibre to the home (FTTH)
- Optical network terminal in individual homes (ONT)
- Optical line terminal in central office (OLT)
- Fibre optic cables are similar to coax cables (lots of layers)
- Class core with higher index of refraction than the outer glass
- Light propagates through glass core
- Thin plastic jacket to protect glass cladding
- Fibres are typically grouped in bundles protected by an outer sheath
- The outer layer keeps the light inside, not leaking any energy by reflecting the signal off an outer sheath
- Has a few excellent features:
- Very low signal attenuation up to 100km
- Immune to electromagnetic interference
- Larger bandwidth, support data rate up to 10s or 100s of Gbps
- Hard to tap
Network Core:
- How is data moved through a network of links and packet switches?
- There are two fundamental approaches
- Circuit switching
- Packet switching
-

View File

@ -0,0 +1,42 @@
Lecture Topic: Network Core
Resource Sharing with circuit switching:
- Network resources divided into pieces allocated to connections
- Frequency division multiplexing (FDM). Dividing over bandwidth, and each end user gets a portion of the bandwidth for the entire portion of time.
- Time division multiplexing (TDM). Dividing over time, and each end user gets the full bandwidth for a portion of allocated time. Similar to round robin.
Table of some information of cellular network technologies:
CS: Circuit Switching
1G (FDMA)
2G (TDMA) (GSM/CS)
3G (CDMA) (CS/PS)
4G (PS)
5G (millimeter wave)
With circuit switching you can guarantee a certain level of performance, while with packet switching there is no/less of a guarantee of performance, which is why circuit switching was important for mobile networks as emergency calls need a certain level of performance to be guaranteed.
Packet Switching:
- Internet is based on packet switching
- ARPANET was the first packet-switched network and is an ancestor of the internet
- A sending host breaks a message into packets (numbered sequentially) and sends them into the network one by one
- Packets are transmitted individually through the network and reassembled at the receiving host to recover the original message
Packet switching is a very adaptive to changing network conditions. Due to packet chunking, packets in transit can be routed through different routes depending on the used bandwidth of other nodes on the network, and this can occur between two packets of the same chunk of data. This is because packets are numbered and are reordered at the destination.
A packet follows a path:
- First hop router: This is the first router that inspects the packet and forwards it to the next hop
- Then next router does the same, and so on
- The packets eventually arrives at the destination and are decoded
Packets follow a protocol called "store and forward"
Resource sharing with packet switching:
- Is very easy, as you can just send all packets over a link, according to different priorities
Multiplexing comparison:
- With circuit switching, if you allocate bandwidth to two services, it may end up unused and wasted, as the format of data is fixed and if service A is not using any traffic service B cannot use that other bandwidth
- Statistical multiplexing: Packet switching is on demand, so no bandwidth is explicitly allocated, and bandwidth is dynamically allocated based on current network usage
There are some downsides to packet switching to be aware of however:
- In next lecture

View File

@ -0,0 +1,66 @@
Lecture Topic: Probability
Experiment: An act where the outcome is subject to uncertainty
Sample space: The set of all possible outcomes of an experiment
Example:
- Flip a coin: $S = \{H, T\}$
- Throw a dice: $S = \{1, 2, 3, 4, 5, 6\}$
Events: An event is a collection (subset) of outcomes contained in the sample space S
$$
S =
\begin{Bmatrix}
1,1 & 1,2 & 1,3 & 1,4 & 1,5 & 1,6 \\
2,1 & 2,2 & 2,3 & 2,4 & 2,5 & 2,6 \\
3,1 & 3,2 & 3,3 & 3,4 & 3,5 & 3,6 \\
4,1 & 4,2 & 4,3 & 4,4 & 4,5 & 4,6 \\
5,1 & 5,2 & 5,3 & 5,4 & 5,5 & 5,6 \\
6,1 & 6,2 & 6,3 & 6,4 & 6,5 & 6,6
\end{Bmatrix}
$$
A = First and second elements are the same
$A = \{(1,1) \ (2,2) \ (3,3) \ (4,4) \ (5,5) \ (6,6)\}$
Union: Union of two events, A and B, ($A \cup B$)
Compliment: The compliment of an event A, is the set of all outcomes in S that are not in A
Mutually Exclusive Events: When and B have no common outcomes, they are said to be mutually exclusive or disjoint events, i.e. $P=(A \cap B) = 0$
Axiom:
1. For event A, P(A) >= 0
2. P(S) = 1
3. (Need to look at slides to correct)
(a) If $A_1, A_2 ... A_k$ is a finite collection of mutually exclusive events then: $$P(A_1 \cup A_2 \cup ... \cup A_k) = \sum^{\infty}_{i=1} P(A_i) $$
(b) If $A_1, A_2 ... A_k$ is a finite collection of mutually exclusive events then: $$P(A_1 \cup A_2 \cup ... \cup A_k) = \sum^{\infty}_{i=1} P(A_i) $$
Proposition:
1. For event A, P(A) = 1 - P(A')
2. If and and B are mutually exclusive then $P(A \cap B) = 0$
Permutation: Any ordered sequence of k objects taken from a set of n distinct objects is called a permutation of size k of the objects. The number of permutations of size k that can be constructed from n objects is denoted by $P_{k,n}$ and calculated by:
$$
P_{k,n} = \frac{n!}{(n-k)!}
$$
Combination: Given a set of n, any unordered sub-set of k of the objects is called a combination. The set of combinations of size k that can be formed from n distinct objected will be denoted by $C_{k,n}$ and calculated by:
$$
C_{k,n} = \frac{n!}{k!(n-k)!} = \begin{pmatrix}n \\ k \end{pmatrix}
$$
(NEED TO REVIEW THIS)
Example: S = {1, 2, 3, 4, 5}
$A_1$ = {1,2,3}, $A_2$ = {2,3,5}, $A_3$ = {2,3,1}
Permutation:
5! = 120
(5-3)! = 2! = 2
120 / 2 = 60
Combination:
5!/2!3! = 60/6 = 10
0! = 1
5 out of 5
5!/(5-5)! = 120/1 = 120

View File

@ -0,0 +1,2 @@
Lecture Topic: