Convert "Odd Dice" to typst
This commit is contained in:
parent
28dd6c67bb
commit
dfddfb5137
@ -1,132 +0,0 @@
|
|||||||
\documentclass[
|
|
||||||
nosolutions,
|
|
||||||
hidewarning,
|
|
||||||
singlenumbering,
|
|
||||||
nopagenumber
|
|
||||||
]{../../../lib/tex/ormc_handout}
|
|
||||||
\usepackage{../../../lib/tex/macros}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
\usepackage{tikz}
|
|
||||||
\usetikzlibrary{arrows.meta}
|
|
||||||
\usetikzlibrary{shapes.geometric}
|
|
||||||
|
|
||||||
% We put nodes in a separate layer, so we can
|
|
||||||
% slightly overlap with paths for a perfect fit
|
|
||||||
\pgfdeclarelayer{nodes}
|
|
||||||
\pgfdeclarelayer{path}
|
|
||||||
\pgfsetlayers{main,nodes}
|
|
||||||
|
|
||||||
% Layer settings
|
|
||||||
\tikzset{
|
|
||||||
% Layer hack, lets us write
|
|
||||||
% later = * in scopes.
|
|
||||||
layer/.style = {
|
|
||||||
execute at begin scope={\pgfonlayer{#1}},
|
|
||||||
execute at end scope={\endpgfonlayer}
|
|
||||||
},
|
|
||||||
%
|
|
||||||
% Arrowhead tweak
|
|
||||||
>={Latex[ width=2mm, length=2mm ]},
|
|
||||||
%
|
|
||||||
% Nodes
|
|
||||||
main/.style = {
|
|
||||||
draw,
|
|
||||||
circle,
|
|
||||||
fill = white,
|
|
||||||
line width = 0.35mm
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
\title{Warm Up: Odd Dice}
|
|
||||||
\uptitler{\smallurl{}}
|
|
||||||
\subtitle{Prepared by Mark on \today}
|
|
||||||
|
|
||||||
|
|
||||||
\begin{document}
|
|
||||||
|
|
||||||
\maketitle
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
|
|
||||||
We say a set of dice $\{A, B, C\}$ is \textit{nontransitive}
|
|
||||||
if, on average, $A$ beats $B$, $B$ beats $C$, and $C$ beats $A$.
|
|
||||||
In other words, we get a counterintuitive \say{rock - paper - scissors} effect.
|
|
||||||
|
|
||||||
\vspace{2mm}
|
|
||||||
|
|
||||||
Create a set of nontransitive six-sided dice. \par
|
|
||||||
\hint{All sides should be numbered with positive integers less than 10.}
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
One possible set can be numbered as follows:
|
|
||||||
\begin{itemize}
|
|
||||||
\item Die $A$: $2, 2, 4, 4, 9, 9$
|
|
||||||
\item Die $B$: $1, 1, 6, 6, 8, 8$
|
|
||||||
\item Die $C$: $3, 3, 5, 5, 7, 7$
|
|
||||||
\end{itemize}
|
|
||||||
|
|
||||||
\vspace{4mm}
|
|
||||||
|
|
||||||
Another solution is below:
|
|
||||||
\begin{itemize}
|
|
||||||
\item Die $A$: $3, 3, 3, 3, 3, 6$
|
|
||||||
\item Die $B$: $2, 2, 2, 5, 5, 5$
|
|
||||||
\item Die $C$: $1, 4, 4, 4, 4, 4$
|
|
||||||
\end{itemize}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
\problem{}
|
|
||||||
Now, consider the set of six-sided dice below:
|
|
||||||
\begin{itemize}
|
|
||||||
\item Die $A$: $4, 4, 4, 4, 4, 9$
|
|
||||||
\item Die $B$: $3, 3, 3, 3, 8, 8$
|
|
||||||
\item Die $C$: $2, 2, 2, 7, 7, 7$
|
|
||||||
\item Die $D$: $1, 1, 6, 6, 6, 6$
|
|
||||||
\item Die $E$: $0, 5, 5, 5, 5, 5$
|
|
||||||
\end{itemize}
|
|
||||||
On average, which die beats each of the others? Draw a graph. \par
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
\begin{center}
|
|
||||||
\begin{tikzpicture}[scale = 0.5]
|
|
||||||
\begin{scope}[layer = nodes]
|
|
||||||
\node[main] (a) at (-2, 0.2) {$a$};
|
|
||||||
\node[main] (b) at (0, 2) {$b$};
|
|
||||||
\node[main] (c) at (2, 0.2) {$c$};
|
|
||||||
\node[main] (d) at (1, -2) {$d$};
|
|
||||||
\node[main] (e) at (-1, -2) {$e$};
|
|
||||||
\end{scope}
|
|
||||||
|
|
||||||
\draw[->]
|
|
||||||
(a) edge (b)
|
|
||||||
(b) edge (c)
|
|
||||||
(c) edge (d)
|
|
||||||
(d) edge (e)
|
|
||||||
(e) edge (a)
|
|
||||||
|
|
||||||
(a) edge (c)
|
|
||||||
(b) edge (d)
|
|
||||||
(c) edge (e)
|
|
||||||
(d) edge (a)
|
|
||||||
(e) edge (b)
|
|
||||||
;
|
|
||||||
\end{tikzpicture}
|
|
||||||
\end{center}
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
|
|
||||||
Now, say we roll each die twice. What happens to the graph above?
|
|
||||||
|
|
||||||
\begin{solution}
|
|
||||||
The direction of each edge is reversed!
|
|
||||||
\end{solution}
|
|
||||||
|
|
||||||
\vfill
|
|
||||||
\pagebreak
|
|
||||||
|
|
||||||
\end{document}
|
|
117
src/Warm-Ups/Odd Dice/main.typ
Normal file
117
src/Warm-Ups/Odd Dice/main.typ
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
#import "@local/handout:0.1.0": *
|
||||||
|
#import "@preview/cetz:0.3.1"
|
||||||
|
|
||||||
|
|
||||||
|
#show: doc => handout(
|
||||||
|
doc,
|
||||||
|
quarter: link(
|
||||||
|
"https://betalupi.com/handouts",
|
||||||
|
"betalupi.com/handouts",
|
||||||
|
),
|
||||||
|
|
||||||
|
title: [Warm-Up: Odd Dice],
|
||||||
|
by: "Mark",
|
||||||
|
)
|
||||||
|
|
||||||
|
#problem()
|
||||||
|
We say a set of dice ${A, B, C}$ is _nontransitive_
|
||||||
|
if, on average, $A$ beats $B$, $B$ beats $C$, and $C$ beats $A$.
|
||||||
|
In other words, we get a counterintuitive "rock - paper - scissors" effect.
|
||||||
|
|
||||||
|
#v(2mm)
|
||||||
|
|
||||||
|
Create a set of nontransitive six-sided dice. \
|
||||||
|
#hint([All sides should be numbered with positive integers less than 10.])
|
||||||
|
|
||||||
|
#solution([
|
||||||
|
One possible set can be numbered as follows:
|
||||||
|
- Die $A$: $2, 2, 4, 4, 9, 9$
|
||||||
|
- Die $B$: $1, 1, 6, 6, 8, 8$
|
||||||
|
- Die $C$: $3, 3, 5, 5, 7, 7$
|
||||||
|
|
||||||
|
#v(2mm)
|
||||||
|
|
||||||
|
Another solution is below:
|
||||||
|
- Die $A$: $3, 3, 3, 3, 3, 6$
|
||||||
|
- Die $B$: $2, 2, 2, 5, 5, 5$
|
||||||
|
- Die $C$: $1, 4, 4, 4, 4, 4$
|
||||||
|
|
||||||
|
])
|
||||||
|
|
||||||
|
#v(1fr)
|
||||||
|
|
||||||
|
#problem()
|
||||||
|
Now, consider the set of six-sided dice below:
|
||||||
|
- Die $A$: $4, 4, 4, 4, 4, 9$
|
||||||
|
- Die $B$: $3, 3, 3, 3, 8, 8$
|
||||||
|
- Die $C$: $2, 2, 2, 7, 7, 7$
|
||||||
|
- Die $D$: $1, 1, 6, 6, 6, 6$
|
||||||
|
- Die $E$: $0, 5, 5, 5, 5, 5$
|
||||||
|
On average, which die beats each of the others? Draw a diagram.
|
||||||
|
|
||||||
|
#solution(
|
||||||
|
align(
|
||||||
|
center,
|
||||||
|
cetz.canvas({
|
||||||
|
import cetz.draw: *
|
||||||
|
|
||||||
|
let s = 0.8 // Scale
|
||||||
|
let t = 13pt * s // text size
|
||||||
|
let radius = 0.3 * s
|
||||||
|
|
||||||
|
// Points
|
||||||
|
let a = (-2 * s, 0.2 * s)
|
||||||
|
let b = (0 * s, 2 * s)
|
||||||
|
let c = (2 * s, 0.2 * s)
|
||||||
|
let d = (1.2 * s, -2.1 * s)
|
||||||
|
let e = (-1.2 * s, -2.1 * s)
|
||||||
|
|
||||||
|
set-style(
|
||||||
|
stroke: (thickness: 0.6mm * s),
|
||||||
|
mark: (
|
||||||
|
end: (
|
||||||
|
symbol: ">",
|
||||||
|
fill: black,
|
||||||
|
offset: radius + (0.025 * s),
|
||||||
|
width: 1.2mm * s,
|
||||||
|
length: 1.2mm * s,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
line(a, b)
|
||||||
|
line(b, c)
|
||||||
|
line(c, d)
|
||||||
|
line(d, e)
|
||||||
|
line(e, a)
|
||||||
|
line(a, c)
|
||||||
|
line(b, d)
|
||||||
|
line(c, e)
|
||||||
|
line(d, a)
|
||||||
|
line(e, b)
|
||||||
|
|
||||||
|
circle(a, radius: radius, fill: oblue, stroke: none)
|
||||||
|
circle(b, radius: radius, fill: oblue, stroke: none)
|
||||||
|
circle(c, radius: radius, fill: oblue, stroke: none)
|
||||||
|
circle(d, radius: radius, fill: oblue, stroke: none)
|
||||||
|
circle(e, radius: radius, fill: oblue, stroke: none)
|
||||||
|
|
||||||
|
content(a, text(fill: white, size: t, [*A*]))
|
||||||
|
content(b, text(fill: white, size: t, [*B*]))
|
||||||
|
content(c, text(fill: white, size: t, [*C*]))
|
||||||
|
content(d, text(fill: white, size: t, [*D*]))
|
||||||
|
content(e, text(fill: white, size: t, [*E*]))
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
#v(1fr)
|
||||||
|
|
||||||
|
#problem()
|
||||||
|
Now, say we roll each die twice. What happens to the graph from the previous problem?
|
||||||
|
|
||||||
|
#solution([
|
||||||
|
The direction of each edge is reversed!
|
||||||
|
])
|
||||||
|
|
||||||
|
#v(1fr)
|
Loading…
x
Reference in New Issue
Block a user