-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: (Bit-Mage) <[email protected]>
- Loading branch information
(Bit-Mage)
committed
Nov 20, 2024
1 parent
b4763bc
commit 7a205fe
Showing
48 changed files
with
507 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: 912ba440-5083-41a9-b2ab-553cd9a7f8c7 | ||
:END: | ||
#+title: Variable Scope | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:PROPERTIES: | ||
:ID: c6ef7bd2-dd62-44bf-90d5-a7520b873fcd | ||
:END: | ||
#+title: Referential Transparency | ||
#+filetags: :programming: | ||
|
||
* Overview | ||
- *Definition*: | ||
- Referential transparency is a property of parts of a computer program where an expression can be replaced with its value without changing the program's behavior. | ||
- often associated with [[id:20231212T081907.908301][functional programming]]. | ||
|
||
- *Benefits*: | ||
- *Improved Readability and Understandability*: Because expressions can be replaced consistently with their values, it simplifies reasoning about code. | ||
- *Easier Debugging and Testing*: With referentially transparent code, testing becomes easier as expressions yield the same result every time they are evaluated with the same inputs. | ||
- *Facilitates Optimization*: Compilers and interpreters can more easily optimize code through techniques like [[id:1bdc93aa-b564-4520-8590-c1ffcb026f55][memoization]] or [[id:eba75a47-6e35-4146-a152-b05089bbd8ec][lazy evaluation]]. | ||
|
||
- *Key Concepts*: | ||
- *Pure Functions*: Functions that are deterministic (same inputs lead to the same outputs) and do not produce [[id:ca98597a-027f-4eda-bbb2-801b8f74d0a5][side effects]], a critical component for achieving referential transparency. | ||
- *[[id:efba8f9b-a5df-4212-94c9-230bef916b5c][Immutable]] Data*: Often accompanies referential transparency by ensuring that data is not altered after creation which supports consistency in function results. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: 1bdc93aa-b564-4520-8590-c1ffcb026f55 | ||
:END: | ||
#+title: Memoization | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: eba75a47-6e35-4146-a152-b05089bbd8ec | ||
:END: | ||
#+title: Lazy Evaluation | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: ca98597a-027f-4eda-bbb2-801b8f74d0a5 | ||
:END: | ||
#+title: Side Effects | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
:PROPERTIES: | ||
:ID: c30a1e1b-f615-4b02-884f-656fee743e1d | ||
:ROAM_ALIASES: Calculi | ||
:END: | ||
#+title: Calculus | ||
#+filetags: :meta: | ||
|
||
* Etymological roots | ||
|
||
- *Origin Language*: The word "calculus" comes from Latin. | ||
- *Latin Meaning*: In Latin, "calculus" means "small stone" or "pebble." | ||
- *Historical Context*: | ||
- /Counting Stones/: This term was historically used because small stones were used for counting and calculations, particularly in the ancient abacus. | ||
- /Mathematical Practice/: As methods for systematic calculation evolved, the name stuck to represent the burgeoning mathematical field. | ||
- *Development of Mathematical Concept*: | ||
- /17th Century and Beyond/: The development of calculus as we understand it today is attributed to the work of mathematicians Neumann, Leibniz, and Newton in the 17th century. | ||
- /Use as a Mathematical Term/: Over time, "calculus" began to be used more broadly in the context of mathematics to specifically signify the advanced study of rates of change and quantities found under curves. | ||
|
||
Connections and Further Exploration: | ||
|
||
- The term’s roots in counting and measurement reflect the foundational aspects of calculus as a system for analyzing changes quantitatively. | ||
- The use of a metaphorical "small stones" indicates the fundamental building blocks nature of calculus in mathematics, similar to atoms in matter. | ||
- The transition from physical representations (stones) to abstract mathematical formulations mirrors the broader evolution of scientific thought from tangible observations to abstract theories. | ||
|
||
Questions for Further Exploration: | ||
|
||
- How did the transition from physical methods of calculation to theoretical calculus influence other scientific domains? | ||
- What impact did the work of Newton and Leibniz have on the understanding and teaching of calculus in modern education systems? | ||
- How has the notion of 'building blocks' evolved in other areas of mathematics and science from the etymological roots of calculus? | ||
|
||
* Branches | ||
** [[id:b2efd76b-740b-486d-b307-7ea4bed72b5d][Pi Calculus]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: cbd8cb36-6cba-46c3-84bf-077756dc3b37 | ||
:END: | ||
#+title: Etymology | ||
#+filetags: :linguistics:meta: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
:PROPERTIES: | ||
:ID: 95edc4bc-c364-4b18-833a-ba476b3283e8 | ||
:END: | ||
#+title: Recursion | ||
#+filetags: :programming: | ||
|
||
* Overview | ||
|
||
- *Definition and Concept*: | ||
- Recursion is a programming technique where a [[id:a31671c6-12ea-4fc9-93cb-73d29fd508a6][function]] calls itself, either directly or indirectly, to solve a problem. | ||
- It typically involves a base case to stop the recursion and a recursive case to divide the problem into smaller instances of the same problem. | ||
|
||
- *Base Case*: | ||
- The base case is the termination condition that stops the recursion. | ||
- Without a base case, the recursive calls would continue indefinitely, leading to a [[id:ea557127-190f-4861-aecb-f727fe6e676b][stack overflow]]. | ||
|
||
- *Recursive Case*: | ||
- This is the part of the function that includes a call to itself. | ||
- It reduces the problem at each step, bringing it closer to the base case. | ||
|
||
- *Applications*: | ||
- Used in algorithms for traversing data structures like trees and graphs (e.g., depth-first search). | ||
- Useful in problems that can be divided into similar sub-problems, like divide and conquer algorithms (e.g., mergesort, quicksort). | ||
|
||
*Connections*: | ||
- Recursion is a fundamental concept in computer science closely related to [[id:120cade5-1cf0-4afe-b541-e2b607ae77da][mathematical induction]], as both involve solving problems by breaking them down into base cases and smaller sub-problems. | ||
- Recursion is frequently compared to [[id:40722d92-1d10-445e-bcd9-f41999ccdf52][iteration]], as both can be used to repeat tasks but have different trade-offs in terms of complexity and efficiency. | ||
|
||
* Interconverting Recursion and [[id:40722d92-1d10-445e-bcd9-f41999ccdf52][Iteration]] | ||
** Steps for Interconverting Recursion to Iteration: | ||
|
||
1. *Identify Base Case*: | ||
- Determine the base case(s) in recursion which serves as the termination condition. | ||
|
||
2. *Set Initial Conditions*: | ||
- Translate the base case of recursion into initial conditions for the iterative loop. | ||
|
||
3. *Transform Recursive Logic*: | ||
- Convert the recursive calls into loop updates. This often involves using auxiliary data structures like stacks to simulate the recursive call stack. | ||
|
||
4. *Loop Until Condition Met*: | ||
- Replace the recursive function call mechanism with a loop structure to handle repetitive execution until the condition is met. | ||
|
||
5. *End Condition*: | ||
- Ensure the loop has a termination condition similar to how a recursive function has a base case. | ||
|
||
** Steps for Interconverting Iteration to Recursion: | ||
|
||
1. *Define Base Case*: | ||
- Translate the loop’s termination condition into a base case for the recursive function. | ||
|
||
2. *Create Recursive Function*: | ||
- Define a recursive function that includes parameters reflecting loop variables or state. | ||
|
||
3. *Inject Recursive Call*: | ||
- Replace loop iteration with a self-referential function call, where each call updates the state similar to loop iteration. | ||
|
||
4. *Ensure Termination*: | ||
- Implement a termination check within the recursive function to ensure the function exits appropriately. | ||
|
||
* Relevant Nodes | ||
- [[id:3a717d24-64ef-4d38-936a-6814baaa1e6a][Tail Recursion]] | ||
- [[id:1bdc93aa-b564-4520-8590-c1ffcb026f55][Memoization]] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: ea557127-190f-4861-aecb-f727fe6e676b | ||
:END: | ||
#+title: stack overflow | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: 120cade5-1cf0-4afe-b541-e2b607ae77da | ||
:END: | ||
#+title: mathematical induction | ||
#+filetags: :math: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: 40722d92-1d10-445e-bcd9-f41999ccdf52 | ||
:END: | ||
#+title: Iteration | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: 3a717d24-64ef-4d38-936a-6814baaa1e6a | ||
:END: | ||
#+title: Tail Recursion | ||
#+filetags: :programming: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
:PROPERTIES: | ||
:ID: bb91d3d1-c6f9-4864-9291-35c10ce79c42 | ||
:END: | ||
#+title: Computational Complexity | ||
#+filetags: :programming: |
Oops, something went wrong.