eecs376 / issues

Community feedback for EECS 376 notes and assignments.
0 stars 0 forks source link

Typo in Example 48 #10

Closed ajaypillay closed 1 year ago

ajaypillay commented 1 year ago

Current language

Example 48 states:

an arbitrary negative integer $i$ appears at position $2i$.

Formally, we can define a one-to-one function $f:\mathbb{Z}\to\mathbb{N}$ as follows:

$$ f(i) = \begin{cases} 2i-1 & \text{if } i > 0 \ 2i & \text{otherwise.} \end{cases} $$

Problem

The position when $i$ is non-positive should be $|2i|$ or $2(-i)$.

Proposed language

an arbitrary non-positive integer $i$ appears at position $|2i|$.

Formally, we can define a one-to-one function $f:\mathbb{Z}\to\mathbb{N}$ as follows:

$$ f(i) = \begin{cases} 2i-1 & \text{if } i > 0 \ |2i| & \text{otherwise.} \end{cases} $$

I think either $2(-i)$ or $|2i|$ work fine, though I think it's probably easier to parse if it's $|2i|$.

(credit: @606 in Piazza for W23)

amirkamil commented 1 year ago

Fixed by @cpeikert in b7e6f5c.