fmt
All checks were successful
CI / Typos (pull_request) Successful in 9s
CI / Typst formatting (pull_request) Successful in 4s
CI / Build (pull_request) Successful in 6m3s
CI / Typos (push) Successful in 10s
CI / Typst formatting (push) Successful in 4s
CI / Build (push) Successful in 7m25s
All checks were successful
CI / Typos (pull_request) Successful in 9s
CI / Typst formatting (pull_request) Successful in 4s
CI / Build (pull_request) Successful in 6m3s
CI / Typos (push) Successful in 10s
CI / Typst formatting (push) Successful in 4s
CI / Build (push) Successful in 7m25s
This commit is contained in:
@ -31,7 +31,9 @@ Rewrite the following binary decimals in base 10: \
|
||||
#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.])
|
||||
#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: *
|
||||
|
@ -131,9 +131,9 @@ $
|
||||
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 \
|
||||
& = 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
|
||||
$
|
||||
])
|
||||
|
@ -156,9 +156,9 @@ float Q_rsqrt( float number ) {
|
||||
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
|
||||
(3 times 2^22) (127 - epsilon) & = 6240089 \
|
||||
(127 - epsilon) & = 126.955 \
|
||||
epsilon & = 0.0450466
|
||||
$
|
||||
|
||||
So, $0.045$ is the $epsilon$ used by Quake. \
|
||||
|
@ -26,9 +26,9 @@ $
|
||||
|
||||
#solution([
|
||||
- Is tropical addition commutative?\
|
||||
Yes, $min(min(x,y),z) = min(x,y,z) = min(x,min(y,z))$
|
||||
Yes, $min(min(x, y), z) = min(x, y, z) = min(x, min(y, z))$
|
||||
- Is tropical addition associative? \
|
||||
Yes, $min(x,y) = min(y,x)$
|
||||
Yes, $min(x, y) = min(y, x)$
|
||||
- Is there a tropical additive identity? \
|
||||
No. There is no $n$ where $x <= n$ for all real $x$
|
||||
])
|
||||
@ -117,7 +117,7 @@ Do tropical multiplicative inverses always exist? \
|
||||
Is tropical multiplication distributive over addition? \
|
||||
#note([Does $x #tm (y #tp z) = x #tm y #tp x #tm z$?])
|
||||
|
||||
#solution([Yes, $x + min(y,z) = min(x+y, x+z)$])
|
||||
#solution([Yes, $x + min(y, z) = min(x+y, x+z)$])
|
||||
|
||||
#v(1fr)
|
||||
|
||||
@ -134,14 +134,7 @@ Fill the following tropical addition and multiplication tables
|
||||
table(
|
||||
columns: (col, col, col, col, col, col),
|
||||
align: center,
|
||||
table.header(
|
||||
[$#tp$],
|
||||
[$1$],
|
||||
[$2$],
|
||||
[$3$],
|
||||
[$4$],
|
||||
[$#sym.infinity$],
|
||||
),
|
||||
table.header([$#tp$], [$1$], [$2$], [$3$], [$4$], [$#sym.infinity$]),
|
||||
|
||||
box(inset: 3pt, $1$), [], [], [], [], [],
|
||||
box(inset: 3pt, $2$), [], [], [], [], [],
|
||||
@ -152,14 +145,7 @@ Fill the following tropical addition and multiplication tables
|
||||
table(
|
||||
columns: (col, col, col, col, col, col),
|
||||
align: center,
|
||||
table.header(
|
||||
[$#tm$],
|
||||
[$0$],
|
||||
[$1$],
|
||||
[$2$],
|
||||
[$3$],
|
||||
[$4$],
|
||||
),
|
||||
table.header([$#tm$], [$0$], [$1$], [$2$], [$3$], [$4$]),
|
||||
|
||||
box(inset: 3pt, $0$), [], [], [], [], [],
|
||||
box(inset: 3pt, $1$), [], [], [], [], [],
|
||||
@ -178,14 +164,7 @@ Fill the following tropical addition and multiplication tables
|
||||
table(
|
||||
columns: (col, col, col, col, col, col),
|
||||
align: center,
|
||||
table.header(
|
||||
[$#tp$],
|
||||
[$1$],
|
||||
[$2$],
|
||||
[$3$],
|
||||
[$4$],
|
||||
[$#sym.infinity$],
|
||||
),
|
||||
table.header([$#tp$], [$1$], [$2$], [$3$], [$4$], [$#sym.infinity$]),
|
||||
|
||||
box(inset: 3pt, $1$),
|
||||
box(inset: 3pt, $1$),
|
||||
@ -225,14 +204,7 @@ Fill the following tropical addition and multiplication tables
|
||||
table(
|
||||
columns: (col, col, col, col, col, col),
|
||||
align: center,
|
||||
table.header(
|
||||
[$#tm$],
|
||||
[$0$],
|
||||
[$1$],
|
||||
[$2$],
|
||||
[$3$],
|
||||
[$4$],
|
||||
),
|
||||
table.header([$#tm$], [$0$], [$1$], [$2$], [$3$], [$4$]),
|
||||
|
||||
box(inset: 3pt, $0$),
|
||||
box(inset: 3pt, $0$),
|
||||
@ -281,10 +253,9 @@ Adjacent parenthesis imply tropical multiplication
|
||||
|
||||
#solution([
|
||||
$
|
||||
(x #tp 2)(x #tp 3)
|
||||
&= x^2 #tp 2x #tp 3x #tp (2 #tm 3) \
|
||||
&= x^2 #tp (2 #tp 3)x #tp (2 #tm 3) \
|
||||
&= x^2 #tp 2x #tp 5
|
||||
(x #tp 2)(x #tp 3) & = x^2 #tp 2x #tp 3x #tp (2 #tm 3) \
|
||||
& = x^2 #tp (2 #tp 3)x #tp (2 #tm 3) \
|
||||
& = x^2 #tp 2x #tp 5
|
||||
$
|
||||
|
||||
Also, $f(1) = 2$ and $f(4) = 5$.
|
||||
|
@ -166,7 +166,7 @@ Find a formula for each $C_i$ in terms of $c_0, c_1, ..., c_n$.
|
||||
|
||||
#solution([
|
||||
$
|
||||
A_j & = min_(l<=j<k)( (a_l - a_k) / (k-l) (k-j) + a_k ) \
|
||||
A_j & = min_(l<=j<k)( (a_l - a_k) / (k-l) (k-j) + a_k ) \
|
||||
& = min_(l<=j<k)( a_l (k-j) / (k-l) + a_k (j-l) / (k-l) )
|
||||
$
|
||||
|
||||
|
@ -12,7 +12,9 @@ There are four classes of Euclidean isometries:
|
||||
- reflections
|
||||
- rotations
|
||||
- glide reflections
|
||||
#note([We can prove there are no others, but this is beyond the scope of this handout.]) \
|
||||
#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) = {
|
||||
|
@ -46,10 +46,10 @@ Use two half adders to construct a full adder.
|
||||
|
||||
#solution([
|
||||
$
|
||||
s_1, c_1 &= "HA"(a, b) \
|
||||
s_2, c_2 &= "HA"(s_1, c_"in") \
|
||||
s_"out" &= s_2 \
|
||||
c_"out" &= "OR"(c_1, c_2)
|
||||
s_1, c_1 & = "HA"(a, b) \
|
||||
s_2, c_2 & = "HA"(s_1, c_"in") \
|
||||
s_"out" & = s_2 \
|
||||
c_"out" & = "OR"(c_1, c_2)
|
||||
$
|
||||
|
||||
#v(2mm)
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#problem()
|
||||
Take any positive integer $n$. \
|
||||
Now, write it as sum of smaller positive integers: $n = a_1 + a_2 + ... a_k$ \
|
||||
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$
|
||||
|
||||
|
||||
@ -17,7 +17,9 @@ Maximize the product $a_1 #sym.times a_2 #sym.times ... #sym.times a_k$
|
||||
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.])
|
||||
#note(
|
||||
[Note that two twos are the same as one four, but we exclude fours for simplicity.],
|
||||
)
|
||||
|
||||
#v(2mm)
|
||||
|
||||
|
Reference in New Issue
Block a user