Commit stuff

This commit is contained in:
2026-01-01 21:25:26 +01:00
parent 5e164e791c
commit dfb471c25e
136 changed files with 0 additions and 0 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1,61 @@
Section 6.4: 7, *9*, *11*, 17, *21*, 23, *29, 33, 35, 37, 39*
= Exercise 7
What is the coefficient of $x "in" (2-x)^(19)$
= Exercise 9
What is the coefficient of $x^101y^99 "in the expansion of" (2x-3y)^200$
*Answer:*
$ -200!/(101! dot 99!)dot 2^101 dot 3^99 = -2^101 dot 3^99 dot mat(200;99) $
= Exercise 11
Use the binomial theorem to expand $(3x-2y³)$ into a sum of terms of the form $c x^a y^b$, where $c$ is a real number and $a$ and $b$ are nonnegative integers
*Answer:*
$ sum^5_(k=0)mat(5;k)(3x^4)^(5-k) (-2y^3)^(k) =\
243x^20-81dot x^16dot 2y^3 dot 5 + 27 dot x^12dot 4y^6dot 10 - 9x^8dot 8y^9dot 10 + 3x^4 dot 16y^12dot 5 -32y^15 =\
243x^20-810x^16y^3+1080x^12y^6-720x^8y^9+240x^4y^12-32y^15 $
= Exercise 17
What is the row of Pascal's triangle containing the binomial coefficients $mat(9;k),0<=k<=9$
= Exercise 21
Show that if $n$ and $k$ are integers with $1<=k<=n$, then $mat(n;k)<=n^k / 2^(k-1)$
*Answer:*
We know that $mat(n;k)$ is $n!/((n-k)!k!) = (n(n-1)(n-2)dots n-k+1)/(k(k-1)(k-2)(k-3)dots 2) <= (n dot n dot n dot dots)/(2 dot 2 dot 2)$
= Exercise 23
Prove Pascal's identity, using the formula for $mat(n;r)$
= Exercise 29
Let $n$ be a positive integer. Show that $ mat(2n;n+1)+mat(2n;n) = mat(2n+2;n+1) / 2 $
*Answer:*
We know:
$mat(2n;n+1)+mat(2n;n)=mat(2n+1;n+1)$
$mat(2n+1;n+1)=1/2dot (mat(2n+1;n+1)mat(2n+1;n+1))=mat(2n+2;n+1)/2$
= Exercise 33
Give a combinatorial proof that $sum_(k=1)^n k mat(n;k)=n 2^(n-1)$.
_Hint: Count in two ways the number of ways to select a committee and to then select a leader of the committee._
*Answer:*
To select a committee, you have $2^(n-1)$ choices (n-1 because when you have n=1, then the choices are $2^0=1$) and then you select one from the `n` people in the committee.
= Exercise 35
Show that a nonempty set has the same number of subsets with an odd number of elements as it does subsets with an even number of elements
= Exercise 37
In this exercise we will count the number of paths in the $x y$ plane between the origin $(0,0)$ and point $(m,n)$, where $m$ and $n$ are nonnegative integers, such that each path is made up of a series of steps, where each step is a move unit to the right or a move unit upward. (No moves to the left or downward are allowed.) Two such paths from $(0,0)" to "(5,3)$ are illustrated here.
#image("Exercise 6.4-37.png")
a) Show that each path of the type described can be represented by a bit string consisting of $m$ 0s and $n$ 1s, where a 0 represents a move one unit to the right and a 1 represents a move one unit upward.
b) Conclude from part (a) that there are $mat(m+n;n)$ paths of the desired type
= Exercise 39
Use Exercise 37 to prove Theorem 4. _Hint: Count the number of paths with $n$ steps of the type described in Exercise 37. Every such path must end at one of the points $(n-k,k)$ for $k=0,1,2, dots, n$._
Theorem 4: Let $n$ and $r$ be nonnegative integers with $r<=n$. Then: $mat(n+1;r+1)=sum^n_(j=r) mat(j;r)$

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 KiB

View File

@@ -0,0 +1,178 @@
#import "@preview/cetz:0.4.2"
Section 6.4
#title[Binomial coefficients, formula and identities]
= Binomial coefficient
From last week:
$C(n, k) = $ the number of k-combinations from an n-set. Or the number of ways to select k elements from an n-set. Or the number of k-subsets of an n-set. Formula: $n!/(k!(n-k)!)=mat(n;k)$ for $0<=k<=n$
== Pascal's triangle
#align(center, grid(columns: 2, column-gutter: 1em, cetz.canvas({
import cetz.draw: *
let n = 6
// calculate the triangle
let pascal = ()
for row in range(n + 1) {
let row-data = ()
for col in range(row + 1) {
let value = if col == 0 or col == row {
1
} else {
let prev = pascal.at(row - 1)
prev.at(col - 1) + prev.at(col)
}
row-data.push(value)
}
pascal.push(row-data)
}
// draw lines
for (row-idx, row) in pascal.enumerate() {
if row-idx < n {
let row-len = row.len()
let y = n - row-idx
for (col-idx, val) in row.enumerate() {
let x = col-idx - row-len / 2 + 0.5
let next-row-len = row-len + 1
let left-child-x = col-idx - next-row-len / 2 + 0.5
let right-child-x = (col-idx + 1) - next-row-len / 2 + 0.5
let child-y = y - 1
line((x, y / 1.5), (left-child-x, child-y / 1.5), stroke: gray)
line((x, y / 1.5), (right-child-x, child-y / 1.5), stroke: gray)
}
}
}
// draw values
for (row-idx, row) in pascal.enumerate() {
let row-len = row.len()
let y = (n - row-idx) / 1.5
for (col-idx, val) in row.enumerate() {
let x = col-idx - row-len / 2 + 0.5
circle((x, y), radius: 0.25, fill: white, stroke: none, name: "c-" + str(row-idx) + "-" + str(col-idx))
content((x, y), $binom(#str(row-idx), #str(col-idx))$)
}
}
// draw n
for i in range(n + 1) {
content((rel: (-2, 0), to: ("c-" + str(i) + "-0", "-|", "c-" + str(n - 1) + "-0")), [n=#i])
}
}), cetz.canvas({
import cetz.draw: *
let n = 6
// calculate the triangle
let pascal = ()
for row in range(n + 1) {
let row-data = ()
for col in range(row + 1) {
let value = if col == 0 or col == row {
1
} else {
let prev = pascal.at(row - 1)
prev.at(col - 1) + prev.at(col)
}
row-data.push(value)
}
pascal.push(row-data)
}
// draw lines
for (row-idx, row) in pascal.enumerate() {
if row-idx < n {
let row-len = row.len()
let y = n - row-idx
for (col-idx, val) in row.enumerate() {
let x = col-idx - row-len / 2 + 0.5
let next-row-len = row-len + 1
let left-child-x = col-idx - next-row-len / 2 + 0.5
let right-child-x = (col-idx + 1) - next-row-len / 2 + 0.5
let child-y = y - 1
line((x, y / 1.5), (left-child-x, child-y / 1.5), stroke: gray)
line((x, y / 1.5), (right-child-x, child-y / 1.5), stroke: gray)
}
}
}
// draw values
for (row-idx, row) in pascal.enumerate() {
let row-len = row.len()
let y = (n - row-idx) / 1.5
for (col-idx, val) in row.enumerate() {
let x = col-idx - row-len / 2 + 0.5
circle((x, y), radius: 0.25, fill: white, stroke: none, name: "c-" + str(row-idx) + "-" + str(col-idx))
content((x, y), str(val))
}
}
})))
#figure(image("Pascals triangle-2.png"),caption: [Another form of Pascals triangle. It is mirrored])
Binomial identity:
$ mat(n;k) = mat(n;n-k) $
You can do analytic proof (mathematic proof using the formulas) or the combinatorial proof (count it in one way to get first result, then in a different way to get the other result).
*Combinatorial proof for $mat(n;k)=mat(n;n-k)$:* You could say that for n people, you ask k people to walk out the door, or you could ask `n-k` people to stay in the room.
In Pascal's triangle, adding the rows:
$ mat(n;0)+mat(n;1)+mat(n;2)+dots+(n;n)=sum^n_(k=0)mat(n;k)=2^k $
= Binomial identity
For $mat(n;k)$ you can also write $mat(n-1;k)+mat(n-1;k-1)$. It is called Pascal's identity.
#image("pascals identity.png")
= Binomial formula
$ (x+y)¹=x¹+y¹\
(x+y)²=x²+2x y+y²\
(x+y)³=x³ + 3x²y + 3x y³ + y³\
(x+y)=x+4x³y+6x²y²+4x y³+y
$
Note for each $x^(a)y^(b)$, you have $(x+y)^(a+b)$
You also have that the coefficients (for $(x+y)$ you have 1,4,6,4,1) they follow Pascal's triangle
== The formula
$ (x+y)^n&=mat(n;0)x^n+mat(n;1)x^(n-1) y + mat(n;2)x^(n-2)y²+dots+mat(n;n-1)x y^(n-1)+mat(n;n)y^n\
&=sum^n_(k=0) mat(n;k)x^(n-k)y^k $
$ (x+y)^n=sum^n_(k=0)mat(n;k)x^k y^(n-k)$
== Proof by induction with respect to `n`
*Basis step:* Put $n=1$ and prove that the formular is true:
$ (x+y)¹&=mat(1;0)dot x dot y¹ + mat(1;1)dot x¹ dot y\
&=y+x $
*Induction step:* Assume true for `n-1`, then prove that it's then true for `n`:
$ (x+y)^(n-1)=sum^(n-1)_(k=0)mat(n-1;k)x^k y^(n-1-k) $
$
(x+y)^n&=(x+y)dot (x+y)^(n-1) \
&= (x+y)dot sum^(n-1)_(k=0)mat(n-1;k)x^k y^(n-1-k)\
&=sum^(n-1)_(k=0)mat(n-1;k)x^(k+1)y^(n-1-k)+sum^(n-1)_(k=0)mat(n-1;k)x^k y^(n-k)\
&= x^n+ sum^(n-2)_(k=0)mat(n-1;k)x^(k+1)y^(n-1-k) + sum^(n-1)_(k=1)mat(n-1;k)x^k y^(n-k)+y^n\
&"Replace k+1 with k"\
&= x^n+ sum^(n-1)_(k=1)mat(n-1;k-1)x^(k)y^(n-k) + sum^(n-1)_(k=1)mat(n-1;k)x^k y^(n-k)+y^n\
& "Note from pascals identity:" mat(n-1;k-1) + mat(n-1;k) = mat(n;k)\
$
*Combinatorial Proof:*
Consider expanding $(x+y)^n = (x+y)(x+y)dots.c(x+y)$ (n factors).
To get a term $x^(n-k)y^k$, we must:
- Choose $k$ of the $n$ factors to contribute a $y$ (the rest contribute $x$)
- There are $binom(n,k)$ ways to do this
Therefore, the coefficient of $x^(n-k)y^k$ is $binom(n,k)$.
= Van der Mande
$mat(m+n;r)=sum^r_(k=0)mat(m;r-k) mat(n;k)$

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB

View File

@@ -0,0 +1,578 @@
#import "@local/dtu-template:0.5.1":*
#import "@preview/cetz:0.4.2"
#import "@preview/cetz-venn:0.1.4": venn2, venn3
#import "@preview/auto-div:0.1.0": poly-div, poly-div-working
#let mark-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, radius: 50%)
#let ans(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), mark-circle, body)
#let corr-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, fill: black, radius: 50%)
#let corr(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), corr-circle, body)
#show heading: it => { pagebreak(weak: true); it }
== Question 1
If $p,q$ are prime numbers such that $100 < p < q$, then the number of positive integers less than $p q$ which are relative prime to $p q$ is:
#corr[$p q - p - q + 1$ (Rasmus's, Sebastian's answer)]
#ans[$p q - q + 1$]
#ans[$p q-p-q-1$]
#ans[$p q-p-q$ (Mikkel's answer)]
#ans[$p q-1$]
#ans[None of these]
== Question 2
The number $(4^100 mod 6 )^100 mod 10$ equals
#ans[3]
#corr[6 (All's answer)]
#ans[2]
#ans[None of these]
#ans[5]
#ans[1]
#ans[4]
== Question 3
Consider the set of all 99 positive integers not exceeding 99.
#table(
columns: (18%, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[],
[$binom(99, 50)$],
[$2^98$],
[$2^97$],
[$2^49$],
[None of these],
[$2^50$],
[$binom(99,50) binom(99,49)$],
[$binom(99,49) binom(99, 49)$],
[How many subsets have an odd number of odd numbers, and an even number of even numbers?],
mark-circle,
[Mikkel's answer],
[*Sebastian's answer*],
[Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of even numbers and an even number of odd numbers?],
mark-circle,
mark-circle,
corr-circle,
[Rasmus's answer],
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
[How many subsets have 49 elements?],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of odd numbers?],
mark-circle,
[*Rasmus's, Sebastian's answer*],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 4
Consider the following system of congruences:
$
x &equiv 1 mod 2 \
x &equiv 1 mod 5 \
x &equiv 7 mod 9
$
Indicate the set of all solutions to the above system of congruences.
#ans[None of these]
#ans[${90 + 7k | k in ZZ}$]
#ans[${1 + 2k | k in ZZ} union {1 + 5k | k in ZZ} union {7 + 9k | k in ZZ}$]
#ans[${9 + 90k | k in ZZ}$]
#corr[${61 + 90k | k in ZZ}$ (All's answer)]
#ans[${7 + 90k | k in ZZ}$]
== Question 5
Find a greatest common divisor of the polynomials $x^3 - 1$ and $x^3 + 2x^2 + 2x + 1$
#ans[$x+1$]
#ans[$1$(Mikkel's answer)]
#ans[$x-1$]
#corr[$x^2 + x + 1$ (Rasmus's, Sebastian's answer)]
#ans[$x^2 + x - 1$]
#ans[None of these]
#ans[$x^2 - x + 1$]
#ans[$x^2-x-1$]
== Question 6
Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers. For all $n in NN$ define $f(n) = sum^n_(k=0) k dot k! = 0 dot 0! + 1 dot !+ dots + n dot n!$. It is possible to prove by induction that $f(n) = (n+1)! -1$ holds for all nonnegative integers $n$.
By choosing 4 of the following 8 text fragments and putting them in the correct order, a proof by induction for the above statement can be created.
A. To prove the induction step, we assume that $f(n+1) = ((n+1)+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n) = (n+1)!-1$
B. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for all $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$ holds for all $n in NN$.
C. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$.
D. The statement now follows from the principle of mathematical induction.
E. We prove the statement by induction. The base case is $n = 1$. For $n=1$, we see that $f(1) = sum^1_(k=0)k dot k! = 0 dot 0! + 1 dot 1! = 0 dot 1 + 1 dot 1 = 1$ and also that $(n+1)! -1 = (1+1)!-1 = 2!-1 = 2-1 =1$. This proves the base case.
F. We prove the statement by induction. The base case is $n=0$. For $n=0$, we see that $f(0) = sum^0_(k=0) k dot k! = 0 dot 0! = 0 dot 1 = 0$ and also that $(n+1)! -1 = (0+1)!-1 = 1!-1 = 1-1 =0$. This proves the base case.
G. We have that $
f(n) &= sum^n_(k=0) k dot k! \
&= (sum^(n+1)_(k=0) k dot k! ) - (n+1)(n+1)! \
&= f(n+1) - (n+1)(n+1)! \
&= ((n+1)+1)! - 1 - (n+1)(n+1)! "By the induction hypothesis" \
&= (n+2)! -(n+1)(n+1)!-1 \
&= (n+2)(n+1)!-(n+1)(n+1)!-1 \
&= (n+2 - (n+1))(n+1)!-1 \
&= (n+1)! -1
$ which is what we wanted to prove. This concludes the induction step.
H. We have that $
f(n+1) &= sum^(n+1)_(k=0) k dot k! \
&= (sum^n_(k=0) k dot k!) + (n+1)(n+1)! \
&= f(n)+(n+1)(n+1)! \
&= (n+1)!-1+(n+1)(n+1)! "By the induction hypothesis" \
&= (n+1)(n+1)!+(n+1)!-1 \
&= [(n+1)+1](n+1)!-1 \
&= (n+2)! - 1 = ((n+1)+1)!-1
$ which is what we wanted to prove. This concludes the induction step.
#table(
columns: (20%, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[],
[A],
[B],
[C],
[D],
[E],
[F],
[G],
[H],
[The first fragment is:],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[The second fragment is:],
[Sebastian's answer],
mark-circle,
[*Rasmus's answer*],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[The third fragment is:],
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[*Rasmus's answer*],
[The fourth fragment is:],
mark-circle,
mark-circle,
mark-circle,
[*Rasmus's answer*],
mark-circle,
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
)
== Question 7
For all $n in NN$ define $a_n$ recursively as follows $a_0 = 2, a_1 = 3, a_n = cases(a_(n-1) + n "if" n "is even", a_(n-1) + 2a_(n-2) "if" n "is odd")$
#corr[37 (All's answer)]
#ans[38]
#ans[35]
#ans[40]
#ans[None of these]
#ans[36]
#ans[39]
== Question 8
We wish to construct a bipartite graph with bipartition $(V_1, V_2)$ such that $abs(V_1) = 4, abs(V_2) = 5$ (Note that a bipartite graph has no loops, but it may contain multiple edges.)
#table(
columns: (40%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[The graph exists without multiple edges.],
[The graph exists but only if we allow multiple edges.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_1$.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_2$.],
[None of these are correct],
[If the degrees in $V_1$ are $5,5,5,5$ and the degrees in $V_2$ are $4,4,4,4,4$ then],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
[If the degrees in $V_1$ are $1,2,2,2$ and the degrees in $V_2$ are $1,2,2,2,2$ then],
[Sebastian's answer],
[Mikkel's answer],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[If the degrees in $V_1$ are $4,4,4,4$, and the degrees in $V_2$ are $5,5,5,5,5$ then],
mark-circle,
[Rasmus's answer],
[Mikkel's, Sebastian's answer],
corr-circle,
mark-circle,
)
== Question 9
The formula $binom(m+n, r) = sum^r_(k=a) binom(m, r-k) binom(n,k)$ is true for all integers $m,n,r$ satisfying $0 < m < r < n$ if we let the summation start with:
#ans[$a = n$ (Sebastian's answer)]
#ans[$a = r$]
#ans[None of these (Rasmus's answer)]
#ans[$a = n -r$ (Mikkel's answer)]
#ans[$a = m$]
#corr[$a = r - m$]
== Question 10
Let $A = {0,1,2,4}, B = {0,1,3,5}, "and" C = {0,2,3,6}$. IF the universal set $U = {0,1,2,3,4,5,6,7}$, then which of the following is equal to $((A inter B) backslash C) union ((B inter C) backslash A) union ((C inter A) backslash B)$
#ans[${0,1,2,3}$]
#ans[All of these sets]
#ans[$emptyset$ (Mikkel's answer)]
#ans[${4,5,6}$]
#ans[None of these ]
#ans[${0,4,5,6}$]
#corr[${1,2,3}$ (Rasmus's, Sebastian's answer)]
== Question 11
Consider the statement "for every positive rational number $x$ there are positive integers $a$ and $b$ such that $x = a/b$ and $gcd(a,b) = 1$." Which of the following statement in predicate logic is equivalent to this if we let $G(a,b)$ denote the statement " $a "and" b$ are relatively prime"?
#ans[It is not possible to translate the statement into predicate logic. (Sebastian's answer)]
#corr[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b and G(a,b)) $ (Mikkel's, Rasmus's answer)]
#ans[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (G(a,b) -> x = a/b)$]
#ans[$forall x in QQ^+ forall a in ZZ^+ forall b in ZZ^+ (x = a/b and G(a,b))$]
#ans[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b -> G(a,b))$]
== Question 12
Given a univerisal set $U$, which of the following is equal to the set $A inter overline((B backslash C))$?
#ans[None of these]
#ans[$A inter B inter overline(C)$]
#ans[$(A union B) inter (A union overline(C))$]
#corr[$(A inter overline(B)) union (A inter C)$ (Rasmus's answer)]
#ans[$A inter overline(B) inter C$]
#ans[$A inter (C backslash B)$ (Mikkel's, Sebastian's answer)]
== Question 13
The empty set is an element of which of the following sets?
#ans[${{emptyset}}$]
#ans[None of these]
#ans[$emptyset$ (Mikkel's answer)]
#ans[${x in RR : x < x}$]
#corr[${emptyset}$ (Rasmus's, Sebastian's answer)]
#ans[All of these sets]
== Question 14
Which of the following are tautologies?
#ans[$(p -> q) or (not q -> not p)$ (Sebastian's answer)]
#ans[None of these]
#ans[$p <-> q$]
#ans[All of these]
#corr[$(not p or not q) -> (not (p and q))$ (Mikkel's, Rasmus's answer)]
#ans[$(p or q or r) and (p or not q or not r)$]
== Question 15
Consider all possible seatings of $3n$ people around two tables, one with $n$ seats and one with $2n$ seats. Find the number of seatings when
#table(
columns: (20%, auto, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center, center),
stroke: none,
[],
[$((3n)!)/(2(n!))$],
[$((3n)!)/(4(n!))$],
[$((3n)!)/(4n)$],
[$2 binom(3n,n)$],
[$((3n)!)/(2n^2)$],
[$((3n)!)/(4n^2)$],
[$((3n)!)/(8n^2)$],
[$4 binom(3n,n)$],
[None of these],
[Two seatings are considered the same when each person has the same left and right neighbor.],
mark-circle,
[Rasmus's answer],
mark-circle,
[Sebastian's answer],
corr-circle,
mark-circle,
mark-circle,
[Mikkel's answer],
mark-circle,
[Two seatings are considered the same when each person has the same neighbors (and we do not care about right or left)],
[Rasmus's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
[Sebastian's answer],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
)
== Question 16
For each of the following, determine whether it is surjective/injective, or not a well defined function. Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers.
#table(
columns: (35%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[Not a well defined function],
[Well defined but neither injective nor surjective],
[Surjective but not injective],
[Injective but not surjective],
[Both injective and surjective],
[$ f: RR -> ZZ $ given by $f(x) = 2 floor(x/2)$],
[Mikkel's, Sebastian's answer],
[*Rasmus's answer*],
mark-circle,
mark-circle,
mark-circle,
[$f : RR -> {x in RR : x >= 0}$ given by $f(x) = sqrt(x^2)$],
mark-circle,
[Sebastian's answer],
[*Rasmus's answer*],
mark-circle,
[Mikkel's answer],
[$f: NN -> NN$ given by $f(x) = 2x +7$],
mark-circle,
mark-circle,
mark-circle,
[*All's answer*],
mark-circle,
[$f: NN -> NN$ given by $f(x) = x-x^2$],
[*Rasmus's, Sebastian's answer*],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
[$f: RR -> RR$ given by $f(x) = cases(x "if" x in QQ, -x "if" x in.not QQ)$],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
[*Rasmus's answer*],
)
== Question 17
Consider all permutations of ABCDE
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[12],
[24],
[36],
[48],
[50],
[64],
[None of these],
[How many contain none of AB, BC, CD],
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
mark-circle,
[*Rasmus's answer*],
mark-circle,
[How many contain ACE],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
[*Mikkel's, Rasmus's answer*],
[How many contain precisely one of AB, CD],
mark-circle,
[Mikkels's, Sebastian's answer],
[*Rasmus's answer*],
mark-circle,
mark-circle,
mark-circle,
mark-circle
)
== Question 18
For each relation on the set of four distinct elements $a,b,c,d$ below, decide which property it has.
#table(
columns: (30%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
stroke: none,
[],
[The edges of a hasse diagram],
[Partial order],
[Total order but not well ordered],
[Well-order],
[None of these],
[Total order but not partial order],
[Equivalence relation],
[$(a,a),(a,b),(a,c)(a,d)$],
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[$(a,b),(b,c),(c,d)$],
corr-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's, Rasmus's answer],
mark-circle,
mark-circle,
[$(a,a),(b,b),(c,c),\ (d,d),(a,d),(d,a)$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
[*Mikkel's, Rasmus's answer*],
[$(a,a),(b,b),(c,c),\ (d,d),(d,c)$],
mark-circle,
[*Mikkel's, Rasmus's answer*],
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
[$(a,a),(b,b),(c,c),(d,d),\ (a,b),(a,c),(a,d),(b,c),\ (b,d),(c,d)$],
[Mikkel's answer],
[Rasmus's answer],
corr-circle,
corr-circle,
mark-circle,
mark-circle,
[Sebastian's answer]
)
Note: AI'er var uenige om den sidste, har markeret de to svar jeg fik.
== Question 19
Which of the following is a recursively defined function for the number of ways to tile an $n times 2$ board using $2 times 1$ tiles.
#corr[$f(0) = 1, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$]
#ans[$f(0) = 0, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$]
#ans[$f(0) = 1, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$ (Rasmus's answer)]
#ans[$f(0) = 1, f(1) = 1, f(n) = f(n - 1)f(n - 2) "for" n >= 2$]
#ans[All of these (Mikkel's answer)]
#ans[$f(0) = 0, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$ (Sebastian's answer)]
#ans[None of these ]
== Question 20
Find the coefficient of $x^15 y^20$ in the polynomials below.
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[$- binom(10,5)2^5$],
[$binom(10,5) 2^15$],
[$- binom(10,5)2^15$],
[0],
[None of these],
[$-binom(10,5)2^10$],
[$- binom(10,3)2^5$],
[$(2x^3-y^4)^10$],
[*Mikkel's, Rasmus's answer*],
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
[$(1-2x^3y^4)^10$],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
[$(x^3-2y^4)^10$],
[*Mikkel's, Rasmus's answer*],
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
)
== Question 21
Which of the following is equivalent to the statement " $a$ and $b$ are relatively prime"? The domain for each statement is
the set of all positive integers
#ans[None of these three are equivalent to the statement.]
#ans[$not (exists c (c divides a and c divides b and c > 1) )$ is equivalent to the statement, and the other two are not. (Rasmus's answer)]
#ans[$forall c (not (c divides a) or not (c divides b) or (c <= 1))$ is equivalent to the statement, and the other two are not.]
#corr[All of these three are equivalent to the statement.]
#ans[$forall c ( (c divides a and c divides b) -> (c <= 1))$ is equivalent to the statement, and other two are not. (Mikkel's, Sebastian's answer)]

View File

@@ -0,0 +1,574 @@
#import "@local/dtu-template:0.5.1":*
#import "@preview/cetz:0.4.2"
#import "@preview/cetz-venn:0.1.4": venn2, venn3
#import "@preview/auto-div:0.1.0": poly-div, poly-div-working
#let mark-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, radius: 50%)
#let ans(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), mark-circle, body)
#let corr-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, fill: black, radius: 50%)
#let corr(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), corr-circle, body)
#show heading: it => { pagebreak(weak: true); it }
== Question 1
If $p,q$ are prime numbers such that $100 < p < q$, then the number of positive integers less than $p q$ which are relative prime to $p q$ is:
#corr[$p q - p - q + 1$]
#ans[$p q - q + 1$]
#ans[$p q-p-q-1$]
#ans[$p q-p-q$]
#ans[$p q-1$]
#ans[None of these]
== Question 2
The number $(4^100 mod 6 )^100 mod 10$ equals
#ans[3]
#corr[6 (All's answer)]
#ans[2]
#ans[None of these]
#ans[5]
#ans[1]
#ans[4]
== Question 3
Consider the set of all 99 positive integers not exceeding 99.
#table(
columns: (18%, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
[],
[$binom(99, 50)$],
[$2^98$],
[$2^97$],
[$2^49$],
[None of these],
[$2^50$],
[$binom(99,50) binom(99,49)$],
[$binom(99,49) binom(99, 49)$],
[How many subsets have an odd number of odd numbers, and an even number of even numbers?],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of even numbers and an even number of odd numbers?],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have 49 elements?],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of odd numbers?],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 4
Consider the following system of congruences:
$
x &equiv 1 mod 2 \
x &equiv 1 mod 5 \
x &equiv 7 mod 9
$
Indicate the set of all solutions to the above system of congruences.
#ans[None of these]
#ans[${90 + 7k | k in ZZ}$]
#ans[${1 + 2k | k in ZZ} union {1 + 5k | k in ZZ} union {7 + 9k | k in ZZ}$]
#ans[${9 + 90k | k in ZZ}$]
#corr[${61 + 90k | k in ZZ}$ (All's answer)]
#ans[${7 + 90k | k in ZZ}$]
== Question 5
Find a greatest common divisor of the polynomials $x^3 - 1$ and $x^3 + 2x^2 + 2x + 1$
#ans[$x+1$]
#ans[$1$(Mikkel's answer)]
#ans[$x-1$]
#corr[$x^2 + x + 1$]
#ans[$x^2 + x - 1$]
#ans[None of these]
#ans[$x^2 - x + 1$]
#ans[$x^2-x-1$]
== Question 6
Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers. For all $n in NN$ define $f(n) = sum^n_(k=0) k dot k! = 0 dot 0! + 1 dot !+ dots + n dot n!$. It is possible to prove by induction that $f(n) = (n+1)! -1$ holds for all nonnegative integers $n$.
By choosing 4 of the following 8 text fragments and putting them in the correct order, a proof by induction for the above statement can be created.
A. To prove the induction step, we assume that $f(n+1) = ((n+1)+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n) = (n+1)!-1$
B. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for all $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$ holds for all $n in NN$.
C. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$.
D. The statement now follows from the principle of mathematical induction.
E. We prove the statement by induction. The base case is $n = 1$. For $n=1$, we see that $f(1) = sum^1_(k=0)k dot k! = 0 dot 0! + 1 dot 1! = 0 dot 1 + 1 dot 1 = 1$ and also that $(n+1)! -1 = (1+1)!-1 = 2!-1 = 2-1 =1$. This proves the base case.
F. We prove the statement by induction. The base case is $n=0$. For $n=0$, we see that $f(0) = sum^0_(k=0) k dot k! = 0 dot 0! = 0 dot 1 = 0$ and also that $(n+1)! -1 = (0+1)!-1 = 1!-1 = 1-1 =0$. This proves the base case.
G. We have that $
f(n) &= sum^n_(k=0) k dot k! \
&= (sum^(n+1)_(k=0) k dot k! ) - (n+1)(n+1)! \
&= f(n+1) - (n+1)(n+1)! \
&= ((n+1)+1)! - 1 - (n+1)(n+1)! "By the induction hypothesis" \
&= (n+2)! -(n+1)(n+1)!-1 \
&= (n+2)(n+1)!-(n+1)(n+1)!-1 \
&= (n+2 - (n+1))(n+1)!-1 \
&= (n+1)! -1
$ which is what we wanted to prove. This concludes the induction step.
H. We have that $
f(n+1) &= sum^(n+1)_(k=0) k dot k! \
&= (sum^n_(k=0) k dot k!) + (n+1)(n+1)! \
&= f(n)+(n+1)(n+1)! \
&= (n+1)!-1+(n+1)(n+1)! "By the induction hypothesis" \
&= (n+1)(n+1)!+(n+1)!-1 \
&= [(n+1)+1](n+1)!-1 \
&= (n+2)! - 1 = ((n+1)+1)!-1
$ which is what we wanted to prove. This concludes the induction step.
#table(
columns: (35%, 1fr, 1fr,1fr,1fr,1fr,1fr,1fr,1fr),
align: (left, center, center, center, center, center, center, center, center),
[],
[A],
[B],
[C],
[D],
[E],
[F],
[G],
[H],
[The first fragment is:],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[The second fragment is:],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[The third fragment is:],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[The fourth fragment is:],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 7
For all $n in NN$ define $a_n$ recursively as follows $a_0 = 2, a_1 = 3, a_n = cases(a_(n-1) + n "if" n "is even", a_(n-1) + 2a_(n-2) "if" n "is odd")$
#corr[37 (All's answer)]
#ans[38]
#ans[35]
#ans[40]
#ans[None of these]
#ans[36]
#ans[39]
== Question 8
We wish to construct a bipartite graph with bipartition $(V_1, V_2)$ such that $abs(V_1) = 4, abs(V_2) = 5$ (Note that a bipartite graph has no loops, but it may contain multiple edges.)
#table(
columns: (40%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[The graph exists without multiple edges.],
[The graph exists but only if we allow multiple edges.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_1$.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_2$.],
[None of these are correct],
[If the degrees in $V_1$ are $5,5,5,5$ and the degrees in $V_2$ are $4,4,4,4,4$ then],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[If the degrees in $V_1$ are $1,2,2,2$ and the degrees in $V_2$ are $1,2,2,2,2$ then],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[If the degrees in $V_1$ are $4,4,4,4$, and the degrees in $V_2$ are $5,5,5,5,5$ then],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
)
== Question 9
The formula $binom(m+n, r) = sum^r_(k=a) binom(m, r-k) binom(n,k)$ is true for all integers $m,n,r$ satisfying $0 < m < r < n$ if we let the summation start with:
#ans[$a = n$]
#ans[$a = r$]
#ans[None of these]
#ans[$a = n -r$]
#ans[$a = m$]
#corr[$a = r - m$]
== Question 10
Let $A = {0,1,2,4}, B = {0,1,3,5}, "and" C = {0,2,3,6}$. IF the universal set $U = {0,1,2,3,4,5,6,7}$, then which of the following is equal to $((A inter B) backslash C) union ((B inter C) backslash A) union ((C inter A) backslash B)$
#ans[${0,1,2,3}$]
#ans[All of these sets]
#ans[$emptyset$]
#ans[${4,5,6}$]
#ans[None of these ]
#ans[${0,4,5,6}$]
#corr[${1,2,3}$]
== Question 11
Consider the statement "for every positive rational number $x$ there are positive integers $a$ and $b$ such that $x = a/b$ and $gcd(a,b) = 1$." Which of the following statement in predicate logic is equivalent to this if we let $G(a,b)$ denote the statement " $a "and" b$ are relatively prime"?
#ans[It is not possible to translate the statement into predicate logic.]
#corr[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b and G(a,b)) $]
#ans[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (G(a,b) -> x = a/b)$]
#ans[$forall x in QQ^+ forall a in ZZ^+ forall b in ZZ^+ (x = a/b and G(a,b))$]
#ans[$forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b -> G(a,b))$]
== Question 12
Given a univerisal set $U$, which of the following is equal to the set $A inter overline((B backslash C))$?
#ans[None of these]
#ans[$A inter B inter overline(C)$]
#ans[$(A union B) inter (A union overline(C))$]
#corr[$(A inter overline(B)) union (A inter C)$]
#ans[$A inter overline(B) inter C$]
#ans[$A inter (C backslash B)$]
== Question 13
The empty set is an element of which of the following sets?
#ans[${{emptyset}}$]
#ans[None of these]
#ans[$emptyset$]
#ans[${x in RR : x < x}$]
#corr[${emptyset}$]
#ans[All of these sets]
== Question 14
Which of the following are tautologies?
#ans[$(p -> q) or (not q -> not p)$]
#ans[None of these]
#ans[$p <-> q$]
#ans[All of these]
#corr[$(not p or not q) -> (not (p and q))$]
#ans[$(p or q or r) and (p or not q or not r)$]
== Question 15
Consider all possible seatings of $3n$ people around two tables, one with $n$ seats and one with $2n$ seats. Find the number of seatings when
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center, center, center),
[],
[$((3n)!)/(2(n!))$],
[$((3n)!)/(4(n!))$],
[$((3n)!)/(4n)$],
[$2 binom(3n,n)$],
[$((3n)!)/(2n^2)$],
[$((3n)!)/(4n^2)$],
[$((3n)!)/(8n^2)$],
[$4 binom(3n,n)$],
[None of these],
[Two seatings are considered the same when each person has the same left and right neighbor.],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Two seatings are considered the same when each person has the same neighbors (and we do not care about right or left)],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
)
== Question 16
For each of the following, determine whether it is surjective/injective, or not a well defined function. Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers.
#table(
columns: (35%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[Not a well defined function],
[Well defined but neither injective nor surjective],
[Surjective but not injective],
[Injective but not surjective],
[Both injective and surjective],
[$ f: RR -> ZZ $ given by $f(x) = 2 floor(x/2)$],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
[$f : RR -> {x in RR : x >= 0}$ given by $f(x) = sqrt(x^2)$],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[$f: NN -> NN$ given by $f(x) = 2x +7$],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
[$f: NN -> NN$ given by $f(x) = x-x^2$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$f: RR -> RR$ given by $f(x) = cases(x "if" x in QQ, -x "if" x in.not QQ)$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
)
== Question 17
Consider all permutations of ABCDE
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[12],
[24],
[36],
[48],
[50],
[64],
[None of these],
[How many contain none of AB, BC, CD],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
[How many contain ACE],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[How many contain precisely one of AB, CD],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle
)
== Question 18
For each relation on the set of four distinct elements $a,b,c,d$ below, decide which property it has.
#table(
columns: (30%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[The edges of a hasse diagram],
[Partial order],
[Total order but not well ordered],
[Well-order],
[None of these],
[Total order but not partial order],
[Equivalence relation],
[$(a,a),(a,b),(a,c)(a,d)$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[$(a,b),(b,c),(c,d)$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$(a,a),(b,b),(c,c),\ (d,d),(a,d),(d,a)$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[$(a,a),(b,b),(c,c),\ (d,d),(d,c)$],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$(a,a),(b,b),(c,c),(d,d),\ (a,b),(a,c),(a,d),(b,c),\ (b,d),(c,d)$],
mark-circle,
mark-circle,
corr-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle
)
Note: AI'er var uenige om den sidste, har markeret de to svar jeg fik.
== Question 19
Which of the following is a recursively defined function for the number of ways to tile an $n times 2$ board using $2 times 1$ tiles.
#corr[$f(0) = 1, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$]
#ans[$f(0) = 0, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$]
#ans[$f(0) = 1, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$]
#ans[$f(0) = 1, f(1) = 1, f(n) = f(n - 1)f(n - 2) "for" n >= 2$]
#ans[All of these]
#ans[$f(0) = 0, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$]
#ans[None of these ]
== Question 20
Find the coefficient of $x^15 y^20$ in the polynomials below.
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[$- binom(10,5)2^5$],
[$binom(10,5) 2^15$],
[$- binom(10,5)2^15$],
[0],
[None of these],
[$-binom(10,5)2^10$],
[$- binom(10,3)2^5$],
[$(2x^3-y^4)^10$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$(1-2x^3y^4)^10$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$(x^3-2y^4)^10$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 21
Which of the following is equivalent to the statement " $a$ and $b$ are relatively prime"? The domain for each statement is
the set of all positive integers
#ans[None of these three are equivalent to the statement.]
#ans[$not (exists c (c divides a and c divides b and c > 1) )$ is equivalent to the statement, and the other two are not.]
#ans[$forall c (not (c divides a) or not (c divides b) or (c <= 1))$ is equivalent to the statement, and the other two are not.]
#corr[All of these three are equivalent to the statement.]
#ans[$forall c ( (c divides a and c divides b) -> (c <= 1))$ is equivalent to the statement, and other two are not.]

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,780 @@
#import "@local/dtu-template:0.5.1":*
#import "@preview/cetz:0.4.2"
#import "@preview/cetz-venn:0.1.4": venn2, venn3
#import "@preview/auto-div:0.1.0": poly-div, poly-div-working
// Small circle for marking answers
#let mark-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, radius: 50%)
// Answer option with circle
#let ans(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), mark-circle, body)
#let corr-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, fill: black, radius: 50%)
#let corr(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), corr-circle, body)
#show: dtu-note.with(
course: "01017",
course-name: "Discrete Mathematics",
title: "01019 E24 Exam - Discrete Mathematics",
date: datetime.today(),
author: "DTU (Technical University of Denmark)",
semester: "2025 Fall",
)
#show heading: it => { pagebreak(weak: true); it }
= 01019 E24 Exam Discrete Mathematics
Der anvendes en scoringsalgoritme, som er baseret "One correct answer"
Dette betyder følgende:
- Der er altid præcist ét korrekt svar
- Studerende kan kun vælge ét svar per spørgsmål
- Hvert rigtigt svar giver 1 point. et spørgsmål, der består af f.eks. 3 del-spørgsmål, giver 3 points, hvis alle 3 er korrekte.
- Hvert forkert svar giver 0 point (der benyttes IKKE negative point)
The following approach to scoring responses is implemented and is based on "One correct answer":
- There is always only one correct answer
- Students are only able to select one answer per question
- Every correct answer that you click on corresponds to 1 point, so a question with 3 parts is worth 3 points if you get every part correct.
- Every incorrect answer corresponds to 0 points (incorrect answers do not result in subtraction of points)
== Question 1
If $a, b, c$, and $d$ are positive integers such that $a b | c d$, then which of the following must be true?
*Vælg en svarmulighed*
#ans[$a|"lcm"(c, d)$ or $b|"lcm"(c, d)$]
#corr[If $p$ is a prime that divides $a$, then $p|c$ or $p|d$]
#ans[None of these]
#ans[If $b$ is prime, then $b|"gcd"(c, d)$]
#ans[$"gcd"(a, b)| "gcd"(c, d)$]
#ans[$a|c$ or $a|d$ or $b|c$ or $b|d$]
#solution()[
Because if you instead of $a,b,c,d$ put them factorized into primes. Then if $a b$ divides $c d$ they must share some common primes when factorized, and thus if $p$ divides $a$ so it is in the factorized $a b$, then it must also be in the factorized $c d$ and thus $p | c$ or $p | d$
]
== Question 2
For $n >= 4$, the number of edges in the $n$-cube $Q_n$ is
*Vælg en svarmulighed*
#ans[None of these]
#ans[$2^n + 16$]
#corr[$n 2^(n-1)$]
#ans[$2^(n+1)$]
#ans[$n! + 8$]
#solution()[
It it probably not the 2nd or last one. 3rd one makes more intuitive sense than 4th one.
]
== Question 3
For each of the following, determine whether it is surjective/injective, or not a well defined function. Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers, and $ZZ^+$ is the set of positive integers.
*Vælg de rigtige svarmuligheder*
#table(
columns: (40%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
stroke: none,
[],
[Not well defined],
[Well defined but neither],
[Surjective but not injective],
[Injective but not surjective],
[Both surjective and injective],
[$f: ZZ^+ -> NN$ given by $f(x) = floor(log_2(x))$],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[$f: RR -> ZZ^+$ given by $f(x) = floor(|x|)$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$f: NN -> ZZ$ given by $f(x) = cases(ceil(x\/2) "if" x "is even", -ceil(x\/2) "if" x "is odd")$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[$f: RR -> {-1, 0, 1}$ given by $f(x) = floor(x) - ceil(x)$],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
[$f: NN -> NN$ given by $f(x) = x^3 + 1$],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
)
#solution()[
/ 1):
It is not injective because when rounded down, multiple x-values will give the same y-value. It is surjective since it continues on forever.
/ 2):
$0, 0.5, 0.6$, etc. are in $RR$, but rounded down to $0$ are not in $ZZ^+$ so this function isn't well defined.
/ 3):
You have all odd numbers halved and rounded up make up the negative numbers, and same with even numbers. Since every integer times 2 is also an integer, every number in $ZZ$ will have a corresponding x-value because of that. Also since integers times two only have one answer, you will not have multiple numbers in $NN$ give the same value
/ 4):
This is not injective because almost all x-values will give the same y-value (-1). It is not surjective because a positive number rounded down minus same number rounded up will give -1. And same for negative numbers.
/ 5):
No two natural numbers cubed plus one will give the same value, so this is injective. But there are a lot of natural numbers that is not hit.
]
== Question 4
Consider the following three statements on the complete graph $K_(2n)$:
(a): $K_(2n)$ has $binom(2n, 2)$ edges
(b): $K_(2n)$ has $2binom(n, 2) + n^2$ edges
(c): $K_(2n)$ has $n(2n - 1)$ edges
*Vælg en svarmulighed*
#ans[(a) and (b) are true, but (c) is false]
#corr[(a) and (b) and (c) are all true]
#ans[(a) and (c) are true, but (b) is false]
#ans[(b) and (c) are true, but (a) is false]
#ans[Precisely one of (a),(b),(c) is true]
#solution()[
/ *(a)*: A complete graph is a graph where all vertices are connected, but only once. So the amount of edges can also be described as how many ways can you select two of $2n$ elements (how many ways can you select to vertices to connect in the graph)
/ *(b)*: This can be verified using (a). Take $n=10$ for example:
$
vec(20,2) = 190\
2 vec(10,2) + 100 = 2 dot 45 + 100 = 190
$
This holds true, so (b) must be true as well.
/ *(c)*: We can check this as well. For $n=10$:
$
190 = 10*19
$
This holds true as well.
]
== Question 5
Consider a simple graph with degrees 2,2,3,3,3,3,3.
*Vælg en svarmulighed*
#ans[Such a graph exists, and any such graph has less than 19 edges]
#corr[Such a graph does not exist]
#ans[Such a graph exists, and any such graph has precisely 19 edges]
#ans[Such a graph exists, and any such graph has more than 19 edges]
#ans[There exists such a graph with more than 19 edges and another with less than 19 edges]
#solution()[
Uneven amount of odd degrees, so it cannot exist.
]
== Question 6
How many elements are in the union of four sets if each set has 200 elements, each pair of sets share 50 elements, each three of the sets share 25 elements, and there are 5 elements in all four sets.
*Vælg en svarmulighed*
#ans[395]
#ans[695]
#ans[495]
#corr[595]
#ans[None of these]
#solution()[
Imagine the sets $A,B,C,D$:
$
A + B + C + D - |A inter B| - |A inter C| - |A inter D| - |B inter C| - |B inter D| - |C inter D|\
+ |A inter B inter C| + |B inter C inter D| + |C inter D inter A| + |D inter A inter B|\
- |A inter B inter C inter D| = \
200+200+200+200 - 50-50-50-50-50-50\
+25+25+25+25-5 = 595
$
]
== Question 7
Suppose that $a, b, c$, and $m$ are positive integers such that $a c equiv b c mod m$. Which of the following must be true?
*Vælg en svarmulighed*
#ans[$a equiv b mod m$]
#corr[$a - b in {k m : k in ZZ}$ if $"gcd"(c, m) = 1$]
#ans[$c|m(a - b)$]
#ans[$a equiv b mod c m$]
#ans[None of these]
#solution()[
The solution means $a equiv b mod m$ but only if $c,m$ are coprime. This is because $a c equiv b c mod m$ cant also be written as $m | c(a-b)$, so for our equation to hold, $m$ must divide $a-b$ not $c$, so $gcd(c,m)=1$
]
== Question 8
If $2a + 3 equiv 2b + 3 mod m$, for positive integers $a, b$, and $m$, then which of the following does NOT necessarily have to be true?
*Vælg en svarmulighed*
#ans[$2a equiv 2b mod m$]
#corr[$a = k m + b$ for some $k in ZZ$]
#ans[$14a equiv 14b + 7m mod m$]
#ans[All of these are true]
#ans[$m|2(a - b)$]
#solution()[
Because for example: $a=101, b=100, m = 2$
$
205 equiv 203 mod 2\
101 != 2k + 100 "for some" k in ZZ
$
]
== Question 9
Which of these three are partitions of $ZZ times ZZ$, that is, the set of ordered pairs of integers:
(a): the set of pairs $(x, y)$ where $x$ or $y$ (or both) are odd; the set of pairs $(x, y)$ where $x$ and $y$ are even;
(b): the set of pairs $(x, y)$ where $x$ and $y$ are odd; the set of pairs $(x, y)$ where $x$ and $y$ are even;
(c): the set of pairs $(x, y)$ where $x$ or $y$ (or both) are odd; the set of pairs $(x, y)$ where $x$ or $y$ (or both) are even.
*Vælg en svarmulighed*
#ans[None of them are]
#corr[(a) is a partition but (b),(c) are not]
#ans[Precisely two of them are]
#ans[(b) is a partition but (a),(c) are not]
#ans[(c) is a partition but (a),(b) are not]
#solution()[
To be a partition, the following conditions must be met:
+ Every element $a in S$ belongs to exactly one equivalence class $[a]_tilde$.
+ The equivalence classes are pairwise disjoint: if $[a]_tilde eq.not [b]_tilde$, then $[a]_tilde inter [b]_tilde = emptyset$.
+ The union of all equivalence classes equals $S$.
So basically you can't have pairs appear more than once, and the union of all the pairs must be equal to, here, $ZZ$.
/ a): This satisfies all three.
/ b): This satisfies the first two, but not the third.
/ c): This doesn't satisfy the first one.
]
== Question 10
Consider the statement: There exist infinitely many simple graphs (that is, graphs with no loops and no multiple edges) such that all degrees are distinct. This statement can be proved to be
*Vælg en svarmulighed*
#ans[neither true nor false because some graphs have all degrees distinct and others do not]
#corr[false by the pigeonhole principle]
#ans[false by giving a counterexample]
#ans[true by the pigeonhole principle]
#ans[true by induction]
#solution()[
If you have a graph of $n$ vertices, and then add another one. It will need to have $n+1$ edges, but for that to be true, it would have to connect to itself, which it can't (and for example the first edge, would need to connect to it as well).
In terms of Pigeonhole principle, we will end up having too many edges.
]
== Question 11
Consider the polynomial $(2x^2 - 3y^3)^8$.
*Vælg de rigtige svarmuligheder*
#table(
columns: (1fr, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center),
stroke: none,
[ ],
[0],
[$2^4 3^4 binom(8, 4)$],
[$-2^4 3^4 binom(8, 4)$],
[$2^3 3^6 binom(8, 4)$],
[$-2^4 3^6 binom(8, 4)$],
[The coefficient of $x^8 y^12$ is],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
[The coefficient of $x^6 y^9$ is],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
#solution()[
You can use calculator to calculate this. But by intuition:
You know that $(x+y)^n$ will have coefficient: $binom(n,k)x^(n-k)y^k$
For $x^8y^12$:
Here we have $n=8, k = 8-8/2=4$. So coefficients are: $2^(n-k=4)3^(k=4) binom(n=8,k=4)$. It will be positive as we multiple a negative number even number of times, so its positive.
For $x^6y^9$. Here we have $n=8, k = 8-6/2=5$ but $3 dot 5 != 9$ so this doesnt exist.
]
== Question 12
The polynomial $x^n + 1$ is divisible by the polynomial $x + 1$ (where $n$ is a positive integer)
*Vælg en svarmulighed*
#ans[for each $n >= 1$]
#corr[for each odd $n >= 1$, and for no even $n$]
#ans[for each even $n >= 4$, and for no odd $n$]
#ans[for infinitely many, but not all, even $n$, and for no odd $n$]
#ans[for $n = 1$ only]
#solution()[
Use calculator to solve this.
]
== Question 13
The least number of cables required to connect ten computers to five printers to guarantee that, for every choice of five of the ten computers, these five computers can directly access five different printers is
*Vælg en svarmulighed*
#ans[40]
#ans[None of these]
#ans[$binom(10, 5)$]
#corr[30]
#ans[50]
#solution()[
To guarantee that no matter the five computers we select they will connect to different printers, each printer must be connected to >5 computers so 6. And since there's 5 printers, its: $5 dot 6 =30$
]
== Question 14
Consider the following relations on ${1, 2, 3, 4, 5, 6}$:
$R_1$: ${(1, 2),(2, 3),(1, 3),(4, 5),(5, 6),(4, 6)}$.
$R_2$: ${(1, 1),(2, 2),(3, 3),(4, 4),(5, 5),(6, 6),(1, 2),(3, 4),(5, 6),(1, 6)}$.
$R_3$: ${(1, 2),(2, 3),(3, 4),(4, 5),(5, 6),(1, 3),(2, 4),(3, 5),(4, 6)}$.
Recall that questions below may appear in random order.
*Vælg de rigtige svarmuligheder*
#table(
columns: (15%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
stroke: none,
[ ],
[an \ equivalence relation],
[a partial \ ordering],
[transitive and reflexive\ but not \ antisymmetric],
[transitive and antisymmetric but not\ reflexive],
[none of these],
[$R_3$ is],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[$R_2$ is],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
[$R_1$ is],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
)
#solution()[
Definitions:
+ *Reflexive:* $forall a in S, a R a$
+ *Symmetric:* $forall a, b in S$, if $a R b$ then $b R a$
+ *Antisymmetric:* $forall a, b in S$, if $a R b$ and $b R a$ then $a = b$
+ *Transitive:* $forall a, b, c in S$, if $a R b$ and $b R c$ then $a R c$
A partial ordering is Reflexive, Antisymmetric and Transitive.
An equivalence relation is Reflexive, Symmetric and Transitive
/ $R_3$: Not reflexive, not symmetric, is antisymmetric and not transitive (you have $(1,2), (2,4)$ but not $(1,4)$)
/ $R_2$: It is reflexive, antisymmetric and transitive. Thus, a partial ordering
/ $R_1$: Not reflexive, not symmetric, is antisymmetric, is transitive.
]
== Question 15
For each of the following values of $n$, determine the multiplicative inverse of $n mod 9$ or indicate that it does not exist.
*Vælg de rigtige svarmuligheder*
#table(
columns: (auto, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[ ],
[*Does not exist*],
[*0*],
[*1*],
[*2*],
[*3*],
[*4*],
[*5*],
[*6*],
[$n = 6$],
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[$n = 2$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
[$n = 7$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
)
#solution()[
The multiplicative inverse is the number for which you need to multiply n for $n dot x equiv 1 mod 9$ here.
This can be calculated in Sympy.
/ $n=6$: No value
/ $n=2$: $2 dot 5=10 equiv 1 mod 9$
/ $n=7$: $7 dot 4 = 28 equiv 1 mod 9$
]
== Question 16
Given a universal set $U$, which of the following sets are necessarily equal to $(overline(B) - A) union (overline(C) - A)$?
*Vælg en svarmulighed*
#ans[$emptyset$]
#ans[$overline((B union C)) - A$]
#ans[$((U - B) union (U - C)) inter A$]
#corr[$overline((B inter C))- A$]
#ans[None of these]
#solution()[
The given equation mean: What is in either not $B$ nor $A$, or not in $C$ nor $A$.
This can be rewritten as what is not in both $B$ and $C$ and also not in $A$
]
== Question 17
20 people are seated around a round table.
*Vælg de rigtige svarmuligheder*
#table(
columns: (1fr, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center),
stroke: none,
[ ],
[$2^20$],
[$2^19$],
[$20!$],
[$19!$],
[$19!\/2$],
[Two seatings are considered identical if each person has the same two neighbors in the two seatings (but we don't care about left and right). The number of seatings is],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[Two seatings are considered identical if each person has the same left neighbor and the same right neighbor in the two seatings. The number of seatings is],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
[Two seatings are considered identical if each person has the same left neighbor in the two seatings. The number of seatings is],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
)
#solution()[
Can be calculated in Sympy!
But intuitively:
/ a): Here we have $20!/(20*2)=19!/2$. Because for every seating you have, you can rotate it 20 times and same neighbors, and you can mirror it, and same neighbors.
/ b): Same as before but only rotation now so: $20!/20=19!$
/ c): This is the same as before as if you change a persons right neighbor, the now have a new left neighbor so you cant do that.
]
== Question 18
Let $a$ and $b$ be positive integers. Which of the following integers can NOT necessarily be written as $a s + b t$ for some integers $s$ and $t$?
*Vælg en svarmulighed*
#ans[All of these can be written as $a s + b t$ for some integers $s$ and $t$]
#ans[$"gcd"(a, b)^2 - 17 "lcm"(a, b)$]
#corr[$("lcm"(a,b))/("gcd"(a,b))$]
#ans[$"gcd"(2a, 6b)$]
#ans[$"gcd"(a, b)$]
#solution()[
$"lcm"(a,b)$ is the least common multiple of $a,b$ so that means if you go any lower than that, it can't necessarily be divided by $a,b$ so you cant necessarily write it as $a s + b t$
]
== Question 19
Which of the following gives a recursive definition of the number of ways to choose 3 elements from an $n$ element set for $n >= 3$?
*Vælg en svarmulighed*
#ans[$f(3) = 1$ and $f(n + 1) = binom(n, 2)f(n - 1)$ for $n >= 3$]
#ans[None of these]
#ans[$f(4) = 1$ and $f(n) = n^4 + f(n - 1)$ for $n > 4$]
#ans[$f(3) = 1$ and $f(n) = binom(n, 3) + f(n - 1)$ for $n > 3$]
#ans[$f(n) = n^3$]
#corr[$f(3) = 1$ and $f(n) = ((n-1)(n-2))/2 + f(n - 1)$ for $n > 3$]
== Question 20
For any integers $n, m$, where $2 <= n <= m$, the binomial coefficient $binom(n+m, m+2)$ equals
*Vælg en svarmulighed*
#ans[$sum_(k=0)^n binom(n, k)binom(m, m-k)$]
#corr[$sum_(k=2)^n binom(n, k)binom(m, m+2-k)$]
#ans[$sum_(k=0)^(n+2) binom(n, k)binom(m, n-k)$]
#ans[None of these because we cannot use Vandermonde's identity in this case]
#ans[$sum_(k=1)^n binom(n, k)binom(m, m+1-k)$]
#solution()[
Because we know: $mat(m+n;r)=sum^r_(k=0) mat(n;k) mat(m;r-k)$
]
== Question 21
The number of derangements of 1,2,3,4,5,6,7 ending with 1,2,3 in some order is
*Vælg en svarmulighed*
#ans[$3!(4! - 1)$]
#ans[$3!4!\/2$]
#ans[$3!4!$]
#corr[$3!(4! - 3!)$]
#ans[None of these]
#solution()[
Can be calculated in Sympy.
Intuitively:
There are $3!$ ways to order $1,2,3$. And if it must end in that, there are 4 more numbers to order, which have $4!$ numbers of ways to be ordered. Since it is a derangement though, this means that no number can have its original position, so we must count out the positions where 4 is in the 4th spot, so $- 3!$. So it becomes $3! (4!-3!)$
]
== Question 22
Consider the following system of congruences:
$x equiv 1 mod 2$
$x equiv 4 mod 5$
$x equiv 3 mod 7$
Indicate the set of all solutions to the above system of congruences.
*Vælg en svarmulighed*
#ans[${12 + 70k | k in ZZ}$]
#ans[${8 + 70k | k in ZZ}$]
#ans[${1 + 2k | k in ZZ} union {4 + 5k | k in ZZ} union {3 + 7k | k in ZZ}$]
#ans[${70 + 12k | k in ZZ}$]
#ans[${8 + 14k | k in ZZ}$]
#corr[${59 + 70k | k in ZZ}$]
#ans[None of these]
#solution()[
Can be solved using Sympy.
Also calculate for each of the formulas whether 2 divides it minus 1, 5 divides it minus 4 and 7 divides it minus 3.
]
== Question 23
It is possible to prove that a simple graph on $n >= 1$ vertices has at most $binom(n, 2)$ edges using mathematical induction. Here we take $binom(1, 2)$ to be equal to zero.
By choosing some of the following text fragments and putting them in the correct order, a proof by induction for the above statement can be created.
*A)* To prove the inductive step, assume that every simple graph on $n$ vertices has at most $binom(n, 2)$ edges, for every integer $n >= 1$. We will show that this implies that every simple graph on $n + 1$ vertices has at most $binom(n+1, 2)$ edges.
*B)* To prove the inductive step, assume that every simple graph on $n$ vertices has at most $binom(n, 2)$ edges, for some fixed integer $n >= 1$. We will show that this implies that every simple graph on $n + 1$ vertices has at most $binom(n+1, 2)$ edges.
*C)* The statement now follows from the principle of mathematical induction.
*D)* Since $v$ had at most $n$ edges incident to it, we have that $G$ has at most $n + binom(n, 2)$ edges. Moreover, $n + binom(n, 2) = n + (n(n-1))/2 = 1/2(2n + n^2 - n) = 1/2(n^2 + n) = ((n+1)n)/2 = binom(n+1, 2)$.
*E)* We prove the statement by induction. The base case is $n = 1$. A simple graph on 1 vertex cannot have any edges, so it has at most $binom(1, 2) = 0$ edges.
*F)* Let $G$ be a simple graph on $n + 1$ vertices. Pick any vertex $v in V(G)$ and note that $v$ has at most $n$ edges incident to it since there are $n$ vertices it could be adjacent to. Let $G'$ be the graph obtained from $G$ by removing $v$ and all the edges incident to $v$. Then $G'$ is a simple graph on $n$ vertices and thus it has at most $binom(n, 2)$ edges by our induction hypothesis.
*G)* Let $G$ be a simple graph on $n$ vertices. Construct a simple graph $G'$ on $n + 1$ vertices by adding a new vertex $v$ to $G$ and making it adjacent to an arbitrary subset $S$ of vertices of $G$. Since $G$ has $n$ vertices, we have that $|S| <= n$ and so $v$ is incident to at most $n$ edges. Therefore $G'$ has at most $n + binom(n, 2) = n + (n(n-1))/2 = 1/2(2n + n^2 - n) = 1/2(n^2 + n) = ((n+1)n)/2 = binom(n+1, 2)$ edges.
*PLEASE NOTE THAT THE QUESTIONS AND ANSWERS BELOW APPEAR IN RANDOM ORDER. PLEASE READ THEM CAREFULLY.*
*Vælg de rigtige svarmuligheder*
#block(width: 100%, breakable: false)[
#table(
columns: (20%, 0.5fr, 0.5fr, 0.5fr, 0.5fr, 0.5fr, 0.5fr, 0.5fr, 1fr),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[ ],
[*A*],
[*B*],
[*C*],
[*D*],
[*E*],
[*F*],
[*G*],
[*No more \ fragments*],
[The first text fragment of the proof is],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
[The second text fragment of the proof is],
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[The third text fragment of the proof is],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
[The fourth text fragment of the proof is],
mark-circle,
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[The fifth text fragment of the proof is],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
]
#solution()[
First is *E)* because it is our base step.
Then it is *B)* for the start of the inductive step. It is not *A)* because we calculate induction for some _fixed_ integer, not every integer.
Then is *F)* because it makes more sense than *G)*
Then is *D)* because calculations
Then is *C)* because there is another option left and this also concludes stuff.
]
== Question 24
Let $P(x)$ denote the statement "$x$ is prime". Which of the following statements can be written in predicate logic as the following:
$forall x in ZZ (x > 1 -> (exists y in NN (P(y) and x < y < 2x)))$
*Vælg en svarmulighed*
#ans[For every integer $x$ greater than 1, every number strictly between $x$ and $2x$ is prime.]
#ans[None of these]
#ans[For every integer $x$, either $x > 1$ or there is a prime $y$ such that $x < y < 2x$.]
#ans[For any integer $x > 1$ and any prime $y$, if $x > 1$ then $x < y < 2x$.]
#corr[For every integer $x > 1$, there is a prime $y$ such that $x < y < 2x$.]
#ans[There exist infinitely many primes.]
#solution()[
This is just using words to describe the statement
]
== Question 25
Let $a$ and $b$ be two positive integers with $a b = 5292 = 2^2 3^3 7^2$. Which of the following values CANNOT be the greatest common divisor of $a$ and $b$?
*Vælg en svarmulighed*
#ans[1]
#ans[3]
#corr[36]
#ans[42]
#ans[All of these are possible values for $"gcd"(a, b)$]
#solution()[
36 can't be gcd because, even though you can construct it using the primes, you do: $2 dot 2 dot 3 dot 3$, and then you wouldn't be able to construct it again, meaning it would only be able to divide one of $a,b$
]
== Question 26
Consider the number of ways we can put $n + 1$ distinguishable balls (meaning that we can tell the difference between them) into $n$ distinct boxes.
*Vælg de rigtige svarmuligheder*
#table(
columns: (1fr, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center),
stroke: none,
[ ],
[*none of these*],
[$2n!$],
[$binom(n+1, 2)n!$],
[$n^(n+1) - 2n!$],
[$n^(n+1) - binom(n+1, 2)n!$],
[If at least one box is empty, the number of ways is],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
corr-circle,
[If no box is empty, the number of ways is],
mark-circle,
mark-circle,
corr-circle,
mark-circle,
mark-circle,
)
#solution()[
For the non-empty one first:
You first chose 2 of the $n+1$ balls, these will go into the same container. Then you put the balls into the container (the two balls just acting as one)
For the non-empty one:
You can arrange the balls in $n$ ways in the boxes, but then you must subtract all the ways to order the balls when there are no empty boxes as there must be at least one empty box.
]

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,577 @@
#import "@local/dtu-template:0.5.1":*
#import "@preview/cetz:0.4.2"
#import "@preview/cetz-venn:0.1.4": venn2, venn3
#import "@preview/auto-div:0.1.0": poly-div, poly-div-working
#let mark-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, radius: 50%)
#let ans(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), mark-circle, body)
#let corr-circle = box(width: 0.8em, height: 0.8em, stroke: 0.5pt + black, fill: black, radius: 50%)
#let corr(body) = grid(columns: (auto, 1fr), column-gutter: 0.5em, align: (center, left), corr-circle, body)
#show heading: it => { pagebreak(weak: true); it }
== Question 1
If $p,q$ are prime numbers such that $100 < p < q$, then the number of positive integers less than $p q$ which are relative prime to $p q$ is:
#corr[$p q - p - q + 1$ (Rasmus's, Sebastian's answer)]
#ans[$p q - q + 1$]
#ans[$p q-p-q-1$]
#ans[$p q-p-q$ (Mikkel's answer)]
#ans[$p q-1$]
#ans[None of these]
== Question 2
The number $(4^100 mod 6 )^100 mod 10$ equals
#ans[3]
#corr[6 (All's answer)]
#ans[2]
#ans[None of these]
#ans[5]
#ans[1]
#ans[4]
== Question 3
Consider the set of all 99 positive integers not exceeding 99.
#table(
columns: (18%, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[],
[$binom(99, 50)$],
[$2^98$],
[$2^97$],
[$2^49$],
[None of these],
[$2^50$],
[$binom(99,50) binom(99,49)$],
[$binom(99,49) binom(99, 49)$],
[How many subsets have an odd number of odd numbers, and an even number of even numbers?],
mark-circle,
[Mikkel's answer],
[*Sebastian's answer*],
[Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of even numbers and an even number of odd numbers?],
mark-circle,
mark-circle,
corr-circle,
[Rasmus's answer],
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
[How many subsets have 49 elements?],
[*Rasmus's answer*],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[How many subsets have an odd number of odd numbers?],
mark-circle,
[*Rasmus's, Sebastian's answer*],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 4
Consider the following system of congruences:
$
x &equiv 1 mod 2 \
x &equiv 1 mod 5 \
x &equiv 7 mod 9
$
Indicate the set of all solutions to the above system of congruences.
#ans[None of these]
#ans[${90 + 7k | k in ZZ}$]
#ans[${1 + 2k | k in ZZ} union {1 + 5k | k in ZZ} union {7 + 9k | k in ZZ}$]
#ans[${9 + 90k | k in ZZ}$]
#corr[${61 + 90k | k in ZZ}$ (All's answer)]
#ans[${7 + 90k | k in ZZ}$]
== Question 5
Find a greatest common divisor of the polynomials $x^3 - 1$ and $x^3 + 2x^2 + 2x + 1$
#ans[$x+1$]
#ans[$1$(Mikkel's answer)]
#ans[$x-1$]
#corr[$x^2 + x + 1$ (Rasmus's, Sebastian's answer)]
#ans[$x^2 + x - 1$]
#ans[None of these]
#ans[$x^2 - x + 1$]
#ans[$x^2-x-1$]
== Question 6
Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers. For all $n in NN$ define $f(n) = sum^n_(k=0) k dot k! = 0 dot 0! + 1 dot !+ dots + n dot n!$. It is possible to prove by induction that $f(n) = (n+1)! -1$ holds for all nonnegative integers $n$.
By choosing 4 of the following 8 text fragments and putting them in the correct order, a proof by induction for the above statement can be created.
A. To prove the induction step, we assume that $f(n+1) = ((n+1)+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n) = (n+1)!-1$
B. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for all $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$ holds for all $n in NN$.
C. To prove the induction step we assume that $f(n) = (n+1)!-1$ holds for some $n in NN$. We will now prove that under this assumption, $f(n+1) = ((n+1)+1)!-1$.
D. The statement now follows from the principle of mathematical induction.
E. We prove the statement by induction. The base case is $n = 1$. For $n=1$, we see that $f(1) = sum^1_(k=0)k dot k! = 0 dot 0! + 1 dot 1! = 0 dot 1 + 1 dot 1 = 1$ and also that $(n+1)! -1 = (1+1)!-1 = 2!-1 = 2-1 =1$. This proves the base case.
F. We prove the statement by induction. The base case is $n=0$. For $n=0$, we see that $f(0) = sum^0_(k=0) k dot k! = 0 dot 0! = 0 dot 1 = 0$ and also that $(n+1)! -1 = (0+1)!-1 = 1!-1 = 1-1 =0$. This proves the base case.
G. We have that $
f(n) &= sum^n_(k=0) k dot k! \
&= (sum^(n+1)_(k=0) k dot k! ) - (n+1)(n+1)! \
&= f(n+1) - (n+1)(n+1)! \
&= ((n+1)+1)! - 1 - (n+1)(n+1)! "By the induction hypothesis" \
&= (n+2)! -(n+1)(n+1)!-1 \
&= (n+2)(n+1)!-(n+1)(n+1)!-1 \
&= (n+2 - (n+1))(n+1)!-1 \
&= (n+1)! -1
$ which is what we wanted to prove. This concludes the induction step.
H. We have that $
f(n+1) &= sum^(n+1)_(k=0) k dot k! \
&= (sum^n_(k=0) k dot k!) + (n+1)(n+1)! \
&= f(n)+(n+1)(n+1)! \
&= (n+1)!-1+(n+1)(n+1)! "By the induction hypothesis" \
&= (n+1)(n+1)!+(n+1)!-1 \
&= [(n+1)+1](n+1)!-1 \
&= (n+2)! - 1 = ((n+1)+1)!-1
$ which is what we wanted to prove. This concludes the induction step.
#table(
columns: (20%, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center),
stroke: none,
[],
[A],
[B],
[C],
[D],
[E],
[F],
[G],
[H],
[The first fragment is:],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Mikkel's answer],
[*Rasmus's, Sebastian's answer*],
mark-circle,
mark-circle,
[The second fragment is:],
[Sebastian's answer],
mark-circle,
[Rasmus's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[The third fragment is:],
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Rasmus's answer],
[The fourth fragment is:],
mark-circle,
mark-circle,
mark-circle,
[Rasmus's answer],
mark-circle,
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
)
== Question 7
For all $n in NN$ define $a_n$ recursively as follows $a_0 = 2, a_1 = 3, a_n = cases(a_(n-1) + n "if" n "is even", a_(n-1) + 2a_(n-2) "if" n "is odd")$
1. 37 (All's answer)
2. 38
3. 35
4. 40
5. None of these
6. 36
7. 39
== Question 8
We wish to construct a bipartite graph with bipartition $(V_1, V_2)$ such that $abs(V_1) = 4, abs(V_2) = 5$ (Note that a bipartite graph has no loops, but it may contain multiple edges.)
#table(
columns: (40%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[The graph exists without multiple edges.],
[The graph exists but only if we allow multiple edges.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_1$.],
[The graph does not exist, but it will exist if we are allowed to increase one of the degrees in $V_2$.],
[None of these are correct],
[If the degrees in $V_1$ are $5,5,5,5$ and the degrees in $V_2$ are $4,4,4,4,4$ then],
[Rasmus's answer],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
[If the degrees in $V_1$ are $1,2,2,2$ and the degrees in $V_2$ are $1,2,2,2,2$ then],
[Sebastian's answer],
[Mikkel's answer],
[Rasmus's answer],
mark-circle,
mark-circle,
[If the degrees in $V_1$ are $4,4,4,4$, and the degrees in $V_2$ are $5,5,5,5,5$ then],
mark-circle,
[Rasmus's answer],
[Mikkel's, Sebastian's answer],
mark-circle,
mark-circle,
)
== Question 9
The formula $binom(m+n, r) = sum^r_(k=a) binom(m, r-k) binom(n,k)$ is true for all integers $m,n,r$ satisfying $0 < m < r < n$ if we let the summation start with:
1. $a = n$ (Sebastian's answer)
2. $a = r$
3. None of these (Rasmus's answer)
4. $a = n -r$ (Mikkel's answer)
5. $a = m$
6. $a = r - m$
== Question 10
Let $A = {0,1,2,4}, B = {0,1,3,5}, "and" C = {0,2,3,6}$. IF the universal set $U = {0,1,2,3,4,5,6,7}$, then which of hte following is equal to $((A inter B) backslash C) union ((B inter C) backslash C) union ((C inter A) backslash B)$
1. ${0,1,2,3}$
2. All of these sets
3. $emptyset$ (Mikkel's answer)
4, ${4,5,6}$
5. None of these
6. ${0,4,5,6}$
7. ${1,2,3}$ (Rasmus's, Sebastian's answer)
== Question 11
Consider the statement "for every positive rational number $x$ there are positive integers $a$ and $b$ such that $x = a/b$ and $gcd(a,b) = 1$." Which of the following statement in predicate logic is equivalent to this if we let $G(a,b)$ denote the statement " $a "and" b$ are relatively prime"?
1. It is not possible to translate the statement into predicate logic. (Sebastian's answer)
2. $forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b and G(a,b)) $ (Mikkel's, Rasmus's answer)
3. $forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (G(a,b) -> x = a/b)$
4. $forall x in QQ^+ forall a in ZZ^+ forall b in ZZ^+ (x = a/b and G(a,b))$
5. $forall x in QQ^+ exists a in ZZ^+ exists b in ZZ^+ (x = a/b -> G(a,b))$
== Question 12
Given a univerisal set $U$, which of the following is equal to the set $A inter overline(B backslash C)$?
1. None of these
2. $A inter B inter overline(C)$
3. $(A union B) inter (A union overline(C))$
4. $(A inter overline(B)) union (A inter C)$ (Rasmus's answer)
5. $A inter overline(B) inter C$
6. $A inter (C backslash B)$ (Mikkel's, Sebastian's answer)
== Question 13
The empty set is an element of which of the following sets?
1. ${{emptyset}}$
2. None of these
3. $emptyset$ (Mikkel's answer)
4. ${x in RR : x < x}$
5. ${emptyset}$ (Rasmus's, Sebastian's answer)
6. All of these sets
== Question 14
Which of the following are tautologies?
1. $(p -> q) or (not q -> not p)$ (Sebastian's answer)
2. None of these
3. $p <-> q$
4. All of these
5. $(not p or not q) -> (not (p and q))$ (Mikkel's, Rasmus's answer)
6. $(p or q or r) and (p or not q or not r)$
== Question 15
Consider all possible seatings of $3n$ people around two tables, one with $n$ seats and one with $2n$ seats. Find the number of seatings when
#table(
columns: (20%, auto, auto, auto, auto, auto, auto, auto, auto, auto),
align: (left, center, center, center, center, center, center, center, center, center),
stroke: none,
[],
[$((3n)!)/(2(n!))$],
[$((3n)!)/(4(n!))$],
[$((3n)!)/(4n)$],
[$2 binom(3n,n)$],
[$((3n)!)/(2n^2)$],
[$((3n)!)/(4n^2)$],
[$((3n)!)/(8n^2)$],
[$4 binom(3n,n)$],
[None of these],
[Two seatings are considered the same when each person has the same left and right neighbor.],
mark-circle,
[Rasmus's answer],
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
[Mikkel's answer],
mark-circle,
[Two seatings are considered the same when each person has the same neighbors (and we do not care about right or left)],
[Rasmus's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
)
== Question 16
For each of the following, determine whether it is surjective/injective, or not a well defined function. Recall that $NN$ is the set of natural numbers, in other words the set of nonnegative integers.
#table(
columns: (35%, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center),
[],
[Not a well defined function],
[Well defined but neither injective nor surjective],
[Surjective],
[Injective],
[Both injective and surjective],
[$ f: RR -> ZZ $ given by $f(x) = 2 floor(x/2)$],
[Mikkel's, Sebastian's answer],
[Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
[$f : RR -> {x in RR : x >= 0}$ given by $f(x) = sqrt(x^2)$],
mark-circle,
[Sebastian's answer],
[Rasmus's answer],
mark-circle,
[Mikkel's answer],
[$f: NN -> NN$ given by $f(x) = 2x +7$],
mark-circle,
mark-circle,
mark-circle,
[All's answer],
mark-circle,
[$f: NN -> NN$ given by $f(x) = x-x^2$],
[Rasmus's, Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
mark-circle,
[$f: RR -> RR$ given by $f(x) = cases(x "if" x in QQ, -x "if" x in.not QQ)$],
mark-circle,
mark-circle,
[Mikkel's, Sebastian's answer],
mark-circle,
[Rasmus's answer],
)
== Question 17
Consider all permutations of ABCDE
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[12],
[24],
[36],
[48],
[50],
[64],
[None of these],
[How many contain none of AB, BC, CD],
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
mark-circle,
[Rasmus's answer],
mark-circle,
[How many contain ACE],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
[Mikkel's, Rasmus's answer],
[How many contain precisely one of AB, CD],
mark-circle,
[Mikkels's, Sebastian's answer],
[Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle
)
== Question 18
For each relation on the set of four distinct elements $a,b,c,d$ below, decide which property it has.
#table(
columns: (30%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
stroke: none,
[],
[The edges of a hasse diagram],
[Partial order],
[Total order but not well ordered],
[Well-order],
[None of these],
[Total order but not partial order],
[Equivalence relation],
[$(a,a),(a,b),(a,c)(a,d)$],
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's answer],
[Rasmus's answer],
mark-circle,
mark-circle,
[$(a,b),(b,c),(c,d)$],
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
[Mikkel's, Rasmus's answer],
mark-circle,
mark-circle,
[$(a,a),(b,b),(c,c),\ (d,d),(a,d),(d,a)$],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
[Mikkel's, Rasmus's answer],
[$(a,a),(b,b),(c,c),\ (d,d),(d,c)$],
mark-circle,
[Mikkel's, Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
[$(a,a),(b,b),(c,c),(d,d),\ (a,b),(a,c),(a,d),(b,c),\ (b,d),(c,d)$],
[Mikkel's answer],
[Rasmus's answer],
mark-circle,
mark-circle,
mark-circle,
mark-circle,
[Sebastian's answer]
)
== Question 19
Which of the following is a recursively defined function for the number of ways to tile an $n times 2$ board using $2 times 1$ tiles.
1. $f(0) = 1, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$
2. $f(0) = 0, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$
3. $f(0) = 1, f(1) = 1, f(n) = 2f(n - 2) "for" n >= 2$
4. $f(0) = 1, f(1) = 1, f(n) = f(n - 1)f(n - 2) "for" n >= 2$
5. All of these (Mikkel's answer)
6. $f(0) = 0, f(1) = 1, f(n) = f(n - 1) + f(n - 2) "for" n >= 2$ (Rasmus's, Sebastian's answer)
7. None of these
== Question 20
Find the coefficient of $x^15 y^20$ in the polynomials below.
#table(
columns: (20%, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr, 1fr),
align: (left, center, center, center, center, center, center, center),
[],
[$- binom(10,5)2^5$],
[$binom(10,5) 2^15$],
[$- binom(10,5)2^15$],
[0],
[None of these],
[$-binom(10,5)2^10$],
[$- binom(10,3)2^5$],
[$(2x^3-y^4)^10$],
[Mikkel's, Rasmus's answer],
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
[$(1-2x^3y^4)^10$],
[Rasmus's answer],
mark-circle,
mark-circle,
[Sebastian's answer],
[Mikkel's answer],
mark-circle,
mark-circle,
[$(x^3-2y^4)^10$],
[Mikkel's, Rasmus's answer],
mark-circle,
mark-circle,
[Sebastian's answer],
mark-circle,
mark-circle,
mark-circle,
)
== Question 21
Which of the following is equivalent to the statement " $a$ and $b$ are relatively prime"? The domain for each statement is
the set of all positive integers
1. None of these three are equivalent to the statement.
2. $not (exists c (c divides a and c divides b and c > 1) )$ is equivalent to the statement, and the other two are not.
3. $forall c (not (c divides a) or not (c divides b) or (c <= 1))$ is equivalent to the statement, and the other two are not.
4. All of these three are equivalent to the statement.
5. $forall c ( (c divides a and c divides b) -> (c <= 1))$ is equivalent to the statement, and other two are not. (All's answer)

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@@ -0,0 +1,184 @@
#import "@local/dtu-template:0.5.1":*
#show: dtu-note.with(
course: "01017",
course-name: "Discrete Mathematics",
title: "Lecture - November 27, 2025",
date: datetime(day: 27, month: 11, year: 2025),
author: "Rasmus Rosendahl-Kaa (S255955)",
semester: "2025 Fall",
)
= Graphs
== Konigsberg Bridge problem
Consider a river with an island, and where it diverges into two streams. There are 7 bridges to the island.
#image("Lecture-pictures/Konigsberg Bridge Problem.png")
Can you start somewhere and walk over every bridge without walking over a bridge more than once.
*Solution:*\
The layout of the bridges doesn't matter. You can represent the island, and the land areas as points. So 4 points, and lines between them. What you have is a graph. The points are *vertexes* and the lines/curves are *edge* (you can have single-edges, double-edges, and so on). If you have more than 3 vertexes between two vertexes, its called a multiple edge. A loop is an edge looping to the same vertex.
If there are no loops or multiple edges, the graph is called _simple_.
#definition(title: "Vertex")[
A vertex is the points in the graph.
$V(G)={v_1,v_2,dots,v_n}$ are the vertices in graph $G$
An isolated vertex is a singular vertex with no edges.
]
#proof()[
Assume $G$ is connected and every vertex has even degree. We shall find a closed Euler walk.\
You start in a vertex $s$ and go to a random neighbor. Continue this until you can't anymore. You _will_ stop in $s$ because else $s$ will always have degree 1.
This doesn't prove it necessarily because you don't know if some vertex has another edge. Though you can solve this by starting from the vertex that has more edges, and assuming that is a smaller graph, so you complete that.
]
#theorem()[
A graph $G$ has a closed Euler walk if and only if ($<=>$) every vertex has even degree and $G$ is connected.
]
#definition(title: "Degree")[
The amount of edges going out of a vertex.
]
#definition(title: "Euler circuit/walk/tour")[
*Closed (circuit):*\
You start in a vertex $s$ and go through every edge precisely once and return in $s$.
*Open (path):*\
The same as closed, but you return to $t$, not $s$
]
#definition(title: "Connected")[
A graph is called connected when there's a path between every vertexes ($forall x,y in V(G)$).\
If not, it is called *disconnected*.
- *Strongly connected:* A directed graph is strongly connected if there is a path from a to b and from b to a whenever a and b are vertices in the graph.
- *Weekly connected:* A directed graph is weakly connected if there is a path between every two vertices in the
underlying undirected graph.
]
#definition(title: "Connected component (piece)")[
For a graph, there is not connected, you can have connected components. Is is a subgraph of the graph that is connected.
You can also call it the maximal connected subgraph
]
== Degree sequence
#definition(title: "Complete")[
A complete graph of _n_ vertices, denoted $K_n$, is a simple graph that contains exactly one edge between each pair of distinct vertices. Like a tetrahedron
#image("Lecture-pictures/Tetrahedron.svg",width: 50%)
A tetrahedron can be realized as a degree sequence ($3,3,3,3$)
]
#definition(title: "Degree Sequence")[
The *degree sequence* of a graph is a list of the degrees of its vertices, usually written in non-increasing order.
For example, if a graph has vertices with degrees 3, 2, 2, and 1, its degree sequence is (3, 2, 2, 1).
]
#lemma()[
*Hand shaking Lemma*
For a graph $G$ with vertices $v_1,v_2,dots,v_n$ and degrees\ $deg(v_1),deg(v_2),dots,deg(v_n)$.
$
sum^(n)_(i=1)deg(v_i)=2|E(G)|
$
#proof()[
Each edge is contributing to the total degree twice, so the sum of the degrees are just the twice the amount of edges.
]
Every graph has an even number of odd-degree vertices, because to get an even degree you can't have a single odd degree.
]
#definition(title: "Path")[
The path is a line of vertices. $P_n$
]
#definition(title: "Cycle")[
#image("Lecture-pictures/Cycle.png")
]
#definition(title: "Wheel")[
#image("Lecture-pictures/Wheel.png")
]
#definition(title: "n-cube")[
#image("Lecture-pictures/n-Cube.png")
$Q_n$
$ V(Q_n)={(x_1,x_2,dots, x_(n))| x_(i) in {0,1}} $
Two vertices $(x_1,dots,x_n)$ and $(y_1,dots,y_n)$ are neighbors if and only if $exists ! i : x_i eq.not y_i$
]
#definition(title: "Tree and forest")[
A tree (like a family tree) is also a graph. It is a connected graph without cycle
A forest is a (_non-connected_) graph without cycle
]
#definition(title: "Bipartite")[
A bipartite graph with $"bipartite"(V_1,V_2)$ is a graph with $V(G)=V_1 union V_2$ and all its edges go from $V_1 "to" V_2$
]
== The marriage problem
You have a collection of men (set $V_1$) and a collection of women (set $V_2$). Some man may know some women.
The problem is: Can every man marry a women, when a man can only marry _one_ woman.\
It will not be possible to solve if you have more men than women. Even if you have more women than men, there is a possibility of not all men having married, if, for example, 3 men know some 3 women out of 4, but there is a man who doesn't know any women.
#theorem(title: "Hall's marriage problem")[
A bipartite graph $G$ with bipartitian $V_1,V_2$ has a matching with $|V_1|$ edges if and only if:
$ forall S subset.eq V_1, |N(S)| >= |S| $
which is called Hall's condition.
So if you take 3 men, they should know at least 3 women.
Hall's condition solves the marriage problem because you can take a subset containing one man, which then must be at least 1 (so every man will know at least one woman if Hall's condition is true).
]
#definition(title: "Matching")[
Every vertex has degree at most 1
]
== Isomorphism problem
#definition(title: "Isomorphism problem")[
#image("Lecture-pictures/Isomorphism.jpg",width:40%)
$ G tilde.eq H <=>^("def") V(G)={v_1,v_2,dots,v_n}, V(H)={u_1,u_2,dots,u_n}\
v_i v_j "is an edge" <=> u_i u_j "is an edge"
$
A graph is isomorphism if, for every pair of vertices in one that are neighbors, a likewise pair should be in the other (though they can be arranged in a different way)
]
== Adjacency matrix
#set math.mat(delim: "[")
#definition(title: "Adjacency matrix")[
#image("Lecture-pictures/Adjacency-Matrix.jpg", width: 50%)
A matrix consisting of all the neighbors:
$mat("",v_1,v_2,v_3,v_4;v_1,0,1,0,1;v_2,1,0,1,1;v_3,0,1,0,1;v_4,1,1,1,0)$
]
#definition(title: "Directed graph")[
There is a path through the graph
*Strongly directed:* A graph $D$ is strongly connected if and only f $forall x,y in V(D):$ D contains a directed path from $x$ to $y$ and from $y$ to $x$
*Weekly directed:* If you take all the directed away, you will be left with an undirected graph which is still connected.
]
Strong component: The directed path is also the maximal connected graph.
#definition(title: "Complementary")[
The complementary graph $overline(G)$ of a simple graph $G$ has the same vertices as $G$. Two vertices are adjacent in $G$ if and only if they are not adjacent in $G$. Describe each of these graphs.
A simple graph G is called self-complementary if $G$ and $overline(G)$ are isomorphic
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -0,0 +1,176 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<svg
version="1.1"
baseProfile="full"
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:ev="http://www.w3.org/2001/xml-events"
width="10.468963887942621cm"
height="9.217239944819047cm"
viewBox="0 0 275 242"
>
<title>
</title>
<g stroke-linejoin="miter" stroke-dashoffset="0.0000" stroke-dasharray="none" stroke-width="1.0000" stroke-miterlimit="10.000" stroke-linecap="square">
<g id="misc">
</g><!-- misc -->
<g id="layer0">
<clipPath id="clipd5046605-4ed4-4e15-a91b-9552a95d57ca">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip1)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 22.812 218.08 L 251.13 218.08"/>
<title>Strecke g</title>
<desc>Strecke g: Strecke E, F</desc>
</g> <!-- drawing style -->
</g> <!-- clip1 -->
<clipPath id="clipb55b0f85-2a89-4cbf-aa0d-5d1b1ed22a20">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip2)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 251.13 218.08 L 136.97 20.355"/>
<title>Strecke h</title>
<desc>Strecke h: Strecke F, B</desc>
</g> <!-- drawing style -->
</g> <!-- clip2 -->
<clipPath id="clip3dd532cb-aa4c-4d50-9c38-a78a16ad270f">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip3)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 136.97 20.355 L 22.812 218.08"/>
<title>Strecke i</title>
<desc>Strecke i: Strecke B, E</desc>
</g> <!-- drawing style -->
</g> <!-- clip3 -->
<clipPath id="clip28579d81-173a-407f-b7fb-0037f3c533e0">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip4)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 136.97 152.17 L 251.13 218.08"/>
<title>Strecke g_1</title>
<desc>Strecke g_1: Strecke J, F</desc>
</g> <!-- drawing style -->
</g> <!-- clip4 -->
<clipPath id="clip0a89471f-90fa-4950-a22f-d96015531c2d">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip5)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 136.97 152.17 L 22.812 218.08"/>
<title>Strecke h_1</title>
<desc>Strecke h_1: Strecke J, E</desc>
</g> <!-- drawing style -->
</g> <!-- clip5 -->
<clipPath id="clip6fa63553-ddcd-444d-9797-42df27937c52">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip6)">
<g stroke-linejoin="round" stroke-width="4.5000" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 136.97 152.17 L 136.97 20.355"/>
<title>Strecke i_1</title>
<desc>Strecke i_1: Strecke J, B</desc>
</g> <!-- drawing style -->
</g> <!-- clip6 -->
<clipPath id="clip25ccdaea-ad68-442d-ba36-ffb4203b2c72">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip7)">
<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#ff0000">
<path d="M 145.97 20.355 C 145.97 25.325 141.94 29.355 136.97 29.355 C 132.00 29.355 127.97 25.325 127.97 20.355 C 127.97 15.384 132.00 11.355 136.97 11.355 C 141.94 11.355 145.97 15.384 145.97 20.355 z"/>
<title>Punkt B</title>
<desc>Punkt B: Punkt auf yAchse</desc>
</g> <!-- drawing style -->
</g> <!-- clip7 -->
<clipPath id="clipfc998179-ddc5-4a1c-b298-aee0907e6916">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip8)">
<g stroke-linejoin="round" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 145.97 20.355 C 145.97 25.325 141.94 29.355 136.97 29.355 C 132.00 29.355 127.97 25.325 127.97 20.355 C 127.97 15.384 132.00 11.355 136.97 11.355 C 141.94 11.355 145.97 15.384 145.97 20.355 z"/>
<title>Punkt B</title>
<desc>Punkt B: Punkt auf yAchse</desc>
</g> <!-- drawing style -->
</g> <!-- clip8 -->
<clipPath id="clip83ebdac3-f14d-40a5-a2ba-09f5385a0a52">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip9)">
<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#0000ff">
<path d="M 31.812 218.08 C 31.812 223.05 27.782 227.08 22.812 227.08 C 17.841 227.08 13.812 223.05 13.812 218.08 C 13.812 213.11 17.841 209.08 22.812 209.08 C 27.782 209.08 31.812 213.11 31.812 218.08 z"/>
<title>Punkt E</title>
<desc>Punkt E: Schnittpunkt von c, f</desc>
</g> <!-- drawing style -->
</g> <!-- clip9 -->
<clipPath id="clip4230337d-64de-4eaf-9e03-74955b07fd6e">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip10)">
<g stroke-linejoin="round" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 31.812 218.08 C 31.812 223.05 27.782 227.08 22.812 227.08 C 17.841 227.08 13.812 223.05 13.812 218.08 C 13.812 213.11 17.841 209.08 22.812 209.08 C 27.782 209.08 31.812 213.11 31.812 218.08 z"/>
<title>Punkt E</title>
<desc>Punkt E: Schnittpunkt von c, f</desc>
</g> <!-- drawing style -->
</g> <!-- clip10 -->
<clipPath id="clip36c9251b-0985-4d19-856b-7fed1fae6d7a">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip11)">
<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#00ff00">
<path d="M 260.13 218.08 C 260.13 223.05 256.10 227.08 251.13 227.08 C 246.16 227.08 242.13 223.05 242.13 218.08 C 242.13 213.11 246.16 209.08 251.13 209.08 C 256.10 209.08 260.13 213.11 260.13 218.08 z"/>
<title>Punkt F</title>
<desc>Punkt F: Schnittpunkt von c, e</desc>
</g> <!-- drawing style -->
</g> <!-- clip11 -->
<clipPath id="clip002d13e1-f6a6-4361-aab6-18a2f9a8dec6">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip12)">
<g stroke-linejoin="round" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 260.13 218.08 C 260.13 223.05 256.10 227.08 251.13 227.08 C 246.16 227.08 242.13 223.05 242.13 218.08 C 242.13 213.11 246.16 209.08 251.13 209.08 C 256.10 209.08 260.13 213.11 260.13 218.08 z"/>
<title>Punkt F</title>
<desc>Punkt F: Schnittpunkt von c, e</desc>
</g> <!-- drawing style -->
</g> <!-- clip12 -->
<clipPath id="clip01efcf42-0645-4f99-9342-ff0f774b2cd2">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip13)">
<g fill-opacity="1.0000" fill-rule="nonzero" stroke="none" fill="#ffff00">
<path d="M 145.97 152.17 C 145.97 157.14 141.94 161.17 136.97 161.17 C 132.00 161.17 127.97 157.14 127.97 152.17 C 127.97 147.20 132.00 143.17 136.97 143.17 C 141.94 143.17 145.97 147.20 145.97 152.17 z"/>
<title>Punkt J</title>
<desc>Punkt J: Schnittpunkt von j, k</desc>
</g> <!-- drawing style -->
</g> <!-- clip13 -->
<clipPath id="clipb5c7b8a8-7fb7-4902-9367-ebb65c614792">
<path d="M 0.0000 0.0000 L 0.0000 243.00 L 276.00 243.00 L 276.00 0.0000 z"/>
</clipPath>
<g clip-path="url(#clip14)">
<g stroke-linejoin="round" stroke-linecap="round" fill="none" stroke-opacity="1.0000" stroke="#000000">
<path d="M 145.97 152.17 C 145.97 157.14 141.94 161.17 136.97 161.17 C 132.00 161.17 127.97 157.14 127.97 152.17 C 127.97 147.20 132.00 143.17 136.97 143.17 C 141.94 143.17 145.97 147.20 145.97 152.17 z"/>
<title>Punkt J</title>
<desc>Punkt J: Schnittpunkt von j, k</desc>
</g> <!-- drawing style -->
</g> <!-- clip14 -->
</g><!-- layer0 -->
</g> <!-- default stroke -->
</svg> <!-- bounding box -->

After

Width:  |  Height:  |  Size: 8.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -0,0 +1,68 @@
#import "@local/dtu-template:0.5.1":*
= 10.1
== 11
Let $G$ be a simple graph. Show that the relation $R$ on the set of vertices of $G$ such that $u R v$ if and only if there is an edge associated to ${u, v}$ is a symmetric, irreflexive relation on G.
#solution[
- *Symmetric:* If $u$ is connected to $v$, then $v$ is connected to $u$
- *Irreflexive:* Because you are looking at a simple graph, then there will not be a loop.
]
= 10.2
== 5
_Can a simple graph exist with 15 vertices each of degree five?_
#solution[
No because the total degree would be uneven
]
== 43
_How many edges does a graph have if its degree sequence is $5, 2, 2, 2, 2, 1$? Draw such a graph._
#solution[
$(5+2+2+2+2+1)/2=7$
]
== (53)
= 10.3
== (7)
_Represent the graph in Exercise 3 with an adjacency matrix._
#image("Exercise-pictures/10.3-7.png",width: 40%)
#set math.mat(delim: "[")
#solution[
$mat("",a,b,c,d;a,1,1,1,1;b,0,0,0,1;c,1,1,0,0;d,0,1,1,1)$
]
== 57
_For which integers $n$ is $C_n$ self-complementary?_
#solution[
n=5 only
]
= 10.4
== 9
_Explain why in the collaboration graph of mathematicians (see Example 3 in Section 10.1) a vertex representing a mathematician is in the same connected component as the vertex representing Paul Erdős if and only if that mathematician has a nite Erdős number._
#solution[
Because if a mathematician has a finite Erdos number, then there must be a path of mathematicians who have collaborated connecting them to Erdo.
]
== 11
_Determine whether each of these graphs is strongly connected and if not, whether it is weakly connected._
#image("Exercise-pictures/10.4-11.png", width: 50%)
#solution[
/ a): No. Because of a. But it is weekly connected
/ b): No. Because of a-e-b-a. But it is weekly connected.
/ c): Neither, because of the two subgraphs are not connected
]
= 10.5
_In Exercises 18 determine whether the given graph has an Euler circuit. Construct such a circuit when one exists. If no Euler circuit exists, determine whether the graph has an Euler path and construct such a path if one exists._
== (1)
#image("Exercise-pictures/10.5-1.png", width: 40%)
#solution[
Neither
]
== 3
#image("Exercise-pictures/10.5-3.png", width: 40%)
#solution[
No Euler circuit because a has degree 3. It has a path $a,b,e,b,d,e,a,c,e,c,d$
]
== 13
_In Exercises 1315 determine whether the picture shown can be drawn with a pencil in a continuous motion without lifting the pencil or retracing part of the picture._
#image("Exercise-pictures/10.5-13.png",width: 40%)
#solution[
Yes, draw the triangles first, and then after draw the pentagon in the middle. Also, imagine if every time the lines cross, its a vertex, all the vertices have even edges.
]

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,103 @@
#title[Inclusion/Exclusion]
Section 8.5+8.6
The hat problem: Suppose everyone one in a classroom has a hat, and they put their hat in a box when they enter, and then grab a random hat when they leave. What is the probability that everybody gets their own hat. Answer is $1/n!$
What about the probability that _someone_ will not get their own hat: $1-1/n!$
What about the probability that someone will get their own hat, or that no one? Need inclusion/exclusion. The probability that no one will get their own hat is $37.8%$ pretty much no matter how many people.
*Remember:*
$|A union B| = |A| + |B| - |A inter B|$
and
$|A union B union C| = |A|+|B|+|C| - |A inter B| - |A inter C| - |B inter C| + |A inter B inter C|$
== Formula
$ |A_1 union A_2 union dots union A_n| = |A_1| + |A_2| + dots + |A_n| - |A_1 inter A_2| - |A_1 inter A_3| - ... - |A_(n-1) inter A_n|\
+ |A_1 inter A_2 inter A_3| + |A_1 inter A_2 inter A_4| + dots + |A_(n-2) inter A_(n-1) inter A_n)|\
- |A_1 inter A_2 inter A_3 inter A_4| - dots - |A_(n-3) inter A_(n-2) inter A_(n-1) inter A_(n)|\
+ |A_1 inter A_2 inter A_3inter A_4 inter A_5| + dots + |A_(n-4) inter A_(n-3) inter A_(n-2) inter A_(n-1) inter A_(n)|\
dots dots (-1)^(n+1) |A_1 inter A_2 inter dots inter A_n| $
$ =sum_(i=1)^n |A_i|- sum_(i<=i_1<i_2<=n) |A_i_1 inter A_i_2| + dots + (-1)^(k+1) sum_(i_1<i_2<dots<i_k)|A_i_1 inter A_i_2 inter dots inter A_i_k| + dots + (-1)^(n+1)|A_1 inter dots inter A_n| $
Proof: Focus on any $x in A_1 union A_2 union dots union A_n$ and see how many times it is counted. Let $k$ be the number of $i$ such that $x in A_i$
$ -mat(k;0) + mat(k;1)-mat(k;2)+mat(k;3)-mat(k;4)+mat(k;5)-dots + (-1)^(k+1) mat(k;k) + 1 = 1 $
(The reason we write $+1$ is because $-mat(k;0)=-1$)
Ignoring the $+1$, the rest is a row in Pascals triangle, and we now the alternating sum (+, then -, then +) is 0, so we know the whole thing will be 1.
Consider a set `A` with `N` elements. Properties $P_1, P_2, P_3, dots, P_n$ which means that some elements have the property and some doesn't. $N(P_3 P_5 P_6 P_9) = $ number of elements with each of the properties $P_3 P_5 P_6 P_9$
$N(P_(3) ' P_(5) ' P_6 ' P_9 ') = $ the number of elements with none of the properties $P_3 P_5 P_6 P_9$
*Inclusion/Exclusion:*
$ N(P_1 'P_2 'dots P_n ') = N - sum^n_(i=1)N(P_i) + sum_(i_1 < i_2)N(P_i_1 P_i_2) dots + (-1)^n N(P_1 P_2 dots P_n) $
*Proof:* Put $A_i=$ the elements with property $P_i$
`m` balls in `n` boxes. We want to count the number of ways to put `m` balls into `n` boxes such that no box is empty. It follows $m>=n$.
$A = $ all functions of $S->B={1,2,3,dots,n}$
$A_i = $ all functions such that `i` is not in the image.
$ |A\\ union_(i=1)^n A_i| = |A|-|union_(i=1)^n A_i| = n^m-mat(n;1)(n-1)^m +mat(n;2)(n-2)^m-dots (-1)^n mat(n;n)(n-n)^m $
= Permutations of an n-set {1,2,3,4}
Normally a permutation of a set is the elements put on a row (like here $2,3,1,4$ and $3,1,4,2$).
You can think of permutations as a bijection (different elements should be mapped to different elements, and every element needs to be mapped to an element) from ${1,2,3,4}$ to ${1,2,3,4}$:
$ mat(1,2,3,4;2,3,1,4) $
Notice the 4, mapped unto itself, it's called a fixed point. The 4's would also be a fixed point here:
$ mat(1,2,4,3;2,3,4,1) $
But then its a different set at the top.
== Derangement
A bijection ($pi$) of a set `S` unto itself with no fixed points.
That is $pi(i) eq.not i$
The hat problem: to find the chances of noone getting their own hat, just use derangements.
== Counting permutations
$A$ is the set of all permutations of ${1,2,dots,n}$
$A_i =$ the set of permutations $pi$ such that $pi(i)=i$
$
D_n &=|A\\(union_(i=1)^n) = |A| - sum_(i=1)^n + sum_(i_1<i_2)|A_i_i inter A_i_2| - dots (-1)^n|A_1 inter A_2 inter dots inter A_n|\
= n! - mat(n;1)(n-1)! + mat(n;2)(n-2)! - &mat(n;3)(n-3)!+dots (-1)^k mat(n;k)(n-k)! plus.minus dots |A_1 inter A_2 inter dots inter A_n|\
&= sum_(k=0)^n (-1)^k mat(n;k)(n-k)!\
&= sum_(k=0)^n (-1)^k n!/(k!(n-k)!) (n-k)!\
&=n! sum_(k=0)^n (-1)^k/k!\
&= k! [1- 1/1! + 1/2! - 1/3! + dots (-1)^n 1/(n!)]
$
$D_n$ is the permutations
$
1&=1/2+1/4+1/8+1/16+1/32+dots\
1&=0.99999999dots\
exp(x)&=1+x/1!+x^2/2!+x^3/3!+dots\
exp(1)&=e=1+1/2!+1/3!+dots\
exp(-1)&=e^-1=1/e=1-1/2!+1/3!-1/4!+dots
$
$exp(-1)$ is what we had before, so
$ D_n &= k! [1- 1/1! + 1/2! - 1/3! + dots (-1)^n 1/(n!)]=n! dot 1/e\
&= n! 1/(2.7dots)= 0.378 n!
$
= Counting primes
The number of primes $<= 100$. The same as saying $100-"not primes"$
Put $ A&={1,2,dots,100}\ A_2 &="The numbers divisible by 2"\ A_3&="The numbers divisible by 3"\ A_5&="The numbers divisible by 5"\ A_7&="The numbers divisible by 7" $
Number of primes
$ &=100-|A_2 union A_3 union A_5 union A_7|-1+4 - |A_2|-|A_3|-|A_5|-|A_7|+|A_2 inter A_3|+dots\
&=103-50-33-20-14+16+14+6+dots=25
$
($-1$ because 1 is not a prime, and $+4$ because else we're excluding $2,3,5,7$)

View File

@@ -0,0 +1,57 @@
Section 8.5: 1, *5*, 9, *11*, *15*, *23*, 27
Section 8.6: 3, *5*, *7*, 13, *21*, *25*
= 8.5-5
Find the number of elements in $A_1 union A_2 union A_3$ if there
are 100 elements in each set and if
1. The sets are pairwise disjoint.
$100+100+100=300$
2. There are 50 common elements in each pair of sets and no elements in all three sets.
$100+100+100-50-50-50=150$
3. There are 50 common elements in each pair of sets and 25 elements in all three sets.
$100+100+100-50-50-50+25=175$
4. The sets are equal.
$100+100+100-100-100-100+100=100$
= 8.5-11
Find the number of positive integers not exceeding 1000 that are not divisible by $3,17, "or" 35$
$1000-333-58-28+19+9+1-17=610$
= 8.5-15
How many bit strings of length eight do not contain six consecutive 0s?
$2^8-12-4-1+7+2=248$
= 8.5-23
Write out the explicit formula given by the principle of inclusionexclusion for the number of elements in the union of six sets when it is known that no three of these sets have a common intersection.
$ |A_1union A_2 union A_3 union A_4 union A_5 union A_6| =\
|A_1|+|A_2|+|A_3|+|A_4|+|A_5|+|A_6|-|A_1 inter A_2| - |A_1 inter A_3| - |A_1 inter A_4| - inter |A_1 inter a_5| - |A_1 inter A_6|\
- |A_2 inter A_3| - |A_2 inter A_4| - |A_2 inter A_5| - |A_2 inter A_6|\
- |A_3 inter A_4| - |A_3 inter A_5| - |A_3 inter A_6| - |A_4 inter A_5| - |A_4 inter A_6| - |A_5 inter A_6|
$
= 8.6-5
Find the number of primes less than 200 using the principle of inclusionexclusion.
$A_n =$ Numbers divisible by `n`
$
"Number of primes" &= 200 - abs(A_2 union A_3 union A_5 union A_7 union A_11 union A_13) - 1 + 6 \
&= 205 - |A_2| - |A_3| - |A_5| - |A_7| - |A_11| - |A_13| \
&quad + |A_2 inter A_3| + |A_2 inter A_5| + ... + |A_11 inter A_13| \
&quad - |A_2 inter A_3 inter A_5| - ... \
&quad + |A_2 inter A_3 inter A_5 inter A_7| + ... \
&quad - |A_2 inter A_3 inter A_5 inter A_7 inter A_11| - ... \
&quad + |A_2 inter A_3 inter A_5 inter A_7 inter A_11 inter A_13| \
&= 205 - 100 - 66 - 40 - 28 - 18 - 15 \
&quad + 33 + 20 + 14 + 9 + 6 + 4 + 2 + 1 + 1 + 1 + 1 + 1 + 1 \
&quad - 6 - 4 - 2 - 2 - 1 - 1 - 1 - 1 - 1 - 1 \
&quad + 1 + 1 + 1 + 1 + 1 \
&quad - 0 - 0 - 0 - 0 \
&quad + 0 \
&= 46
$
= 8.6-7
How many positive integers less than 10,000 are not the second or higher power of an integer?
= 8.6-21

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 108 KiB

View File

@@ -0,0 +1,60 @@
#image("Opgaver-numre.png")
= Opgave 1.7-3
#image("opgave3-1.7.png")
For an even number you know that $a=2k$.
Thus you can say $a²=(2k)²=4k²=2(2k²)$
Now you have $2(2k²)$ which is the same form as the formula for an even number, thus it's proven.
= Opgave 1.7-11
#image("opgave11.png")
If you for example take the irrational number $sqrt(2)$. The product of that is $sqrt(2)²=2$. This disproves that the product of two irrational numbers are irrational.
= Opgave 1.7-37
#image("opgave37.png")
Because there is not a biimplification between step 1 and 2. When you take the square root of something, you can't nescecarily go back, because you have to go back to a $plus.minus$. You can prove this by x=6. For step 2, this is a correct x to solve the equation, but not for step 1. When you have $sqrt(x+3)$, and you take the square too, you have $(plus.minus sqrt(x+3))²$.
= Opgave 1.7-41
#image("opgave41.png")
The equal to is easy to prove. If you have only 1 number or take the average of $a_n$ of same value, the average will then be the same value.
To prove the theory, you can say the opposite, which is that all the values of a is less than the sum.
This is provably false. The equation to get the average is $A=(a_1+a_2+a_3+...+a_n)/n$. We can get this from it: $A*n=a_1+a_2+a_3+...+a_n$.
If we say that all numbers of _a_ is less than the average, then all of them added together must be less than the average times the amount of elements: $a_1+a_2+a_3+...+a_n<A*n$
Now we have a contradiction. We know that when you prove the opposite, then the original must be true, and thust the statement is true.
I used proof by contradiction
= Opgave 2.1-11
#image("opgave-2.1-11.png")
a) False. Empty set has no elements
b) False. Only an empty set contains nothing
c) False. No elements in empty set
d) True. An empty subset is a subset of everything.
e) False.
f) False. True {0} is a subset of {0}, but they are equal to each other, so its false
g) True.
= Opgave 2.1-21
#image("Opgave 2.1-21.png")
a) 1 (contains 1 element)
b) 1 (contains 1 element: a list of another element)
c) 2 (contains 2 elements: a and a list)
d) 3 (contains 3 elements: a, and 2 lists)
= Opgave 2.1-27
#image("opgave 2.1-27.png")
For $cal(P)(A)$ to be a subset of $cal(P)(B)$, then A must have been a subset of B to begin with. If A is a subset of B, then the elements of the powerset of A must be contained in the powerset of B (alongside many more). If A was not a subset of B (containing an element not in B), then its powerset would also have elements not in the powerset of B and thus not be a subset.
= Opgave 2.1-37
#image("Opgave 2.1-37.png")
Its size would be $|A|*|B|$. When you calculate $A times B$ you calculate every "variation" of the elements of both, so for $a_1$ you pair it with every element of B until $a_n$. Thus it's their lengths times eachother

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,92 @@
#import "@local/academ:0.2.2"
#image("Opgaveliste.png")
#image("opgave4.1-1.png")
#image("opgave5.png")
#academ.solution[
When $a | b$ then we know that $b = a c$ where _c_ is an integer. We can do the same for $b | a$, so $a = b c$. When looking at the equations for a and b, we can conclude that c must be 1, because if it was bigger, the other equation would not hold. If b is 2a, then a must be $1/2 b$ but then c would not be an integer.
It is the same thing for if a or b is negative, as then it would be that $c=-1$
]
#image("opgave4.1-9.png")
#academ.solution[
When a devides b we know that _b_ must be a multiple of _a_. We also know that an even number multiplied by an integer will always give an even number, so if b is even, then a cannot be odd. And then if a is odd, then b must also be odd.
]
#image("opgave4.1-17.png")
#image("opgave4.1-21.png")
#image("opgave4.1-29.png")
#academ.solution[
a) 1=228 *div* 119, 109 = 228 *mod* 119
b) 40 = 9009 *div* 223, 89 = 9009 *mod* 223
c) -31 = -10101 *div* 333, 222 = -10101 *mod* 333
d) -21 = -765432 *div* 38721, 38259 = -765432 *mod* 38721
]
#image("opgave4.1-1.png")
#image("opgave4.1-41.png")
#academ.solution[
When $n | m$ we know that m is a multiple of n. And when we say $a equiv b (mod m)$ we basically say that a and b is the same distance away from a multiple of m. But since we also know that m is a multiple of n, this means that a and b must be the same distance away from a multiple of n as well.
]
#image("opgave4.1-43.png")
#academ.solution[
a) This is false when $m=c$. Example: $a=19, b=18, c=5,m=5$.
We would then have $ 19 dot 5 mod 5 = 18 dot 5 mod 5 <=> 95 mod 5 = 90 mod 5 <=> 0 = 0 $
Which is true. But then:
$ 19 mod 5 = 18 mod 5 <=> 4 = 3$
Which is false.
~
b) $a=-13, b=-23, c=5, d=15, m=10$.
Proof:
$
-13 mod 10 = -23 mod 10 <=> 7 = 7\
\
5 mod 10 = 15 mod 10 <=> 5 = 5\
\
(-13)^(5) mod 10 = (-23)^(15) mod 10 <=> -371293 mod 10 approx -2.666352 dot 10^(20) <=>\
7 = 3
$
]
#image("opgave4.1-44.png")
#academ.solution[
When you look at a table of a number of $n^2$ and $n^2-(n-1)^2$ you can see an interesting pattern:
#table(
columns: 3,
align: horizon,
table.header(
[$n$],[$n^2$],[$n^2-(n-1)^2$],
),
[2], [4], [3],
[3], [9], [5],
[4], [16], [7],
[5], [25], [9],
[6], [36], [11],
[7], [49], [13],
[8], [64], [15],
[9], [81], [17],
)
On this table you can see that the difference between each $n^2$ grows by 2 for each _n_. This means that the difference is $n^2$ and $(n-1)^2$ is always $4 dot x plus.minus 1$. So as we can see, $n^2$ is always either a multiple of 4, or _a multiple of 4_ plus 1.
]
#image("opgave4.1-45.png")
#academ.solution[
As seen on the table, $n^2$ is always either a multiple of 4, or _a multiple of 4_ +1. _m_ is always 1 below a multiple of 4, which makes it never be equal to the sum of the squares of two integers. This is because the sum of the squares of two integers will always either be 4k (when the squares of the two integers both are a multiple of 4), $4k+1$ (when one of the squares are a multiple of 4, and the other is a multiple + 1), or $4k+2$ (when both of the squares are a multiple of 4 + 1). So the sum of the squares of two integers will never equal $4k+3$
]
#image("opgave4.1-47.png")
#academ.solution[
This is true because $a equiv a^k (mod m)$. We know this as when you for when you take $a^k$, the result will still be a multiple of a. So that means that you could rewrite $a^k$ as $a dot a^(k-1) dot a^(k-2) dots$. So if we call the $a^(k-1) dot a^(k-2) dots$ _l_, we can write $a=m dot c + d$ and $a dot l = m dot c dot l + d$.
]
#image("opgave4.1-51.png")
Dette er korrekt. eller er det

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -0,0 +1,116 @@
#import("@local/dtu-template:0.5.1"):*
#show: dtu-note.with(
course: "01017",
course-name: "Discrete Mathematics",
title: "Polynomials and the Extended Euclidean Algorithm - Exercises",
date: datetime(year: 2025, month: 12, day: 4),
author: "Rasmus Rosendahl-Kaa",
semester: "Fall 2025"
)
= Exercise 6.16
Let $p(x) = sum^n_(k=0) c_k x^k$ be a polynomial if the coefficients $c_0, dots , c_n$ are all integers where $c_0 eq.not 0$ as well as $c_n eq.not 0$.
Let $QQ$ denominate the set of rational number, meaning fractions with integers in the numerator and the denominator. Then the following theorem is true:
If $a/b in QQ$ with $"gcd"(a,b) = 1$, and if $p(a/b)=0$, then it is true that $a | c_0$ and $b | c_n$.
/ a): Show by the help of the above that the polynomial $p(x)=x^2-2$ does not have any rational roots.
#solution()[
For $a | c_0$ and $b | c_n$ to be true, $a = 1,2$ and $b = 1$.
If $p(x)$ has integer roots, they would divide $c_0 "and" c_n$
Here, we already have the only numbers that can divide $c_0 "and" c_n$. But neither $P(2/1) "nor" P(1/1)$ equals 0, so that must mean $p(x)$ does not have any rational roots. Only $a=b=1$ would have $"gcd"(a,b)=1$, but $p(1/1)$ still doesn't equal 0, so that must mean that $p(x)$ doesn't have rational roots.
]
/ b): Conclude that $sqrt(2) in.not QQ$
#solution()[
$p(x)$ has roots: $-sqrt(2)$ and $sqrt(2)$. Because we have what values $a,b$ ($a=b=1$) could be in $p(x)$, we can see that $1/1 in QQ$, $"gcd"(1,1)=1$, and that $a | c_0$ and $b | c_n$.
But since we know that $sqrt(2)$ and $-sqrt(2)$ are roots, this means $p(sqrt(2))=p(-sqrt(2))=0$. But since we have that $1/1 eq.not sqrt(2)$, we can conclude that $sqrt(2) in.not QQ$.
]
/ c): Conclude in a similar fashion that $sqrt(5) in.not QQ$
#solution()[
We can observe a similar equation: $p(x)=x^2-5$. We can also observe that for the given theorem, then $a=b=1$ are the only value that they could have. But for similar reasons as before, $1/1 eq.not sqrt(5)$, so $sqrt(5) in.not QQ$.
]
/ d): Is it possible that $sqrt(5) sqrt(2) QQ$? We actually do not know that yet. Show that $sqrt(5) - sqrt(2)$ is a root of the polynomial $q(x) = x^4 14x^2 + 9$. Show that$sqrt(5) - sqrt(2) in.not QQ$.
#solution()[
$
p(sqrt(5)-sqrt(2)) = (sqrt(5)-sqrt(2))^4 - 14 dot (sqrt(5)-sqrt(2))^2 + 9\
$
$
(sqrt(5)-sqrt(2)) dot (sqrt(5)-sqrt(2)) &= sqrt(5)^2+sqrt(2)^2-2 dot sqrt(5) dot sqrt(2)\
&=5+2-2 dot sqrt(10) = 7 - 2 sqrt(10)
$
$
p(sqrt(5)-sqrt(2)) &= (7 - 2 sqrt(10)) dot (7 - 2 sqrt(10)) - 14 dot (7 - 2 sqrt(10)) + 9\
&= 49 + 4 sqrt(10)^2 - 28 sqrt(10) - 14 dot 7 + 28 sqrt(10) + 9\
&= 49+40-14 dot 7+9\
&=98 - 98 = 0
$
$sqrt(5)-sqrt(2)$ is a root.
The only $a,b$ we can have are $a=b=1$. 1 is not a root:
$
q(1)=1^4-14+9 = -4
$
Therefore $sqrt(5)-sqrt(2) in.not QQ$
]
/ e): (Extra, not in the curriculum) Prove the theorem in the beginning of the exercise. (Tip: Consider $p(a/b) = 0$ and multiply by the common denominator, such that all terms are integers. Thereafter use modulus arithmetic.)
= Exercise 6.17
We will examine the execution time of Euclids algorithm
/ a): Prove as function of $deg(f(x))$ and $deg(g(x))$, how many iteration Euclid's algorithm uses at most, when it is executed on $f(x)$ and $g(x)$.
#solution()[
Because we in the Euclidean Algorithm have that $deg(R_i) < deg(R_(i-1))$ aka the degree must always go down, and also have that $deg(R_1) < deg(M)$. Then the Euclidean Algorithm must use at most $deg(g(x))$ iterations, where $deg(g(x))<deg(f(x))$
]
/ b): Let $D(n)$ be an upper limit for the number of arithmetic operations it takes to execute a division of $f(x)$ by $g(x)$ with a remainder if $deg(f(x)), deg(g(x)) <= n$. By arithmetic operations we mean $+,,· "or" "/"$ of elements from the field, thus $RR$ or $CC$. Argue that $D(n) <= 2n^2$.
#solution()[
Imagine for the upper bound that $deg(f(x))=deg(g(x))=n$.
]
/ c):
/ d):
= Exercise 6.18
As usual with fractions, they can be reduced such that given $p(x)/q(x)$ if you by chance know that there exists a $t(x)$ such that $p(x)=t(x)p_1 (x)$ and $q(x)=t(x)q_1 (x)$, then we have:
$
p(x)/q(x)=(t(x)p_1 (x))/(t(x)q_1 (x)) = (p_1(x))/(q_1(x))
$
If you are just given a rational function $p(x)/q(x)$, describe a course of action to calculate the completely reduced fraction.
#solution()[
Calculate the roots of each of the functions, then divide the two. You would be able to remove all their common roots, and be left with a completely reduced fraction
]
= Exercise 6.19
Let $p(x)$ and $d(x)$ be polynomials both different from zero. Assume that $d(x) = d_1(x)d_2(x)$, where $"gcd"(d_1(x), d_2(x)) = 1$, and assume that $deg(p(x)) < deg(d(x))$. Show that there exists polynomials $p_1(x)$ and $p_2(x)$ such that
$
deg(p_1(x)) < deg(d_1(x)) "and" deg(p_2(x)) < deg(d_2(x))
$
and
$
p(x)/d(x)=(p_1(x))/(d_1(x)) + (p_2(x))/(d_2(x))
$
Tip: First multiply the wanted equation by $d(x)$
#solution()[
$
p(x)=p_1(x)d_2(x) + p_2(x)d_1(x)
$
]

View File

@@ -0,0 +1,221 @@
#import("@local/dtu-template:0.5.1"):*
#show: dtu-note.with(
course: "01017",
course-name: "Discrete Mathematics",
title: "Polynomials and the Extended Euclidean Algorithm",
date: datetime(year: 2025, month: 12, day: 4),
author: "Rasmus Rosendahl-Kaa",
semester: "Fall 2025"
)
An example of a polynomial
$
f(x) = x^2 - 4x+3\
g(x)= 2x-3\
h(x) = 7
$
The curve on the graph is called a parabola
What we say for polynomials with real coefficients also applies to the ones with complex coefficients
#definition(title: "Polynomial of degree n")[
$
P(x)=a_0 + a_1 x + a_2 x^2 + dots + a_n x^n, quad a_n eq.not 0, a_i in RR "or" CC
$
- $a_n$ is called the leading term
- $a_0$ is called the constant term.
- $n$ is the degree
]
#definition(title: "Addition of polynomials")[
Same $P(x)$ as before
$
Q(x) = b_0 + b_1 x + dots + b_m x^m, quad m <= n\
$
$
P(x) + Q(x) = (a_0 + b_0) + (a_1 + b_1) x + dots + (a_m + b_m)x^m\ + a_(m+1)x^(m+1) + dots + a_n x^n
$
$
deg(P(x) + Q(x)) <= n "with equality if" m < n
$
]
#definition(title: "Multiplication")[
Same $P(x), Q(x)$ as before
$
P(x) dot Q(x) = a_0 dot b_0 + (a_0 b_1 + a_1 b_0) x + (a_0 b_2 + a_1 b_1 + a_2 b_0) x^2 + dots +\
a_n b_m x^(n+m)
$
$
deg(P(x) dot Q(x)) = n+m = deg(P(x)) + deg(Q(x))
$
When multiplying you basically do:
$
P(x) dot Q(x) = a_0 dot Q(x) + a_1x dot Q(x) + dots + a_n x^n Q(x)
$
]
== Divisible
#definition(title: "Divisible")[
$M(x)$ divides $N(x)$ (we write $M(x) | N(x)$) if $N(x) = Q(x) dot M(x)$
$Q(x)$ is some polynomial.
We have: $deg(N) = deg(Q) + deg(M)$, so $deg(M) <= deg(N)$
So basically, you need to find a polynomial $Q(x)$ so that $Q(x) dot M(x) = N(x)$, then $M(x)$ divides $N(x)$
If $M(x) | N(x)$ and $N(x)|M(x)$, then they must have the same degree. And then $deg(Q)$ must have degree 0 and be a constant.
$exists alpha in RR: N(x) = alpha dot M(x)$
]
=== Common divisor
$D(x)$ is a common divisor of $M(x), N(x)$ if $D(x) | M(x) "and" D(x) | N(x)$
=== Greatest common divisor
#definition()[
$D_1(x)$ is _a_ greatest common divisor (gcd) of $M(x), N(x)$ if and only if $D$ is a common divisor and $D_1(x)$ also satisfies:
$ (D_1(x) | M(x) and D_1(x) | N(x)) => D_1(x) | D(x) $
If $D_1(x)$ is a greatest common divisor, then $D_1(x)$ times a constant is also a greatest common divisor
Suppose $D_2(x)$ is also a $"gcd"(M(x), N(x))$, then $D_2(x) | D_1(x)$ and $D_1(x) | D_2(x)$ so $D_2 = alpha D_1$
]
#note-box()[
There can be more than one greatest common divisor
]
Given $N(x), M(x)$, find a gcd.
#note-box(title: "For integers (repetition)")[
For integers: $n, m,$ find $"gcd"(n,m)$.
==== Euclid
$ n &= q_1 dot m + r_1, quad 0 <= r_1 < r_0 = m\
r_0 &= q_2 dot r_1 + r_2\
r_1 &= q_3 dot r_2 + r_3\
dots.v\
r_(k-3)&= q_(k-1) dot r_(k-2) + r_(k-1)\
r_(k-2)&= q_k dot r_(k-1) + r_k\
r_(k-1)&= q_(k+1) dot r_(k) + 0
$
$r_k$ is the greatest common divisor.
*Why is it a divisor*
It is the divisor because looking at the last line:
$r_k$ divides $r_(k-1), r_k$
We can go a line up: $r_(k-1)$ divides $r_(k-2), r_(k-1)$, but $r_k$ must also divide them.
Can go up a line again: $r_k$ divides $r_(k-3), r_(k-2)$ up until we get $r_k$ divides $n, m$
*Why is it the greatest common divisor*
$r_k$ can be written as a linear combination of $r_(k-2) "and" r_(k-1)$ which coefficients are integers.
You can go a line up and write $r_(k-1)$ as a linear combination, which you can input into $r_k$'s linear combination. Continue until you get:\
$
r_k = A dot N + B dot M
$
]
#definition(title: "GCD for polynomials")[
$deg(M) = m < n = deg(N)$
$
N(x) &= Q_1(x) dot M(x) + R_1(x), quad deg(R_1) < deg(M)\
M(x) &= Q_2(x) dot R_1(x) + R_2(x), quad deg(R_2) < deg(R_1)\
&dots.v\
R_(k-2)(x)&=Q_k (x) dot R_(k-1)(x)+R_k (x), quad deg(R_k) = 0\
R_(k-1)(x)&=Q_(k+1)(x) dot R_(k) (x)+0
$
$R_k (x) = A(x) dot N(x) + B(x) dot M(x)$
$A(x), B(x)$ are some polynomials.
$deg(R_k (x)) = deg(N(x)) - deg(M(x))$
]
#example()[
Find the greatest common divisor of
$
N(x) &= x^4 + x^3 - 2x^2 + 2x - 2 "and"\
M(x) &= x^2 + 2x -3
$
Divide:
$
underline(x^2+2x-3 |) x^4+3x^3-2x^2+2x-2 &underline(| x^2-x+3)\
underline(x^4 + 2x^3 -3x^2) &\
-x^3+x^2+2x-2&\
underline(-x^3-2x^2+3x)&\
3x^2-x-2&\
underline(3x^2+6x-9)&\
-7x+7
$
So:
$
N(x)=(x^2-x+3)M(x) + (-7x+7)
$
Now continue with the two new polynomials you found:
$
underline(-7x+7|) x^2+2x-3 &underline(|-1/7x-3/7)\
underline(x^2 - x)\
3x-3\
underline(3x-3)\
0
$
So:
$
M(x) = (-1/7 x - 3/7) dot (-7x+7) + 0
$
Now we're finished as we have 0. The greatest common divisor is $-7x+7$
We can write:
$
D(x)=-7x +7 = N(x) - (x^2-x+3) dot M(x)
$
To find $D_1(x)$ (a divisor of $D(x)$:
Remember: $D_1(x) = D(x) dot alpha$ where $alpha$ is a constant
$
D_1(x) = -x+1
$
#note-box()[
Both $D(x)$ and $D_1(x)$ are greatest common divisors of $N(x), M(x)$. as $D(x) = 1 dot D(x)$ (constant here is just $1$).
]
]
= Roots of polynomials
For the polynomial $a x^2 + b x + c$, the roots are: $(-b plus.minus sqrt(b^2 - 4 a c))/(2 a)$
Let's assume $"gcd"(N(x), M(x)) = D(x)$ then $alpha$ is a common root of $N(x), M(x) <=> alpha$ is a root in $D(x)$
$
N(x)=D(x) dot Q_1 (x)\
M(x)=D(x) dot Q_2 (x)
$
If $alpha$ is a root in $D(x)$, then it must also be a root in $M(x)$ and $N(x)$. The reason is that we can write $N, M$ as above
$
D(x) = A(x) N(x) + B(x) M(x)
$
$alpha$ is a root of $P(x) <=> (x- alpha)| P(x)$ which means $exists Q(x): P(x) = Q(x)(x-alpha) + beta$ where $beta$ is a constant
We can find $beta$ by calculating $P(alpha)$:
$
P(alpha) = Q(alpha)(alpha-alpha) + beta\
P(alpha) = Q(alpha)(0) + beta\
P(alpha) = beta
$
$x^2 +1= (x-i) dot (x+i)$

View File

@@ -0,0 +1,20 @@
#import "@local/dtu-template:0.5.1":*
#show: dtu-note.with(
course: "01017",
course-name: "Discrete Mathematics",
title: "Primes and the Eucledian algorithm",
date: datetime(day: 27, month: 11, year: 2025),
author: "Rasmus Rosendahl-Kaa (S255955)",
semester: "2025 Fall",
)
= Primes
#definition()[
$
a,b,c in ZZ, a in ZZ_+
$
If $a = b dot c$ then $a$ is _composite_ (sammensat), if not, then $a$ is a prime,
]

View File

@@ -0,0 +1,95 @@
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{corollary}[theorem]{Corollary}
\theoremstyle{definition}
\newtheorem{definition}[theorem]{Definition}
\title{Primes and the Euclidean Algorithm}
\date{02-10-2025}
\begin{document}
\maketitle
\section{Introduction}
Let $a, b \in \mathbb{Z}$. We say that $a$ \textbf{divides} $b$, written $a \mid b$, if there exists $c \in \mathbb{Z}$ such that $b = ac$.
\begin{definition}
A positive integer $p > 1$ is called \textbf{prime} if its only positive divisors are $1$ and $p$ itself.
\end{definition}
\begin{definition}
For integers $a$ and $b$, not both zero, the \textbf{greatest common divisor} $\gcd(a,b)$ is the largest positive integer that divides both $a$ and $b$.
\end{definition}
\section{The Euclidean Algorithm}
The Euclidean algorithm is an efficient method for computing the greatest common divisor of two integers.
\begin{theorem}[Division Algorithm]
Let $a, b \in \mathbb{Z}$ with $b > 0$. Then there exist unique integers $q$ and $r$ such that
\[
a = bq + r \quad \text{with} \quad 0 \leq r < b.
\]
Here $q$ is called the \textbf{quotient} and $r$ is called the \textbf{remainder}.
\end{theorem}
\begin{theorem}
If $a = bq + r$, then $\gcd(a,b) = \gcd(b,r)$.
\end{theorem}
\begin{proof}
Let $d = \gcd(a,b)$. Then $d \mid a$ and $d \mid b$. Since $r = a - bq$, we have $d \mid r$. Thus $d$ is a common divisor of $b$ and $r$, so $d \leq \gcd(b,r)$.
Conversely, let $d' = \gcd(b,r)$. Then $d' \mid b$ and $d' \mid r$. Since $a = bq + r$, we have $d' \mid a$. Thus $d'$ is a common divisor of $a$ and $b$, so $d' \leq \gcd(a,b) = d$.
Therefore $d = \gcd(b,r)$.
\end{proof}
\subsection{The Algorithm}
To compute $\gcd(a,b)$ where $a \geq b > 0$:
\begin{enumerate}
\item Apply the division algorithm repeatedly:
\begin{align*}
a &= bq_1 + r_1, \quad 0 \leq r_1 < b \\
b &= r_1 q_2 + r_2, \quad 0 \leq r_2 < r_1 \\
r_1 &= r_2 q_3 + r_3, \quad 0 \leq r_3 < r_2 \\
&\vdots \\
r_{n-2} &= r_{n-1} q_n + r_n, \quad 0 \leq r_n < r_{n-1} \\
r_{n-1} &= r_n q_{n+1} + 0
\end{align*}
\item The last non-zero remainder $r_n$ is $\gcd(a,b)$.
\end{enumerate}
\begin{theorem}[Bézout's Identity]
Let $a, b \in \mathbb{Z}$, not both zero, and let $d = \gcd(a,b)$. Then there exist integers $x$ and $y$ such that
\[
ax + by = d.
\]
\end{theorem}
\begin{proof}
Consider the set $S = \{ax + by : x, y \in \mathbb{Z} \text{ and } ax + by > 0\}$. This set is non-empty (contains $|a|$ or $|b|$) and bounded below by $1$, so by the well-ordering principle it has a smallest element, say $d' = ax_0 + by_0$.
We claim that $d' = \gcd(a,b)$. First we show that $d' \mid a$. By the division algorithm, write $a = d'q + r$ with $0 \leq r < d'$. Then
\[
r = a - d'q = a - (ax_0 + by_0)q = a(1 - x_0q) + b(-y_0q).
\]
If $r > 0$, then $r \in S$ and $r < d'$, contradicting the minimality of $d'$. Thus $r = 0$ and $d' \mid a$. Similarly, $d' \mid b$.
So $d'$ is a common divisor of $a$ and $b$, hence $d' \leq d = \gcd(a,b)$.
Conversely, since $d \mid a$ and $d \mid b$, we have $d \mid (ax_0 + by_0) = d'$. Thus $d \leq d'$.
Therefore $d = d'$, completing the proof.
\end{proof}
\end{document}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,88 @@
= Introduction
<introduction>
Let $a , b in bb(Z)$. We say that $a$ #strong[divides] $b$, written
$a divides b$, if there exists $c in bb(Z)$ such that $b = a c$.
#block[
#strong[Definition 1];. A positive integer $p > 1$ is called
#strong[prime] if its only positive divisors are $1$ and $p$ itself.
Hello
]
#block[
#strong[Definition 2];. For integers $a$ and $b$, not both zero, the
#strong[greatest common divisor] $gcd (a , b)$ is the largest positive
integer that divides both $a$ and $b$.
]
= The Euclidean Algorithm
<the-euclidean-algorithm>
The Euclidean algorithm is an efficient method for computing the
greatest common divisor of two integers.
#block[
#strong[Theorem 3] (Division Algorithm). #emph[Let $a , b in bb(Z)$ with
$b > 0$. Then there exist unique integers $q$ and $r$ such that
$ a = b q + r quad upright("with") quad 0 lt.eq r < b . $ Here $q$ is
called the #strong[quotient] and $r$ is called the #strong[remainder];.]
]
#block[
#strong[Theorem 4];. #emph[If $a = b q + r$, then
$gcd (a , b) = gcd (b , r)$.]
]
#block[
#emph[Proof.] Let $d = gcd (a , b)$. Then $d divides a$ and
$d divides b$. Since $r = a - b q$, we have $d divides r$. Thus $d$ is a
common divisor of $b$ and $r$, so $d lt.eq gcd (b , r)$.
Conversely, let $d' = gcd (b , r)$. Then $d' divides b$ and
$d' divides r$. Since $a = b q + r$, we have $d' divides a$. Thus $d'$
is a common divisor of $a$ and $b$, so $d' lt.eq gcd (a , b) = d$.
Therefore $d = gcd (b , r)$.~◻
]
== The Algorithm
<the-algorithm>
To compute $gcd (a , b)$ where $a gt.eq b > 0$:
+ Apply the division algorithm repeatedly:
$ a & = b q_1 + r_1 , quad 0 lt.eq r_1 < b\
b & = r_1 q_2 + r_2 , quad 0 lt.eq r_2 < r_1\
r_1 & = r_2 q_3 + r_3 , quad 0 lt.eq r_3 < r_2\
& dots.v\
r_(n - 2) & = r_(n - 1) q_n + r_n , quad 0 lt.eq r_n < r_(n - 1)\
r_(n - 1) & = r_n q_(n + 1) + 0 $
+ The last non-zero remainder $r_n$ is $gcd (a , b)$.
#block[
#strong[Theorem 5] (Bézouts Identity). #emph[Let $a , b in bb(Z)$, not
both zero, and let $d = gcd (a , b)$. Then there exist integers $x$ and
$y$ such that $ a x + b y = d . $]
]
#block[
#emph[Proof.] Consider the set
$S = { a x + b y : x , y in bb(Z) upright(" and ") a x + b y > 0 }$.
This set is non-empty (contains $lr(|a|)$ or $lr(|b|)$) and bounded
below by $1$, so by the well-ordering principle it has a smallest
element, say $d' = a x_0 + b y_0$.
We claim that $d' = gcd (a , b)$. First we show that $d' divides a$. By
the division algorithm, write $a = d' q + r$ with $0 lt.eq r < d'$. Then
$ r = a - d' q = a - (a x_0 + b y_0) q = a (1 - x_0 q) + b (- y_0 q) . $
If $r > 0$, then $r in S$ and $r < d'$, contradicting the minimality of
$d'$. Thus $r = 0$ and $d' divides a$. Similarly, $d' divides b$.
So $d'$ is a common divisor of $a$ and $b$, hence
$d' lt.eq d = gcd (a , b)$.
Conversely, since $d divides a$ and $d divides b$, we have
$d divides (a x_0 + b y_0) = d'$. Thus $d lt.eq d'$.
Therefore $d = d'$, completing the proof.~◻
]

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Some files were not shown because too many files have changed in this diff Show More