Compare commits

25 Commits

Author SHA1 Message Date
121780df6c Wallpaper groups (#23)
All checks were successful
CI / Typst formatting (push) Successful in 5s
CI / Typos (push) Successful in 11s
CI / Build (push) Successful in 5m39s
Reviewed-on: #23
2025-05-08 18:40:59 -07:00
99344f9aed Lattice edits (#22)
All checks were successful
CI / Typst formatting (push) Successful in 4s
CI / Typos (push) Successful in 11s
CI / Build (push) Successful in 10m5s
Reviewed-on: #22
2025-04-04 08:36:33 -07:00
095c4b314c Add "Gods, Demons, Mortals"
All checks were successful
CI / Typos (push) Successful in 7s
CI / Typst formatting (push) Successful in 7s
CI / Build (push) Successful in 4m39s
2025-03-02 19:48:45 -08:00
c29f0d25c7 ECC edits
All checks were successful
CI / Typos (pull_request) Successful in 7s
CI / Typst formatting (pull_request) Successful in 5s
CI / Build (pull_request) Successful in 4m32s
2025-03-02 19:41:20 -08:00
871a02bb1d Added "Gods, Demons, and Mortals" 2025-03-02 19:41:20 -08:00
b5ccf95a8b Added short warning to typst lib 2025-03-02 19:41:20 -08:00
563dd990a5 Minor cleanup
All checks were successful
CI / Typst formatting (push) Successful in 5s
CI / Typos (push) Successful in 11s
CI / Build (push) Successful in 10m19s
2025-03-02 19:36:19 -08:00
6681724804 Style tweaks
All checks were successful
CI / Typos (pull_request) Successful in 12s
CI / Typst formatting (pull_request) Successful in 6s
CI / Build (pull_request) Successful in 9m12s
2025-03-02 19:26:38 -08:00
8d49154277 Typst solution state 2025-03-02 14:40:22 -08:00
acf57ceab6 Replace "ORMC" with generic "handout" 2025-03-02 14:18:25 -08:00
a4e5a065b0 Allow manual builds
All checks were successful
CI / Typst formatting (push) Successful in 5s
CI / Typos (push) Successful in 12s
CI / Build (push) Successful in 8m58s
2025-02-25 14:38:57 -08:00
7c75c6b5c9 FISR edits
All checks were successful
CI / Typst formatting (push) Successful in 6s
CI / Typos (push) Successful in 7s
CI / Build (push) Successful in 8m57s
2025-02-17 08:24:51 -08:00
fc5a1cbbaf Add Advanced/Fast Inverse Root
All checks were successful
CI / Typst formatting (push) Successful in 6s
CI / Typos (push) Successful in 10s
CI / Build (push) Successful in 9m20s
2025-02-13 16:07:07 -08:00
89e3880442 Add slide rule warm-up
All checks were successful
CI / Typos (pull_request) Successful in 10s
CI / Typst formatting (pull_request) Successful in 6s
CI / Build (pull_request) Successful in 7m12s
2025-02-13 15:41:31 -08:00
b4852e7fcd Tom edits 2025-02-13 15:34:06 -08:00
6d4127f5a5 Added "Fast Inverse Root" 2025-02-13 13:33:35 -08:00
62ce3ddaa7 Fixed handout header 2025-02-13 13:33:35 -08:00
c97bea7443 Added instructornote and if_solutions_else 2025-02-13 13:33:35 -08:00
0083843417 Added generic object to typst 2025-02-13 13:33:35 -08:00
7efc3c83a5 Comments 2025-02-13 13:33:35 -08:00
816c1c462c >:( macos 2025-02-13 13:33:31 -08:00
b958da33a9 Edit README
All checks were successful
CI / Typst formatting (push) Successful in 6s
CI / Typos (push) Successful in 11s
CI / Build (push) Successful in 6m31s
2025-02-12 17:37:28 -08:00
6861d4fca3 README edits
All checks were successful
CI / Typst formatting (pull_request) Successful in 6s
CI / Typos (pull_request) Successful in 11s
CI / Build (pull_request) Successful in 6m42s
2025-02-12 17:30:23 -08:00
727e06fa69 Move actions to .gitea 2025-02-12 16:54:14 -08:00
57cd8d63a8 ECC edits
All checks were successful
CI / Typst formatting (push) Successful in 6s
CI / Typos (push) Successful in 7s
CI / Build (push) Successful in 9m22s
2025-02-11 19:43:58 -08:00
132 changed files with 177707 additions and 345 deletions

4
.gitignore vendored
View File

@ -3,14 +3,16 @@ venv
__pycache__
*.ignore
.mypy_cache
.DS_Store
# Output files
/output
/output.zip
*.pdf
/manual
# TeX build files
*.synctex.gz*
*.synctex*
*.latexmk
*.aux
*.out

View File

@ -1,52 +1,70 @@
[tinymist]: https://marketplace.visualstudio.com/items?itemName=myriad-dreamin.tinymist
[latex-workshop]: https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop
[CC BY-NC-SA 4.0]: https://creativecommons.org/licenses/by-nc-sa/4.0
[betalupi.com/handouts]: https://static.betalupi.com/ormc
[betalupi.com/handouts]: https://betalupi.com/handouts
[ORMC]: https://circles.math.ucla.edu/circles/
[Overleaf]: https://overleaf.com
[Typst.app]: https://typst.app
[vscode]: https://code.visualstudio.com
[vscodium]: https://vscodium.com
[homebrew]: https://brew.sh
# Mark's Handout Library
This is a collection of math circle handouts that I (and many others) have written. \
They are used regularly at the [ORMC].
For more information, visit [betalupi.com/handouts]. \
The latest version of each handout is available at that page.
## License
Unless otherwise stated, all documents in this repository are licensed under [CC BY-NC-SA 4.0]. \
Each document has its own authors. See `meta.toml` in each project directory for details.
By submitting or editing a handout in this repository, you agree to release it under this license.
## 🛠️ Contributing
If you want to use one of these handouts for a class, see [`betalupi.com/handouts`](https://betalupi.com/handouts). \
If you want to use one of these handouts for a class, see [betalupi.com/handouts]. \
You only need to read this section if you want to edit these handouts.
Use git to clone this repository, then open the root folder in [vscode] or [vscodium]. \
We use the [latex-workshop] and [tinymist] extensions to write these handouts, install them before continuing. \
[`./vscode/settings.json`](./vscode/settings.json) will automatically configure them to work with this repository.
- All handouts are in [`./src`](./src) \
Every handout is stored in its own directory, even if it only consists of one file. \
Handouts are organized by group (see [betalupi.com/handouts] for details).
### Setup
- Packages are stored in [`./lib`](./lib) \
You shouldn't need to modify any library files, but you may want to read them to see how they work. \
Use git to clone this repository, then open the root folder in [vscode] or [vscodium].
- [`./tools`](./tools) contains build scripts, [`./.github`](./.github) configures automation. \
You can ignore everything in these directories.
We use the [latex-workshop] and [tinymist] extensions. Install them before continuing.
[`./vscode/settings.json`](./vscode/settings.json) will automatically configure them to work with this repository. \
You may need to install texlive and typst:
- If you use Linux, you'll figure it out.
- On macos, use [homebrew]: \
`brew install texlive typst typstyle`
- On Windows, I don't know. I may write instructions later.
### Editing
This repository is organized as follows:
- All handouts are in [`./src`](./src). \
Every handout is stored in its own directory, even if it only consists of one file. \
Handouts are organized by group (see [betalupi.com/handouts] for details).
- Packages are stored in [`./lib`](./lib) \
You shouldn't need to modify any library files, but you may want to read them to see how they work.
- [`./tools`](./tools) contains build scripts, [`./.github`](./.github) configures automation. \
You can ignore everything in these directories.
All handouts in this repository are based on `handout.cls` or `handout@0.1.0`.
- If you're using Typst (preferred), read [`docs-typst.md`](./docs-typst.md)
- If you're still using LaTeX, read [`docs-latex.md`](./docs-latex.md).
All handouts in this repository are based on `ormc_handout.cls` or `handout@0.1.0`. \
If you're using LaTeX, read [`docs-latex.md`](./docs-latex.md). \
If you're using Typst (preferred), read [`docs-typst.md`](./docs-typst.md)
### Metadata
Every handout directory should contain a file called `meta.toml` with the following contents:
```toml
# This is a sample `meta.toml`.
# A copy of this file should exist in every handout directory.
@ -69,15 +87,16 @@ handout = true
solutions = true
```
## 💾 Out-of-band compilation
If you want to compile these handouts _without_ this repository (e.g, on [Overleaf] or [Typst.app]), do the following: \
_(I do not recommend this. The default toolchain makes it easier to share improvements to these handouts.)_
### For LaTeX:
1. Get the handout's directory (i.e, download the whole repo as a zip and extract the folder you want.)
2. Download [`./resources/ormc_handout.cls`](./resources/ormc_handout.cls)
3. Put this `ormc_handout.cls` in the same directory as the handout.
2. Download [`./resources/handout.cls`](./resources/handout.cls)
3. Put this `handout.cls` in the same directory as the handout.
4. Fix the include path at the top of `main.tex`:
You'll need to replace
@ -85,7 +104,7 @@ You'll need to replace
```latex
\documentclass[
...
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
```
with
@ -93,19 +112,17 @@ with
```latex
\documentclass[
...
]{ormc_handout}
]{handout}
```
5. Make a new overleaf project with the resulting directory.
6. **Do not use pdflatex**, it misbehaves with `ormc_handout`. Tell Overleaf to use XeLaTeX.
5. Make a new overleaf project with the resulting directory.
6. **Do not use pdflatex**, it misbehaves with `handout`. Tell Overleaf to use XeLaTeX.
### For Typst:
Out-of-band typst compilation isn't supported. Clone the repository and use vscode. \
This is because typst can't import packages from a relative path.
If you _really_ want it, standalone typst compilation _is_ possible. \
Follow the LaTeX instructions, but fix `handout@0.1.0` instead of `ormc_handout`. \
Follow the LaTeX instructions, but fix `handout@0.1.0` instead of `handout`. \
You'll figure it out.

View File

@ -1,23 +1,25 @@
# LaTeX documentation
All LaTeX handouts are based on [`ormc_handout.cls`](./lib/tex/ormc_handout.cls). \
All LaTeX handouts are based on [`handout.cls`](./lib/tex/handout.cls). \
This class is based on `article.cls`, and should work with most LaTeX packages.
The best way to start a new document is to make a copy of an existing one.
- [Advanced/Cryptography](./src/Advanced/Cryptography) is a good example of a simple handout.
- [Advanced/DFAs](./src/Advanced/DFAs) is a good example of a handout with graphs.
- [Advanced/Geometric Optimization](./src/Advanced/Geometric%20Optimization) is a good example of a handout with geometry.
- [Advanced/Cryptography](./src/Advanced/Cryptography) is a good example of a simple handout.
- [Advanced/DFAs](./src/Advanced/DFAs) is a good example of a handout with graphs.
- [Advanced/Geometric Optimization](./src/Advanced/Geometric%20Optimization) is a good example of a handout with geometry.
## Notes
- Compile your handouts with XeLaTeX. \
`pdflatex` is known to misbehave with `ormc_handout.cls`. \
This will happen by default if you use vscode. \
If you use Overleaf, you'll have to configure it manually (see document settings).
- Compile your handouts with XeLaTeX. \
`pdflatex` is known to misbehave with `handout.cls`. \
This will happen by default if you use vscode. \
If you use Overleaf, you'll have to configure it manually (see document settings).
## Document Options
Document options are passed to `\documentclass`, as follows:
```latex
\documentclass[
% Show solutions is `solutions` is provided,
@ -37,49 +39,52 @@ Document options are passed to `\documentclass`, as follows:
% This should only be used for single-page handouts
% (e.g, warm-ups)
nopagenumber
]{ormc_handout}
]{handout}
```
Use `geometry` to change margins and page dimensions. US letter is the default.
## Utilities
- `\say{text}`: Puts text in quotes, handling details like period spacing. Courtesy of `dirtytalk`.
- `\note[Type]{text}`: Makes a note.
- `\hint{text}`: Shorthand for `\note[Hint]{text}`
- `\say{text}`: Puts text in quotes, handling details like period spacing. Courtesy of `dirtytalk`.
- `\note[Type]{text}`: Makes a note.
- `\hint{text}`: Shorthand for `\note[Hint]{text}`
## Sections
The usual LaTeX title-customization techniques *WILL NOT WORK* with this class. \
The usual LaTeX title-customization techniques _WILL NOT WORK_ with this class. \
Don't even try to load `titlesec`.
`ormc_handout.cls` supports two levels of sections:
- `\section`, for large parts of the handout
- `\definition`, `\theorem`, `\proposition`, `\example`, `\remark`, `\problem`, and `\problempart`
`handout.cls` supports two levels of sections:
- `\section`, for large parts of the handout
- `\definition`, `\theorem`, `\proposition`, `\example`, `\remark`, `\problem`, and `\problempart`
All these macros have the following syntax: `\problem{title}<label>`
- `title` is the problem's title, and may be empty.
- `label` is the problem's label. This is optional. \
If a label is provided, this section may be referenced with `\ref{label}`.
- `title` is the problem's title, and may be empty.
- `label` is the problem's label. This is optional. \
If a label is provided, this section may be referenced with `\ref{label}`.
Examples:
- `\problem{}`
- `\problem{Bonus}`
- `\problem{}<gcd>`, which may be referenced with `\ref{gcd}`
- `\problem{}`
- `\problem{Bonus}`
- `\problem{}<gcd>`, which may be referenced with `\ref{gcd}`
Do **not** use `\begin{problem} ... \end{problem}`. \
Sections are macros, not environments.
## Environments:
- `\begin{solution}`: A fancy red for solutions to problems. \
This is hidden if the `nosolutions` is provided.
- `\begin{instrutornote}`: A fancy blue box for instructor notes. \
This is hidden if the `nosolutions` is provided.
- `\begin{examplesolution}`: A fancy gray for sample solutions. \
This is never hidden.
- `\begin{solution}`: A fancy red for solutions to problems. \
This is hidden if the `nosolutions` is provided.
- `\begin{instrutornote}`: A fancy blue box for instructor notes. \
This is hidden if the `nosolutions` is provided.
- `\begin{examplesolution}`: A fancy gray for sample solutions. \
This is never hidden.
All the above environments break across pages and may safely be nested.
Each of these environments also provides the `\linehack` macro, which draws a line across the box. \
This is useful for, say, solutions to multipart problems.
This is useful for, say, solutions to multipart problems.

View File

@ -4,23 +4,27 @@ See [typst.app/docs](https://typst.app/docs) for typst's documentation. \
All typst handouts are based on [`handout@0.1.0`](./lib/typst/local/handout/0.1.0).
The best way to start a new document is to make a copy of an existing one.
- [Advanced/Tropical Polynomials](./src/Advanced/Tropical%20Polynomials) is a good place to start.
- [Warm-Ups/Painting](./src/Warm-Ups/Painting) is a good example of tikz-like pictures.
- [Advanced/Tropical Polynomials](./src/Advanced/Tropical%20Polynomials) is a good place to start.
- [Warm-Ups/Painting](./src/Warm-Ups/Painting) is a good example of tikz-like pictures.
## Notes
- Typst's equivalent of tikz is cetz ([homepage](https://cetz-package.github.io), [docs](https://cetz-package.github.io/docs/api))
- Typst handouts are always compiled with solutions. \
Handouts without solutions are automatically compiled and published at [betalupi.com/handouts](https://static.betalupi.com/ormc). \
If you'd like to compile a student handout manually, run the following command in a handout directory:
- Typst's equivalent of tikz is cetz ([homepage](https://cetz-package.github.io), [docs](https://cetz-package.github.io/docs/api))
- Typst handouts are always compiled with solutions. \
Handouts without solutions are automatically compiled and published at [betalupi.com/handouts](https://betalupi.com/handouts). \
If you'd like to compile a student handout manually, run the following command in a handout directory:
```bash
typst compile main.typ --package-path ../../../lib/typst --input show_solutions=false
```
Where `package_path` is a relative path to [./lib/typst](./lib/typst).
## Document Options
All typst handouts start with the following:
```typst
#show: handout.with(
// Should match `meta.toml`
@ -38,39 +42,44 @@ All typst handouts start with the following:
```
## Notable commands
- `#v(1fr)`: Like LaTeX's `\vfill`. Creates whitespace that grows automatically. \
`fr` means "fraction". `#v(2fr)` will fill twice as much space as `#v(1fr)` on the same page.
- `#v(1fr)`: Like LaTeX's `\vfill`. Creates whitespace that grows automatically. \
`fr` means "fraction". `#v(2fr)` will fill twice as much space as `#v(1fr)` on the same page.
## Utilities
- `#note([content], type: "Note type")`: Makes a note. `type` is optional.
- `#hint([content])`: Shorthand for `#note([content], type: "Hint")`
- `#solution([content])`: A pretty box for solutions. Hidden in student handouts.
- `#examplesolution([content])`: Like `#solution()`, but is never hidden.
- `#if_solutions([content])`: Shows content only if we are showing solutions.
- `#if_no_solutions([content])`: Shows content only if we **aren't** showing solutions.
- `#note([content], type: "Note type")`: Makes a note. `type` is optional.
- `#hint([content])`: Shorthand for `#note([content], type: "Hint")`
- `#solution([content])`: A pretty box for solutions. Hidden in student handouts.
- `#examplesolution([content])`: Like `#solution()`, but is never hidden.
- `#if_solutions([content])`: Shows content only if we are showing solutions.
- `#if_no_solutions([content])`: Shows content only if we **aren't** showing solutions.
## Sections
High-level sections are denoted with `=`. \
Subsections start with `==`, subsubsections with `===`, and so on. \
**`handout@0.1.0` is only designed to use `=`, subsections might be ugly.**
`handout@0.1.0` also provides the following commands:
- `problem`
- `definition`
- `theorem`
- `example`
- `remark`
- `problem`
- `definition`
- `theorem`
- `example`
- `remark`
These all have the same syntax: `#problem("title", label: "label")`
- `title` is the problem's title, and may be omitted.
- `label` is the problem's label. This is optional. \
If a label is provided, this problem can be referenced with `@label`
- `title` is the problem's title, and may be omitted.
- `label` is the problem's label. This is optional. \
If a label is provided, this problem can be referenced with `@label`
**Examples:**
- `#problem()`
- `#problem("Bonus")`
- `#problem(label: "gcd")`, which may be referenced with `@gcd`
- `#problem()`
- `#problem("Bonus")`
- `#problem(label: "gcd")`, which may be referenced with `@gcd`
### Complete example:
@ -91,4 +100,4 @@ Consider the polynomial $f(x) = x^3 + 1x^2 + 3x + 6$.
#problem()
Recall @imaproblem.
- use this graph to find the roots of $f$
```
```

View File

@ -1,20 +1,5 @@
% Copyright (C) 2023 Mark (mark@betalupi.com)
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{../../../lib/tex/ormc_handout}[2023/05/29 2.0.2 ORMC Handout]
\ProvidesClass{../../../lib/tex/handout}[2025/03/02 2.0.2 Mark's handout class]
@ -28,7 +13,7 @@
\@twocolumnfalse
\@twosidefalse
\@mparswitchfalse
% ORMC-specific
% Handout-specific
\newif{\if@solutions} % If false, solutions and instructor notes are hidden.
\newif{\if@singlenumbering} % If true, the same counter is used for all objects.
\newif{\if@nopagenumber} % If true, don't number pages.
@ -40,7 +25,7 @@
\DeclareOption{10pt}{\renewcommand\@ptsize{0}}
\DeclareOption{11pt}{\renewcommand\@ptsize{1}}
\DeclareOption{12pt}{\renewcommand\@ptsize{2}}
% ORMC-specific options
% Handout-specific options
\DeclareOption{solutions}{\@solutionstrue}
\DeclareOption{nosolutions}{\@solutionsfalse}
\DeclareOption{multinumbering}{\@singlenumberingfalse}
@ -52,7 +37,7 @@
\DeclareOption{showwarning}{\@nowarningfalse}
\DeclareOption{hidewarning}{\@nowarningtrue}
\DeclareOption{unfinished}{\@unfinishedtrue}
\DeclareOption*{\ClassWarning{ormc_handout}{\CurrentOption ignored}}
\DeclareOption*{\ClassWarning{handout}{\CurrentOption ignored}}
\@unfinishedfalse
\ExecuteOptions{
@ -644,12 +629,12 @@
% Keep track of the current background color.
% Useful for transparent tikz drawings.
\def\ORMCbgcolor{white}
\def\bgcolor{white}
% Make a box environment.
% These can safely be nested.
% Args: title, back color, frame color.
\newenvironment{ORMCbox}[3]{
\newenvironment{hobox}[3]{
% \linehack draws a line across a tcolorbox.
% tcolorbox only supports two sections, but
% this hack allows us to have more.
@ -668,7 +653,7 @@
% Keep track of the current background color.
% Useful for transparent tikz drawings.
\def\ORMCbgcolor{#2}
\def\bgcolor{#2}
\begin{tcolorbox}[
enhanced,
@ -690,21 +675,21 @@
}
\newenvironment{examplesolution}{
\begin{ORMCbox}{Example Solution}{black!10!white}{black!65!white}
\begin{hobox}{Example Solution}{black!10!white}{black!65!white}
} {
\end{ORMCbox}
\end{hobox}
}
\if@solutions
\newenvironment{solution}{
\begin{ORMCbox}{Solution}{ored!10!white}{ored}
\begin{hobox}{Solution}{ored!10!white}{ored}
} {
\end{ORMCbox}
\end{hobox}
}
\newenvironment{instructornote}{
\begin{ORMCbox}{Note for Instructors}{ocyan!10!white}{ocyan}
\begin{hobox}{Note for Instructors}{ocyan!10!white}{ocyan}
} {
\end{ORMCbox}
\end{hobox}
}
\else
\excludecomment{solution}

View File

@ -1,5 +1,5 @@
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{../../../lib/tex/macros}[2023/10/16 ORMC Macros]
\ProvidesPackage{../../../lib/tex/macros}[2025/03/02 Handout macros]
\RequirePackage{hyperref}
\RequirePackage{pgf}

View File

@ -29,6 +29,26 @@
)
}
#let short_solution_warning() = {
set text(ored)
align(
center,
block(
width: 60%,
height: auto,
breakable: false,
fill: rgb(255, 255, 255),
stroke: ored + 2pt,
inset: 3mm,
(
align(center, text(weight: "bold", size: 12pt, [Instructor's Handout]))
+ parbreak()
),
),
)
}
#let make_header(
title,
subtitle: none,
@ -44,6 +64,14 @@
by = text(size: 10pt, [Prepared by #by on #date])
}
let sub = ()
if (by != none) {
sub.push(by)
}
if (subtitle != none) {
sub.push(subtitle)
}
// Main title
align(
center,
@ -61,8 +89,7 @@
// Title
text(size: 20pt, title),
// Subtitle
if (by != none) { text(size: 10pt, by) },
if (subtitle != none) { text(size: 10pt, subtitle) },
..sub,
line(length: 100%, stroke: 0.2mm),
),
),

View File

@ -3,8 +3,14 @@
// Re-exports
// All functions that maybe used by client code are listed here
#import "misc.typ": *
#import "object.typ": problem, definition, theorem
#import "solution.typ": if_solutions, if_no_solutions, solution
#import "object.typ": problem, definition, theorem, example, remark, generic
#import "solution.typ": (
if_solutions,
if_no_solutions,
if_solutions_else,
solution,
instructornote,
)
/// Main handout wrapper.
@ -26,6 +32,7 @@
title: none,
by: none,
subtitle: none,
short_warning: false,
) = {
set page(
margin: 20mm,
@ -42,19 +49,28 @@
// Text style
set text(font: "New Computer Modern")
set par(
leading: 0.55em,
first-line-indent: 0mm,
justify: true,
leading: 0.5em,
spacing: 0.5em,
first-line-indent: 0mm,
hanging-indent: 0mm,
justify: true,
)
//
// List style
show list: set block(spacing: 0.5em, below: 1em)
set list(
tight: false,
indent: 5mm,
spacing: 3mm,
indent: 4mm,
body-indent: 1.5mm,
// Manually set spacing,
// `tight` has no effect.
spacing: 2mm,
)
set enum(
indent: 4mm,
body-indent: 1.5mm,
spacing: 2mm,
)
//
@ -86,8 +102,10 @@
// Make handout title
{
import "header.typ": make_header, solution_warning
import "solution.typ": show_solutions
import "header.typ": make_header, solution_warning, short_solution_warning
import "solution.typ": solutions_state, reset_solutions
reset_solutions()
let url = link(
"https://betalupi.com/handouts",
@ -102,8 +120,14 @@
top_right: url,
)
if show_solutions {
solution_warning()
context {
if solutions_state.get() {
if short_warning {
short_solution_warning()
} else {
solution_warning()
}
}
}
}

View File

@ -98,3 +98,11 @@
#let theorem = _mkobj("Theorem")
#let example = _mkobj("Example")
#let remark = _mkobj("Remark")
#let generic(obj_content) = {
block(
above: 8mm,
below: 2mm,
text(weight: "bold", obj_content),
)
}

View File

@ -1,30 +1,63 @@
#import "misc.typ": ored
#import "misc.typ": ored, oblue
/// If false, hide instructor info.
///
/// Compile with the following command to hide solutions:
/// `typst compile main.typ --input show_solutions=false`
/// If true, show it.
///
/// Solutions are shown by default. This behavior
/// is less surprising than hiding content by default.
#let show_solutions = {
#let solutions_state = state("solutions_state", true)
/// Force solutions to be hidden after this point.
///
/// This function produces content that must be
/// included in the document. If it is not included,
/// this function will have no effect.
#let hide_solutions() = {
return solutions_state.update(x => false)
}
/// Force solutions to be shown after this point.
///
/// This function produces content that must be
/// included in the document. If it is not included,
/// this function will have no effect.
#let show_solutions() = {
return solutions_state.update(x => true)
}
/// Reset the solution flag to its default value.
/// This value is determined by compile flags:
/// Compile with the following command to hide solutions:
/// `typst compile main.typ --input show_solutions=false`
///
/// Solutions are shown by default.
///
/// This function produces content that must be
/// included in the document. If it is not included,
/// this function will have no effect.
#let reset_solutions() = {
if "show_solutions" in sys.inputs {
// Show solutions unless they're explicitly disabled
not (
if (
sys.inputs.show_solutions == "false" or sys.inputs.show_solutions == "no"
)
} else {
// Show solutions by default
true
) {
return solutions_state.update(x => false)
}
}
}
#let if_solutions(content) = {
if show_solutions { content }
#let if_solutions(content) = context {
if solutions_state.get() { content }
}
#let if_no_solutions(content) = {
if not show_solutions { content }
#let if_no_solutions(content) = context {
if not solutions_state.get() { content }
}
#let if_solutions_else(if_yes, if_no) = context {
if solutions_state.get() { if_yes } else { if_no }
}
#let solution(content) = {
@ -54,3 +87,31 @@
),
)
}
#let instructornote(content) = {
if_solutions(
align(
center,
stack(
block(
width: 100%,
breakable: false,
fill: oblue,
stroke: oblue + 2pt,
inset: 1.5mm,
align(left, text(fill: white, weight: "bold", [Instructor note:])),
),
block(
width: 100%,
height: auto,
breakable: false,
fill: oblue.lighten(80%).desaturate(10%),
stroke: oblue + 2pt,
inset: 3mm,
align(left, content),
),
),
),
)
}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{tikzset.tex}

View File

@ -24,7 +24,7 @@
label/.style = {
rectangle,
% For automatic red background in solutions
fill = \ORMCbgcolor,
fill = \bgcolor,
draw = none,
rounded corners = 0mm
},
@ -32,7 +32,7 @@
% Nodes
edg/.style = {
midway,
fill = \ORMCbgcolor,
fill = \bgcolor,
text = gray
},
int/.style = {},

View File

@ -5,7 +5,7 @@
shortwarning,
singlenumbering,
unfinished
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{multicol}

View File

@ -4,7 +4,7 @@
solutions,
singlenumbering,
shortwarning
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{multicol}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{tikzset.tex}

View File

@ -24,7 +24,7 @@
label/.style = {
rectangle,
% For automatic red background in solutions
fill = \ORMCbgcolor,
fill = \bgcolor,
draw = none,
rounded corners = 0mm
},

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{tikzset.tex}

View File

@ -24,7 +24,7 @@
label/.style = {
rectangle,
% For automatic red background in solutions
fill = \ORMCbgcolor,
fill = \bgcolor,
draw = none,
rounded corners = 0mm
},

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
@ -16,6 +16,11 @@
\title{Error-Correcting Codes}
\subtitle{Prepared by Mark on \today}
% TODO:
% ISBN section is tedious, could use some work.
% Check problem 5
\begin{document}
\maketitle

View File

@ -1,6 +1,8 @@
\section{Error Detection}
An ISBN\footnote{International Standard Book Number} is a unique numeric book identifier. It comes in two forms: ISBN-10 and ISBN-13. Naturally, ISBN-10s have ten digits, and ISBN-13s have thirteen. The final digit in both versions is a \textit{check digit}.
An ISBN\footnote{International Standard Book Number} is a unique identifier publishers assign to their books. \par
It comes in two forms: ISBN-10 and ISBN-13. Naturally, ISBN-10s have ten digits, and ISBN-13s have thirteen.
The final digit in both versions is a \textit{check digit}.
\vspace{3mm}
@ -15,23 +17,25 @@ If $n_{10}$ is equal to 10, it is written as \texttt{X}.
\problem{}
Only one of the following ISBNs is valid. Which one is it?
Only one of the following ISBNs is valid. Which one is it? \par
\note[Note]{Dashes are meaningless.}
\begin{itemize}
\item \texttt{0-134-54896-2}
\item \texttt{0-895-77258-2}
\item \texttt{0-895-77258-2} % oliver twist
\end{itemize}
\begin{solution}
The first has an inconsistent check digit.
The second is valid.
\end{solution}
\vfill
\pagebreak
\problem{}
Take a valid ISBN-10 and change one digit. Is it possible that you get another valid ISBN-10? \par
Provide a proof.
Take a valid ISBN-10 and change one digit. \par
Is it possible that you get another valid ISBN-10? \par
Provide an example or a proof.
\begin{solution}
Let $S$ be the sum $10n_1 + 9n_2 + ... + 2n_9 + n_{10}$, before any digits are changed.
@ -50,9 +54,8 @@ Provide a proof.
\vfill
\problem{}
Take a valid ISBN-10 and swap two adjacent digits. When will the result be a valid ISBN-10? \par
This is called a \textit{transposition error}.
Take a valid ISBN-10 and swap two adjacent digits. This is called a \textit{transposition error}. \par
When will the result be a valid ISBN-10?
\begin{solution}
Let $n_1n_2...n_{10}$ be a valid ISBN-10. \par
@ -67,18 +70,20 @@ This is called a \textit{transposition error}.
\vfill
\pagebreak
\problem{}
ISBN-13 error checking is slightly different. Given a partial ISBN-13 $n_1 n_2 n_3 ... n_{12}$, the final digit is given by
\definition{}
ISBN-13 error checking is slightly different. \par
Given a partial ISBN-13 with digits $n_1 n_2 n_3 ... n_{12}$, the final digit is given by
$$
n_{13} = \Biggr[ \sum_{i=1}^{12} n_i \times (2 + (-1)^i) \Biggl] \text{ mod } 10
$$
\problem{}
What is the last digit of the following ISBN-13? \par
\texttt{978-0-380-97726-?}
\texttt{978-030-7292-06*} % foundation
\begin{solution}
The final digit is 0.
The final digit is 3.
\end{solution}
\vfill
@ -126,8 +131,8 @@ Take a valid ISBN-13 and swap two adjacent digits. When will the result be a val
\vfill
\problem{}<isbn-nocorrect>
\texttt{978-0-08-2066-46-6} was a valid ISBN until I changed a single digit. \par
\problem{}<isbnnocorrect>
\texttt{978-008-2066-466} was a valid ISBN until I changed a single digit. \par
Can you find the digit I changed? Can you recover the original ISBN?
\begin{solution}

View File

@ -1,6 +1,6 @@
\section{Error Correction}
As we saw in \ref{isbn-nocorrect}, the ISBN check-digit scheme does not allow us to correct errors. \par
As we saw in \ref{isbnnocorrect}, the ISBN check-digit scheme does not allow us to correct errors. \par
QR codes feature a system that does. \par
\vspace{1mm}
@ -8,7 +8,8 @@ QR codes feature a system that does. \par
Odds are, you've seen a QR code with an image in the center. Such codes aren't \say{special}---they're simply missing their central pixels. The error-correcting algorithm in the QR specification allows us to read the code despite this damage.
\begin{figure}[h]
\centering
\href{https://youtube.com/watch?v=dQw4w9WgXcQ}{\includegraphics[width = 3cm]{qr}}
%\href{https://youtube.com/watch?v=dQw4w9WgXcQ}{\includegraphics[width = 3cm]{qr-rick}}
\href{https://betalupi.com}{\includegraphics[width = 3cm]{qr-betalupi}}
\end{figure}
\definition{Repeating codes}
@ -47,7 +48,8 @@ What is the efficiency of a $k$-repeat code?
\vfill
As you just saw, repeat codes are not a good solution. You need many extra bits for even a small amount of redundancy. We need a better system.
Repeat codes are not efficient. We need to inflate our message by
\textit{three times} if we want to correct even a single error. We need a better system.
\pagebreak

View File

@ -1,6 +1,6 @@
\section{Hamming Codes}
Say we have a 16-bit message, for example \texttt{1011 0101 1101 1001}. \par
Say we have an $n$-bit message, for example \texttt{1011 0101 1101 1001}. \par
We will number its bits in binary, from left to right:
@ -62,13 +62,14 @@ We will number its bits in binary, from left to right:
\problem{}
In this 16-bit message, how many message bits have an index with a one as the last digit? \par
If we number the bits of a 16-bit message as described above, \par
how many message bits have an index with a one as the last digit? \par
(i.e, an index that looks like \texttt{***1})
\vspace{2cm}
\problem{}
Say we number the bits in a 32-bit message as above. \par
Now consider a 32-bit message. \par
How many message bits have an index with a one as the $n^\text{th}$ digit? \par
\vspace{2cm}
@ -76,7 +77,10 @@ How many message bits have an index with a one as the $n^\text{th}$ digit? \par
We now want a way to detect errors in our 16-bit message. To do this, we'll replace a few data bits with parity bits. This will reduce the amount of information we can send, but will also improve our error-detection capabilities.
Now, let's come up with a way to detect errors in our 16-bit message.
To do this, we'll replace a few data bits with parity bits.
This will reduce the amount of information we can send,
but will allow the receiver to detect errors in the received message.
\vspace{1mm}
@ -174,7 +178,8 @@ Can this coding scheme correct a single-bit error?
\vfill
\pagebreak
We'll now add four more parity bits, in positions \texttt{0001}, \texttt{0010}, \texttt{0100}, and \texttt{1000}:
We'll now add four more parity bits, in positions \texttt{0001}, \texttt{0010}, \texttt{0100}, and \texttt{1000}: \par
This error-detection scheme is called the \textit{Hamming code}.
\begin{center}
\begin{tikzpicture}[scale = 1.25]
@ -246,7 +251,7 @@ Bits \texttt{0100} and \texttt{1000} work in the same way. \par
When counting bits in binary numbers, go from right to left.}
\problem{}
Which message bits does each parity bit cover? \par
Which message bits does each parity bit \say{cover}? \par
In other words, which message bits affect the value of each parity bit? \par
\vspace{1mm}
@ -358,7 +363,7 @@ Analyze this coding scheme.
\vfill
\problem{}
Each of the following messages has either 0, 1, or two errors. \par
Each of the following messages has either one, two, or no errors. \par
Find the errors and correct them if possible. \par
\hint{Bit \texttt{0000} should tell you how many errors you have.}
@ -570,8 +575,46 @@ If we know which parity bits are inconsistent, how can we find where the error i
\vfill
\problem{}<generalize-hamming>
Can you generalize this system for messages of 4, 64, or 256 bits?
Generalize this system for messages of 4, 64, or 256 bits. \par
\begin{itemize}
\item How does the resilience of this scheme change if we use a larger message size?
\item How does the efficiency of this scheme change if we send larger messages?
\end{itemize}
\vfill
\pagebreak
\definition{}
A \textit{deletion} error occurs when one bit of the message is deleted. \par
Likewise, an \textit{insertion} error consists of a random inserted bit. \par
\definition{}
A \textit{message stream} is an infinite string of binary digits.
\problem{}
Show that Hamming codes do not reliably detect bit deletions: \par
\hint{
Create a 17-bit message whose first 16 bits are a valid Hamming-coded message, \par
and which is still valid when a bit (chosen by you; not the $17^\text{th}$) is deleted.
}
\vfill
\problem{}
Convince yourself that Hamming codes cannot correct insertions. \par
Then, create a 16-bit message that:
\begin{itemize}
\item is itself a valid Hamming code, and
\item incorrectly "corrects" a single bit error when it encounters an insertion error. \par
You may choose where the insertion occurs.
\end{itemize}
\vfill
As we have seen, Hamming codes effectively handle substitutions, but cannot reliably
detect (or correct) insertions and deletions. Correcting those errors is a bit more difficult:
if the number of bits we receive is variable, how can we split a stream into a series of messages? \par
\note{This is a rhetorical question, which we'll discuss another day.}
\pagebreak

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

Before

Width:  |  Height:  |  Size: 89 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -3,7 +3,7 @@
\documentclass[
nosolutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -4,7 +4,7 @@
solutions,
singlenumbering,
nopagenumber
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\uptitlel{Advanced 2}

View File

@ -0,0 +1,31 @@
#import "@local/handout:0.1.0": *
// Bonus:
// - Floats vs fixed point
// - Float density
// - Find non-floatable rational numbers
// - What if we use `n`-bit floats?
#show: doc => handout(
doc,
group: "Advanced 2",
title: [Fast Inverse Square Root],
by: "Mark",
)
#include "parts/00 intro.typ"
#pagebreak()
#include "parts/01 int.typ"
#pagebreak()
#include "parts/02 float.typ"
#pagebreak()
#include "parts/03 approx.typ"
#pagebreak()
#include "parts/04 quake.typ"
#pagebreak()
#include "parts/05 bonus.typ"

View File

@ -0,0 +1,7 @@
[metadata]
title = "Fast Inverse Square Root"
[publish]
handout = true
solutions = true

View File

@ -0,0 +1,45 @@
#import "@local/handout:0.1.0": *
= Introduction
In 2005, ID Software published the source code of _Quake III Arena_, a popular game released in 1999. \
This caused quite a stir: ID Software was responsible for many games popular among old-school engineers (most notably _Doom_, which has a place in programmer humor even today).
#v(2mm)
Naturally, this community immediately began dissecting _Quake_'s source. \
One particularly interesting function is reproduced below, with original comments: \
#v(3mm)
```c
float Q_rsqrt( float number ) {
long i;
float x2, y;
const float threehalfs = 1.5F;
x2 = number * 0.5F;
y = number;
i = * ( long * ) &y; // evil floating point bit level hacking
i = 0x5f3759df - ( i >> 1 ); // [redacted]
y = * ( float * ) &i;
y = y * ( threehalfs - ( x2 * y * y ) ); // 1st iteration
// y = y * ( threehalfs - ( x2 * y * y ) ); // 2nd iteration, this can be removed
return y;
}
```
#v(3mm)
This code defines a function `Q_sqrt`, which was used as a fast approximation of the inverse square root in graphics routines. (in other words, `Q_sqrt` efficiently approximates $1 div sqrt(x)$)
#v(3mm)
The key word here is "fast": _Quake_ ran on very limited hardware, and traditional approximation techniques (like Taylor series)#footnote[Taylor series aren't used today, and for the same reason. There are better ways.] were too computationally expensive to be viable.
#v(3mm)
Our goal today is to understand how `Q_sqrt` works. \
To do that, we'll first need to understand how computers represent numbers. \
We'll start with simple binary integers---turn the page.

View File

@ -0,0 +1,102 @@
#import "@local/handout:0.1.0": *
= Integers
#definition()
A _bit string_ is a string of binary digits. \
In this handout, we'll denote bit strings with the prefix `0b`. \
#note[This prefix is only notation---it is _not_ part of the string itself.] \
For example, $1001$ is the number "one thousand and one," while $#text([`0b1001`])$ is the string of bits "1 0 0 1".
#v(2mm)
We will separate long bit strings with underscores for readability. \
Underscores have no meaning: $#text([`0b1111_0000`]) = #text([`0b11110000`])$.
#problem()
What is the value of the following bit strings, if we interpret them as integers in base 2?
- `0b0001_1010`
- `0b0110_0001`
#solution([
- $#text([`0b0001_1010`]) = 2 + 8 + 16 = 26$
- $#text([`0b0110_0001`]) = 1 + 32 + 64 = 95$
])
#v(1fr)
#definition()
We can interpret a bit string in any number of ways. \
One such interpretation is the _unsigned integer_, or `uint` for short. \
`uint`s allow us to represent positive (hence "unsigned") integers using 32-bit strings.
#v(2mm)
The value of a `uint` is simply its value as a binary number:
- $#text([`0b00000000_00000000_00000000_00000000`]) = 0$
- $#text([`0b00000000_00000000_00000000_00000011`]) = 3$
- $#text([`0b00000000_00000000_00000000_00100000`]) = 32$
- $#text([`0b00000000_00000000_00000000_10000010`]) = 130$
#problem()
What is the largest number we can represent with a 32-bit `uint`?
#solution([
$#text([`0b11111111_11111111_11111111_11111111`]) = 2^(32)-1$
])
#v(1fr)
#pagebreak()
#problem()
Find the value of each of the following 32-bit unsigned integers:
- `0b00000000_00000000_00000101_00111001`
- `0b00000000_00000000_00000001_00101100`
- `0b00000000_00000000_00000100_10110000`
#hint([The third conversion is easy---look carefully at the second.])
#instructornote[
Consider making a list of the powers of two $>= 1024$ on the board.
]
#solution([
- $#text([`0b00000000_00000000_00000101_00111001`]) = 1337$
- $#text([`0b00000000_00000000_00000001_00101100`]) = 300$
- $#text([`0b00000000_00000000_00000010_01011000`]) = 1200$
Notice that the third int is the second shifted left twice (i.e, multiplied by 4)
])
#v(1fr)
#definition()
In general, fast division of `uints` is difficult#footnote([One may use repeated subtraction, but this isn't efficient.]). \
Division by powers of two, however, is incredibly easy: \
To divide by two, all we need to do is shift the bits of our integer right.
#v(2mm)
For example, consider $#text[`0b0000_0110`] = 6$. \
If we insert a zero at the left end of this string and delete the zero at the right \
(thus "shifting" each bit right), we get `0b0000_0011`, which is 3. \
#v(2mm)
Of course, we lose the remainder when we right-shift an odd number: \
$9$ shifted right is $4$, since `0b0000_1001` shifted right is `0b0000_0100`.
#problem()
Right shifts are denoted by the `>>` symbol: \
$#text[`00110`] #text[`>>`] n$ means "shift `0b0110` right $n$ times." \
Find the value of the following:
- $12 #text[`>>`] 1$
- $27 #text[`>>`] 3$
- $16 #text[`>>`] 8$
#note[Naturally, you'll have to convert these integers to binary first.]
#solution[
- $12 #text[`>>`] 1 = 6$
- $27 #text[`>>`] 3 = 3$
- $16 #text[`>>`] 8 = 0$
]
#v(1fr)

View File

@ -0,0 +1,211 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
= Floats
#definition()
_Binary decimals_#footnote([Note that "binary decimal" is a misnomer---"deci" means "ten"!]) are very similar to base-10 decimals.\
In base 10, we interpret place value as follows:
- $0.1 = 10^(-1)$
- $0.03 = 3 times 10^(-2)$
- $0.0208 = 2 times 10^(-2) + 8 times 10^(-4)$
#v(5mm)
We can do the same in base 2:
- $#text([`0.1`]) = 2^(-1) = 0.5$
- $#text([`0.011`]) = 2^(-2) + 2^(-3) = 0.375$
- $#text([`101.01`]) = 5.125$
#v(5mm)
#problem()
Rewrite the following binary decimals in base 10: \
#note([You may leave your answer as a fraction.])
- `1011.101`
- `110.1101`
#v(1fr)
#pagebreak()
#definition(label: "floatbits")
Another way we can interpret a bit string is as a _signed floating-point decimal_, or a `float` for short. \
Floats represent a subset of the real numbers, and are interpreted as follows: \
#note([The following only applies to floats that consist of 32 bits. We won't encounter any others today.])
#align(
center,
box(
inset: 2mm,
cetz.canvas({
import cetz.draw: *
let chars = (
`0`,
`b`,
`0`,
`_`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`_`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`_`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`_`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
`0`,
)
let x = 0
for c in chars {
content((x, 0), c)
x += 0.25
}
let y = -0.4
line((0.3, y), (0.65, y))
content((0.45, y - 0.2), [s])
line((0.85, y), (2.9, y))
content((1.9, y - 0.2), [exponent])
line((3.10, y), (9.4, y))
content((6.3, y - 0.2), [fraction])
}),
),
)
- The first bit denotes the sign of the float's value
We'll label it $s$. \
If $s = #text([`1`])$, this float is negative; if $s = #text([`0`])$, it is positive.
- The next eight bits represent the _exponent_ of this float.
#note([(we'll see what that means soon)]) \
We'll call the value of this eight-bit binary integer $E$. \
Naturally, $0 <= E <= 255$ #note([(since $E$ consist of eight bits)])
- The remaining 23 bits represent the _fraction_ of this float. \
They are interpreted as the fractional part of a binary decimal. \
For example, the bits `0b10100000_00000000_00000000` represent $0.5 + 0.125 = 0.625$. \
We'll call the value of these bits as a binary integer $F$. \
Their value as a binary decimal is then $F div 2^23$. #note([(convince yourself of this)])
#problem(label: "floata")
Consider `0b01000001_10101000_00000000_00000000`. \
#hint([The underscores here do _not_ match those in @floatbits])
#v(2mm)
Find the $s$, $E$, and $F$ we get if we interpret this bit string as a `float`. \
#note([Leave $F$ as a sum of powers of two.])
#solution([
$s = 0$ \
$E = 131$ \
$F = 2^21+2^19$
])
#v(1fr)
#definition(label: "floatdef")
The final value of a float with sign $s$, exponent $E$, and fraction $F$ is
$
(-1)^s times 2^(E - 127) times (1 + F / (2^(23)))
$
Notice that this is very similar to base-10 scientific notation, which is written as
$
(-1)^s times 10^(e) times (f)
$
#note[
We subtract 127 from $E$ so we can represent positive and negative numbers. \
$E$ is an eight bit binary integer, so $0 <= E <= 255$ and thus $-127 <= (E - 127) <= 127$.
]
#problem()
Consider `0b01000001_10101000_00000000_00000000`. \
This is the same bit string we used in @floata. \
#v(2mm)
What value do we get if we interpret this bit string as a float? \
#hint([$21 div 16 = 1.3125$])
#solution([
This is 21:
$
2^4 times (1 + (2^(21) + 2^(19)) / (2^(23)))
= 2^(4) times (1 + 2^(-2) + 2^(-4))
= 16 + 4 + 1
= 21
$
])
#v(1fr)
#pagebreak()
#problem()
Encode $12.5$ as a float. \
#hint([$12.5 div 8 = 1.5625$])
#solution([
$
12.5
= 8 times 1.5625
= 2^(3) times (1 + (0.5 + 0.0625))
= 2^(130) times (1 + (2^(22) + 2^(19)) / (2^(23)))
$
which is `0b01000001_01001000_00000000_00000000`. \
])
#v(1fr)
#definition()
Say we have a bit string $x$. \
We'll let $x_f$ denote the value we get if we interpret $x$ as a float, \
and we'll let $x_i$ denote the value we get if we interpret $x$ an integer.
#problem()
Let $x = #text[`0b01000001_01001000_00000000_00000000`]$. \
What are $x_f$ and $x_i$? #note([As always, you may leave big numbers as powers of two.])
#solution([
$x_f = 12.5$
#v(2mm)
$x_i = 2^30 + 2^24 + 2^22 + 2^19 = 11,095,237,632$
])
#v(1fr)

View File

@ -0,0 +1,173 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
#import "@preview/cetz-plot:0.1.0": plot, chart
= Integers and Floats
#generic("Observation:")
If $x$ is smaller than 1, $log_2(1 + x)$ is approximately equal to $x$. \
Note that this equality is exact for $x = 0$ and $x = 1$, since $log_2(1) = 0$ and $log_2(2) = 1$.
#v(5mm)
We'll add the _correction term_ $epsilon$ to our approximation: $log_2(1 + a) approx a + epsilon$. \
This allows us to improve the average error of our linear approximation:
#table(
stroke: none,
align: center,
columns: (1fr, 1fr),
inset: 5mm,
[$log_2(1+x)$ and $x + 0$]
+ cetz.canvas({
import cetz.draw: *
let f1(x) = calc.log(calc.abs(x + 1), base: 2)
let f2(x) = x
// Set-up a thin axis style
set-style(axes: (stroke: .5pt, tick: (stroke: .5pt)))
plot.plot(
size: (7, 7),
x-tick-step: 0.2,
y-tick-step: 0.2,
y-min: 0,
y-max: 1,
x-min: 0,
x-max: 1,
legend: none,
axis-style: "scientific-auto",
x-label: none,
y-label: none,
{
let domain = (0, 1)
plot.add(
f1,
domain: domain,
label: $log(1+x)$,
style: (stroke: ogrape),
)
plot.add(
f2,
domain: domain,
label: $x$,
style: (stroke: oblue),
)
},
)
})
+ [
Max error: 0.086 \
Average error: 0.0573
],
[$log_2(1+x)$ and $x + 0.045$]
+ cetz.canvas({
import cetz.draw: *
let f1(x) = calc.log(calc.abs(x + 1), base: 2)
let f2(x) = x + 0.0450466
// Set-up a thin axis style
set-style(axes: (stroke: .5pt, tick: (stroke: .5pt)))
plot.plot(
size: (7, 7),
x-tick-step: 0.2,
y-tick-step: 0.2,
y-min: 0,
y-max: 1,
x-min: 0,
x-max: 1,
legend: none,
axis-style: "scientific-auto",
x-label: none,
y-label: none,
{
let domain = (0, 1)
plot.add(
f1,
domain: domain,
label: $log(1+x)$,
style: (stroke: ogrape),
)
plot.add(
f2,
domain: domain,
label: $x$,
style: (stroke: oblue),
)
},
)
})
+ [
Max error: 0.041 \
Average error: 0.0254
],
)
A suitiable value of $epsilon$ can be found using calculus or with computational trial-and-error. \
We won't bother with this---we'll simply leave the correction term as an opaque constant $epsilon$.
#v(1fr)
#note(
type: "Note",
[
"Average error" above is simply the area of the region between the two graphs:
$
integral_0^1 abs( #v(1mm) log(1+x)_2 - (x+epsilon) #v(1mm))
$
Feel free to ignore this note, it isn't a critical part of this handout.
],
)
#pagebreak()
#problem(label: "convert")
Use the fact that $log_2(1 + a) approx a + epsilon$ to approximate $log_2(x_f)$ in terms of $x_i$. \
Namely, show that
$
log_2(x_f) = (x_i) / (2^23) - 127 + epsilon
$
#note([
In other words, we're finding an expression for $x$ as a float
in terms of $x$ as an int.
])
#solution([
Let $E$ and $F$ be the exponent and float bits of $x_f$. \
We then have:
$
log_2(x_f)
&= log_2 ( 2^(E-127) times (1 + (F) / (2^23)) ) \
&= E - 127 + log_2(1 + F / (2^23)) \
& approx E-127 + F / (2^23) + epsilon \
&= 1 / (2^23)(2^23 E + F) - 127 + epsilon \
&= 1 / (2^23)(x_i) - 127 + epsilon
$
])
#v(1fr)
#problem()
Using basic log rules, rewrite $log_2(1 / sqrt(x))$ in terms of $log_2(x)$.
#solution([
$
log_2(1 / sqrt(x)) = (-1) / (2)log_2(x)
$
])
#v(1fr)

View File

@ -0,0 +1,210 @@
#import "@local/handout:0.1.0": *
= The Fast Inverse Square Root
A simplified version of the _Quake_ routine we are studying is reproduced below.
#v(2mm)
```c
float Q_rsqrt( float number ) {
long i = * ( long * ) &number;
i = 0x5f3759df - ( i >> 1 );
return * ( float * ) &i;
}
```
#v(2mm)
This code defines a function `Q_rsqrt` that consumes a float `number` and approximates its inverse square root.
If we rewrite this using notation we're familiar with, we get the following:
$
#text[`Q_sqrt`] (n_f) =
6240089 - (n_i div 2)
#h(10mm)
approx 1 / sqrt(n_f)
$
#note[
`0x5f3759df` is $6240089$ in hexadecimal. \
Ask an instructor to explain if you don't know what this means. \
It is a magic number hard-coded into `Q_sqrt`.
]
#v(2mm)
Our goal in this section is to understand why this works:
- How does Quake approximate $1 / sqrt(x)$ by simply subtracting and dividing by two?
- What's special about $6240089$?
#v(1fr)
#remark()
For those that are interested, here are the details of the "code-to-math" translation:
- "`long i = * (long *) &number`" is C magic that tells the compiler \
to set `i` to the `uint` value of the bits of `number`. \
#note[
"long" refers to a "long integer", which has 32 bits. \
Normal `int`s have 16 bits, `short int`s have 8.
] \
In other words, `number` is $n_f$ and `i` is $n_i$.
#v(2mm)
- Notice the right-shift in the second line of the function. \
We translated `(i >> 1)` into $(n_i div 2)$.
#v(2mm)
- "`return * (float *) &i`" is again C magic. \
Much like before, it tells us to return the value of the bits of `i` as a float.
#pagebreak()
#generic("Setup:")
We are now ready to show that $#text[`Q_sqrt`] (x)$ effectively approximates $1/sqrt(x)$. \
For convenience, let's call the bit string of the inverse square root $r$. \
In other words,
$
r_f := 1 / (sqrt(n_f))
$
This is the value we want to approximate. \
#problem(label: "finala")
Find an approximation for $log_2(r_f)$ in terms of $n_i$ and $epsilon$ \
#note[Remember, $epsilon$ is the correction constant in our approximation of $log_2(1 + x)$.]
#solution[
$
log_2(r_f)
= log_2(1 / sqrt(n_f))
= (-1) / 2 log_2(n_f)
approx (-1) / 2 ( (n_i) / (2^23) + epsilon - 127 )
$
]
#v(1fr)
#problem(label: "finalb")
Let's call the "magic number" in the code above $kappa$, so that
$
#text[`Q_sqrt`] (n_f) = kappa - (n_i div 2)
$
Use @convert and @finala to show that $#text[`Q_sqrt`] (n_f) approx r_i$ \
#note(type: "Note")[
If we know $r_i$, we know $r_f$. \
We don't even need to convert between the two---the underlying bits are the same!
]
#solution[
From @convert, we know that
$
log_2(r_f) approx (r_i) / (2^23) + epsilon - 127
$
Combining this with the result from @finala, we get:
$
(r_i) / (2^23) + epsilon - 127
&approx (-1) / (2) ( (n_i) / (2^23) + epsilon - 127) \
(r_i) / (2^23)
&approx (-1) / (2) ( (n_i) / (2^23)) + 3 / 2 (127 - epsilon) \
r_i
&approx (-1) / 2 (n_i) + 2^23 3 / 2(127 - epsilon)
= 2^23 3 / 2 (127 - epsilon) - (n_i) / 2
$
#v(2mm)
This is exactly what we need! If we set $kappa$ to $(3 times 2^22) (127-epsilon)$, then
$
r_i approx kappa - (n_i div 2) = #text[`Q_sqrt`] (n_f)
$
]
#v(1fr)
#problem(label: "finalc")
What is the exact value of $kappa$ in terms of $epsilon$? \
#hint[Look at @finalb. We already found it!]
#solution[
This problem makes sure our students see that
$kappa = (3 times 2^22) (127 - epsilon)$. \
See the solution to @finalb.
]
#v(2cm)
#pagebreak()
#remark()
In @finalc we saw that $kappa = (3 times 2^22) (127 - epsilon)$. \
Looking at the code again, we see that $kappa = #text[`0x5f3759df`]$ in _Quake_:
#v(2mm)
```c
float Q_rsqrt( float number ) {
long i = * ( long * ) &number;
i = 0x5f3759df - ( i >> 1 );
return * ( float * ) &i;
}
```
#v(2mm)
Using a calculator and some basic algebra, we can find the $epsilon$ this code uses: \
#note[Remember, #text[`0x5f3759df`] is $6240089$ in hexadecimal.]
$
(3 times 2^22) (127 - epsilon) &= 6240089 \
(127 - epsilon) &= 126.955 \
epsilon &= 0.0450466
$
So, $0.045$ is the $epsilon$ used by Quake. \
Online sources state that this constant was generated by trial-and-error, \
though it is fairly close to the ideal $epsilon$.
#remark()
And now, we're done! \
We've shown that `Q_sqrt(x)` approximates $1/sqrt(x)$ fairly well. \
#v(2mm)
Notably, `Q_sqrt` uses _zero_ divisions or multiplications (`>>` doesn't count). \
This makes it _very_ fast when compared to more traditional approximation techniques (i.e, Taylor series).
#v(2mm)
In the case of _Quake_, this is very important. 3D graphics require thousands of inverse-square-root calculations to render a single frame#footnote[e.g, to generate normal vectors], which is not an easy task for a Playstation running at 300MHz.
#instructornote[
Let $x$ be a bit string. If we assume $x_f$ is positive and $E$ is even, then
$
(x #text[`>>`] 1)_f = 2^((E div 2) - 127) times (1 + (F div 2) / (2^(23)))
$
Notably: a right-shift divides the exponent of $x_f$ by two, \
which is, of course, a square root!
#v(2mm)
This intuition is hand-wavy, though: \
If $E$ is odd, its lowest-order bit becomes the highest-order bit of $F$ when we shift $x$ right. \
Also, a right shift doesn't divide the _entire_ exponent, skipping the $-127$ offset. \
#v(2mm)
Remarkably, this intuition is still somewhat correct. \
The bits align _just so_, and our approximation still works.
#v(8mm)
One can think of the fast inverse root as a "digital slide rule": \
The integer representation of $x_f$ already contains $log_2(x_f)$, offset and scaled. \
By subtracting and dividing in "log space", we effectively invert and root $x_f$!
After all,
$
- 1 / 2 log_2(n_f) = 1 / sqrt(n_f)
$
]

View File

@ -0,0 +1,36 @@
#import "@local/handout:0.1.0": *
= Bonus -- More about Floats
#problem()
Convince yourself that all numbers that can be represented as a float are rational.
#problem()
Find a rational number that cannot be represented as a float.
#v(1fr)
#problem()
What is the smallest positive 32-bit float?
#v(1fr)
#problem()
What is the largest positive 32-bit float?
#v(1fr)
#problem()
How many floats are between $-1$ and $1$?
#v(1fr)
#problem()
How many floats are between $1$ and $2$?
#v(1fr)
#problem()
How many floats are between $1$ and $128$?
#v(1fr)

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -2,7 +2,7 @@
% use [solutions] flag to show solutions.
\documentclass[
solutions
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\uptitlel{Advanced 2}

View File

@ -4,7 +4,7 @@
solutions,
singlenumbering,
shortwarning
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{tikz}

View File

@ -0,0 +1,13 @@
#import "@local/handout:0.1.0": *
#show: handout.with(
title: [Gods, Demons, and Mortals],
by: "Mark",
subtitle: [Based on Raymond Smullyan's _To Mock a Mockingbird_.],
short_warning: true,
)
#include "parts/00 warmup.typ"
#pagebreak()
#include "parts/01 gods.typ"

View File

@ -0,0 +1,6 @@
[metadata]
title = "Gods, Demons, and Mortals"
[publish]
handout = true
solutions = true

View File

@ -0,0 +1,62 @@
#import "@local/handout:0.1.0": *
= Warm-Up
#problem("The Flower Garden")
In a certain garden, each flower was either red, yellow, or blue, and all three colors were represented. A statistician once visited the garden and made the observation that whatever three flowers you picked, at least one of them was bound to be red.
#v(2mm)
A second statistician visited the garden and made the observation that whatever three flowers you picked, at least one was bound to be yellow.
#v(2mm)
Two logic students heard about this and got into an argument. \
The first student said: "It therefore follows that whatever three flowers you pick, at least one is bound to be blue,
doesn't it?" The second student said: "Of course not!"
Which student was right, and why?
#solution[
The first student was right.
#v(2mm)
From the first statistician's report it follows that there cannot be more than one yellow flower, because if there were two yellows, you could pick two yellows and one blue, thus having a group of three flowers that contained no red. This is contrary to the report that every group of three is bound to contain at least one red flower. Therefore there cannot be more than one yellow flower.
#v(2mm)
Similarly, there cannot be more than one blue flower, because if there were two blues, you could pick two blue flowers and one yellow and again have a group of three that contained no red. And so from the first statistician's report it follows that there is at most one yellow flower and one blue.
#v(2mm)
And it follows from the report of the second statistician that there is at most one red flower, for if there were two reds,
you could pick two reds and one blue, thus obtaining a group of three that contained no yellow. It also follows from the
second report that there cannot be more than one blue, although we have already deduced this from the first report.
#v(2mm)
The upshot of all this is that there are only three flowers in the entire garden---one red, one yellow, and one blue! And so it is of course true that whatever three flowers you pick, one of them must be blue.
]
#v(1fr)
#problem("What Question")
There is a question I could ask you that has a definite correct
answer---either yes or no---but it is logically impossible for
you to give the correct answer. You might know what the
correct answer is, but you cannot give it. Anybody other than
you might possibly be able to give the correct answer, but
you cannot!
Can you figure out what question I could have in mind?
#solution[
Suppose I ask you: "Is no your answer to this question?"
If you answer yes, then you are affirming that no is your answer to the question,
which is of course wrong. If you answer
no, then you are denying that no is your answer, although no
was your answer.
]
#v(1fr)

View File

@ -0,0 +1,316 @@
#import "@local/handout:0.1.0": *
= Gods, Demons, and Mortals
#generic("Setup:")
One night, Inspector Craig had a curious dream.
He had been browsing that day in a library specializing in rare
books on mythology, another of his many interests. His head
was filled with gods and demons, and so his dream was perhaps not so surprising.
#v(2mm)
Time sometimes passes in unusual ways in the course of a
dream. Craig dreamed that he spent nine days in a region in
which dwelled gods, demons, and mortals.
#v(2mm)
The gods, of course, always told the truth, and the demons always lied. As to the mortals, half were knights and half were knaves. As usual, the knights told the truth and the knaves lied.
#problem("The First Day")
Craig dreamed that on the first day he met a dweller of the
region who looked as if he might be a god, though Craig could
not be sure. The dweller evidently guessed Craig's thoughts,
smiled, and made a statement to reassure him. From this statement, Craig knew that he was in the presence of a god.
#v(2mm)
Can you supply such a statement?
#solution[
One statement that works is: "I am not a knight."
#v(2mm)
If the speaker were a knave or a demon, then it would be true that he was not a knight, but knaves and demons don't make true statements.
#v(2mm)
Therefore the speaker was neither a knave nor a
demon, hence he was a knight or a god and his statement was
true.
#v(2mm)
Since it was true, then he really is not a knight; hence he must be a god.
]
#v(1fr)
#problem("The Second Day")
In this episode of the dream, Craig met a terrifying being who had every appearance of being a demon.
"What sort of being are you?" asked Craig, in some alarm.
The being answered, and Craig then realized that he was confronting not a demon, but a knave. \
What could the being have answered?
#solution[
A statement that works is: "I am a demon." Obviously
no demon can claim he is a demon, so the speaker is not a
demon. Therefore his statement was false and since he is not
a demon, he must be a knave.
]
#v(1fr)
#pagebreak()
#problem("The Third Day")
In this episode, Craig met a totally nondescript-looking being
who from appearances could have been anything at all. The
being then made a statement from which Craig could deduce
that he was either a god or a demon, but Craig could not tell
which.
Can you supply such a statement?
#solution[
This is a bit more tricky: A statement that works is: "I
am either a god or a knave." That could be said by a god,
since a god is either a god or a knave; it could also be falsely said by a demon.
#v(2mm)
It couldn't be said by a knight, because a knight would never lie and claim that he is either a god or a knave, and it couldn't be said by a knave, because a knave would never admit to the true fact that he is either a god or
a knave.
#v(2mm)
And so the speaker must be either a god or a demon,
but there is no way to tell which.
]
#v(1fr)
#problem("The Fourth Day")
Craig next met a being who made the following two statements:
- A god once claimed that I am a demon.
- No knight has ever claimed that I am a knave.
What sort of being was he?
#solution[
The speaker's first statement was obviously false, for if
it were true, a god would have once claimed that the speaker
was a demon, which would mean that the speaker really was
a demon, but no one who tells the truth can be a demon. Since
the first statement was false, so was the second statement, since it was made by the same speaker. Therefore a knight did once claim that the speaker was a knave, hence the speaker really
is a knave.
]
#v(1fr)
#problem("The Fifth Day")
A being made the following two statements to Craig:
- I never claim to be a knave.
- I sometimes claim that I am a demon.
What sort of being are we now dealing with?
#solution[
The speaker's second statement was obviously a lie, because no truth-teller would ever say that he sometimes claims
to be a demon.
#v(2mm)
Therefore the first statement was also a lie,
hence the speaker does sometimes claim to be a knave, hence
he must be a demon.
]
#v(1fr)
#pagebreak()
#problem("The Sixth Day")
In this episode, Craig came across two beings, each of whom
made a statement. \
Craig could then infer that at least one of
them must be a god, but he could not tell which one. \
From neither statement alone could Craig have deduced this. \
What statements could the beings have made?
#solution[
Many solutions are possible; here is one.
#v(2mm)
Let us call the two beings A and B. \
Now, suppose A and B make the following two statements:
- A: B is a knight.
- B: A is not a knight.
A is either telling the truth or lying.
#v(2mm)
*Case 1: A is telling the truth.* \
Then B really is a knight,
hence his statement is true, hence A is not a knight, therefore A must be a god, since he is telling the truth.
#v(2mm)
*Case 2: A is lying.* \
Then B is not a knight, since A says he is. Also, since A is lying, then A is certainly not a knight, hence B's statement is true. Therefore B is telling the truth, but is not a knight, hence B is a god.
#v(2mm)
So if Case 1 is true, A is a god; if Case 2 is true, then B is a god. \
There is no way to tell whether A is telling the truth or lying.
]
#v(1fr)
#problem("The Seventh Day")
On the next day, Craig again met two beings each of whom
made a statement. Craig could then infer that one of them was
a knave and the other a demon, though he could not tell which
was which. Again, from neither statement alone could Craig
have inferred this. Can you supply two such statements?
#solution[
Again, let us call the two beings A and B. \
The following statements would work:
- A: Both of us are knaves.
- B: Both of us are demons.
It is obvious that both are lying. Since A is lying, they are
not both knaves. Since B is lying, they are not both demons.
Therefore one is a knave and one is a demon, but there is no
way to tell which one is which.
]
#v(1fr)
#problem("Introducing Thor")
On the eighth day, Craig met a being who had every ap-
pearance of being the god Thor. The being made a statement,
and Craig then knew he must be Thor.
What statement could Thor have made?
#solution[
A statement that works is: "I am either a knave or a demon
or the god Thor."
#v(2mm)
If the speaker were either a knave or a demon, then it would
be true that he is either a knave or a demon or the god Thor.
#v(2mm)
This would mean that a knave or a demon made a true statement, which is not possible. Therefore the speaker is neither a knave nor a demon, hence his statement is true.
#v(2mm)
Hence he must be the god Thor.
]
#v(1fr)
#pagebreak()
#problem("A Perplexity Resolved")
Craig and Thor became fast friends. In fact, on the evening of
the ninth day, Thor gave a magnificent banquet in Craig's
honor. "I propose a toast to our illustrious guest!" said Thor,
as he raised his glass of nectar.
#v(2mm)
After a round of cheers, Craig was asked to speak.
"I am very perplexed!" said Craig as he rose. "I wonder
if this may not all be a dream!"
"Why do you think you may be dreaming?" asked Thor.
"Because," said Craig, "two incidents have occurred today
that seem totally inexplicable. This morning I met someone
who made a statement which no knight, knave, god, or demon
could possibly make. Then this afternoon I met someone else
who also made a statement which no dweller of this region
could possibly make. That is why I suspect that I may be
dreaming. "
#v(2mm)
"Oh!" said Thor. "Be reassured; you are not dreaming.
The two incidents have a perfectly rational explanation. You
see, we have had two visitors here from another realm. Both
of them are mortal. One is Cyrus, who always tells the truth,
although he is not called a knight since he is not from this
region. The other is Alexander, who sometimes tells the truth
and sometimes lies. It must have been those two whom you
met today. What statements did they make?"
#v(2mm)
Craig then told the company what each had said.
"That explains it perfectly!" said Thor. "Moreover, it follows from their having said what they did that Cyrus was the
one you met in the morning. And interestingly enough, if you
hadn't met Alexander in the afternoon, you could never have
known whether the one you met in the morning was Cyrus
or Alexander."
#v(2mm)
Craig thought the matter over and realized that Thor was right. \
What statements could these two outsiders have made which fulfill all of the above conditions?
#solution[
Here is one possible solution:
- morning speaker: "I am neither a knight nor a god."
- afternoon speaker: "I am either a knave or a demon."
No inhabitant of the region could make either of those
statements. No knight or god could claim that he is neither a
knight nor a god; no knave or demon could make the true
statement that he is neither a knight nor a god.
#v(2mm)
As for the second statement, obviously no knight or god would claim to be either a knave or a demon and no knave or demon would admit to being a knave or a demon. Therefore both were outsiders; namely, Cyrus and Alexander.
#v(2mm)
The statement of the morning speaker was true and the statement of the afternoon speaker was false. Since Cyrus never makes false statements, he couldn't have been the afternoon speaker. Thus he was the morning speaker.
]
#v(1fr)
#pagebreak()
#problem("A Philosophical Puzzle")
The next morning, Craig was wide awake and recalling
his dream. He wondered whether he had been logically inconsistent in his sleep. "The trouble is this," thought Craig: "In my dream I believed that Thor was a god and that gods always tell the truth. Yet Thor told me that I wasn't dreaming. Now how could Thor, who tells the truth, say that I wasn't dreaming when in fact I was? Wasn't this an inconsistency on my part?"
#v(2mm)
Would you say that Craig's dream was logically inconsistent?
#solution[
As I see it, Craig's dream was not necessarily inconsistent. If Craig had actually believed in the dream that he was dreaming, then the set of his beliefs during his dream would have been inconsistent, since the following propositions are indeed logically contradictory:
- Thor is a god
- Gods make only true statements
- Thor stated that Craig was not dreaming;
- Craig was dreaming.
#v(2mm)
The contradiction is obvious. However, there is no evidence that Craig at any time of his dream believed that he was dreaming, although at one point he wondered whether he might be dreaming. Craig presumably believed that he was awake, and this belief, though false, was perfectly consistent with the other beliefs of his dream.
#v(2mm)
Curiously enough, if Craig had formulated the belief that he was dreaming, then this belief, though correct, would have created a logical inconsistency!
]

View File

@ -0,0 +1,231 @@
#import "@local/handout:0.1.0": *
= The Absentminded Logician
#problem("Only Three Words?")
We are given three brothers named John, James, and William.
John and James always lie, but William always
tells the truth. The three are indistinguishable in appearance.
You meet one of the three brothers on the street one day and
wish to find out whether he is John (because John owes you
money). You are allowed to ask him one question answerable
by yes or no, but the question may not contain more than
three words! What question would you ask?
#solution[
The only three-word question I can think of that works
is: "Are you James?" If you are addressing John, he will answer
yes, since John lies, whereas both James and William would
answer no-James because he lies, and William because he tells
the truth. So a yes answer means that he is John and a no
answer means that he is not John.
]
#v(1fr)
#problem("A Variant")
Suppose we change the above conditions by making John and
James both truthful and William a liar. Again you meet one
of the three and wish to find out if he is John. Is there now a
three-word yes/no question that can accomplish this?
#solution[
The very same question---"Are you James?"---works,
only a yes answer now indicates that he isn't John and a no
answer indicates that he is John.
]
#v(1fr)
#pagebreak()
#problem("A More Subtle Puzzle")
We now have only two brothers (identical twins). One of them
is named Arthur and the other has a different name. One of
the two always lies and the other always tells the truth, but
we are not told whether Arthur is the liar or the truth-teller.
One day you meet the two brothers together, and you wish
to find out which one is Arthur. Note that you are not inter-
ested in finding out which one lies and which one tells the
truth, but only in finding out which one is Arthur. You are
allowed to ask just one of them a question answerable by yes
or no, and again the question may not contain more than three
words. What question would you ask?
#solution[
A common wrong guess is: "Are you Arthur?" This question is quite useless here; the answer you get could be the truth
or a lie, and you would still have no idea which one is really
Arthur.
A question that works is: "Is Arthur truthful?" Arthur will
surely answer yes to this question, because if Arthur is truthful,
he will truthfully claim that Arthur is truthful, and if Arthur
is not truthful, then he will falsely claim that Arthur is truthful.
So regardless of whether Arthur is truthful or whether he lies,
he will certainly claim that Arthur is truthful.
On the other hand, Arthur's brother---call him Henry---will claim that Arthur is not truthful, because if Henry is truthful, then Arthur is really not truthful and Henry will truthfully claim that Arthur is not. And if Henry lies, then Arthur really is truthful,inwhich case Henry will falsely claim that Arthur is not truthful. So whether Henry is truthful or not, he will surely claim that Arthur is not truthful.
In summary, Arthur will claim that
Arthur is truthful and Arthur's brother will claim that Arthur
is not truthful. So if you ask one of the brothers whether Arthur is truthful, and if you get yes for an answer, you will
know that you are speaking to Arthur; if you get no for an
answer, you will know that you are speaking to Arthur's
brother.
Incidentally, there is another three-word question that
works: "Does Arthur lie?" A yes answer to that question
would indicate that you are not speaking to Arthur, and a no
answer would indicate that you are speaking to Arthur. I leave
the verification of this to the reader.
]
#v(1fr)
#pagebreak()
#problem()
Suppose that instead of wanting to find out which one is Arthur, you want to find out whether Arthur is the liar or the
truth-teller. Again there is a three-word question that will do
this. What three-word question will work? There is a pretty
symmetry between the solutions of this and the last problem!
#solution[
To find out whether Arthur is truthful, all you need to
ask is: "Are you Arthur?" Suppose you get the answer yes. If
it is a truthful answer, then the one addressed really is Arthur,
in which case Arthur is the truthful brother.
If the answer is
a lie, then the answerer is not really Arthur, in which case
Arthur must be the other one, again the truthful brother. So
regardless of whether the answer is truthful or a lie, a yes
answer indicates that Arthur-whichever one he is-must be
truthful. What if you get no for an answer?
Well, if it is a
truthful answer, then the speaker is not Arthur, but since he
is truthful, Arthur must be the brother who lies. On the other
hand, if the no answer was a lie, then the speaker really is
Arthur, in which case Arthur just told a lie. So a no answer,
whether it is the truth or a lie, indicates that Arthur is the liar.
]
#v(1fr)
#problem()
This time, all you are interested in finding out is which of the
two brothers you meet is the liar and which is the truth-teller.
You don't care which one is Arthur, or whether Arthur is the
liar or the truth-teller. What three-word question will accomplish this?
#solution[
Just ask him: "Do you exist?
]
#v(1fr)
#problem()
Next you are told to ask one of the brothers just one three-
word question. If he answers yes, you will get a prize; if he
answers no, then you get no prize. What question would you
ask?
#solution[
Just ask: "Are you truthful?" Both constant truth-tellers
and constant liars will answer yes to that question.
]
#v(1fr)
#pagebreak()
#problem("The Absentminded Logician")
A certain logician, though absolutely brilliant in theoretical
matters, was extremely unobservant and highly absent-
minded. He met two beautiful identical-twin sisters named
Teresa and Lenore. The two were indistinguishable ill ap-
pearance, but Teresa always told the truth and Lenore always
lied. The logician fell in love with one of them and married
her, but unfortunately he forgot to find out her first name!
The other sister didn't get married till a couple of years later.
Quite shortly after the wedding, the logician had to go
away for a logic conference. He returned a few days later. He
then met one of the two sisters at a cocktail party and, of
course, had no idea whether or not it was his wife. "I can find
out in only one question," he thought proudly. "I'll simply
use the Nelson Goodman principle and ask her if she is the
type who could claim that she is my wife!" Then he had an
even better idea: "I don't really have to be that elaborate and
ask such a convoluted question. Why, I can find out if she is
my wife by asking a much simpler question-in fact, one having only three words!"
The logician was right! What three-word question answerable
by yes or no should he ask to find out whether the lady he was addressing was his wife?
#solution[
We recall that his wife's sister was not married at the time.
A three-word question that works is: "Is Teresa married?"
Suppose the lady answers yes. She is either Teresa or Lenore.
Suppose she is Teresa. Then the answer is truthful, hence Teresa is really married,
and the lady addressed is married and his
wife. If she is Lenore, the answer is a lie; Teresa is not really
married, so Lenore-who is the lady addressed-is married,
hence again the lady addressed is his wife. So a yes answer
indicates that he is speaking to his wife, regardless of whether
the answer is the truth or a lie. I leave it to the reader to verify
that a no answer indicates that he is speaking to his wife's sister.
]
#v(1fr)
#problem()
A few days later the logician again met one of the two sisters
at another cocktail party. He again didn't know whether it was
his wife or his sister-in-law. "It's high time I find out once
and for all my wife's first name," he thought. "I can ask this
lady just one three-word yes/no question, and then I'll know!"
What three-word question could he ask?
#solution[
The question to ask now is: "Are you married?" Suppose
she answers yes. Again, she is either Teresa or Lenore. Suppose
she is Teresa. Then the answer is truthful, hence the lady ad-
dressed is married, and since she is Teresa, he is married to
Teresa. But ,what if the lady addressed is Lenore? Then the
answer is a lie, hence the lady addressed is not really married,
and he is married to the other lady, again Teresa. So in either
case, a yes answer indicates that his wife's name is Teresa.
I again leave it to the reader to verify that a no answer
indicates that his wife's name is Lenore.
]
#v(1fr)
#pagebreak()
#problem()
Suppose that in the last problem, the logician had wanted to
know both the identity of the lady he met and the first name
of his wife. He is again restricted to asking only one question
answerable by yes or no, but this time there is no restriction
on the number of words in the question.
Can you find a question that will work?
#solution[
No, because no such question exists!
You see, in each of the preceding problems, we were trying
to find out which of two possibilities holds, but in this problem,
we are trying to find out which ofJour possibilities holds.
(The four possibilities are that the lady addressed is Teresa,
his wife; that she is Lenore, his wife; that she is Teresa, his
sister-in-law; and that she is Lenore, his sister-in-law.)
However,
a yes/no question can elicit only two possible responses,
and with only two possible responses it is impossible to
determine which of four possibilities holds.
]
#v(1fr)

View File

@ -2,7 +2,7 @@
% use [solutions] flag to show solutions.
\documentclass[
solutions
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{tikxset}

View File

@ -22,7 +22,7 @@
label/.style = {
circle,
% For automatic red background in solutions
fill = \ORMCbgcolor,
fill = \bgcolor,
draw = none
},
%

View File

@ -3,7 +3,7 @@
\documentclass[
nosolutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -1,7 +1,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{units}
\input{src/tikzset}

View File

@ -1,24 +1,9 @@
% Copyright (C) 2023 <Mark (mark@betalupi.com)>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You may have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
%
% If you edit this, please give credit!
% Quality handouts take time to make.
% use the [nosolutions] flag to hide solutions,
% use the [solutions] flag to show solutions.
\documentclass[
solutions,
singlenumbering
]{../../../../lib/tex/ormc_handout}
]{../../../../lib/tex/handout}
\usepackage{../../../../lib/tex/macros}
\usepackage{units}
\input{tikzset}

View File

@ -462,7 +462,7 @@ Thus,
\end{equation*}
\begin{ORMCbox}{Review: Multiplying Vectors by Matrices}{black!10!white}{black!65!white}
\begin{hobox}{Review: Multiplying Vectors by Matrices}{black!10!white}{black!65!white}
\begin{equation*}
Av =
\begin{bmatrix}
@ -480,7 +480,7 @@ Thus,
\end{equation*}
Note that each element of $Av$ is the dot product of a row in $A$ and a column in $v$.
\end{ORMCbox}
\end{hobox}
\problem{}
Compute the following product:

View File

@ -154,7 +154,7 @@ The \textit{Hadamard Gate} is given by the following matrix: \par
\end{equation*}
\note{Note that we divide by $\sqrt{2}$, since $H$ must be orthonormal.}
\begin{ORMCbox}{Review: Matrix Multiplication}{black!10!white}{black!65!white}
\begin{hobox}{Review: Matrix Multiplication}{black!10!white}{black!65!white}
Matrix multiplication works as follows:
\begin{equation*}
@ -196,7 +196,7 @@ The \textit{Hadamard Gate} is given by the following matrix: \par
This is exactly the first column of the matrix product. \par
Also, note that each element of $Ac_0$ is the dot product of a row in $A$ and a column in $c_0$.
\end{ORMCbox}
\end{hobox}
\problem{}

View File

@ -13,7 +13,7 @@
line width = 0.35mm
},
qubit/.style = {
fill = \ORMCbgcolor,
fill = \bgcolor,
line width = 0.35mm
},
wire/.style = {

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{ifthen}

View File

@ -1,5 +1,6 @@
\definition{}
The \textit{integer lattice} $\mathbb{Z}^n \subset \mathbb{R}^n$ is the set of points with integer coordinates.
The \textit{integer lattice} $\mathbb{Z}^n$ is the set of points with integer coordinates in $n$ dimensions. \par
For example, $\mathbb{Z}^3$ is the set of points $(a, b, c)$ where $a$, $b$, and $c$ are integers.
\problem{}
Draw $\mathbb{Z}^2$.
@ -8,12 +9,13 @@ Draw $\mathbb{Z}^2$.
\definition{}
We say a set of vectors $\{v_1, v_2, ..., v_k\}$ \textit{generates} $\mathbb{Z}^n$ if every lattice point can be written uniquely as
We say a set of vectors $\{v_1, v_2, ..., v_k\}$ \textit{generates} $\mathbb{Z}^n$
if every lattice point can be written as
$$
a_1v_1 + a_2v_2 + ... + a_kv_k
$$
for integer coefficients $a_i$. \par
It is fairly easy to show that $k$ must be at least $n$.
\textbf{Bonus:} show that $k$ must be at least $n$.
\problem{}
Which of the following generate $\mathbb{Z}^2$?
@ -30,8 +32,7 @@ Which of the following generate $\mathbb{Z}^2$?
\vfill
\problem{}
Find a set of two vectors that generates $\mathbb{Z}^2$. \\
Don't say $\{ (0, 1), (1, 0) \}$, that's too easy.
Find a set of two vectors other than $\{ (0, 1), (1, 0) \}$ that generates $\mathbb{Z}^2$. \\
\vfill
@ -44,7 +45,8 @@ Find a set of vectors that generates $\mathbb{Z}^n$.
\pagebreak
\definition{}
A \textit{fundamental region} of a lattice is the parallelepiped spanned by a generating set. The exact shape of this region depends on the generating set we use.
Say we have a generating set of a lattice. \par
The \textit{fundamental region} of this set is the $n$-dimensional parallelogram spanned by its members. \par
\problem{}
Draw two fundamental regions of $\mathbb{Z}^2$ using two different generating sets. Verify that their volumes are the same.

View File

@ -1,6 +1,6 @@
\section{Minkowski's Theorem}
\theorem{Blichfeldt's Theorem}
\theorem{Blichfeldt's Theorem}<blich>
Let $X$ be a finite connected region. If the volume of $X$ is greater than $1$, $X$ must contain two distinct points that differ by an element of $\mathbb{Z}^n$. In other words, there exist distinct $x, y \in X$ so that $x - y \in \mathbb{Z}^n$.
\vspace{2mm}
@ -9,14 +9,22 @@ Intuitively, this means that you can translate $X$ to cover two lattice points a
\problem{}
Draw a region in $\mathbb{R}^2$ with volume greater than 1 that contains no lattice points. Find two points in that region which differ by an integer vector.
Draw a connected region in $\mathbb{R}^2$ with volume greater than 1 that contains no lattice points. Find two points in that region which differ by an integer vector.
\hint{Area is two-dimensional volume.}
\vfill
\problem{}
The following picture gives an idea for the proof of Blichfeldt's theorem in $\mathbb{Z}^2$. Explain the picture and complete the proof.
Draw a \textit{disconnected} region in $\mathbb{R}^2$ with volume greater than 1 that contains no lattice points, \par
and show that no two points in that region differ by an integer vector.
\note{In other words, show that \ref{blich} indeed requires a connected region.}
\vfill
\problem{}
The following picture gives an idea for the proof of Blichfeldt's theorem in $\mathbb{Z}^2$. \par
Explain the picture and complete the proof.
\begin{center}
\includegraphics[angle=90,width=0.5\linewidth]{proof.png}
@ -48,10 +56,8 @@ Let $X$ be a region $\in \mathbb{R}^2$ of volume $k$. How many integral points m
A region $X$ is \textit{convex} if the line segment connecting any two points in $X$ lies entirely in $X$.
\problem{}
\begin{itemize}
\item Draw a convex region in the plane.
\item Draw a region that is not convex.
\end{itemize}
Draw a convex region in two dimensions. \par
Then, draw a two-dimensional region that is \textit{not} convex.
\vfill
\pagebreak
@ -59,23 +65,28 @@ A region $X$ is \textit{convex} if the line segment connecting any two points in
\definition{}
We say a region $X$ is \textit{symmetric} if for all points $x \in X$, $-x$ is also in $X$.
We say a region $X$ is \textit{symmetric with respect to the origin} if for all points $x \in X$, $-x$ is also in $X$. \par
In the following problems, \say{\textit{symmetric}} means \say{symmetric with respect to the origin.}
\problem{}
\begin{itemize}
\item Draw a symmetric region.
\item Draw an asymmetric region.
\end{itemize}
Draw a symmetric region. \par
Then, draw an asymmetric region.
\vfill
\problem{}
Show that a convex symmetric set always contains the origin.
\vfill
\theorem{Minkowski's Theorem}<mink>
Every convex set in $\mathbb{R}^n$ that is symmetric with respect to the origin and which has a volume greater than $2^n$ contains an integral point that isn't zero.
Every convex set in $\mathbb{R}^n$ that is symmetric and has a volume \par
greater than $2^n$ contains an integral point that isn't zero.
\problem{}
Draw a few sets that satisfy \ref{mink} in $\mathbb{R}^2$. \par
What is the simplest region that has the properties listed above?
What is a simple class of regions that has the properties listed above?
\vfill

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -1,25 +1,9 @@
% Copyright (C) 2023 <Mark (mark@betalupi.com)>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You may have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
%
% If you edit this, please give credit!
% Quality handouts take time to make.
% use [nosolutions] flag to hide solutions.
% use [solutions] flag to show solutions.
\documentclass[
nosolutions,
singlenumbering,
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{units}

View File

@ -1,19 +1,3 @@
% Copyright (C) 2023 <Mark (mark@betalupi.com)>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You may have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
%
% If you edit this, please give credit!
% Quality handouts take time to make.
\section{Dual Numbers}
\definition{}

View File

@ -1,18 +1,3 @@
% Copyright (C) 2023 <Mark (mark@betalupi.com)>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You may have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
%
% If you edit this, please give credit!
% Quality handouts take time to make.
\section{Extensions of $\mathbb{R}$}
\definition{}

View File

@ -1,19 +1,3 @@
% Copyright (C) 2023 <Mark (mark@betalupi.com)>
%
% This program is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation, either version 3 of the License, or
% (at your option) any later version.
%
% You may have received a copy of the GNU General Public License
% along with this program. If not, see <https://www.gnu.org/licenses/>.
%
%
%
% If you edit this, please give credit!
% Quality handouts take time to make.
\section*{The supremum \& the infimum}
\definition{}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
%shortwarning
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\graphicspath{ {./images/} }

View File

@ -2,7 +2,7 @@
% use [solutions] flag to show solutions.
\documentclass[
solutions
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{amsmath}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{tikxset.tex}

View File

@ -24,7 +24,7 @@
label/.style = {
rectangle,
% For automatic red background in solutions
fill = \ORMCbgcolor,
fill = \bgcolor,
draw = none,
rounded corners = 0mm
},

View File

@ -4,7 +4,7 @@
solutions,
singlenumbering,
shortwarning
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\input{diagram}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
shortwarning
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{chessfss}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usepackage{units}

View File

@ -3,7 +3,7 @@
\documentclass[
solutions,
singlenumbering
]{../../../lib/tex/ormc_handout}
]{../../../lib/tex/handout}
\usepackage{../../../lib/tex/macros}
\usetikzlibrary{calc}

View File

@ -0,0 +1,26 @@
#import "@local/handout:0.1.0": *
// Resources:
//
// https://eschermath.org/wiki/Wallpaper_Patterns.html
// https://mathworld.wolfram.com/WallpaperGroups.html
// https://en.wikipedia.org/wiki/Wallpaper_group
#show: handout.with(
title: [Wallpaper Symmetry],
by: "Mark",
)
#include "parts/00 intro.typ"
#pagebreak()
#include "parts/01 reflect.typ"
#pagebreak()
#include "parts/02 rotate.typ"
#pagebreak()
#include "parts/03 problems.typ"
#pagebreak()
#include "parts/04 theorem.typ"

View File

@ -0,0 +1,7 @@
[metadata]
title = "Wallpaper Symmetries"
[publish]
handout = true
solutions = true

View File

@ -0,0 +1,151 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
= Wallpaper Symmetries
#definition()
A _Euclidean isometry_ is a transformation of the plane that preserves distances. \
Intuitively, an isometry moves objects on the plane without deforming them.
There are four classes of Euclidean isometries:
- translations
- reflections
- rotations
- glide reflections
#note([We can prove there are no others, but this is beyond the scope of this handout.]) \
A simple example of each isometry is shown below:
#let demo(c) = {
let s = 0.5
cetz.draw.line(
(0, 0),
(3 * s, 0),
(3 * s, 1 * s),
(1 * s, 1 * s),
(1 * s, 2 * s),
(0, 2 * s),
close: true,
fill: c,
stroke: black + 0mm * s,
)
}
#table(
stroke: none,
align: center,
columns: (1fr, 1fr),
rows: (3.5cm, 3.5cm),
row-gutter: 2mm,
[
#cetz.canvas({
import cetz.draw: *
demo(ored)
translate(x: -1.0, y: -1.0)
demo(oblue)
})
#v(1fr)
Translation
],
[
#cetz.canvas({
import cetz.draw: *
circle((-2, 0), radius: 0.1, stroke: none, fill: black)
arc(
(-2, 0),
radius: 1,
anchor: "origin",
start: 0deg,
stop: -30deg,
mode: "PIE",
)
demo(ored)
rotate(z: -30deg, origin: (-2, 0))
demo(oblue)
})
#v(1fr)
Rotation
],
[
#cetz.canvas({
import cetz.draw: *
line((-2, 0), (4, 0))
translate(x: 0, y: 0.25)
demo(ored)
set-transform(none)
set-transform((
(1, 0, 0, 0),
(0, 1, 0, 0),
(0, 0, 1, 0),
(0, 0, 0, 1),
))
translate(x: 0, y: 0.25)
demo(oblue)
})
#v(1fr)
Reflection
],
[
#cetz.canvas({
import cetz.draw: *
demo(ored)
set-transform((
(1, 0, 0, 0),
(0, 1, 0, 0),
(0, 0, 0, 0),
(0, 0, 0, 0),
))
translate(x: 2, y: 0)
demo(oblue)
set-transform(none)
line((-1, 0), (5, 0))
})
#v(1fr)
Glide reflection
],
)
#definition()
A _wallpaper_ is a two-dimensional pattern that...
- has translational symmetry in at least two non-parallel directions (and therefore fills the plane) \
#note[
"Translational symmetry" means that we can slide the entire wallpaper in some direction, \
eventually mapping the pattern to itself.]
- has a countable number of reflection, rotation, or glide symmetries. \
#v(1fr)
#pagebreak()
#problem()
Is a plain square grid a valid wallpaper?
#solution([
Yes!
- It has translational symmetry in the horizontal and vertical directions
- It has a countable number of symmetries---namely, six distinct mirror lines (horizontal, vertical, and diagonal) duplicated once per square.
- A square grid is #sym.convolve`442`
])
#v(1fr)
#problem()
Is the empty plane a valid wallpaper?
#solution([
No, since it has uncountably many symmetries.
])
#v(1fr)

View File

@ -0,0 +1,132 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
= Mirror Symmetry
#definition()
A _reflection_ is a transformation of the plane obtained by reflecting all points about a line. \
If this reflection maps the wallpaper to itself, we have a _mirror symmetry_. \
If $n$ such mirror lines intersect at a point, they form a _mirror node of order $n$_. \
#note[Mirror nodes with order 1 do not exist (i.e, $n >= 2$). A line does not intersect itself!]
#v(2mm)
Two mirror nodes on a wallpaper are identical if we can map one to the other with a translation and a rotation while preserving the pattern on that wallpaper.
#problem(label: "pat333")
Find all three distinct mirror nodes in the following pattern. \
What is the order of each node? \
#hint([
You may notice rotational symmetry in this pattern. \
Don't worry about that yet, we'll discuss it later.
])
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 45mm,
image("../res/wolfram/p3m1.svg", height: 100%),
)
#solution([
The mirror nodes are:
- the center of the amber cross
- the center of each right-handed group of three adjacent hexagons
- the center of each left-handed group of three adjacent hexagons
])
#v(1fr)
#definition()
_Orbifold notation_ gives us a way to describe the symmetries of a wallpaper. \
It defines a _signature_ that fully describes all the symmetries of a given pattern. \
We will introduce orbifold notation one symmetry at a time.
#definition()
In orbifold notation, mirror nodes are denoted by a #sym.convolve followed by a list of integer. \
Every integer $n$ following a #sym.convolve denotes a mirror node of order $n$.
#v(2mm)
The order of these integers doesn't matter. #sym.convolve`234` and #sym.convolve`423` are the same signature. \
However, we usually denote $n$-fold symmetries in descending order (that is, like #sym.convolve`432`). \
If we have many nodes of the same order, integers may be repeated.
#problem()
What is the signature of the wallpaper in @pat333? \
#hint[Again, ignore rotational symmetry for now.]
#solution([It is #sym.convolve`333`])
// MARK: page
#v(1fr)
#pagebreak()
#problem()
Find the signature of the following pattern.
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 60mm,
image("../res/*632-a.png", height: 100%),
)
#solution([
It is #sym.convolve`632`:
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 40mm,
image("../res/*632-b.png", height: 100%),
)
])
#v(1fr)
#problem()
Draw a wallpaper pattern with signature #sym.convolve`2222`
#solution([
Sample solutions are below.
#table(
stroke: none,
align: center,
columns: (1fr, 1fr),
rows: 50mm,
image("../res/wolfram/pmm.svg", height: 100%),
image("../res/escher/pmm.svg", height: 100%),
)
])
#v(1fr)
#pagebreak()
#remark()
In an exceptional case, we have two parallel mirror lines. \
Consider the following pattern:
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 60mm,
image("../res/**.png", height: 100%),
)
The signature of this pattern is #sym.convolve#sym.convolve
#problem()
Draw another wallpaper pattern with signature #sym.convolve#sym.convolve.
#v(1fr)

View File

@ -0,0 +1,181 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
= Rotational Symmetry
#definition()
A wallpaper may also have $n$-fold rotational symmetry about a point.
#v(2mm)
This means there are no more than $n$ rotations around that point that map the wallpaper to itself.
#v(2mm)
As before, two points of rotational symmetry are identical if we can perform a translation and rotation that maps one to the other without changing the wallpaper.
#definition()
In orbifold notation, rotation is specified similarly to reflection, but uses the prefix #sym.diamond.stroked.small. \
For example:
- #sym.diamond.stroked.small`333` denotes a pattern with three distinct centers of rotation of order 3.
- #sym.diamond.stroked.small`4`#sym.convolve`2` denotes a pattern with one rotation center of order 4 and one mirror node of order 2.
#table(
stroke: none,
align: center,
columns: (1fr, 1fr),
rows: 50mm,
image("../res/333.png", height: 100%), image("../res/3*3.png", height: 100%),
)
#problem()
Find the three rotation centers in the left wallpaper. \
What are their orders?
#solution([This is #sym.diamond.stroked.small`333`])
#v(1fr)
#problem()
Find the signature of the pattern on the right.
#solution([This is #sym.diamond.stroked.small`3`#sym.convolve`3`])
#v(1fr)
#remark()
You may have noticed that we could have an ambiguous classification, since two reflections are equivalent to a translation and a rotation.
We thus make the following distinction: _rotational symmetry that can be explained by reflection is not rotational symmetry._
#v(2mm)
In other words, when classifying a pattern...
- we first find all mirror symmetries,
- then all rotational symmetries that are not accounted for by reflection.
#pagebreak()
// MARK: glide
= Glide Reflections
#definition()
Another type of symmetry is the _glide reflection_, denoted #sym.times.
A glide reflection is the result of a translation along a line followed by reflection about that line.
For example, consider the following pattern:
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 60mm,
image("../res/*x-a.png", height: 100%),
)
#problem()
Convince yourself that all mirror lines in this pattern are _not_ distinct. /
In other words, this pattern has only one mirror symmetry.
#solution([
There may seem to be two, but they are identical. \
We can translate one onto the other.
])
#v(1fr)
#problem()
Use the following picture to find the glide reflection in the above pattern.
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 70mm,
image("../res/*x-b.png", height: 100%),
)
#v(1fr)
#remark()
The signature of this wallpaper is #sym.convolve#sym.times.
#pagebreak()
#definition()
If none of the above symmetries appear in a pattern, then we only have simple translational symmetry. We denote this with the signature #sym.circle.small.
#remark()
In summary, to find the signature of a pattern:
- find the mirror lines (#sym.convolve) and the distinct intersections;
- then find the rotation centers (#sym.diamond.stroked.small) not explained by reflection;
- then find all glide reflections (#sym.times) that do not cross a mirror line.
- If we have none of the above, our pattern must be #sym.circle.small.
#problem()
Find the signature of the following pattern:
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 50mm,
image("../res/wiki/Wallpaper_group-cm-4.jpg", height: 100%),
)
#solution([
This is #sym.convolve#sym.times.
])
#v(1fr)
#problem()
Find the signature of the following pattern:
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 60mm,
image("../res/wiki/Wallpaper_group-p4g-2.jpg", height: 100%),
)
#solution([
This is #sym.diamond.stroked.small`4`#sym.convolve`2`
])
#v(1fr)
#pagebreak()
#problem()
Find two glide reflections in the following pattern.\
#note[(and thus show that its signature is #sym.times#sym.times.)]
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 70mm,
image("../res/xx-b.png", height: 100%),
)
#solution([
#table(
stroke: none,
align: center,
columns: 1fr,
rows: 40mm,
image("../res/xx-a.png", height: 100%),
)
])
#v(1fr)

View File

@ -0,0 +1,67 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
#let pat(img, sol) = {
problem()
table(
stroke: none,
align: center,
columns: (1fr, 1fr),
rows: 80mm,
image(img, height: 100%), image(img, height: 100%),
)
solution(sol)
v(1fr)
}
= A few problems
Find the signatures of the following patterns. Mark all mirror nodes, rotation centers, and glide reflections. \
Each pattern is provided twice for convenience.
#pat("../res/wolfram/cm.svg", [#sym.times#sym.convolve])
#pat("../res/wolfram/cmm.svg", [#sym.diamond.stroked`2`#sym.convolve`22`])
#pagebreak()
#pat("../res/wolfram/p3.svg", [#sym.diamond.stroked`333`])
#pat("../res/wolfram/p3m1.svg", [#sym.convolve`333`])
#pagebreak()
#pat("../res/wolfram/p4.svg", [#sym.diamond.stroked`442`])
#pat("../res/wolfram/p4m.svg", [#sym.convolve`442`])
#pagebreak()
#pat("../res/wolfram/p6.svg", [#sym.diamond.stroked`632`])
#pat("../res/wolfram/p6m.svg", [#sym.convolve`632`])
#pagebreak()
#pat("../res/wolfram/p4g.svg", [#sym.diamond.stroked`4`#sym.convolve`2`])
#pat("../res/wolfram/p31m.svg", [#sym.diamond.stroked`3`#sym.convolve`3`])
#pagebreak()
#problem()
Draw a wallpaper with the signature #sym.convolve`442` \
#note[Make sure there are no other symmetries!]
#v(1fr)
#pagebreak()
#pat("../res/wolfram/pgg.svg", [#sym.diamond.stroked`22`#sym.times])
#pat("../res/wolfram/pmg.svg", [#sym.diamond.stroked`22`#sym.convolve])
#pagebreak()
#pat("../res/wolfram/pg.svg", [#sym.times#sym.times])
#pat("../res/wolfram/pm.svg", [#sym.convolve#sym.convolve])
#pagebreak()
#pat("../res/wolfram/p2.svg", [#sym.diamond.stroked`2222`])
#pat("../res/wolfram/pmm.svg", [#sym.convolve`2222`])
#pagebreak()
#pat("../res/wolfram/p1.svg", [#sym.circle.small])

View File

@ -0,0 +1,100 @@
#import "@local/handout:0.1.0": *
#import "@preview/cetz:0.3.1"
= The Signature-Cost Theorem
#definition()
First, we'll associate a _cost_ to each type of symmetry in orbifold notation:
#v(4mm)
#align(
center,
table(
stroke: (1pt, 1pt),
align: center,
columns: (auto, auto, auto, auto),
[*Symbol*], [*Cost*], [*Symbol*], [*Cost*],
[#sym.circle.small], [2], [#sym.times or #sym.convolve], [1],
[#sym.diamond.stroked.small`2`], [1/2], [#sym.convolve`2`], [1/4],
[#sym.diamond.stroked.small`3`], [2/3], [#sym.convolve`3`], [1/3],
[#sym.dots], [#sym.dots], [#sym.dots], [#sym.dots],
[#sym.diamond.stroked.small`n`],
[$(n-1) / n$],
[#sym.convolve`n`],
[$(n-1) / (2n)$],
),
)
We then calculate the total "cost" of a signature by adding up the costs of each component.
For example, a pattern with signature #sym.convolve`333` has cost 2:
#v(2mm)
$
2 / 3 + 2 / 3 + 2 / 3 = 2
$
#problem()
Calculate the costs of the following signatures:
- #sym.diamond.stroked.small`3`#sym.convolve`3`
- #sym.convolve#sym.convolve
- #sym.diamond.stroked.small`4`#sym.convolve`2`:
#solution([
- #sym.diamond.stroked.small`3`#sym.convolve`3`: $2/3 + 1 + 1/3 = 2$
- #sym.convolve#sym.convolve: $1 + 1 = 2$
- #sym.diamond.stroked.small`4`#sym.convolve`2`: $3/4 + 1 + 1/4 = 2$
])
#v(1fr)
#theorem(name: "Signature Cost Theorem")
The signatures of planar wallpaper patterns are exactly those with total cost 2. \
#note([We will not prove this theorem today, accept it without proof.])
#problem()
Consider the 4 symmetries (translation, reflection, rotation, and glide reflection). \
Which preserve orientation? Which reverse orientation?
#solution([
- Reflections and glide reflections reverse orientation (directions of spirals).
- Translation and rotation preserve orientation.
])
#v(1fr)
#pagebreak()
#problem()
Use the signature-cost theorem to find all the signatures consisting of only #sym.circle.small or rotational symmetries.
#solution([
#sym.diamond.stroked.small`632`, #sym.diamond.stroked.small`442`, #sym.diamond.stroked.small`333`, #sym.diamond.stroked.small`2222`, #sym.circle.small
])
#v(1fr)
#problem()
Find all the signatures consisting of only mirror symmetries.
#solution([
#sym.convolve`632`, #sym.convolve`442`, #sym.convolve`333`, #sym.convolve`2222`, #sym.convolve#sym.convolve
])
#v(1fr)
#problem()
Find all the remaining signatures. \
Each must be a mix of of mirror symmetries, rotational symmetries, or glide reflections. \
#hint([They are all shown in the problems section.])
#solution([
#sym.diamond.stroked.small`3`#sym.convolve`3`, #sym.diamond.stroked.small`4`#sym.convolve`2`,
#sym.diamond.stroked.small`22`#sym.times, #sym.diamond.stroked.small`22`#sym.convolve,
#sym.times#sym.times, #sym.times#sym.convolve
])
#v(1fr)

Binary file not shown.

After

Width:  |  Height:  |  Size: 535 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 484 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 280 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 666 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 533 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 568 KiB

View File

@ -0,0 +1,86 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20001102//EN" "http://www.w3.org/TR/2000/CR-SVG-20001102/DTD/svg-20001102.dtd">
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="10.16cm" height="5.08cm" viewBox="0 0 384 192">
<title>pmm</title>
<desc>Exported by Tess 1.70.</desc>
<clipPath id="mainclip"><rect x="0" y="0" width="384" height="192"/></clipPath>
<g style="fill-rule:evenodd; stroke-linejoin:round; stroke-linecap:round; clip-path:url(#mainclip)">
<defs>
<g id="Tess0p">
<path d="
M7.1306642022,-41.0013191628
L7.1306642022,-7.1306642022
L89.1333025278,-7.1306642022
L7.1306642022,-42.7839852134
"/></g>
<g id="Tess0" style="fill:none; stroke:none"><use xlink:href="#Tess0p"/></g>
<g id="Tess1" style="fill:none; stroke:rgb(0,0,0); stroke-width:1.7826660506"><use xlink:href="#Tess0p"/></g>
</defs>
<g transform="translate(192,96) rotate(0) scale(0.5609575611,0.5609575611)">
<g transform="translate(-405.2631578947,-100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,0)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,200)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,0)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,200)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-100)"><use xlink:href="#Tess1"/></g>
<g><use xlink:href="#Tess1"/></g>
<g transform="translate(0,100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,200)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,0)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,100)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,200)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-200) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,0) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-200) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-200) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,0) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,-200) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,-100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,0) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,100) rotate(180)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,0) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,200) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,200) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,0) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,200) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,-100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,0) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,100) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(405.2631578947,200) rotate(180) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,-200) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,-100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,0) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-405.2631578947,100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-200) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,-100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,0) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(-202.6315789474,100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-200) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,-100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(0,100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-200) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,-100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,0) scale(1,-1)"><use xlink:href="#Tess1"/></g>
<g transform="translate(202.6315789474,100) scale(1,-1)"><use xlink:href="#Tess1"/></g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 800 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 436 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 991 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 233 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 236 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 196 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 178 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 205 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 299 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 264 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 268 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 204 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 229 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 273 KiB

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 379 KiB

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