commit allerede lavet opgaver

This commit is contained in:
2025-11-26 15:37:45 +01:00
parent e1a4e65d59
commit ed10a5c1b9
51 changed files with 1038 additions and 0 deletions

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)$

Binary file not shown.

After

Width:  |  Height:  |  Size: 94 KiB