Initial commit
This commit is contained in:
18 files changed
+1852
No files matched your search
@@ -0,0 +1,55 @@
|
||||
#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.
|
||||
]
|
||||
Reference in new issue
Block a user