Files
clean-sheets/template/main.typ
T
2026-09-10 20:02:22 +02:00

56 lines
994 B
Typst

#import "@preview/clean-sheets:0.2.2": base-template, ex_box, qed
#let logo = box(
width: 2.4cm,
height: 1cm,
stroke: 0.8pt + eastern,
radius: 3pt,
align(center + horizon, text(fill: eastern, weight: "bold")[LOGO]),
)
#show: body => base-template(
1,
[Introduction to Examples],
[Prof. Ada Example],
[Dr. Alan Assistant],
3,
([Jane Doe], [John Doe]),
[Taylor Tutor],
logo: logo,
body,
)
= Exercise 1
#ex_box(
heading: [Warm-up],
points: [10 points],
)[
Prove the following identity for every natural number $n$:
$
sum_(k=1)^n k = (n (n + 1)) / 2.
$
]
Write a proof by induction. #qed
= Exercise 2
#ex_box(points: [15 points])[
Implement a function that returns the first $n$ Fibonacci numbers.
]
```python
def fibonacci(n):
values = [0, 1]
while len(values) < n:
values.append(values[-1] + values[-2])
return values[:n]
```
= Exercise 3
#ex_box(heading: [Discussion])[
Compare the iterative and recursive solutions.
]