upload diverse filer
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -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 Euclid’s 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)
|
||||
$
|
||||
]
|
||||
File diff suppressed because one or more lines are too long
@@ -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)$
|
||||
Reference in New Issue
Block a user