Move hexadecimal to radices page.

c-declarations
Joshua Potter 2024-02-21 10:51:48 -07:00
parent 886fb34762
commit 2678c94882
10 changed files with 208 additions and 23 deletions

View File

@ -90,7 +90,7 @@
"bash/quoting.md": "b1d8869a91001f8b22f0cdc54d806f61", "bash/quoting.md": "b1d8869a91001f8b22f0cdc54d806f61",
"bash/robustness.md": "7ab094b95ba2bfa885adba8e9efedf68", "bash/robustness.md": "7ab094b95ba2bfa885adba8e9efedf68",
"bash/shebang.md": "9006547710f9a079a3666169fbeda7aa", "bash/shebang.md": "9006547710f9a079a3666169fbeda7aa",
"c/escape-sequences.md": "0d6219ebb51f6f21e026de67603e25b8", "c/escape-sequences.md": "7b4bbf159908320249158acfe47a9074",
"c/index.md": "a021c92f19831bdd2bca4cbf813882fe", "c/index.md": "a021c92f19831bdd2bca4cbf813882fe",
"gawk/index.md": "dd851e023e11c556c0272a0dcb6dd55d", "gawk/index.md": "dd851e023e11c556c0272a0dcb6dd55d",
"gawk/variables.md": "73b12bd0d7d6f97b4a7285aaf2c45bfa", "gawk/variables.md": "73b12bd0d7d6f97b4a7285aaf2c45bfa",
@ -107,7 +107,7 @@
"posix/index.md": "97b1b8ecb9a953e855a9acf0ab25b8c8", "posix/index.md": "97b1b8ecb9a953e855a9acf0ab25b8c8",
"posix/signals.md": "4fe63c3c9507b2e15c9ad6f3a2b541db", "posix/signals.md": "4fe63c3c9507b2e15c9ad6f3a2b541db",
"templates/daily.md": "7866014e730e85683155207a02e367d8", "templates/daily.md": "7866014e730e85683155207a02e367d8",
"posix/regexp.md": "43825a1b9ed0dd7eeb1b6fe35c928bfe", "posix/regexp.md": "f5fb177c7356faf1bf768023c2563c54",
"journal/2024-02-04.md": "e2b5678fc53d7284b71ed6820c02b954", "journal/2024-02-04.md": "e2b5678fc53d7284b71ed6820c02b954",
"gawk/regexp.md": "d9229f1eabe1b99e965eecaa03bee86c", "gawk/regexp.md": "d9229f1eabe1b99e965eecaa03bee86c",
"_templates/daily.md": "7866014e730e85683155207a02e367d8", "_templates/daily.md": "7866014e730e85683155207a02e367d8",
@ -128,7 +128,7 @@
"algorithms/sorting/selection-sort.md": "fcd0dc2ebaabd0a4db1baf7e7ef9f7a9", "algorithms/sorting/selection-sort.md": "fcd0dc2ebaabd0a4db1baf7e7ef9f7a9",
"algorithms/index 1.md": "6fada1f3d5d3af64687719eb465a5b97", "algorithms/index 1.md": "6fada1f3d5d3af64687719eb465a5b97",
"binary/hexadecimal.md": "c3d485f1fd869fe600334ecbef7d5d70", "binary/hexadecimal.md": "c3d485f1fd869fe600334ecbef7d5d70",
"binary/index.md": "ab345e75dc01f890faa31bc26676d526", "binary/index.md": "d97bddf94227df5903a2929febf25606",
"_journal/2024-02-09.md": "a798d35f0b2bd1da130f7ac766166109", "_journal/2024-02-09.md": "a798d35f0b2bd1da130f7ac766166109",
"c/types.md": "cf3e66e5aee58a94db3fdf0783908555", "c/types.md": "cf3e66e5aee58a94db3fdf0783908555",
"logic/quantification.md": "5d7579a511e9ff683edeec62bcc291b8", "logic/quantification.md": "5d7579a511e9ff683edeec62bcc291b8",
@ -166,7 +166,7 @@
"_journal/2024-02/2024-02-14.md": "aa009f9569e175a8104b0537ebcc5520", "_journal/2024-02/2024-02-14.md": "aa009f9569e175a8104b0537ebcc5520",
"_journal/2024-02-16.md": "5cc129254afd553829be3364facd23db", "_journal/2024-02-16.md": "5cc129254afd553829be3364facd23db",
"_journal/2024-02/2024-02-15.md": "16cb7563d404cb543719b7bb5037aeed", "_journal/2024-02/2024-02-15.md": "16cb7563d404cb543719b7bb5037aeed",
"algebra/floor-ceiling.md": "456fa31bedb9ec7c2fa1d6f75db81dec", "algebra/floor-ceiling.md": "efc4502ed22128e14b20ba88b368a872",
"algebra/index.md": "90b842eb694938d87c7c68779a5cacd1", "algebra/index.md": "90b842eb694938d87c7c68779a5cacd1",
"algorithms/binary-search.md": "08cb6dc2dfb204a665d8e8333def20ca", "algorithms/binary-search.md": "08cb6dc2dfb204a665d8e8333def20ca",
"_journal/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048", "_journal/2024-02-17.md": "7c37cb10515ed3d2f5388eaf02a67048",
@ -179,11 +179,14 @@
"combinatorics/additive-principle.md": "84dcd0243263b3c53456086ae43fa00f", "combinatorics/additive-principle.md": "84dcd0243263b3c53456086ae43fa00f",
"_journal/2024-02-19.md": "30d16c5373deb9cb128d2e7934ae256a", "_journal/2024-02-19.md": "30d16c5373deb9cb128d2e7934ae256a",
"_journal/2024-02/2024-02-18.md": "67e36dbbb2cac699d4533b5a2eaeb629", "_journal/2024-02/2024-02-18.md": "67e36dbbb2cac699d4533b5a2eaeb629",
"combinatorics/permutations.md": "9351e4d5c4457c34198640cf04bdd888", "combinatorics/permutations.md": "606b4b2b8018797ca54857112235d96e",
"combinatorics/combinations.md": "2e7069e018525e10e4e2b9fb46bc8291", "combinatorics/combinations.md": "6fc179a9bf4e3958f28c4c3f7da5cda0",
"_journal/2024-02-20.md": "b85ba0eeeb16e30a602ccefabcc9763e", "_journal/2024-02-20.md": "b85ba0eeeb16e30a602ccefabcc9763e",
"_journal/2024-02/2024-02-19.md": "df1a9ab7ab89244021b3003c84640c78", "_journal/2024-02/2024-02-19.md": "df1a9ab7ab89244021b3003c84640c78",
"combinatorics/inclusion-exclusion.md": "4d5ba716bc90cd378c7c4c816b224c75" "combinatorics/inclusion-exclusion.md": "4d5ba716bc90cd378c7c4c816b224c75",
"_journal/2024-02-21.md": "d7545ab01e651e565c056ded99455286",
"_journal/2024-02/2024-02-20.md": "af2ef10727726200c4defe2eafc7d841",
"algebra/radices.md": "1171835a864103fbc4cbe21d56fcfa1f"
}, },
"fields_dict": { "fields_dict": {
"Basic": [ "Basic": [

View File

@ -0,0 +1,11 @@
---
title: "2024-02-21"
---
- [x] Anki Flashcards
- [x] KoL
- [ ] Sheet Music (10 min.)
- [ ] OGS (1 Life & Death Problem)
- [ ] Korean (Read 1 Story)
- [ ] Interview Prep (1 Practice Problem)
- [ ] Log Work Hours (Max 3 hours)

View File

@ -21,7 +21,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
What is the floor of $x$? What is the floor of $x$?
Back: The greatest integer less than $x$. Back: The greatest integer less than or equal to $x$.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779649--> <!--ID: 1708110779649-->
END%% END%%
@ -37,7 +37,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
What is the ceiling of $x$? What is the ceiling of $x$?
Back: The least integer greater than $x$. Back: The least integer greater than or equal to $x$.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779663--> <!--ID: 1708110779663-->
END%% END%%
@ -68,7 +68,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
What can be said about $x$ if $\lceil x \rceil - \lfloor x \rceil = 0$? What can be said about $x$ if $\lceil x \rceil - \lfloor x \rfloor = 0$?
Back: $x$ is even. Back: $x$ is even.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779687--> <!--ID: 1708110779687-->
@ -76,7 +76,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
What can be said about $x$ if $\lceil x \rceil - \lfloor x \rceil = 1$? What can be said about $x$ if $\lceil x \rceil - \lfloor x \rfloor = 1$?
Back: $x$ is odd. Back: $x$ is odd.
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708110779693--> <!--ID: 1708110779693-->
@ -195,7 +195,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
If `A[p..q]` has odd size, what `r` most fairly allows partitions `A[p..r]` and `A[r+1..q]`? If `A[p..q]` has odd size, what `r` most fairly allows partitions `A[p..r]` and `A[r+1..q]`?
Back: $r = \lfloor (p + q) / 2 \rfloor$ Back: $r = \lfloor (p + q) / 2 \rfloor = \lceil (p + q) / 2 \rceil$
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708114757958--> <!--ID: 1708114757958-->
END%% END%%
@ -203,7 +203,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
If `A[p..q]` has odd size, what `r` most fairly allows partitions `A[p..r-1]` and `A[r..q]`? If `A[p..q]` has odd size, what `r` most fairly allows partitions `A[p..r-1]` and `A[r..q]`?
Back: $r = \lceil (p + q) / 2 \rceil$ Back: $r = \lfloor (p + q) / 2 \rfloor = \lceil (p + q) / 2 \rceil$
Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994). Reference: Ronald L. Graham, Donald Ervin Knuth, and Oren Patashnik, *Concrete Mathematics: A Foundation for Computer Science*, 2nd ed (Reading, Mass: Addison-Wesley, 1994).
<!--ID: 1708114757961--> <!--ID: 1708114757961-->
END%% END%%

View File

@ -1,26 +1,108 @@
--- ---
title: Hexadecimal title: Radices
TARGET DECK: Obsidian::STEM TARGET DECK: Obsidian::STEM
FILE TAGS: binary::hex FILE TAGS: algebra
tags: tags:
- binary - algebra
- hexadecimal
--- ---
## Overview ## Overview
Hexadecimal encoding refers to the 16-base representation of binary numbers. Distinguish potentially ambiguous values like $32$ with the base as a subscript, e.g. $32_{10}$ vs $32_{16}$. The **radix** is the number of unique digits used to represent numbers in a positional numeral system. Most commonly used systems tend to be binary ($2$-base), octal ($8$-base), decimal ($10$-base), and [[#Hexadecimal|hexadecimal]] ($16$-base).
%%ANKI
Basic
What is the process of subtracting a larger digit from a smaller one in radix $r$?
Back: Decrement the next non-zero and add $r$ to the smaller digit in question.
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
<!--ID: 1708534662981-->
END%%
%%ANKI
Basic
What does the first step in the subtraction process of $100_2 - 10_2$ *look* like?
Back: $020_2 - 10_2$
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
<!--ID: 1708534662989-->
END%%
%%ANKI
Basic
In a positional numeral system, what does "radix" refer to?
Back: The number of unique digits used to represent numbers.
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
<!--ID: 1708534662993-->
END%%
%%ANKI
Basic
What is the radix of the decimal system?
Back: $10$
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
<!--ID: 1708534662997-->
END%%
%%ANKI
Basic
What is the radix of the octal system?
Back: $8$
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
Tags: binary
<!--ID: 1708534663001-->
END%%
%%ANKI
Basic
What is the radix of the hexadecimal system?
Back: $16$
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
Tags: binary::hex
<!--ID: 1708534663005-->
END%%
%%ANKI
Basic
What is the radix of the binary system?
Back: $2$
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
Tags: binary
<!--ID: 1708534663009-->
END%%
## Hexadecimal
Hexadecimal is a 16-base numeral system, usually represented with digits `0` to `9` and `a` to `f` or `A` to `F`.
%%ANKI
Cloze
A hexadecimal digit represents {4} bits.
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
Tags: binary::hex
<!--ID: 1708534663013-->
END%%
%%ANKI
Cloze
An octal digit represents {3} bits.
Reference: “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).
Tags: binary
<!--ID: 1708534663018-->
END%%
%%ANKI %%ANKI
Cloze Cloze
A byte consists of {2} hexadecimal digits. A byte consists of {2} hexadecimal digits.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641563--> <!--ID: 1707432641563-->
END%% END%%
%%ANKI %%ANKI
Cloze
A nibble consists of {1} hexadecimal digits. A nibble consists of {1} hexadecimal digits.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1708534663022-->
END%% END%%
%%ANKI %%ANKI
@ -28,6 +110,7 @@ Basic
Hexadecimal digits are represented by what characters? Hexadecimal digits are represented by what characters?
Back: `a` to `f`, `A` to `F`, and `0` to `9`. Back: `a` to `f`, `A` to `F`, and `0` to `9`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641565--> <!--ID: 1707432641565-->
END%% END%%
@ -36,6 +119,7 @@ Basic
How does C denote a hexadecimal numeric constant? How does C denote a hexadecimal numeric constant?
Back: With `0x` or `0X`. Back: With `0x` or `0X`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex c
<!--ID: 1707432641567--> <!--ID: 1707432641567-->
END%% END%%
@ -44,6 +128,7 @@ Basic
What is the decimal equivalent of hex `A`, `C`, and `F`? What is the decimal equivalent of hex `A`, `C`, and `F`?
Back: `10`, `12`, and `15` respectively. Back: `10`, `12`, and `15` respectively.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641568--> <!--ID: 1707432641568-->
END%% END%%
@ -52,6 +137,7 @@ Basic
What is the hexadecimal equivalent of decimal `11`, `12`, and `14`? What is the hexadecimal equivalent of decimal `11`, `12`, and `14`?
Back: `B`, `C`, and `E` respectively. Back: `B`, `C`, and `E` respectively.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641570--> <!--ID: 1707432641570-->
END%% END%%
@ -60,6 +146,7 @@ Basic
*When* should padding be introduced in binary to hexadecimal conversion? *When* should padding be introduced in binary to hexadecimal conversion?
Back: When the number of bits is not a multiple of `4`. Back: When the number of bits is not a multiple of `4`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641571--> <!--ID: 1707432641571-->
END%% END%%
@ -68,6 +155,7 @@ Basic
*Where* is padding introduced in binary to hexadecimal conversion? *Where* is padding introduced in binary to hexadecimal conversion?
Back: To the left of the binary sequence. Back: To the left of the binary sequence.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641573--> <!--ID: 1707432641573-->
END%% END%%
@ -76,6 +164,7 @@ Basic
What are the possible hex values the first digit of $2^n$ can take on? What are the possible hex values the first digit of $2^n$ can take on?
Back: `1`, `2`, `4`, and `8`. Back: `1`, `2`, `4`, and `8`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641579--> <!--ID: 1707432641579-->
END%% END%%
@ -84,6 +173,7 @@ Basic
What are the possible values in binary that the first nibble of $2^n$ can take on? What are the possible values in binary that the first nibble of $2^n$ can take on?
Back: `0001`, `0010`, `0100`, and `1000`. Back: `0001`, `0010`, `0100`, and `1000`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641580--> <!--ID: 1707432641580-->
END%% END%%
@ -92,6 +182,7 @@ Basic
How is $j$ interpreted in the hex representation of $2^{i + 4j}$? How is $j$ interpreted in the hex representation of $2^{i + 4j}$?
Back: As the number of `0`s in the encoding. Back: As the number of `0`s in the encoding.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641582--> <!--ID: 1707432641582-->
END%% END%%
@ -100,6 +191,7 @@ Basic
How is the $0$ in $2^{0 + 4j}$ translated to hex? How is the $0$ in $2^{0 + 4j}$ translated to hex?
Back: As hex digit `1`. Back: As hex digit `1`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641583--> <!--ID: 1707432641583-->
END%% END%%
@ -108,6 +200,7 @@ Basic
How is the $1$ in $2^{1 + 4j}$ translated to hex? How is the $1$ in $2^{1 + 4j}$ translated to hex?
Back: As hex digit `2`. Back: As hex digit `2`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641585--> <!--ID: 1707432641585-->
END%% END%%
@ -116,6 +209,7 @@ Basic
How is the $2$ (power) in $2^{2 + 4j}$ translated to hex? How is the $2$ (power) in $2^{2 + 4j}$ translated to hex?
Back: As hex digit `4`. Back: As hex digit `4`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641586--> <!--ID: 1707432641586-->
END%% END%%
@ -124,6 +218,7 @@ Basic
How is the $3$ in $2^{3 + 4j}$ translated to hex? How is the $3$ in $2^{3 + 4j}$ translated to hex?
Back: As hex digit `8`. Back: As hex digit `8`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641587--> <!--ID: 1707432641587-->
END%% END%%
@ -132,6 +227,7 @@ Basic
How is $n$ in $2^n$ factored to quickly write the decimal value's hex representation? How is $n$ in $2^n$ factored to quickly write the decimal value's hex representation?
Back: $n = i + 4j$ where $0 \leq i \leq 3$. Back: $n = i + 4j$ where $0 \leq i \leq 3$.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641589--> <!--ID: 1707432641589-->
END%% END%%
@ -140,6 +236,7 @@ Basic
How is the *remainder* of e.g. `158 / 16` managed in decimal to hex conversion? How is the *remainder* of e.g. `158 / 16` managed in decimal to hex conversion?
Back: As the next least significant bit of our conversion. Back: As the next least significant bit of our conversion.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641594--> <!--ID: 1707432641594-->
END%% END%%
@ -148,6 +245,7 @@ Basic
How is the *quotient* of e.g. `158 / 16` managed in decimal to hex conversion? How is the *quotient* of e.g. `158 / 16` managed in decimal to hex conversion?
Back: As the next value to divide by `16`. Back: As the next value to divide by `16`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641595--> <!--ID: 1707432641595-->
END%% END%%
@ -156,6 +254,7 @@ Basic
When does repeated division in decimal to hex conversion end? When does repeated division in decimal to hex conversion end?
Back: When the quotient (*not* the remainder) is `0`. Back: When the quotient (*not* the remainder) is `0`.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707919792632--> <!--ID: 1707919792632-->
END%% END%%
@ -164,9 +263,11 @@ Basic
How is e.g. `0xAC32` expressed as a sum of decimal values? How is e.g. `0xAC32` expressed as a sum of decimal values?
Back: $(16^3 \times 10) + (16^2 \times 12) + (16^1 \times 3) + (16^0 \times 2)$ Back: $(16^3 \times 10) + (16^2 \times 12) + (16^1 \times 3) + (16^0 \times 2)$
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: binary::hex
<!--ID: 1707432641596--> <!--ID: 1707432641596-->
END%% END%%
## References ## References
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. * Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
* “Radix,” in *Wikipedia*, August 6, 2023, [https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173](https://en.wikipedia.org/w/index.php?title=Radix&oldid=1169046173).

View File

@ -8,7 +8,7 @@ tags:
## Overview ## Overview
A binary digit or **bit** is a `0` or `1` character. A **bit string** is then a contiguous sequence of bits. It's **weight** is a reference to the number of `1`s in the bit string. Compare the below operation to the method for converting from one numerical base to another (e.g. [[hexadecimal]]). A binary digit or **bit** is a `0` or `1` character. A **bit string** is then a contiguous sequence of bits. It's **weight** is a reference to the number of `1`s in the bit string. Compare the below operation to the method for converting from one numerical base to another (e.g. [[radices#Hexadecimal|hexadecimal]]).
```c ```c
unsigned int bit_weight(int64_t n) { unsigned int bit_weight(int64_t n) {

View File

@ -49,7 +49,7 @@ Tags: bash
<!--ID: 1706975891817--> <!--ID: 1706975891817-->
END%% END%%
* `\xhh`: Consists of one or more hexadecimal digits. The `x` prefix is required to distinguish from octal escape sequences. * `\xhh`: Consists of one or more [[radices#Hexadecimal|hexadecimal]] digits. The `x` prefix is required to distinguish from octal escape sequences.
* [[bash/index|Bash]] supports this sequence as `$'\xhh'`. One or two digits is supported. * [[bash/index|Bash]] supports this sequence as `$'\xhh'`. One or two digits is supported.
* [[gawk/index|gawk]] limits processing to two digits. * [[gawk/index|gawk]] limits processing to two digits.
* Robbins states that using more than two hexadecimal digits can produce undefined results. * Robbins states that using more than two hexadecimal digits can produce undefined results.

View File

@ -90,12 +90,20 @@ END%%
%%ANKI %%ANKI
Basic Basic
How is the closed formula of $\binom{n}{k}$ written in terms of factorials (*not* falling factorials)? Without using falling factorials, what is the closed formula of $\binom{n}{k}$?
Back: $$\binom{n}{k} = \frac{n!}{k!(n - k)!}$$ Back: $$\binom{n}{k} = \frac{n!}{k!(n - k)!}$$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708368078700--> <!--ID: 1708368078700-->
END%% END%%
%%ANKI
Basic
Using falling factorials, what is the closed formula of $\binom{n}{k}$?
Back: $$\binom{n}{k} = \frac{(n)_k}{k!}$$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069694-->
END%%
%%ANKI %%ANKI
Basic Basic
How do $k$-permutations of $n$ objects relate to $k$-combinations? How do $k$-permutations of $n$ objects relate to $k$-combinations?
@ -354,6 +362,68 @@ Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n
<!--ID: 1708434662166--> <!--ID: 1708434662166-->
END%% END%%
### Stars and Bars
The **stars and bars** chart refers to a graphical depiction of distributing $n$ objects (represented as $*$) into $m$ different buckets (delineated via $|$. An example chart looks like so: $$**|***|*||*$$
Notice there are $m - 1$ bars and interspersed amongst the $n$ stars. In the above example, there are $11$ total symbols, $4$ of which are bars, meaning there are $\binom{11}{4}$ ways to distribute the objects amongst the $5$ buckets. We can represent this using bit strings instead, with `0`s as stars and `1`s as bars. The above example is equivalently written as: $$00100010110$$
%%ANKI
Basic
What symbols are typically used in a stars and bars chart?
Back: $*$ and $|$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069700-->
END%%
%%ANKI
Basic
What property is exhibited by objects distributed in a stars and bars chart?
Back: They are identical to one another.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069704-->
END%%
%%ANKI
Basic
What kind of chart is the following an example of? $$**|***|*||*$$
Back: Stars and bars
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069707-->
END%%
%%ANKI
Basic
How is the following stars and bars chart written as a bit string? $$**|***|*||*$$
Back: $00100010110$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069711-->
END%%
%%ANKI
Basic
The following stars and bars chart is a single instance of how many possible choices? $$**|***|*||*$$
Back: $\binom{11}{4}$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069714-->
END%%
%%ANKI
Basic
What graphical depiction is used to find the number of integer solutions to the following equation? $$x_1 + x_2 + \cdots + x_k = n$$
Back: Stars and bars
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069717-->
END%%
%%ANKI
Basic
What *is* the distribution corresponding to the following stars and bars chart? $$*||*$$
Back: A single object in the first and last bucket. No object in the middle.
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708532069719-->
END%%
## Lattice Paths ## Lattice Paths
A **lattice path** is one of the shorted possible paths connecting two points on a lattice, moving only horizontally and vertically. By representing each horizontal move by `1` and each vertical move by `1`, we see every lattice path has a corresponding [[#Bit Strings|bit string]]. A **lattice path** is one of the shorted possible paths connecting two points on a lattice, moving only horizontally and vertically. By representing each horizontal move by `1` and each vertical move by `1`, we see every lattice path has a corresponding [[#Bit Strings|bit string]].

View File

@ -188,7 +188,7 @@ END%%
%%ANKI %%ANKI
Basic Basic
What is the closed formula for $(n)_k$ (falling factorial)? What is the closed formula for falling factorial $(n)_k$?
Back: $$(n)_k = \frac{n!}{(n - k)!}$$ Back: $$(n)_k = \frac{n!}{(n - k)!}$$
Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf). Reference: Oscar Levin, *Discrete Mathematics: An Open Introduction*, 3rd ed., n.d., [https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf](https://discrete.openmathbooks.org/pdfs/dmoi3-tablet.pdf).
<!--ID: 1708366788619--> <!--ID: 1708366788619-->

View File

@ -294,7 +294,7 @@ Class | Similar To | Meaning
`[:punct:]` | | All graphic characters except letters and digits `[:punct:]` | | All graphic characters except letters and digits
`[:space:]` | `[ \t\n\r\f\v]` | Whitespace characters `[:space:]` | `[ \t\n\r\f\v]` | Whitespace characters
`[:upper:]` | `[A-Z]` | Uppercase alphabetic characters `[:upper:]` | `[A-Z]` | Uppercase alphabetic characters
`[:xdigit:]` | `[0-9A-Fa-f]` | Hexadecimal digits `[:xdigit:]` | `[0-9A-Fa-f]` | [[radices#Hexadecimal\|Hexadecimal]] digits
%%ANKI %%ANKI
Basic Basic