Compare commits

..

6 Commits

Author SHA1 Message Date
199cd8709e
Fix page dimensions
All checks were successful
CI / Typst formatting (pull_request) Successful in 11s
CI / Typos (pull_request) Successful in 18s
CI / Build (pull_request) Successful in 13m14s
2025-01-24 17:43:24 -08:00
bea6b77f8f
Refactor handout.typ 2025-01-24 17:43:19 -08:00
a7e7f090f8
Added object metadata & references 2025-01-24 17:37:40 -08:00
f691a49630
Tweak #note() 2025-01-24 17:37:40 -08:00
ca82ba6d86
Added oorange color 2025-01-24 17:37:40 -08:00
334b28ed94 Added "Somewhat Random Numbers" (#6)
All checks were successful
CI / Typst formatting (push) Successful in 8s
CI / Typos (push) Successful in 16s
CI / Build (push) Successful in 10m52s
Reviewed-on: #6
Co-authored-by: Mark <mark@betalupi.com>
Co-committed-by: Mark <mark@betalupi.com>
2025-01-23 19:53:30 -08:00
3 changed files with 110 additions and 18 deletions

View File

@ -29,8 +29,8 @@
) = {
set page(
margin: 20mm,
width: 8in,
height: 11.5in,
width: 8.5in,
height: 11in,
footer: align(
center,
context counter(page).display(),
@ -38,30 +38,28 @@
footer-descent: 5mm,
)
set par(leading: 0.55em, first-line-indent: 0mm, justify: true)
//
// Text style
set text(font: "New Computer Modern")
set par(spacing: 0.5em)
set par(
leading: 0.55em,
first-line-indent: 0mm,
justify: true,
spacing: 0.5em,
)
//
// List style
show list: set block(spacing: 0.5em, below: 1em)
set heading(numbering: (..nums) => nums.pos().at(0))
show ref: it => {
import "object.typ": ref_obj
// Custom impl for object references
let x = ref_obj(it)
if (x != none) { return x }
// Use default `ref` implementation otherwise
return it
}
set list(
tight: false,
indent: 5mm,
spacing: 3mm,
)
//
// Heading style
set heading(numbering: (..nums) => nums.pos().at(0))
show heading.where(level: 1): it => {
set align(center)
set text(weight: "bold")
@ -70,6 +68,18 @@
]
}
//
// Hack for custom references
show ref: it => {
import "object.typ": ref_obj
let x = ref_obj(it) // Custom impl for object references
if (x != none) { return x }
return it // Use default `ref` implementation otherwise
}
//
// Begin content
//

View File

@ -0,0 +1,76 @@
#import "@local/handout:0.1.0": *
#show: handout.with(
title: [Somewhat Random Numbers],
by: "Mark",
subtitle: "Based on a handout by Bryant Mathews",
)
#problem()
Alice generates 100 random numbers uniformly from $[0,1]$. \
Bob generates 101 random numbers from $[0, 1]$, but deletes the lowest result.
#v(2mm)
Say we have both of the resulting arrays, but do not know who generated each one. \
We would like to guess which of the two was generated by Bob. \
What is the optimal strategy, and what is its probability of guessing correctly?
#solution([
Looking at the mean seems like a good idea, but there's a better way: \
Assign the array with the smaller _minimum_ to Alice.
#v(3mm)
To compute the probability, generate 201 numbers. \
Assign the first 100 to Alice and the rest to Bob. \
Look at the lowest two numbers (of these 201, *before* Bob drops his lowest).
#v(8mm)
We'll use the following notation: \
`AB` means the lowest was owned by Alice, and the second-lowest, by Bob.
#v(2mm)
Probabilities are as follows: \
- `AA`: $100\/201 times 99\/200 approx 0.246$
- `AB`: $100\/201 times 101\/200 approx 0.251$
- `BA`: $101\/201 times 100\/200 approx 0.251$ // spell:disable-line
- `BB`: $101\/201 times 100\/200 approx 0.251$
#v(4mm)
Now, Bob drops his lowest number. \
We'll cross out the number he drops and box the new lowest number (i.e, the one we observe):
- #{
(
box(`A`, stroke: ored, inset: 1pt)
+ box(`A`, inset: 1pt)
+ box([: $approx 0.246$], inset: (top: 1pt, bottom: 1pt))
)
}
- #{
(
box(`A`, stroke: ored, inset: 1pt)
+ box(strike(`B`), inset: 1pt)
+ box([: $approx 0.251$], inset: (top: 1pt, bottom: 1pt))
)
}
- #{
(
box(strike(`B`), inset: 1pt)
+ box(`A`, stroke: ored, inset: 1pt)
+ box([: $approx 0.251$], inset: (top: 1pt, bottom: 1pt))
)
}
- #{
(
box(strike(`B`), inset: 1pt)
+ box(`B`, stroke: ored, inset: 1pt)
+ box([: $approx 0.251$], inset: (top: 1pt, bottom: 1pt))
)
}
#v(8mm)
Alice has the smallest number in 3 of 4 cases, which have a total probability of $approx 0.749$.
])

View File

@ -0,0 +1,6 @@
[metadata]
title = "Somewhat Random Numbers"
[publish]
handout = true
solutions = true