commit 757c8b66777799d2eaa576740afdc566ec43e9b1
parent 72507e3f28d0dbfac3e0d19e5537de5a6a9ba817
Author: Andrew <andrewlaack1@gmail.com>
Date: Sat, 24 Aug 2024 23:00:39 -0500
Added notes from yesterday's reading
Diffstat:
8 files changed, 89 insertions(+), 10 deletions(-)
diff --git a/Algorithms.md b/Algorithms.md
@@ -1,4 +1,4 @@
-:index: :algorithm:
+:index: :algorithms:
# Algorithms Index
This is an index for links to notes taken about algorithms. These are CS related algorithms and not related to machine learning (see [[MachineLearning.md]] for that).
@@ -8,6 +8,7 @@ This is an index for links to notes taken about algorithms. These are CS related
[[MonteCarloMethod.md]]
[[LasVegasMethod.md]]
[[PerlinNoise.md]]
+[[FisherYatesShuffle.md]]
#### Intro To Algorithms (MIT)
diff --git a/FisherYatesShuffle.md b/FisherYatesShuffle.md
@@ -0,0 +1,27 @@
+# Fisher-Yates Shuffle
+
+## Notes
+
+**Definition:** The Fisher-Yates sorting algorithm is the most common sorting algorithm whereby you iterate backwards through the list swapping the current index with an arbitrary index that is less than the current until reaching the 0th index.
+
+Implementation:
+
+```python
+
+def swap(ls, pos1, pos2):
+ temp = ls[pos1]
+ ls[pos1] = ls[pos2]
+ ls[pos2] = temp
+ return ls
+
+def shuffle(ls):
+ i = len(ls) - 1
+ # 0 does not need to swap
+ while i > 0:
+ rnd = random.randint(0,i-1)
+ swap(ls,pos1=rnd, pos2=i)
+ i -= 1
+
+ return ls
+
+```
diff --git a/Frequency.md b/Frequency.md
@@ -0,0 +1,10 @@
+:stats:
+# Frequency
+
+Ch 1.1
+
+## Notes
+
+**Definition:** Frequency describes the number of occurences of a given outcome from the trials of a random experiment.
+
+Frequency is often confused with [[RelativeFrequency.md]] and [[Probability.md]] but they are different terms as the others desribe relative likelihood of an event.
diff --git a/RandomExperiment.md b/RandomExperiment.md
@@ -0,0 +1,10 @@
+:stats:
+# Random Experiment
+
+Ch 1.1
+
+## Notes
+
+**Definition:** A random experiment is a specified set of procedures that result in a truly random outcome (not necessarily uniformly) in the sample space.
+
+This is different than a [[RandomVariables.md]] in the sense that a random variable maps the outcomes of a given experiment to another value whereas this outputs the outcome.
diff --git a/RelativeFrequency.md b/RelativeFrequency.md
@@ -0,0 +1,10 @@
+:stats:
+# Relative Frequency
+
+Ch 1.1
+
+## Notes
+
+**Definition:** Relative frequency is the value f/n where f is the [[Frequency.md]] of an event under a [[RandomExperiment.md]].
+
+Note this is not the same as [[Probability.md]] because probability is the true likelihood whereas relative frequency has been the historical observed likelihood based on the experiment. This value does however tend towards the probability. See [[LawOfLargeNumbers.md]].
diff --git a/SimpsonsParadox.md b/SimpsonsParadox.md
@@ -0,0 +1,20 @@
+:stats:
+# Simpson's Paradox
+
+Ch 1.1
+
+## Notes
+
+**Definition:** Simpson's paradox is the seeming paradox that some outcome can be overall more common despite all individual cases making it seem less likely.
+
+Consider the case of some batters and batting averages shown below:
+
+ Batter 1 | Batter 2
+
+2020 .4 .3
+2021 .5 .49
+2022 .2 .19
+
+One can see that the second batter did worse in every season, but if the number of at bats in the 2021 season was far higher for batter 2 than batter 1 then it is possible their overall batting average was higher despite them having a lower percentage in each season.
+
+There are examples of this in MIT's admissions (more females apply to more difficult majors thus they have lower admission rates) as well as some airline stuff and sports related things signifying that it is not super uncommon and should be something to look out for.
diff --git a/StatisticalInference.md b/StatisticalInference.md
@@ -1,8 +1,8 @@
-:: :: :: :: ::
-#
-
+:stats:
+# Statistical Inference
+Ch 1.1
## Notes
-**Definition:**
+**Definition:** Statistical inference is the process of using statistical findings to make predictions about future events (emphasis on future).
diff --git a/StatisticsAndProbability.md b/StatisticsAndProbability.md
@@ -13,12 +13,13 @@ Probability and Statistical Inference Hogg, Tanis:
Chapter 1.1:
- [[SampleSpace.md]]
- - [[StatisticalInference.md]] - TODO
- - [[Frequency.md]] - TODO
- - [[RelativeFrequency.md]] - TODO
+ - [[StatisticalInference.md]]
+ - [[Frequency.md]]
+ - [[RelativeFrequency.md]]
- [[ProbabilityMassFunction.md]]
- - [[SimpsonsParadox.md]] - TODO
- - [[RandomExperiment.md]] - TODO VS Random Variable
+ - [[SimpsonsParadox.md]]
+ - [[RandomExperiment.md]]
+ - [[RandomVariables.md]]
Chapter 1.2:
- [[Event.md]] - TODO