Convert "Partition Products" to typst
This commit is contained in:
parent
dd0ccb5112
commit
df27f2d46e
@ -1,57 +0,0 @@
|
||||
\documentclass[
|
||||
solutions,
|
||||
singlenumbering,
|
||||
nopagenumber
|
||||
]{../../../lib/tex/ormc_handout}
|
||||
\usepackage{../../../lib/tex/macros}
|
||||
|
||||
|
||||
\title{Warm-Up: Partition Products}
|
||||
\uptitler{\smallurl{}}
|
||||
\subtitle{Prepared by Mark on \today.}
|
||||
|
||||
\begin{document}
|
||||
|
||||
\maketitle
|
||||
|
||||
\problem{}
|
||||
Take any positive integer $n$. \par
|
||||
Now, write it as sum of smaller positive integers: $n = a_1 + a_2 + ... + a_k$ \par
|
||||
Maximize the product $a_1 \times a_2 \times ... \times a_k$
|
||||
|
||||
|
||||
|
||||
\begin{solution}
|
||||
|
||||
\textbf{Interesting Solution:}
|
||||
|
||||
Of course, all $a_i$ should be greater than $1$. \par
|
||||
Also, all $a_i$ should be smaller than four, since $x \leq x(x-2)$ if $x \geq 4$. \par
|
||||
Thus, we're left with sequences that only contain 2 and 3. \par
|
||||
\note{Note that two twos are the same as one four, but we exclude fours for simplicity.}
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
Finally, we see that $3^2 > 2^3$, so any three twos are better repackaged as two threes. \par
|
||||
The best sequence $a_i$ thus consists of a maximal number of threes followed by 0, 1, or 2 twos.
|
||||
|
||||
\linehack{}
|
||||
|
||||
|
||||
|
||||
\textbf{Calculus Solution:}
|
||||
|
||||
First, solve this problem for equal, non-integer $a_i$:
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
We know $n = \prod{a_i}$, thus $\ln(n) = \sum{\ln(a_i)}$. \par
|
||||
If all $a_i$ are equal, we get $\ln(n) = k \times \ln(n / k)$. \par
|
||||
Derive wrt $k$ and set to zero to get $\ln(n / k) = 1$ \par
|
||||
So $k = n / e$ and $n / k = e \approx 2.7$
|
||||
|
||||
\vspace{2mm}
|
||||
|
||||
If we try to approximate this with integers, we get the same solution as above.
|
||||
\end{solution}
|
||||
\end{document}
|
41
src/Warm-Ups/Partition Products/main.typ
Normal file
41
src/Warm-Ups/Partition Products/main.typ
Normal file
@ -0,0 +1,41 @@
|
||||
#import "@local/handout:0.1.0": *
|
||||
|
||||
#show: handout.with(
|
||||
title: [Warm-Up: Partition Products],
|
||||
by: "Mark",
|
||||
)
|
||||
|
||||
#problem()
|
||||
Take any positive integer $n$. \
|
||||
Now, write it as sum of smaller positive integers: $n = a_1 + a_2 + ... a_k$ \
|
||||
Maximize the product $a_1 #sym.times a_2 #sym.times ... #sym.times a_k$
|
||||
|
||||
|
||||
#solution([
|
||||
*Interesting Solution:*
|
||||
|
||||
Of course, all $a_i$ should be greater than $1$. \
|
||||
Also, all $a_i$ should be smaller than four, since $x <= x(x-2)$ if $x >= 4$. \
|
||||
Thus, we're left with sequences that only contain 2 and 3. \
|
||||
#note([Note that two twos are the same as one four, but we exclude fours for simplicity.])
|
||||
|
||||
#v(2mm)
|
||||
|
||||
Finally, we see that $3^2 > 2^3$, so any three twos are better repackaged as two threes. \
|
||||
The best sequence $a_i$ thus consists of a maximal number of threes followed by 0, 1, or 2 twos.
|
||||
|
||||
#v(8mm)
|
||||
|
||||
*Calculus Solution:*
|
||||
|
||||
First, solve this problem for equal, real $a_i$:
|
||||
#v(2mm)
|
||||
We know $n = product(a_i)$, thus $ln(n) = sum(ln(a_i))$. \
|
||||
If all $a_i$ are equal, we get $ln(n) = k #sym.times ln(n / k)$. \
|
||||
Derive wrt $k$ and set to zero to get $ln(n / k) = 1$ \
|
||||
So $k = n / e$ and $n / k = e #sym.approx 2.7$
|
||||
|
||||
#v(2mm)
|
||||
|
||||
If we try to approximate this with integers, we get the same solution as above.
|
||||
])
|
Loading…
x
Reference in New Issue
Block a user