Graph transformations and C bit-fields.

main
Joshua Potter 2024-12-19 20:26:57 -07:00
parent d10dc3d24b
commit 5bb40f0018
14 changed files with 1358 additions and 60 deletions

View File

@ -350,7 +350,7 @@
"_journal/2024-02-23.md": "219ce9ad15a8733edd476c97628b71fd",
"_journal/2024-02/2024-02-22.md": "312e55d57868026f6e80f7989a889c2b",
"c17/strings.md": "b021b6f18f865aa89b3088907cdaae94",
"c17/index.md": "4b5a563b8079ea6afb9c57648a2b0124",
"c17/index.md": "78e0ebc5a91d58b297b25346a654d398",
"c17/escape-sequences.md": "a8b99070336878b4e8c11e9e4525a500",
"c17/declarations.md": "9dbaea14e28d00704cfd0b027efe8c97",
"algorithms/sorting/merge-sort.md": "6506483f7df6507cee0407bd205dbedd",
@ -413,7 +413,7 @@
"_journal/2024-03/2024-03-15.md": "e54b2513beac5f46313b4c37622adf39",
"_journal/2024-03-17.md": "72e99c7630085aee2c7f340a06b5ada7",
"_journal/2024-03/2024-03-16.md": "ab7629c24ebe70838072cf6acec47cb0",
"encoding/floating-point.md": "23219ba579de6bb7ccf0cccc2329e183",
"encoding/floating-point.md": "d19e3f992bf2e073d2049fb0973c89bd",
"_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f",
"_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b",
"set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53",
@ -878,7 +878,7 @@
"_journal/2024-09/2024-09-26.md": "2d3e8325e7ab63168c460f18e7aa1afc",
"_journal/2024-09-28.md": "7726baed125a2561def07dcaf48bf5a0",
"_journal/2024-09/2024-09-27.md": "d788fa04c029009f42387317c549d93e",
"encoding/binary.md": "0b9beb6913906aa2523d8ab193c67f67",
"encoding/binary.md": "a7cf4467f1edc6a27869b958cf9f1dba",
"_journal/2024-09-29.md": "232733c9ad7ebd89e8834cd61e1536d7",
"_journal/2024-09/2024-09-28.md": "1b47792313acf09b1ae768d5918df703",
"_journal/2024-10-01.md": "2547ea281e11e2bc728d2b21787f1270",
@ -935,7 +935,7 @@
"_journal/2024-10/2024-10-31.md": "8c5e70f566953974f252da9472e527f0",
"_journal/2024-10/2024-10-30.md": "054bdbf52843fa2445f6b9f91d5ca46e",
"_journal/2024-10/2024-10-29.md": "432b3b073dafd54421ff6f7182ab9a58",
"c17/alignment.md": "94c20731411dc244c13bc00bbf924589",
"c17/alignment.md": "bda6444de141aeb8072d3ef2971c4d30",
"_journal/2024-11-05.md": "6a599e6bc9dcd12a0940956285ae4d00",
"_journal/2024-11-06.md": "c91de8a099cfee2514e1054400996e76",
"_journal/2024-11/2024-11-05.md": "79a1304037e18fefa135d576db040784",
@ -946,7 +946,7 @@
"_journal/2024-11/2024-11-08.md": "806bbade5f8339579287687f9433334e",
"_journal/2024-11/2024-11-07.md": "434ec3f15d7065ea740127aa8477dd17",
"x86-64/directives.md": "019c1c1d04efb26c3e8758aac4543cc7",
"geometry/cartesian.md": "1977d6fd05109456cf1824822b836b02",
"geometry/cartesian.md": "71dd4816e1ead4db46b8189e7d275f34",
"geometry/index.md": "cac68c1b624dbb0552e56cce47bcc21d",
"_journal/2024-11-10.md": "5478337fd2017b99d0b359713a511e66",
"_journal/2024-11/2024-11-09.md": "46f3a640223ef533f4523837b67b57c3",
@ -966,7 +966,7 @@
"_journal/2024-11/2024-11-21.md": "951b6034d60a40dbd8201c50abf0dbb9",
"_journal/2024-11/2024-11-20.md": "951b6034d60a40dbd8201c50abf0dbb9",
"_journal/2024-11/2024-11-19.md": "d879f57154cb27cb168eb1f1f430e312",
"set/cardinality.md": "9609eca0fe79de40e43d56cd0ef45985",
"set/cardinality.md": "b396048272652dcf49c875e723377ff4",
"geometry/area.md": "7f947bb5ac782495a1fb4a63bb2463e7",
"_journal/2024-11-23.md": "911f82ab8aede5ecdb96493aef64b0b9",
"_journal/2024-11/2024-11-22.md": "51117030e2364dbce3a8d507dead86ae",
@ -999,7 +999,7 @@
"_journal/2024-12/2024-12-04.md": "965f6619edf1002d960203e3e12a413b",
"_journal/2024-12-06.md": "d75323d0fec57f4fc1f13cb4370df18d",
"_journal/2024-12/2024-12-05.md": "4f3b1e7a43e01cc97b0eed6fbc6c1f96",
"calculus/integrals.md": "a7ef5031ca474cd9d37c1aea85e96237",
"calculus/integrals.md": "e8d36a8fae9cd785374f419996ef5269",
"_journal/2024-12-07.md": "bfb6c4db0acbacba19f03a04ec29fa5c",
"_journal/2024-12/2024-12-06.md": "d73b611d2d15827186a0252d9b9a6580",
"_journal/2024-12-08.md": "5662897539b222db1af45dcd217f0796",
@ -1017,17 +1017,23 @@
"_journal/2024-12/2024-12-11.md": "e7393c01b44c5b804f86f45b8b899b59",
"encoding/uri.md": "394abe477b882e1414dd2fb151fea823",
"encoding/xml.md": "5b345c09ac60821f88ed5b592e411df6",
"encoding/rdf.md": "b32d6c0a2249794da89d9c7fb7ca325e",
"encoding/rdf.md": "f5c2c0156046a9474bae3577e739c5ce",
"_journal/2024-12-15.md": "be66c8808d8bb66d4e7b91db7c93c94a",
"_journal/2024-12/2024-12-14.md": "d2223f90fd1ce3d82a4fbb6828a1ec56",
"_journal/2024-12/2024-12-13.md": "d2223f90fd1ce3d82a4fbb6828a1ec56",
"_journal/2024-12/2024-12-12.md": "59e71caa4e9ebdb11a7c7549c33bed20",
"linkers/object-files.md": "77767f310330b8650a5023dd0522226c",
"_journal/2024-12-16.md": "6c03d49c05eb47486aae48aa40dcef9f",
"_journal/2024-12-16.md": "d867a62a955f3d080ae25f31464d53c4",
"_journal/2024-12/2024-12-15.md": "be66c8808d8bb66d4e7b91db7c93c94a",
"linkers/elf.md": "83a27a7d71ca26f8f034770a31d58fa0",
"linkers/elf.md": "64262b8ec7d85bab4bd32a238beac638",
"c17/strings/printf.md": "8b67cfbccaf35dd9488b73e7e5555405",
"c17/strings/index.md": "3fa6f42967f3cc786740bb8537c62682"
"c17/strings/index.md": "3fa6f42967f3cc786740bb8537c62682",
"_journal/2024-12-17.md": "ae55db66c9835876c4a0343ac0806951",
"_journal/2024-12/2024-12-16.md": "03fe3263baca3bba63a9129595733d5f",
"_journal/2024-12-18.md": "9cf32faceb4d52bf2303e8dcce7bda20",
"_journal/2024-12/2024-12-17.md": "afea61b79ad8dcb02a99e385dce1bbc2",
"_journal/2024-12-19.md": "0064c8a827222092a55b3d896033b84b",
"_journal/2024-12/2024-12-18.md": "06f32ecf5bc088c6db98476fadfd0b5c"
},
"fields_dict": {
"Basic": [

View File

@ -0,0 +1,12 @@
---
title: "2024-12-19"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Additional flashcards on scaling and shifting.
* Notes on C [[alignment#Bit-Fields|bit-fields]].

View File

@ -2,7 +2,7 @@
title: "2024-12-16"
---
- [ ] Anki Flashcards
- [x] Anki Flashcards
- [x] KoL
- [ ] OGS
- [ ] Sheet Music (10 min.)
@ -10,3 +10,4 @@ title: "2024-12-16"
* Notes on sections found within an [[elf|ELF]] file.
* Additional examples on cardinal numbers and their relation to the recursion theorem.
* Reification in the context of RDF.

View File

@ -0,0 +1,11 @@
---
title: "2024-12-17"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* More notes on [[elf#Relocatable Object Files|relocatable object files]].

View File

@ -0,0 +1,11 @@
---
title: "2024-12-18"
---
- [x] Anki Flashcards
- [x] KoL
- [x] OGS
- [ ] Sheet Music (10 min.)
- [ ] Korean (Read 1 Story)
* Identities regarding cardinal numbers.

View File

@ -468,7 +468,482 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1731165663242-->
END%%
## Bit-Fields
A member of a structure or union may be declared to consist of a specified number of bits (including a sign bit, if any). Such a member is called a **bit-field**; its width is preceded by a colon. Its width must be an ICE with a nonnegative value that does not exceed the width of an object of the type that would be specified were the colon and expression omitted.
A bit-field shall have a type is a qualified or unqualified version of `_Bool`, `signed int`, `unsigned int`, or some other implementation-defined type.
%%ANKI
Basic
A bit-field can be declared as members of what?
Back: `struct`s or `union`s.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614053-->
END%%
%%ANKI
Basic
How is a bit-field declared?
Back: As a member of a `struct` or `union` with width preceded by a colon.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614057-->
END%%
%%ANKI
Basic
What *kind* of expression must the width of a bit-field be?
Back: An ICE.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614060-->
END%%
%%ANKI
Basic
What non-implementation-defined types can a bit-field be declared with?
Back: `_Bool`, `signed int`, or `unsigned int`.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614063-->
END%%
%%ANKI
Basic
What types can a bit-field be declared with?
Back: `_Bool`, `signed int`, `unsigned int`, or some other implementation-defined type.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614068-->
END%%
%%ANKI
Basic
What is the sign of the following bit-field?
```c
struct foo { int bar : 1; };
```
Back: N/A. This is implementation-defined.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614071-->
END%%
%%ANKI
Basic
What is the sign of the following bit-field?
```c
struct foo { signed bar : 1; };
```
Back: Signed.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614075-->
END%%
%%ANKI
Basic
What is the sign of the following bit-field?
```c
struct foo { unsigned bar : 1; };
```
Back: Unsigned.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614079-->
END%%
%%ANKI
Basic
Which unary operator cannot be applied to a bit-field object?
Back: `&`
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614084-->
END%%
%%ANKI
Basic
What compilation error exists in the following translation unit?
```c
#include <stdio.h>
struct foo { int a; int b : 4; };
int main(void) {
struct foo bar = { .a = 1, .b = 1 };
printf("%p\n", (void *)&bar.b);
}
```
Back: Cannot take the address-of a bit-field.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614089-->
END%%
%%ANKI
Basic
What compilation error exists in the following translation unit?
```c
#include <stdio.h>
struct foo { int a; int b : 4; };
int main(void) {
struct foo bar = { .a = 1, .b = 1 };
printf("%p\n", (void *)&bar.a);
}
```
Back: N/A. This compiles correctly.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614094-->
END%%
%%ANKI
Basic
What is an unnamed bit-field?
Back: A bit-field with no declarator.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614099-->
END%%
### Packing
An implementation may allocate any addressable storage unit large enough to hold a bit-field. If enough space remains, a bit-field that immediately follows another in a structure shall be packed into adjacent bits of the same unit.
If insufficient space remains, whether a bit-field that does not fit is put into the next unit or overlaps adjacent units is implementation-defined.
A bit-field structure member with a width of `0` indicates that no further bit-field is to be packed into the unit in which the previous bit-field, if any, was placed.
%%ANKI
Basic
What are the addressable storage units supported in x86-64?
Back: A byte, word, double word, or quad word.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: x86-64
<!--ID: 1734662614105-->
END%%
%%ANKI
Basic
What does the C standard mean by an "addressable storage unit"?
Back: A memory unit that can be directly addressed/manipulated by the processor.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614110-->
END%%
%%ANKI
Basic
Does x86-64 allow bit-fields to overlap adjacent addressable storage units?
Back: No.
Reference: Raymond, Eric. “The Lost Art of Structure Packing.” Accessed November 4, 2024. [http://www.catb.org/esr/structure-packing/](http://www.catb.org/esr/structure-packing/).
Tags: x86-64
<!--ID: 1734662614115-->
END%%
%%ANKI
Basic
What does a bit-field of width `0` indicate?
Back: No subsequent bit-field can be packed into the unit in which the previous bit-field, if any, was placed.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614122-->
END%%
%%ANKI
Basic
What is wrong with the following `struct` definition?
```c
struct foo { unsigned bar : 0; };
```
Back: A bit-field of width `0` cannot have a declarator.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614129-->
END%%
%%ANKI
Basic
How is the following `struct` correctly written?
```c
struct foo { unsigned bar : 0; };
```
Back:
```c
struct foo { unsigned : 0; };
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614138-->
END%%
%%ANKI
Basic
Assume a `4`-byte `unsigned int`. What is wrong with the following `struct` definition?
```c
struct foo { unsigned bar : 31; };
```
Back: N/A. This is correct.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
Tags: x86-64
<!--ID: 1734662614146-->
END%%
%%ANKI
Basic
Assume a `4`-byte `unsigned int`. What is wrong with the following `struct` definition?
```c
struct foo { unsigned bar : 32; };
```
Back: N/A. This is correct.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
Tags: x86-64
<!--ID: 1734662614152-->
END%%
%%ANKI
Basic
Assume a `4`-byte `unsigned int`. What is wrong with the following `struct` definition?
```c
struct foo { unsigned bar : 33; };
```
Back: The width of a bit-field cannot exceed its types (in this case `unsigned int`).
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
Tags: x86-64
<!--ID: 1734662614158-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, no overlapping units, and low-to-high order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
_padding : 2; // 2 bits
signed b : 2; // 2 bits
signed a : 4; // 4 bits
_padding : 4; // 4 bits
signed c : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614163-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, overlapping units, and low-to-high order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed : 0;
signed c : 4;
};
```
Back:
```c
struct foo {
_padding : 4; // 4 bits
signed a : 4; // 4 bits
_padding : 4; // 4 bits
signed c : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734664080915-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, overlapping units, and high-to-low order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed : 0;
signed c : 4;
};
```
Back:
```c
struct foo {
signed a : 4; // 4 bits
_padding : 4; // 4 bits
signed c : 4; // 4 bits
_padding : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734664080919-->
END%%
%%ANKI
Basic
Assume a `32`-bit storage unit, no overlapping units, and low-to-high order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
_padding : 22; // 22 bits
signed c : 4; // 4 bits
signed b : 2; // 2 bits
signed a : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614168-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, overlapping units, and low-to-high order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
_padding : 6; // 6 bits
signed c : 4; // 4 bits
signed b : 2; // 2 bits
signed a : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614174-->
END%%
%%ANKI
Basic
Assume a `32`-bit storage unit, no overlapping units, and low-to-high order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed : 0;
signed c : 4;
};
```
Back:
```c
struct foo {
_padding : 28; // 28 bits
signed c : 4; // 4 bits
_padding : 28; // 28 bits
signed a : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734664080924-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, overlapping units, and high-to-low order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
signed a : 4; // 4 bits
signed b : 2; // 2 bits
signed c : 4; // 4 bits
_padding : 6; // 6 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614181-->
END%%
%%ANKI
Basic
Assume a byte-sized storage unit, no overlapping units, and high-to-low order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
signed a : 4; // 4 bits
signed b : 2; // 2 bits
_padding : 2; // 2 bits
signed c : 4; // 4 bits
_padding : 4; // 4 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614188-->
END%%
%%ANKI
Basic
Assume a `32`-bit storage unit, overlapping units, and high-to-low order. How is the following packed in memory?
```c
struct foo {
signed a : 4;
signed b : 2;
signed c : 4;
};
```
Back:
```c
struct foo {
signed a : 4; // 4 bits
signed b : 2; // 2 bits
signed c : 4; // 4 bits
_padding : 22; // 22 bits
};
```
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614195-->
END%%
%%ANKI
Basic
What implementation-defined property guarantees tightly-packed bit-fields?
Back: Whether bit-fields can overlap adjacent addressable storage units.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614202-->
END%%
%%ANKI
Cloze
An implementation may allocate any {addressable storage} unit large enough to hold a bit-field.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734662614208-->
END%%
%%ANKI
Basic
What does it mean for bit-fields to be allocated low-to-high?
Back: They are packed starting from the least significant bit of the addressable storage unit.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734664080929-->
END%%
%%ANKI
Basic
What does it mean for bit-fields to be allocated high-to-low?
Back: They are packed starting from the most significant bit of the addressable storage unit.
Reference: “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
<!--ID: 1734664080934-->
END%%
## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
* “ISO: Programming Languages - C17,” April 2017, [https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf](https://www.open-std.org/jtc1/sc22/wg14/www/abq/c17_updated_proposed_fdis.pdf).
* Raymond, Eric. “The Lost Art of Structure Packing.” Accessed November 4, 2024. [http://www.catb.org/esr/structure-packing/](http://www.catb.org/esr/structure-packing/).

View File

@ -645,7 +645,7 @@ END%%
%%ANKI
Basic
Which component of a compiler driver produces ASCII relocatable object files?
Which component of a compiler driver produces relocatable object files?
Back: The assembler.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1733607099587-->
@ -655,7 +655,7 @@ The operating system provides a function called the **loader** that copies the c
%%ANKI
Basic
What function does the OS provider to run an executable object file?
What function does the OS provide to run executable object files?
Back: The loader.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1733607099593-->

View File

@ -7,7 +7,7 @@ tags:
- integral
---
## Overview
## Step Functions
Let $s$ be a step function defined on [[intervals|interval]] $[a, b]$, and let $P = \{x_0, x_1, \ldots, x_n\}$ be a [[intervals#Partitions|partition]] of $[a, b]$ such that $s$ is constant on the open subintervals of $P$. Denote by $s_k$ the constant value that $s$ takes in the $k$th open subinterval, so that $$s(x) = s_k \quad\text{if}\quad x_{k-1} < x < x_k, \quad k = 1, 2, \ldots, n.$$

View File

@ -1,6 +1,6 @@
---
title: Binary
TARGET DECK: Obsidian::H&SS
TARGET DECK: Obsidian::STEM
FILE TAGS: binary
tags:
- binary
@ -176,6 +176,42 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1707661283782-->
END%%
%%ANKI
Cloze
A big-endian system stores the {most} significant byte at the {smallest} memory address.
Reference: “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).
<!--ID: 1734664080894-->
END%%
%%ANKI
Cloze
A big-endian system stores the {least} significant byte at the {largest} memory address.
Reference: “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).
<!--ID: 1734664080900-->
END%%
%%ANKI
Cloze
A little-endian system stores the {least} significant byte at the {smallest} memory address.
Reference: “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).
<!--ID: 1734664080903-->
END%%
%%ANKI
Cloze
A little-endian system stores the {most} significant byte at the {largest} memory address.
Reference: “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).
<!--ID: 1734664080907-->
END%%
%%ANKI
Basic
Which of little- or big-endian more closely mirrors the way numbers are written in English?
Back: Big-endian.
Reference: “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).
<!--ID: 1734664080911-->
END%%
```c
#include <stdint.h>
#include <stdio.h>
@ -193,3 +229,4 @@ The above snippet can be used to check endianness on the current machine. If big
## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
* “Endianness,” in _Wikipedia_, December 19, 2024, [https://en.wikipedia.org/w/index.php?title=Endianness](https://en.wikipedia.org/w/index.php?title=Endianness&oldid=1264018894).

View File

@ -442,7 +442,7 @@ END%%
%%ANKI
Cloze
The exponent field of a `float` has {`8`} bits and a `double` has {`11`} bits.
The exponent field of a `float` has {`8`} bits whereas a `double` has {`11`} bits.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
Tags: c17
<!--ID: 1710556915030-->

View File

@ -128,6 +128,114 @@ Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web
<!--ID: 1722191359882-->
END%%
## Reification
**Reification** refers to the process by which an abstract idea is made concrete. In the context of RDF, it refers to writing RDF statements about RDF statements.
%%ANKI
Basic
What is reification?
Back: The process by which an abstract idea is made concrete.
Reference: “Reification (Knowledge Representation),” in _Wikipedia_, October 3, 2023, [https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)](https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)&oldid=1178437461).
<!--ID: 1734385502410-->
END%%
%%ANKI
Basic
In the context of RDF, what does reification typically refer to?
Back: Creating RDF statements about RDF statements.
Reference: “Reification (Knowledge Representation),” in _Wikipedia_, October 3, 2023, [https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)](https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)&oldid=1178437461).
<!--ID: 1734385502419-->
END%%
%%ANKI
Basic
In the context of RDF, what abstract notion is typically reified?
Back: RDF statements.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502422-->
END%%
%%ANKI
Basic
What term describes making an abstract concept concrete?
Back: Reification.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502427-->
END%%
This kind of metadata about statements often take the forms of:
* **Provenance**. Information about the source of a statement.
* **Likelihood**. Information quantifying some probability regarding the statement.
* **Context**. Information about a setting in which a statement holds.
* **Time frame**. Information that holds within a particular period of time.
%%ANKI
Basic
What might reifying a statement with respect to its provenance refer to?
Back: Information about the source of the statement.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502431-->
END%%
%%ANKI
Basic
What "form" of reification does the following sentence take on? $$\text{Wikipedia says Shakespeare wrote Hamlet.}$$
Back: Provenance.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502435-->
END%%
%%ANKI
Basic
What might reifying a statement with respect to its likelihood refer to?
Back: Information quantifying some probability of the statement holding.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502439-->
END%%
%%ANKI
Basic
What "form" of reification does the following sentence take on? $$\text{It is 90\% probable that Shakespeare wrote Hamlet.}$$
Back: Likelihood.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502443-->
END%%
%%ANKI
Basic
What might reifying a statement with respect to its context refer to?
Back: Information about a setting in which the statement holds.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502448-->
END%%
%%ANKI
Basic
What "form" of reification does the following sentence take on? $$\text{Kenneth Branagh played Hamlet in the movie.}$$
Back: Context.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502453-->
END%%
%%ANKI
Basic
What might reifying a statement with respect to its time frame refer to?
Back: Information about a period of time in which the statement holds.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502458-->
END%%
%%ANKI
Basic
What "form" of reification does the following sentence take on? $$\text{Hamlet plays on Broadway Jan. 11th through Mar. 12th.}$$
Back: Time frame.
Reference: Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
<!--ID: 1734385502463-->
END%%
## Bibliography
* Allemang, Dean, James A. Hendler, and Fabien L. Gandon. _Semantic Web for the Working Ontologist_. 3e ed. ACM Books 33. New York: Association for computing machinery, 2020.
* “Reification (Knowledge Representation),” in _Wikipedia_, October 3, 2023, [https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)](https://en.wikipedia.org/w/index.php?title=Reification_(knowledge_representation)&oldid=1178437461).

View File

@ -131,13 +131,13 @@ Reference: Tom M. Apostol, _Calculus, Vol. 1: One-Variable Calculus, with an Int
<!--ID: 1731185808252-->
END%%
## Translations
## Transformations
There are two kinds of translations that we can do to a graph: **shifting** and **scaling**. A **reflection** is a special case of scaling.
There are two kinds of transformations that we can do to a graph: **shifting** and **scaling**. A **reflection** is a special case of scaling.
%%ANKI
Basic
What are the two kinds of translations that can be done to a graph?
What are the two kinds of transformations that can be done to a graph?
Back: Shifting and scaling.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733520214987-->
@ -145,7 +145,7 @@ END%%
%%ANKI
Basic
Which of the two kinds of translations is reflection a special case of?
Which of the two kinds of transformations is reflection a special case of?
Back: Scaling.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733520269110-->
@ -165,6 +165,150 @@ Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” acces
<!--ID: 1733522558480-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ relate to shifting? $$y = af(b[x - c]) + d$$
Back: $c$ and $d$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943896-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ relate to a horizontal transformation? $$y = af(b[x - c]) + d$$
Back: $b$ and $c$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943904-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ relate to a vertical transformation? $$y = af(b[x - c]) + d$$
Back: $a$ and $d$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943910-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ relate to scaling? $$y = af(b[x - c]) + d$$
Back: $a$ and $b$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943916-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ apply a transformation that "acts normally"? $$y = af(b[x - c]) + d$$
Back: $a$ and $d$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943921-->
END%%
%%ANKI
Basic
Given function $f$, which of $a$, $b$, $c$, and/or $d$ apply a transformation that "acts inversely"? $$y = af(b[x - c]) + d$$
Back: $b$ and $c$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943926-->
END%%
%%ANKI
Basic
Which of horizontal and/or vertical transformations "act inversely"?
Back: Horizontal transformations.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943931-->
END%%
%%ANKI
Basic
Which of horizontal and/or vertical transformations "act normally"?
Back: Vertical transformations.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943937-->
END%%
%%ANKI
Basic
How is the graph of $y = f(x)$ transformed in the graph of $y = \frac{1}{2}f(\frac{x}{3})$?
Back: It's horizontally scaled by $3$ and vertically compressed by $2$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174535-->
END%%
%%ANKI
Basic
Consider $y = f(x)$. Is $y = af(bx)$ first scaled vertically or horizontally?
Back: N/A. There is no order of operations in this case.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174588-->
END%%
%%ANKI
Basic
How is the graph of $y = f(x)$ transformed in the graph of $y = f(x - 3) + 2$?
Back: It's shifted right by $3$ and shifted up by $2$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174596-->
END%%
%%ANKI
Basic
Consider $y = f(x)$. Is $y = f(x + a) + b$ first shifted vertically or horizontally?
Back: N/A. There is no order of operations in this case.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174604-->
END%%
%%ANKI
Basic
How is the graph of $y = f(x)$ transformed in the graph of $y = 2f(x) + 5$?
Back: It's vertically scaled by $2$ and then shifted up by $5$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174610-->
END%%
%%ANKI
Basic
Consider $y = f(x)$. Is $y = af(x) + b$ first scaled or shifted?
Back: Scaled.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174615-->
END%%
%%ANKI
Basic
Consider $y = f(x)$. Is $y = f(ax) + b$ first scaled or shifted?
Back: Scaled.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174619-->
END%%
%%ANKI
Basic
How is the graph of $y = f(x)$ transformed in the graph of $y = f(2x - 3)$?
Back: It's horizontally compressed by $2$ and then shifted right by $3/2$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656174624-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $2f(x - 3) - 5$?
Back: $(1, 8)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734657098882-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $2f(x - 3) - 5$?
Back: $[3, 11]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734657098887-->
END%%
### Shifting
A **vertical shift** adds/subtracts a constant to every $y$-coordinate of a graph, leaving the $x$-coordinate unchanged. A **horizontal shift** adds/subtracts a constant to every $x$-coordinate of a graph, leaving the $y$-coordinate unchanged.
@ -179,7 +323,7 @@ END%%
%%ANKI
Basic
Which of the two fundamental graph translations is considered "rigid"?
Which of the two fundamental graph transformations is considered "rigid"?
Back: Shifts.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733522558483-->
@ -215,7 +359,7 @@ END%%
%%ANKI
Basic
Let $f(x)$ be a function and $k$ be a constant. What kind of translation is $f(x + k)$?
Let $f(x)$ be a function and $k$ be a constant. What kind of transformations is $f(x + k)$?
Back: A horizontal shift.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733520215013-->
@ -223,7 +367,7 @@ END%%
%%ANKI
Basic
Let $f(x)$ be a function and $k$ be a constant. What kind of translation is $f(x) + k$?
Let $f(x)$ be a function and $k$ be a constant. What kind of transformations is $f(x) + k$?
Back: A vertical shift.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733520215016-->
@ -311,6 +455,70 @@ Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” acces
<!--ID: 1733520215056-->
END%%
%%ANKI
Basic
Horizontal shifting of a function affects which of its range and/or domain?
Back: The domain.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938097-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(x - 2)$?
Back: $(0, 7)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938102-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(x + 2)$?
Back: $(-4, 3)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938105-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(x) + 2$?
Back: $(-2, 5)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938109-->
END%%
%%ANKI
Basic
Vertical shifting of a function affects which of its range and/or domain?
Back: The range.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938112-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $f(x - 2)$?
Back: $[4, 8]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938116-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $f(x) - 2$?
Back: $[2, 6]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938120-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $f(x) + 2$?
Back: $[6, 10]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938124-->
END%%
### Scaling
A **vertical scaling** will multiply/divide every $y$-coordinate of a graph, leaving the $x$-coordinate unchanged. A **horizontal scaling** will multiply/divide every $x$-coordinate of a graph, leaving the $y$-coordinate unchanged.
@ -341,7 +549,7 @@ END%%
%%ANKI
Basic
Let $f(x)$ be a function and $k$ be a constant. What kind of translation is $kf(x)$?
Let $f(x)$ be a function and $k$ be a constant. What kind of transformation is $kf(x)$?
Back: A vertical scaling.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733522558503-->
@ -349,7 +557,7 @@ END%%
%%ANKI
Basic
Let $f(x)$ be a function and $k$ be a constant. What kind of translation is $f(kx)$?
Let $f(x)$ be a function and $k$ be a constant. What kind of transformation is $f(kx)$?
Back: A horizontal scaling.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1733522558507-->
@ -425,6 +633,144 @@ Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” acces
<!--ID: 1733522558555-->
END%%
%%ANKI
Basic
Horizontal scaling of a function affects which of its range and/or domain?
Back: The domain.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938129-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(2x)$?
Back: $(-1, 5/2)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938133-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $2f(x)$?
Back: $(-2, 5)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938137-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(x / 2)$?
Back: $(-4, 10)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938141-->
END%%
%%ANKI
Basic
Vertical scaling of a function affects which of its range and/or domain?
Back: The range.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938145-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $f(2x)$?
Back: $[4, 8]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938149-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $2f(x)$?
Back: $[8, 16]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938152-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $f(x) / 2$?
Back: $[2, 4]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938156-->
END%%
### Reflecting
A **reflection** is a special case of a [[#Scaling|scaling]].
%%ANKI
Basic
A reflection is a special case of what other kind of transformation?
Back: A scaling.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943942-->
END%%
%%ANKI
Cloze
To reflect a function's graph about the {$y$}-axis, multiply its {inputs} by $-1$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943947-->
END%%
%%ANKI
Cloze
To reflect a function's graph about the {$x$}-axis, multiply its {outputs} by $-1$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734620943953-->
END%%
%%ANKI
Basic
Consider the graph of $f(x)$. Is $f(-x)$ its horizontal or vertical reflection?
Back: Horizontal (reflection along the $y$-axis).
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938160-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the domain of $f(-x)$?
Back: $(-5, 2)$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938163-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has domain $(-2, 5)$. What is the range of $f(-x)$?
Back: The same as that of $f(x)$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938167-->
END%%
%%ANKI
Basic
Consider the graph of $f(x)$. Is $-f(x)$ its horizontal or vertical reflection?
Back: Vertical (reflection along the $x$-axis).
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938171-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the domain of $-f(x)$?
Back: The same as that of $f(x)$.
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938174-->
END%%
%%ANKI
Basic
Suppose $f(x)$ has range $[4, 8]$. What is the range of $-f(x)$?
Back: $[-8, -4]$
Reference: James Jones, “Shifting, Reflecting, and Stretching Graphs,” accessed December 6, 2024, [https://people.richland.edu/james/lecture/m116/functions/translations.html](https://people.richland.edu/james/lecture/m116/functions/translations.html).
<!--ID: 1734656938178-->
END%%
## Bibliography
* “Cartesian Coordinate System,” in _Wikipedia_, October 21, 2024, [https://en.wikipedia.org/w/index.php?title=Cartesian_coordinate_system](https://en.wikipedia.org/w/index.php?title=Cartesian_coordinate_system&oldid=1252434514).

View File

@ -12,8 +12,6 @@ tags:
Modern [[x86-64/index|x86-64]] Linux systems use the ELF (Executable and Linkable Format) object file format.
![[elf.png]]
%%ANKI
Basic
What object file format do modern x86-64 Linux machines typically use?
@ -38,11 +36,46 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734356868446-->
END%%
### Relocatable Object Files
## Relocatable Object Files
A typical ELF relocatable object file contains the following sections:
![[elf.png]]
#### `.text`
%%ANKI
Basic
A relocatable object file is typically broken up into what three regions?
Back: The header, sections, and the section header table.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879220-->
END%%
%%ANKI
Basic
In a relocatable object file, what exists between the header and section header table?
Back: The sections.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879305-->
END%%
%%ANKI
Cloze
A relocatable object file consists of a {header}, {sections}, and a {section header table}, in that order.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879322-->
END%%
%%ANKI
Basic
Where in a relocatable object file does the section header table exist?
Back: At the end.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879328-->
END%%
## Sections
A typical ELF object file contains the following sections:
### `.text`
The machine code of the compiled program.
@ -69,7 +102,7 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734367304872-->
END%%
#### `.rodata`
### `.rodata`
Read-only data such as the format strings in [[c17/strings/printf|printf]] statements and [[conditions#JMP|jump tables]] for switch statements.
@ -114,7 +147,7 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734367304878-->
END%%
#### `.data`
### `.data`
Global and static C variables initialized to a non-zero value.
@ -187,7 +220,7 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734369188110-->
END%%
#### `.bss`
### `.bss`
Uninitialized global and static C variables, along with any global or static variables initialized to zero.
@ -298,7 +331,7 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734369188106-->
END%%
#### `.symtab`
### `.symtab`
A symbol table with information about functions and global variables defined and referenced in the program.
@ -326,6 +359,96 @@ Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Program
<!--ID: 1734370180083-->
END%%
### `.rel.text`
A list of locations in the `.text` section that will need to be modified when the linker combines this object file with others.
%%ANKI
Basic
What does the `.rel.text` section of an ELF file contain?
Back: Relocation entries for the `.text` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879344-->
END%%
%%ANKI
Basic
Why is the `.rel.text` ELF section named the way it is?
Back: It's short for **rel**ocation entries for the `.text` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879386-->
END%%
%%ANKI
Cloze
The {`.rel.text`} section contains {relocation entries} for the `.text` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879393-->
END%%
### `.rel.data`
A list of locations in the `.data` section that will need to be modified when the linker combines this object file with others.
%%ANKI
Basic
What does the `.rel.data` section of an ELF file contain?
Back: Relocation entries for the `.data` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879404-->
END%%
%%ANKI
Basic
Why is the `.rel.data` ELF section named the way it is?
Back: It's short for **rel**ocation entries for the `.data` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879407-->
END%%
%%ANKI
Cloze
The {`.rel.data`} section contains {relocation entries} for the `.data` section.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879414-->
END%%
### `.strtab`
A string table for the symbol tables in the `.symtab` section as well as for section names in the section headers. It is a sequence of `NUL`-terminated character strings.
%%ANKI
Basic
What does the `.strtab` section of an ELF file contain?
Back: A string table.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879418-->
END%%
%%ANKI
Basic
Why is the `.strtab` ELF section named the way it is?
Back: It is short for **str**ing **tab**le.
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879422-->
END%%
%%ANKI
Basic
The `.strtab` provides information for what other, non-debug ELF section?
Back: `.symtab`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879427-->
END%%
%%ANKI
Basic
Section names are contained in what ELF section?
Back: `.strtab`
Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.
<!--ID: 1734456879433-->
END%%
## Bibliography
* Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016.

View File

@ -552,7 +552,7 @@ END%%
%%ANKI
Basic
Suppose sets $A$ and $B$ are finite. When is $A \cup B$ infinite?
Back: The union of two finite sets is always finite.
Back: N/A. The union of two finite sets is always finite.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733675522739-->
END%%
@ -591,8 +591,8 @@ END%%
%%ANKI
Basic
Suppose sets $A$ and $B$ are finite. When is $A \cap B$ finite?
Back: The intersection of two finite sets is always finite.
Suppose sets $A$ and $B$ are finite. When is $A \cap B$ infinite?
Back: N/A. The intersection of two finite sets is always finite.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733675522748-->
END%%
@ -615,20 +615,12 @@ END%%
%%ANKI
Basic
Suppose sets $A$ and $B$ are finite. When is $A \times B$ finite?
Back: The Cartesian product of two finite sets is always finite.
Suppose sets $A$ and $B$ are finite. When is $A \times B$ infinite?
Back: N/A. The Cartesian product of two finite sets is always finite.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733675522751-->
END%%
%%ANKI
Basic
Let $m, n \in \omega$ such that $A \approx m$ and $B \approx n$. What does $\mathop{\text{card}}(A \times B)$ evaluate to?
Back: $m \cdot n$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733693785295-->
END%%
### Addition
Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa + \lambda = \mathop{\text{card}}(K \cup L)$, where $K$ and $L$ are any disjoint sets of cardinality $\kappa$ and $\lambda$, respectively.
@ -641,14 +633,6 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1733710439132-->
END%%
%%ANKI
Basic
Let $K$ and $L$ be sets. What does $\mathop{\text{card}}(K \cup L)$ evaluate to?
Back: N/A. $K$ and $L$ must be disjoint sets for evaluation to make sense.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733710439139-->
END%%
%%ANKI
Basic
Let $K$ and $L$ be disjoint sets. What does $\mathop{\text{card}}(K \cup L)$ evaluate to?
@ -659,7 +643,7 @@ END%%
%%ANKI
Basic
Let $K \approx \kappa$ and $L \approx \lambda$. What is necessary for $\mathop{\text{card}}(K \cup L) \approx \kappa + \lambda$?
Let $\mathop{\text{card}}(K) = \kappa$ and $\mathop{\text{card}}(L) = \lambda$. What is necessary for $\mathop{\text{card}}(K \cup L) = \kappa + \lambda$?
Back: That $K$ and $L$ are disjoint.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733710439146-->
@ -696,6 +680,62 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1734374219325-->
END%%
%%ANKI
Basic
What cardinal number does $0 + \aleph_0$ evaluate to?
Back: $\aleph_0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487310-->
END%%
%%ANKI
Basic
Expression $0 + \aleph_0$ corresponds to the cardinality of what set?
Back: $\varnothing \cup \omega$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487313-->
END%%
%%ANKI
Basic
Let $n \in \omega$. What cardinal number does $n^+ + \aleph_0$ evaluate to?
Back: $\aleph_0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487316-->
END%%
%%ANKI
Basic
Let $n \in \omega$. Expression $n + \aleph_0$ corresponds to the cardinality of what set?
Back: $(n \times \{0\}) \cup (\omega \times \{1\})$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487319-->
END%%
%%ANKI
Basic
What cardinal number does $\aleph_0 + \aleph_0$ evaluate to?
Back: $\aleph_0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487326-->
END%%
%%ANKI
Basic
Expression $\aleph_0 + \aleph_0$ corresponds to the cardinality of what set?
Back: $(\omega \times \{0\}) \cup (\omega \times \{1\})$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487330-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. What cardinal number does $\kappa + 0$ evaluate to?
Back: $0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487333-->
END%%
### Multiplication
Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa \cdot \lambda = \mathop{\text{card}}(K \times L)$, where $K$ and $L$ are any sets of cardinality $\kappa$ and $\lambda$, respectively.
@ -731,6 +771,14 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1733710439162-->
END%%
%%ANKI
Basic
Let $m, n \in \omega$ such that $A \approx m$ and $B \approx n$. What does $\mathop{\text{card}}(A \times B)$ evaluate to?
Back: $m \cdot n$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1733693785295-->
END%%
%%ANKI
Basic
How do we prove $2 \cdot 2 = 4$ using the recursion theorem?
@ -755,6 +803,70 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1734374219328-->
END%%
%%ANKI
Basic
What cardinal number does $0 \cdot \aleph_0$ evaluate to?
Back: $0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487336-->
END%%
%%ANKI
Basic
Expression $0 \cdot \aleph_0$ corresponds to the cardinality of what set?
Back: $\varnothing \times \omega$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487339-->
END%%
%%ANKI
Basic
Let $n \in \omega$. What cardinal number does $n^+ \cdot \aleph_0$ evaluate to?
Back: $\aleph_0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487342-->
END%%
%%ANKI
Basic
Let $n \in \omega$. Expression $n \cdot \aleph_0$ corresponds to the cardinality of what set?
Back: $n \times \omega$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487345-->
END%%
%%ANKI
Basic
What cardinal number does $\aleph_0 \cdot \aleph_0$ evaluate to?
Back: $\aleph_0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487349-->
END%%
%%ANKI
Basic
Expression $\aleph_0 \cdot \aleph_0$ corresponds to the cardinality of what set?
Back: $\omega \times \omega$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487352-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. What cardinal number does $\kappa \cdot 0$ evaluate to?
Back: $0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487356-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. What cardinal number does $\kappa \cdot 1$ evaluate to?
Back: $\kappa$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487359-->
END%%
### Exponentiation
Let $\kappa$ and $\lambda$ be any cardinal numbers. Then $\kappa^\lambda = \mathop{\text{card}}(^LK)$, where $K$ and $L$ are any sets of cardinality $\kappa$ and $\lambda$, respectively.
@ -822,6 +934,62 @@ Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Pre
<!--ID: 1734374219332-->
END%%
%%ANKI
Basic
What cardinal number does $0^{\aleph_0}$ evaluate to?
Back: $0$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487363-->
END%%
%%ANKI
Basic
Expression $0^{\aleph_0}$ corresponds to the cardinality of what set?
Back: $^\omega \varnothing$
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487368-->
END%%
%%ANKI
Basic
Let $\kappa$ be a nonzero cardinal number. What cardinal number does $0^\kappa$ evaluate to?
Back: $0$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487372-->
END%%
%%ANKI
Basic
What cardinal number does $0^0$ evaluate to?
Back: $1$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487376-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. Expression $0^\kappa$ corresponds to the cardinality of what set?
Back: $^K\varnothing$ where $\mathop{\text{card}} K = \kappa$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487381-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. What cardinal number does $\kappa^0$ evaluate to?
Back: $1$.
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487384-->
END%%
%%ANKI
Basic
Let $\kappa$ be a cardinal number. Expression $\kappa^0$ corresponds to the cardinality of what set?
Back: $^\varnothing K$ where $\mathop{\text{card}} K = \kappa$..
Reference: Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).
<!--ID: 1734520487388-->
END%%
## Bibliography
* Herbert B. Enderton, *Elements of Set Theory* (New York: Academic Press, 1977).