From bb0b7f9fea5e4376ad3ca3ae63d1682a3df933e7 Mon Sep 17 00:00:00 2001 From: Joshua Potter Date: Thu, 2 Jan 2025 20:08:59 -0700 Subject: [PATCH] Complex numbers and the iterative command. --- .../plugins/obsidian-to-anki-plugin/data.json | 17 +- notes/_journal/2025-01-02.md | 12 + notes/algebra/complex.md | 246 ++++++++++++++++++ notes/algebra/images/complex-plane-point.png | Bin 0 -> 5335 bytes notes/data-models/rdf.md | 5 +- notes/encoding/floating-point.md | 9 + notes/linkers/relocatable.md | 6 +- .../programming/images/iterative-command.png | Bin 0 -> 7924 bytes notes/programming/pred-trans.md | 108 ++++++++ 9 files changed, 392 insertions(+), 11 deletions(-) create mode 100644 notes/_journal/2025-01-02.md create mode 100644 notes/algebra/complex.md create mode 100644 notes/algebra/images/complex-plane-point.png create mode 100644 notes/programming/images/iterative-command.png diff --git a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json index c7b334a..4461d59 100644 --- a/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json +++ b/notes/.obsidian/plugins/obsidian-to-anki-plugin/data.json @@ -241,7 +241,9 @@ "state-diagram.png", "state-diagram-ends1.png", "state-diagram-ends0.png", - "dfs-edge-classification.png" + "dfs-edge-classification.png", + "complex-plane-point.png", + "iterative-command.png" ], "File Hashes": { "algorithms/index.md": "3ac071354e55242919cc574eb43de6f8", @@ -417,7 +419,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": "d19e3f992bf2e073d2049fb0973c89bd", + "encoding/floating-point.md": "4deee7fd18a0efdf18fee993013ba4b0", "_journal/2024-03-18.md": "8479f07f63136a4e16c9cd07dbf2f27f", "_journal/2024-03/2024-03-17.md": "23f9672f5c93a6de52099b1b86834e8b", "set/directed-graph.md": "b4b8ad1be634a0a808af125fe8577a53", @@ -544,7 +546,7 @@ "_journal/2024-05-13.md": "71eb7924653eed5b6abd84d3a13b532b", "_journal/2024-05/2024-05-12.md": "ca9f3996272152ef89924bb328efd365", "git/remotes.md": "6fbbc95efa421c720e40500e5d133639", - "programming/pred-trans.md": "c02471c6c9728dd19f8df7bc180ef8b1", + "programming/pred-trans.md": "5b271eebe32e33108d7a36ad98600148", "set/axioms.md": "063955bf19c703e9ad23be2aee4f1ab7", "_journal/2024-05-14.md": "f6ece1d6c178d57875786f87345343c5", "_journal/2024-05/2024-05-13.md": "d549dd75fb42b4280d4914781edb0113", @@ -1047,7 +1049,7 @@ "encoding/xml/index.md": "01a66b1a102cccc682f8f1cab0f50bc6", "ontology/reification.md": "ef8275957dcc1a7e5501722d4652e41c", "ontology/rdf.md": "fd273c30bec6f46b68547f0d392620b1", - "data-models/rdf.md": "98594898837f981dcbdd26df80e93a87", + "data-models/rdf.md": "122bad0fa8e2b299e75e744bc5c246d6", "serialization/xml.md": "84b632282ebcc2b6216923a02abdd4c2", "serialization/index.md": "5ed7e99e4efc4844839ea357d351f5d8", "data-models/index.md": "9e60f40798490f0743f291e55f492033", @@ -1065,7 +1067,7 @@ "_journal/2024-12/2024-12-23.md": "72b0964a8a5ed8ba0acf7fe10b5de279", "_journal/2024-12-25.md": "1717d37b074df58175ec0272adc278de", "_journal/2024-12/2024-12-24.md": "dcd3bd8b82ca4d47a9642a46d8bece0d", - "linkers/relocatable.md": "64c3c75dca8ec9676bd80a9a9feb7887", + "linkers/relocatable.md": "31b5d8700a787e5aeee41f819864bcd9", "data-models/federation.md": "1d92747304186bd2833a00a488fcac48", "_journal/2024-12-26.md": "022aeaf68d46fd39b23aca9c577f3f41", "_journal/2024-12/2024-12-25.md": "1717d37b074df58175ec0272adc278de", @@ -1416,7 +1418,10 @@ "_journal/2024/2024-12/2024-12-03.md": "54480a38f1e16e48529cbb99c5349c74", "_journal/2024/2024-12/2024-12-02.md": "beb50f6f3656470f2cb28b759b652994", "_journal/2024/2024-12/2024-12-01.md": "84987be103489d6447eba85726aa2489", - "_journal/2025-01-01.md": "3cf29f753c27313c95a435a7845b4c13" + "_journal/2025-01-01.md": "3cf29f753c27313c95a435a7845b4c13", + "_journal/2025-01-02.md": "d836d831495d0646e7bf8c564579f9f1", + "_journal/2025-01/2025-01-01.md": "3cf29f753c27313c95a435a7845b4c13", + "algebra/complex.md": "37befb93643418cd8905c49e2f53627b" }, "fields_dict": { "Basic": [ diff --git a/notes/_journal/2025-01-02.md b/notes/_journal/2025-01-02.md new file mode 100644 index 0000000..412c137 --- /dev/null +++ b/notes/_journal/2025-01-02.md @@ -0,0 +1,12 @@ +--- +title: "2025-01-02" +--- + +- [x] Anki Flashcards +- [x] KoL +- [x] OGS +- [ ] Sheet Music (10 min.) +- [ ] Korean (Read 1 Story) + +* Add a number of basic facts about [[complex|complex numbers]]. +* Introductory notes on the [[pred-trans#Iterative|iterative command]]. \ No newline at end of file diff --git a/notes/algebra/complex.md b/notes/algebra/complex.md new file mode 100644 index 0000000..4ef785f --- /dev/null +++ b/notes/algebra/complex.md @@ -0,0 +1,246 @@ +--- +title: Complex Numbers +TARGET DECK: Obsidian::STEM +FILE TAGS: algebra::complex +tags: + - algebra + - complex +--- + +## Overview + +The set $\mathbb{C}$ of **complex numbers** is defined by $$\mathbb{C} = \{a + bi \mid a, b \in \mathbb{R}\},$$ +where $i$ is the **imaginary number** defined as $i^2 = -1$. + +%%ANKI +Basic +How is set the complex numbers denoted? +Back: As $\mathbb{C}$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +How is set $\mathbb{C}$ defined in set-builder notation? +Back: $\mathbb{C} = \{a + bi \mid a, b \in \mathbb{R}\}$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Which of $\mathbb{R}$ or $\mathbb{C}$ is a subset of the other? +Back: $\mathbb{R} \subseteq \mathbb{C}$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What is $i$ called? +Back: The imaginary number. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +How is the imaginary number typically denoted? +Back: As $i$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +$i$ was invented to provide a solution to what equation? +Back: $x^2 = -1$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What is the solution of $x^2 = -1$? +Back: $i$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Cloze +Real number {$r$} is identified with complex number {$r + 0i$}. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Cloze +What real number is identified with $-\pi + 0i$? +Back: $-\pi$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Cloze +What real number is identified with $\pi + 2i$? +Back: N/A. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What is the horizontal axis of the complex plane typically called? +Back: The real axis. +Reference: “Complex Plane,” in _Wikipedia_, December 14, 2024, [https://en.wikipedia.org/w/index.php?title=Complex_plane](https://en.wikipedia.org/w/index.php?title=Complex_plane&oldid=1263031649). + +END%% + +%%ANKI +Basic +What is the vertical axis of the complex plane typically called? +Back: The imaginary axis. +Reference: “Complex Plane,” in _Wikipedia_, December 14, 2024, [https://en.wikipedia.org/w/index.php?title=Complex_plane](https://en.wikipedia.org/w/index.php?title=Complex_plane&oldid=1263031649). + +END%% + +%%ANKI +Cloze +The complex plane is formed from the {$x$}-axis and {$yi$}-axis. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Which number is plotted on the complex plane below? +![[complex-plane-point.png]] +Back: $2 + i$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Cloze +Real numbers are plotted on a {line} whereas complex numbers are plotted on a {plane}. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +## Operations + +Addition and multiplication of complex numbers are done in the natural way. Given complex numbers $a + bi$ and $c + di$, we have that $$\begin{align*} (a + bi) + (c + di) & = (a + c) + (b + d)i \\ (a + bi) \cdot (c + di) & = (ac -bd) + (ad + bc)i \end{align*}$$ + +The **absolute value** of $a + bi$, denoted $\lvert a + bi \rvert$, is defined as $$\lvert a + bi \rvert = \sqrt{a^2 + b^2}.$$ + +%%ANKI +Basic +Let $a + bi$ and $c + di$ be complex numbers. What is their sum? +Back: $(a + c) + (b + d)i$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Let $a + bi$ and $c + di$ be complex numbers. What is their product? +Back: $(ac - bd) + (ad + bc)i$ +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Is addition of complex numbers commutative? +Back: Yes. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Is addition of complex numbers associative? +Back: Yes. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What does it mean for addition of complex numbers to be commutative? +Back: For $z_1, z_2 \in \mathbb{C}$, it follows that $z_1 + z_2 = z_2 + z_1$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Is multiplication of complex numbers commutative? +Back: Yes. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Is multiplication of complex numbers associative? +Back: Yes. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What does it mean for multiplication of complex numbers to be associative? +Back: For $z_1, z_2, z_3 \in \mathbb{C}$, it follows that $z_1(z_2z_3) = (z_1z_2)z_3$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +How is the absolute value of complex number $z \in \mathbb{C}$ denoted? +Back: As $\lvert z \rvert$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Let $z \in \mathbb{C}$. How is $\lvert z \rvert$ defined? +Back: Assuming $z = a + bi$, as $\lvert z \rvert = \sqrt{a^2 + b^2}$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Geometrically speaking, what does the absolute value of $z \in \mathbb{C}$ correspond to? +Back: $z$'s distance from the complex plane's origin. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +Let $a + bi$ be a complex number. How is $\sqrt{a^2 + b^2}$ more compactly written? +Back: As $\lvert a + bi \rvert$. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +%%ANKI +Basic +What geometric theorem motivates the definition of complex numbers' absolute values? +Back: The Pythagorean theorem. +Reference: John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). + +END%% + +## Bibliography + +* “Complex Plane,” in _Wikipedia_, December 14, 2024, [https://en.wikipedia.org/w/index.php?title=Complex_plane](https://en.wikipedia.org/w/index.php?title=Complex_plane&oldid=1263031649). +* John B. Fraleigh, _A First Course in Abstract Algebra_, Seventh edition, Pearson new international edition (Harlow: Pearson, 2014). \ No newline at end of file diff --git a/notes/algebra/images/complex-plane-point.png b/notes/algebra/images/complex-plane-point.png new file mode 100644 index 0000000000000000000000000000000000000000..4617e44bd4c704714330d4b1f26e0da03b14aaae GIT binary patch literal 5335 zcmeHLd03L$zW&^1R+jBkcG{I%XJA4+MwIeL<`fLGgA~(l1W7b8$H=h3sX!{ za!5l`GiOC}ow{?;vL znBArgJ2wCTunBt7<_rMH4S{dvb!)+2PN%&>fFElx$DuCkz!!1d#lM5!cVKPLVd1Di zY=j>=06>JHLIZR${^)>!Fia2%J15V!0te}=4myDj@WTe9!uGfXhXw#HLAX5zhI{P& z!uA*%7@F)kWNu+#Y++)y#}V$54^z$r02L#s%`ulq+Dw1wC9kmu4WFAb*S~@OxKXo8 zZKuTeZhVA|=`A?^R)xx$g0px3UX~6#l2g4GyQKh|Ge58EnM^#Nq>x;pm2d^Gt>o#m zbb`6XYNyVRKn(jH~MqcBY zp4W=SW+ll1?!3;`)2{SlT_Uns@~1(aw@&!(zZ@! zdIy$-kkLC80AMoVhqb_SKw%>gE4Se%0FYNP0D!ex=K)}&^K$_B>0zuKU~p7U9ylNS zX9MG*l*eZn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y}HJ}X;Ye%?a`eDb)K~gPB`Rwl-kpdw6(k%ui!YqSx23*}kV$?wB7A;T^17Le_gsUp22Apm} zULorGuzCnIDA*Vhv#rBd#zX-_yvCLLWLBNNXT>SdVRzM$!Jkoj0c0#DXAv>=QM%Ed$4M=k5L0(I_bW^;gM$DQMk!H`h?bU?_QWo&3uKY7ILY;3MV45}zO;t4XWJ5l?RH@6j_Y(Z z<*qK*SB=5Vly?_^f6Cx8ukwB#W43x+z0kWBFGRQRO|;AgZyG$qs%?!BEnT3`GchgZ zcD~{l+siQHu$b{9gY6M)iT8+`VbrEgn}W}uKQAPa$!tP&w26PiMg)5=zQFwQQ0!`1 zff>OGJlAJYsA3Izin>tf~J~d_WQ1P zvZ*6UJ49@m^im7W{C#kKMvCsar+cO*CwGceNorZWv=ed40S;8X<~%2QrtRtbG14jD zR%AJUVx-$U!n*=J_O@M;k&*FUVY}B|6BCnw?cUgSyA_=O-(+vgEzLJWgwFee`#8R{ ztjvY$cQJwo2=$13iD<4BR79AyR5;zJNmq@jUyQaWlbH%y>Eu3Xv3qI5#mvS`IJG!- zU-0YrZ5|~TZ0lf((l60<`m9ec*6$t!V{5A9fLl@5+vEdIi|61CHMps=uzriFLs#di zZYl|g$jHcdF$0}pGXr(KgzFDKjYQ==ot+Jv`b*wMy!YirODxsy&B-Hp6#_`SYVI8Jt%IsSk0mZ(K0{{bIIR?&Gg0$w@-P+OQy J(ed+F{|ieeoH_si literal 0 HcmV?d00001 diff --git a/notes/data-models/rdf.md b/notes/data-models/rdf.md index bb99ef0..f232640 100644 --- a/notes/data-models/rdf.md +++ b/notes/data-models/rdf.md @@ -201,12 +201,12 @@ END%% ## Blank Nodes -A **blank node** (bnode) is a node in an RDF graph representing a resource for which a [[uri|URI]] is not specified. That is, the represented resource is anonymous. Such a node can only be used as a subject or object in an RDF triple. +A **blank node** (bnode) is a node in an RDF graph representing a resource for which a [[uri|IRI]] is not specified. That is, the represented resource is anonymous. Such a node can only be used as a subject or object in an RDF triple. %%ANKI Basic What is a blank node? -Back: A node in an RDF graph representing a resource with an unspecified URI. +Back: A node in an RDF graph representing a resource with an unspecified IRI. 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. END%% @@ -214,7 +214,6 @@ END%% %%ANKI Cloze A {bnode} is shorthand for a {blank node}. -Back: A node in an RDF graph representing a resource with an unspecified URI. 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. END%% diff --git a/notes/encoding/floating-point.md b/notes/encoding/floating-point.md index 586df37..a49d3ea 100644 --- a/notes/encoding/floating-point.md +++ b/notes/encoding/floating-point.md @@ -850,6 +850,15 @@ Tags: c17 END%% +%%ANKI +Basic +Let `float x = 1.0`. What does `x`'s exponent *value* equal? +Back: $0$ +Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. +Tags: c17 + +END%% + %%ANKI Basic Let `double x = 1.0`. What is the bit representation of `x`'s exponent *field*? diff --git a/notes/linkers/relocatable.md b/notes/linkers/relocatable.md index ece3aa7..a7c8c1b 100644 --- a/notes/linkers/relocatable.md +++ b/notes/linkers/relocatable.md @@ -225,21 +225,23 @@ Basic What C variables are marked `COMMON` instead of put in `.bss`? Back: Global uninitialized variables. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. +Tags: c17 END%% %%ANKI Basic What C variables are put in `.bss` instead of marked `COMMON`? -Back: Static variables or global variables initialized to zero. +Back: Static variables and global variables initialized to zero. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. +Tags: c17 END%% %%ANKI Basic Assuming `-fcommon`, what kind of C variables does the `.bss` section contain? -Back: Static variables or global and static variables initialized to zero. +Back: Static variables and global variables initialized to zero. Reference: Bryant, Randal E., and David O'Hallaron. *Computer Systems: A Programmer's Perspective*. Third edition, Global edition. Always Learning. Pearson, 2016. Tags: c17 diff --git a/notes/programming/images/iterative-command.png b/notes/programming/images/iterative-command.png new file mode 100644 index 0000000000000000000000000000000000000000..e6a30c2fd68e34f0d2db648e641e5326cc1d3956 GIT binary patch literal 7924 zcmbt(1yohhy6z%G1p$#11SFJ@Qjpk`C?TSBDc#aio7j|!(ygE(pc@GR>E6;3f`Agz z0@C1?kS_1P&$;K`@x~kDjdR9hFkrFQT#L2l{Qs|JxTd-aB{?%Wf*_QtHx;!Jgs1?H z`%jR;&ri~A;qZ&pES^we>+_4KxIw?XV&T%BzMJ*?bqY+O9< zyLzsW)XTvje!`#|?lu;l_O34Hb?u#P5Z(J;=S8lZzh&Wa{))(ztMCIQauo#!cXV_g zVHx}pgiTXbQ9;+|HGUlPK*#1te$~5g|49WMx!|mJoSIGbr{~v?#|d(3YVwItl$;3r z)qU@rMNKKyQbA1>uBJ-zw!sXibVR!nn&!PODxYz|{k^UNd5a6tLxl2KZ*LZ(<4uq5 z?bsvtz>qSr#S0o~Gl#Eszi{_RN%=~I1o|a-q)i{cc8rE5p4$^ka+-#w`cZUbSlGL! zRwYG6ZHsA6PR{p5Zg5(6s46V%Ccl%hq9QlFxDY320yzsK4UOuPe|Pw;;05Hji2KaV zv7o<)T|%SP9@!~j+bd?b5&dy6pJF3D_z87kBZo~UQfpI^oK|M=*;Gn1$xg4uH7 zjd=8DzQ?LPjsv~?TFQg0`6=a%yLZp>^Ye>14T-##@jauZrNty-jyO0tJUG~KdzPGR z1(!?uu5)*%$xSzG9`z_^+horp{O9OcWZR0gw6qhewrka*;{h_F*M^8r0 z7ByPw%Eimu{{9@{Gbg8f^n|&{`OBA!hrL$H$8&S}J@F%YIM?!fQ!6Vgx=&-~emSZt zI%nkaKc!;LJ$%TKFo<^>4vc4DVEBozoKQA2WXihzviIknO3XP0C8c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72|%O-wBsiI*-m3QI1;uKDWO$>Z+%t)z4_^)9B(4 zc?vx8QjOR0uh#mbJx92+7wD}fGuot{=c@oMoh>!)vk^C@UrBoxRQQ7tBFue@rJIk_ zwQIpQrfWR%LHmyEfPF}DcK0q|XJr*U*fihOhd`9`WWf4o9x5xymg~z$g+HzmBj+U~ z1}$pAg(3~WG}+Nzucc@a5JN=95TmjL{S4DFiupM0=f@PeYEqUFVh``fVhkOOAkWlL&(ef?JjL4y$9 zX&_gx$&4aNBk7;-w7$Jv>1b?J;Z$t&W2_D1EgTsh{;f4iIU|=h0{zb7`t?T+#fD{G zL5Is`qs|$SiokNKid5>k57Wi-R_d>HWxt<3WM@~V5WckxxA*C}?nbC8R${<%R@ zea&avy4bKF8UMf&7HMO{6K5lf*&-~mqod;hknUAcQ5|WGOF}~3F5|1K4{)`Wu!VM2 zO6o2lJDImXcKmoA(htEsZnL?$`AI#4zyyE&U+>3Z+@ikg*04kMmk0sw zylYV3@A|(-`vfJQubD=MU>28A?$`;UA5Its`X6b=zW$l5^c zk^vupsro6fIfEuZz^yxXS{{-dN3QKJ#I!T6j;nK5!)_Ttb9S&d-1^25*6szFfAFwV zt7Bp9Q`ocn<`y>gl%4(z?3V6mar`HnqyOPv>i>KA5w$9sk(fu0aR+v!5mhC1#e(bR GkNykU*)7Qc literal 0 HcmV?d00001 diff --git a/notes/programming/pred-trans.md b/notes/programming/pred-trans.md index 83f18b3..2496c83 100644 --- a/notes/programming/pred-trans.md +++ b/notes/programming/pred-trans.md @@ -878,6 +878,14 @@ The general form of the **alternative command** is: $$\begin{align*} \textbf{if Each $B_i \rightarrow S_i$ is called a **guarded command**. To execute the alternative command, find one true guard and execute the corresponding command. Notice this is nondeterministic. We denote the alternative command as $\text{IF}$ and define $\text{IF}$ in terms of $wp$ as: $$\begin{align*} wp(\text{IF}, R) = \;& (\forall i, 1 \leq i \leq n \Rightarrow domain(B_i)) \;\land \\ & (\exists i, 1 \leq i \leq n \land B_i) \;\land \\ & (\forall i, 1 \leq i \leq n \Rightarrow (B_i \Rightarrow wp(S_i, R))) \end{align*}$$ +%%ANKI +Basic +The conventional `if` statement corresponds to what command? +Back: The alternative command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + %%ANKI Basic How is the alternative command compactly denoted? @@ -960,6 +968,14 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% +%%ANKI +Basic +Suppose two guards of an alternative command is true. Which is chosen? +Back: Either is permitted. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + %%ANKI Basic When *might* the following alternative command abort? $$\begin{align*} \textbf{if } & x > 0 \rightarrow z \coloneqq x \\ \textbf{ | } & x < 0 \rightarrow z \coloneqq -x \\ \textbf{fi } & \end{align*}$$ @@ -1015,6 +1031,98 @@ Reference: Gries, David. *The Science of Programming*. Texts and Monographs in END%% +### Iterative + +The general form of the **iterative command** is: $$\begin{align*} \textbf{do } & B_1 \rightarrow S_1 \\ \textbf{ | } & B_2 \rightarrow S_2 \\ & \quad\cdots \\ \textbf{ | } & B_n \rightarrow S_n \\ \textbf{od } & \end{align*}$$ + +%%ANKI +Basic +The conventional `while` statement corresponds to what command? +Back: The iterative command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Cloze +{1:$\text{IF}$} is to the {2:alternative} command whereas {2:$\text{DO}$} is to the {1:iterative} command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How is the iterative command compactly denoted? +Back: As $\text{DO}$. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What kind of command is $\text{DO}$ a representation of? +Back: An iterative command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What is the general form of the iterative command? +Back: $$\begin{align*} \textbf{do } & B_1 \rightarrow S_1 \\ \textbf{ | } & B_2 \rightarrow S_2 \\ & \quad\cdots \\ \textbf{ | } & B_n \rightarrow S_n \\ \textbf{od } & \end{align*}$$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How are iterative commands executed? +Back: By repeatedly choosing any true guard and executing the corresponding command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +What does it mean to "perform an iteration" of an iterative command? +Back: Choosing a true guard and executing its command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +In what way is the iterative command's execution different from traditional loop statements? +Back: It is nondeterministic. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Suppose two guards of an iterative command is true. Which is chosen? +Back: Either is permitted. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +How is the following rewritten to have just one iterative guard? $$\begin{align*} \textbf{do } & B_1 \rightarrow S_1 \\ \textbf{ | } & B_2 \rightarrow S_2 \\ & \quad\cdots \\ \textbf{ | } & B_n \rightarrow S_n \\ \textbf{od } & \end{align*}$$ +Back: Given $BB = B_1 \lor \cdots \lor B_n$, as $$\begin{align*} \textbf{do } & BB \rightarrow \textbf{if } B_1 \rightarrow S_1 \\ & \quad\quad\quad \textbf{ | } B_2 \rightarrow S_2 \\ & \quad\quad\quad \quad\cdots \\ & \quad\quad\quad \textbf{ | } B_n \rightarrow S_n \\ & \quad\quad\quad \textbf{fi } \\ \textbf{od } & \end{align*}$$ +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + +%%ANKI +Basic +Which command is demonstrated in the following diagram? +![[iterative-command.png]] +Back: The iterative command. +Reference: Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. + +END%% + ## Bibliography * Gries, David. *The Science of Programming*. Texts and Monographs in Computer Science. New York: Springer-Verlag, 1981. \ No newline at end of file