Compare commits

..

2 Commits

Author SHA1 Message Date
dfda27e56e Added "Somewhat Random Numbers"
All checks were successful
CI / Typst formatting (pull_request) Successful in 12s
CI / Typos (pull_request) Successful in 23s
CI / Build (pull_request) Successful in 10m49s
2025-01-23 19:41:31 -08:00
b9751385d1 Added if_solutions methods
All checks were successful
CI / Typst formatting (push) Successful in 9s
CI / Typos (push) Successful in 17s
CI / Build (push) Successful in 15m19s
Reviewed-on: #5
Co-authored-by: Mark <mark@betalupi.com>
Co-committed-by: Mark <mark@betalupi.com>
2025-01-23 13:08:50 -08:00
8 changed files with 100 additions and 17 deletions

View File

@ -1,3 +0,0 @@
[authors."mark"]
email = "mark@betalupi.com"
webpage = "betalupi.com"

View File

@ -137,7 +137,11 @@
} }
} }
#let notsolution(content) = { #let if_solutions(content) = {
if show_solutions { content }
}
#let if_no_solutions(content) = {
if not show_solutions { content } if not show_solutions { content }
} }

View File

@ -126,7 +126,7 @@ Fill the following tropical addition and multiplication tables
#let col = 10mm #let col = 10mm
#notsolution( #if_no_solutions(
table( table(
columns: (1fr, 1fr), columns: (1fr, 1fr),
align: center, align: center,

View File

@ -63,7 +63,7 @@ where all exponents represent repeated tropical multiplication.
Draw a graph of the tropical polynomial $f(x) = x^2 #tp 1x #tp 4$. \ Draw a graph of the tropical polynomial $f(x) = x^2 #tp 1x #tp 4$. \
#hint([$1x$ is not equal to $x$.]) #hint([$1x$ is not equal to $x$.])
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
$f(x) = min(2x , 1+x, 4)$, which looks like: $f(x) = min(2x , 1+x, 4)$, which looks like:
@ -132,7 +132,7 @@ How can we use the graph to determine these roots?
Graph $f(x) = -2x^2 #tp x #tp 8$. \ Graph $f(x) = -2x^2 #tp x #tp 8$. \
#hint([Use half scale. 1 box = 2 units.]) #hint([Use half scale. 1 box = 2 units.])
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
#graphgrid({ #graphgrid({
@ -210,7 +210,7 @@ and always produces $7$ for sufficiently large inputs.
#problem() #problem()
Graph $f(x) = 1x^2 #tp 3x #tp 5$. Graph $f(x) = 1x^2 #tp 3x #tp 5$.
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
The graphs of all three terms intersect at the same point: The graphs of all three terms intersect at the same point:
@ -261,7 +261,7 @@ How are the roots of $f$ related to its coefficients?
#problem() #problem()
Graph $f(x) = 2x^2 #tp 4x #tp 4$. Graph $f(x) = 2x^2 #tp 4x #tp 4$.
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution( #solution(
graphgrid({ graphgrid({

View File

@ -10,7 +10,7 @@ Consider the polynomial $f(x) = x^3 #tp x^2 #tp 3x #tp 6$. \
- use this graph to find the roots of $f$ - use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$. - write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
- Roots are 1, 2, and 3. - Roots are 1, 2, and 3.
@ -48,7 +48,7 @@ Consider the polynomial $f(x) = x^3 #tp x^2 #tp 6x #tp 6$. \
- use this graph to find the roots of $f$ - use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$. - write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
- Roots are 1, 2.5, and 2.5. - Roots are 1, 2.5, and 2.5.
@ -82,7 +82,7 @@ Consider the polynomial $f(x) = x^3 #tp 6x^2 #tp 6x #tp 6$. \
- use this graph to find the roots of $f$ - use this graph to find the roots of $f$
- write (and expand) a product of linear factors with the same graph as $f$. - write (and expand) a product of linear factors with the same graph as $f$.
#notsolution(graphgrid(none)) #if_no_solutions(graphgrid(none))
#solution([ #solution([
- Roots are 2, 2, and 2. - Roots are 2, 2, and 2.

View File

@ -4,8 +4,3 @@ title = "Odd Dice"
[publish] [publish]
handout = true handout = true
solutions = true solutions = true
[[attribution]]
who = "mark"
when = 2024-02-13
what = "Initial version of handout"

View File

@ -0,0 +1,81 @@
#import "@local/handout:0.1.0": *
#show: doc => handout(
doc,
quarter: link(
"https://betalupi.com/handouts",
"betalupi.com/handouts",
),
title: [Somewhat Random Numbers],
by: "Mark",
)
#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