Skip to content

Commit

Permalink
automata commit
Browse files Browse the repository at this point in the history
  • Loading branch information
eldridgejm committed Jan 8, 2025
1 parent efd7a6e commit 7559566
Show file tree
Hide file tree
Showing 24 changed files with 797 additions and 775 deletions.
456 changes: 228 additions & 228 deletions practice/all.html

Large diffs are not rendered by default.

144 changes: 72 additions & 72 deletions practice/midterm-01.html

Large diffs are not rendered by default.

280 changes: 140 additions & 140 deletions practice/midterm-02.html

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions practice/tags/Gaussians.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ <h2>Problem #040</h2>
<p>Suppose a Gaussian with a diagonal covariance matrix is fit to 200 points in <span class="math">\(\mathbb R^4\)</span> using the maximum likelihood estimators. How many parameters are estimated? Count each entry of <span class="math">\(\mu\)</span> and the covariance matrix that must be estimated as its own parameter.</p>
<p>
<span class="inline-response-box">
<span id="answer-05894302-c97d-4c07-b43c-d2538b00b91d" style="display: none">8</span>
<span id="button-05894302-c97d-4c07-b43c-d2538b00b91d">
<span id="answer-8fd30733-2ee3-461e-8ae7-7bde22ee00ce" style="display: none">8</span>
<span id="button-8fd30733-2ee3-461e-8ae7-7bde22ee00ce">
<button
type="button"
onclick="
document.getElementById('answer-05894302-c97d-4c07-b43c-d2538b00b91d').style.display = 'inline-block';
document.getElementById('button-05894302-c97d-4c07-b43c-d2538b00b91d').style.display = 'none'
document.getElementById('answer-8fd30733-2ee3-461e-8ae7-7bde22ee00ce').style.display = 'inline-block';
document.getElementById('button-8fd30733-2ee3-461e-8ae7-7bde22ee00ce').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -179,13 +179,13 @@ <h2>Problem #053</h2>
<p>Suppose a Gaussian with a diagonal covariance matrix is fit to 200 points in <span class="math">\(\mathbb R^4\)</span> using the maximum likelihood estimators. How many parameters are estimated? Count each entry of <span class="math">\(\vec\mu\)</span> and the covariance matrix that must be estimated as its own parameter (the off-diagonal elements of the covariance are zero, and shouldn't be included in your count).</p>
<p>
<span class="inline-response-box">
<span id="answer-c78a476d-aa21-4eb8-9d26-0ec5867f5788" style="display: none">8</span>
<span id="button-c78a476d-aa21-4eb8-9d26-0ec5867f5788">
<span id="answer-efcaa938-e7bb-4231-9e7f-b225faad9203" style="display: none">8</span>
<span id="button-efcaa938-e7bb-4231-9e7f-b225faad9203">
<button
type="button"
onclick="
document.getElementById('answer-c78a476d-aa21-4eb8-9d26-0ec5867f5788').style.display = 'inline-block';
document.getElementById('button-c78a476d-aa21-4eb8-9d26-0ec5867f5788').style.display = 'none'
document.getElementById('answer-efcaa938-e7bb-4231-9e7f-b225faad9203').style.display = 'inline-block';
document.getElementById('button-efcaa938-e7bb-4231-9e7f-b225faad9203').style.display = 'none'
"
>
Show Answer
Expand Down
8 changes: 4 additions & 4 deletions practice/tags/SVMs.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ <h2>Problem #073</h2>
<p>What weight vector <i>is</i> the solution of the Hard SVM problem for this data set?</p>
<p>
<span class="inline-response-box">
<span id="answer-b2283d67-8b17-4756-b127-41387ee72b19" style="display: none"><span class="math">\((3, 0, \frac{1}{4})^T\)</span></span>
<span id="button-b2283d67-8b17-4756-b127-41387ee72b19">
<span id="answer-28384f29-5918-41ee-98ba-e979cc4cedd4" style="display: none"><span class="math">\((3, 0, \frac{1}{4})^T\)</span></span>
<span id="button-28384f29-5918-41ee-98ba-e979cc4cedd4">
<button
type="button"
onclick="
document.getElementById('answer-b2283d67-8b17-4756-b127-41387ee72b19').style.display = 'inline-block';
document.getElementById('button-b2283d67-8b17-4756-b127-41387ee72b19').style.display = 'none'
document.getElementById('answer-28384f29-5918-41ee-98ba-e979cc4cedd4').style.display = 'inline-block';
document.getElementById('button-28384f29-5918-41ee-98ba-e979cc4cedd4').style.display = 'none'
"
>
Show Answer
Expand Down
104 changes: 52 additions & 52 deletions practice/tags/bayes classifier.html
Original file line number Diff line number Diff line change
Expand Up @@ -139,13 +139,13 @@ <h3 class="subproblem-id">Part 2)</h3>
<p>Suppose <span class="math">\(\pr(Y = 1) = 0.5\)</span> and <span class="math">\(\pr(Y = 0) = 0.5\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-332e10ed-3d69-4230-9655-740a33e4db60" style="display: none">0.25</span>
<span id="button-332e10ed-3d69-4230-9655-740a33e4db60">
<span id="answer-145cd293-a4f5-4a00-8735-85a40a5455f2" style="display: none">0.25</span>
<span id="button-145cd293-a4f5-4a00-8735-85a40a5455f2">
<button
type="button"
onclick="
document.getElementById('answer-332e10ed-3d69-4230-9655-740a33e4db60').style.display = 'inline-block';
document.getElementById('button-332e10ed-3d69-4230-9655-740a33e4db60').style.display = 'none'
document.getElementById('answer-145cd293-a4f5-4a00-8735-85a40a5455f2').style.display = 'inline-block';
document.getElementById('button-145cd293-a4f5-4a00-8735-85a40a5455f2').style.display = 'none'
"
>
Show Answer
Expand All @@ -172,13 +172,13 @@ <h3 class="subproblem-id">Part 4)</h3>
<p>Now suppose <span class="math">\(\pr(Y = 1) = 0.7\)</span> and <span class="math">\(\pr(Y = 0) = 0.3\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-5fbe3246-fa7e-417c-9619-722caae4a2c8" style="display: none">0.29</span>
<span id="button-5fbe3246-fa7e-417c-9619-722caae4a2c8">
<span id="answer-86dc3079-fcd6-4029-a427-a0322c074396" style="display: none">0.29</span>
<span id="button-86dc3079-fcd6-4029-a427-a0322c074396">
<button
type="button"
onclick="
document.getElementById('answer-5fbe3246-fa7e-417c-9619-722caae4a2c8').style.display = 'inline-block';
document.getElementById('button-5fbe3246-fa7e-417c-9619-722caae4a2c8').style.display = 'none'
document.getElementById('answer-86dc3079-fcd6-4029-a427-a0322c074396').style.display = 'inline-block';
document.getElementById('button-86dc3079-fcd6-4029-a427-a0322c074396').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -278,13 +278,13 @@ <h3 class="subproblem-id">Part 1)</h3>
<p>What is <span class="math">\(\pr(1 \leq X \leq 3 \given Y = 0)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-44d2302b-b721-455a-bf58-b5827e4c4cf1" style="display: none">0.6</span>
<span id="button-44d2302b-b721-455a-bf58-b5827e4c4cf1">
<span id="answer-b898015e-3a57-4b84-b3e6-fa8e11d89e5a" style="display: none">0.6</span>
<span id="button-b898015e-3a57-4b84-b3e6-fa8e11d89e5a">
<button
type="button"
onclick="
document.getElementById('answer-44d2302b-b721-455a-bf58-b5827e4c4cf1').style.display = 'inline-block';
document.getElementById('button-44d2302b-b721-455a-bf58-b5827e4c4cf1').style.display = 'none'
document.getElementById('answer-b898015e-3a57-4b84-b3e6-fa8e11d89e5a').style.display = 'inline-block';
document.getElementById('button-b898015e-3a57-4b84-b3e6-fa8e11d89e5a').style.display = 'none'
"
>
Show Answer
Expand All @@ -311,13 +311,13 @@ <h3 class="subproblem-id">Part 3)</h3>
<p>Suppose again that <span class="math">\(\pr(Y = 1) = \pr(Y = 0) = 0.5\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-8c0c0bea-ebea-49af-80c2-9b3a2ae390f0" style="display: none">0.30</span>
<span id="button-8c0c0bea-ebea-49af-80c2-9b3a2ae390f0">
<span id="answer-6ab8a7d5-587e-4124-9064-a3f417437a4a" style="display: none">0.30</span>
<span id="button-6ab8a7d5-587e-4124-9064-a3f417437a4a">
<button
type="button"
onclick="
document.getElementById('answer-8c0c0bea-ebea-49af-80c2-9b3a2ae390f0').style.display = 'inline-block';
document.getElementById('button-8c0c0bea-ebea-49af-80c2-9b3a2ae390f0').style.display = 'none'
document.getElementById('answer-6ab8a7d5-587e-4124-9064-a3f417437a4a').style.display = 'inline-block';
document.getElementById('button-6ab8a7d5-587e-4124-9064-a3f417437a4a').style.display = 'none'
"
>
Show Answer
Expand All @@ -344,13 +344,13 @@ <h3 class="subproblem-id">Part 5)</h3>
<p>Suppose again that <span class="math">\(\pr(Y = 1) = 0.7\)</span> and <span class="math">\(\pr(Y = 0) = 0.3\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-a2b8fadf-3567-429b-95f1-c27acf95c6ba" style="display: none">0.27</span>
<span id="button-a2b8fadf-3567-429b-95f1-c27acf95c6ba">
<span id="answer-4843ae9d-d175-454d-9357-db88d2f90ce1" style="display: none">0.27</span>
<span id="button-4843ae9d-d175-454d-9357-db88d2f90ce1">
<button
type="button"
onclick="
document.getElementById('answer-a2b8fadf-3567-429b-95f1-c27acf95c6ba').style.display = 'inline-block';
document.getElementById('button-a2b8fadf-3567-429b-95f1-c27acf95c6ba').style.display = 'none'
document.getElementById('answer-4843ae9d-d175-454d-9357-db88d2f90ce1').style.display = 'inline-block';
document.getElementById('button-4843ae9d-d175-454d-9357-db88d2f90ce1').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -385,13 +385,13 @@ <h3 class="subproblem-id">Part 1)</h3>
<p>Suppose that <span class="math">\(\pr(Y = 1) = \pr(Y = 0) = 0.5\)</span>. What is <span class="math">\(\pr(1 \leq X \leq 3)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-2e4e7915-d711-4c6b-a062-ca46dbe7f8da" style="display: none">0.3</span>
<span id="button-2e4e7915-d711-4c6b-a062-ca46dbe7f8da">
<span id="answer-bf3ba415-95ce-429d-a96c-86a230e21762" style="display: none">0.3</span>
<span id="button-bf3ba415-95ce-429d-a96c-86a230e21762">
<button
type="button"
onclick="
document.getElementById('answer-2e4e7915-d711-4c6b-a062-ca46dbe7f8da').style.display = 'inline-block';
document.getElementById('button-2e4e7915-d711-4c6b-a062-ca46dbe7f8da').style.display = 'none'
document.getElementById('answer-bf3ba415-95ce-429d-a96c-86a230e21762').style.display = 'inline-block';
document.getElementById('button-bf3ba415-95ce-429d-a96c-86a230e21762').style.display = 'none'
"
>
Show Answer
Expand All @@ -418,13 +418,13 @@ <h3 class="subproblem-id">Part 3)</h3>
<p>Suppose again that <span class="math">\(\pr(Y = 1) = \pr(Y = 0) = 0.5\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-708fbcb1-3397-4393-9cab-de251d582bc4" style="display: none">0.25</span>
<span id="button-708fbcb1-3397-4393-9cab-de251d582bc4">
<span id="answer-7f1d2144-bebc-47cd-8c00-707bb540d3c2" style="display: none">0.25</span>
<span id="button-7f1d2144-bebc-47cd-8c00-707bb540d3c2">
<button
type="button"
onclick="
document.getElementById('answer-708fbcb1-3397-4393-9cab-de251d582bc4').style.display = 'inline-block';
document.getElementById('button-708fbcb1-3397-4393-9cab-de251d582bc4').style.display = 'none'
document.getElementById('answer-7f1d2144-bebc-47cd-8c00-707bb540d3c2').style.display = 'inline-block';
document.getElementById('button-7f1d2144-bebc-47cd-8c00-707bb540d3c2').style.display = 'none'
"
>
Show Answer
Expand All @@ -439,13 +439,13 @@ <h3 class="subproblem-id">Part 4)</h3>
<p>Now suppose <span class="math">\(\pr(Y = 1) = 0.7\)</span> and <span class="math">\(\pr(Y = 0) = 0.3\)</span>. What is <span class="math">\(\pr(1 \leq X \leq 3)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-4835e393-7c89-4ad4-9c39-3b7f3b1b8d5b" style="display: none">0.34</span>
<span id="button-4835e393-7c89-4ad4-9c39-3b7f3b1b8d5b">
<span id="answer-b1dab2fc-2b2e-4ad2-a877-e8d55e027ca2" style="display: none">0.34</span>
<span id="button-b1dab2fc-2b2e-4ad2-a877-e8d55e027ca2">
<button
type="button"
onclick="
document.getElementById('answer-4835e393-7c89-4ad4-9c39-3b7f3b1b8d5b').style.display = 'inline-block';
document.getElementById('button-4835e393-7c89-4ad4-9c39-3b7f3b1b8d5b').style.display = 'none'
document.getElementById('answer-b1dab2fc-2b2e-4ad2-a877-e8d55e027ca2').style.display = 'inline-block';
document.getElementById('button-b1dab2fc-2b2e-4ad2-a877-e8d55e027ca2').style.display = 'none'
"
>
Show Answer
Expand All @@ -472,13 +472,13 @@ <h3 class="subproblem-id">Part 6)</h3>
<p>Suppose again that <span class="math">\(\pr(Y = 1) = 0.7\)</span> and <span class="math">\(\pr(Y = 0) = 0.3\)</span>. What is the Bayes error with respect to this distribution?</p>
<p>
<span class="inline-response-box">
<span id="answer-a1b7b869-beef-41fe-97b7-2ca7e7926196" style="display: none">0.28</span>
<span id="button-a1b7b869-beef-41fe-97b7-2ca7e7926196">
<span id="answer-856bcebf-2f24-4be3-bf6f-48722c8b6d4e" style="display: none">0.28</span>
<span id="button-856bcebf-2f24-4be3-bf6f-48722c8b6d4e">
<button
type="button"
onclick="
document.getElementById('answer-a1b7b869-beef-41fe-97b7-2ca7e7926196').style.display = 'inline-block';
document.getElementById('button-a1b7b869-beef-41fe-97b7-2ca7e7926196').style.display = 'none'
document.getElementById('answer-856bcebf-2f24-4be3-bf6f-48722c8b6d4e').style.display = 'inline-block';
document.getElementById('button-856bcebf-2f24-4be3-bf6f-48722c8b6d4e').style.display = 'none'
"
>
Show Answer
Expand Down Expand Up @@ -510,13 +510,13 @@ <h3 class="subproblem-id">Part 1)</h3>
<p>What is the estimate of the Class 0 density at <span class="math">\(x = 0.6\)</span>? That is, what is the estimate <span class="math">\(\hat p(0.6 \given Y = 0)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-74c7eff7-38b6-4a9e-82ca-a54a9c935b7d" style="display: none">5/3</span>
<span id="button-74c7eff7-38b6-4a9e-82ca-a54a9c935b7d">
<span id="answer-8792c8df-3f75-4dab-b13f-c04a92effbd3" style="display: none">5/3</span>
<span id="button-8792c8df-3f75-4dab-b13f-c04a92effbd3">
<button
type="button"
onclick="
document.getElementById('answer-74c7eff7-38b6-4a9e-82ca-a54a9c935b7d').style.display = 'inline-block';
document.getElementById('button-74c7eff7-38b6-4a9e-82ca-a54a9c935b7d').style.display = 'none'
document.getElementById('answer-8792c8df-3f75-4dab-b13f-c04a92effbd3').style.display = 'inline-block';
document.getElementById('button-8792c8df-3f75-4dab-b13f-c04a92effbd3').style.display = 'none'
"
>
Show Answer
Expand All @@ -531,13 +531,13 @@ <h3 class="subproblem-id">Part 2)</h3>
<p>Using the same histogram estimator, what is the estimate <span class="math">\(\hat\pr(Y = 1 \given x = 0.35)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-dfd3ae6a-7681-4855-98d6-805cea1131b6" style="display: none">3/5 = 0.6</span>
<span id="button-dfd3ae6a-7681-4855-98d6-805cea1131b6">
<span id="answer-2761f43f-e819-43b2-ac2a-d87547876ecb" style="display: none">3/5 = 0.6</span>
<span id="button-2761f43f-e819-43b2-ac2a-d87547876ecb">
<button
type="button"
onclick="
document.getElementById('answer-dfd3ae6a-7681-4855-98d6-805cea1131b6').style.display = 'inline-block';
document.getElementById('button-dfd3ae6a-7681-4855-98d6-805cea1131b6').style.display = 'none'
document.getElementById('answer-2761f43f-e819-43b2-ac2a-d87547876ecb').style.display = 'inline-block';
document.getElementById('button-2761f43f-e819-43b2-ac2a-d87547876ecb').style.display = 'none'
"
>
Show Answer
Expand All @@ -552,13 +552,13 @@ <h3 class="subproblem-id">Part 3)</h3>
<p>What is the estimate of the marginal density of <span class="math">\(x\)</span> at <span class="math">\(x = 0.1\)</span>? That is, what is <span class="math">\(\hat p(0.1)\)</span>?</p>
<p>
<span class="inline-response-box">
<span id="answer-c4cb8381-f7de-45af-bd03-08e46c25d4ef" style="display: none">7/(19*0.25) = 1.47</span>
<span id="button-c4cb8381-f7de-45af-bd03-08e46c25d4ef">
<span id="answer-18f3d049-1e86-4d6e-ab92-fbf7df726ac4" style="display: none">7/(19*0.25) = 1.47</span>
<span id="button-18f3d049-1e86-4d6e-ab92-fbf7df726ac4">
<button
type="button"
onclick="
document.getElementById('answer-c4cb8381-f7de-45af-bd03-08e46c25d4ef').style.display = 'inline-block';
document.getElementById('button-c4cb8381-f7de-45af-bd03-08e46c25d4ef').style.display = 'none'
document.getElementById('answer-18f3d049-1e86-4d6e-ab92-fbf7df726ac4').style.display = 'inline-block';
document.getElementById('button-18f3d049-1e86-4d6e-ab92-fbf7df726ac4').style.display = 'none'
"
>
Show Answer
Expand All @@ -575,13 +575,13 @@ <h3 class="subproblem-id">Part 4)</h3>
\]</div>
<p>
<span class="inline-response-box">
<span id="answer-00e125b3-099a-49b4-835e-86df693f0bb9" style="display: none">1</span>
<span id="button-00e125b3-099a-49b4-835e-86df693f0bb9">
<span id="answer-d2de7c75-7e86-4cb1-9863-fa664150ccab" style="display: none">1</span>
<span id="button-d2de7c75-7e86-4cb1-9863-fa664150ccab">
<button
type="button"
onclick="
document.getElementById('answer-00e125b3-099a-49b4-835e-86df693f0bb9').style.display = 'inline-block';
document.getElementById('button-00e125b3-099a-49b4-835e-86df693f0bb9').style.display = 'none'
document.getElementById('answer-d2de7c75-7e86-4cb1-9863-fa664150ccab').style.display = 'inline-block';
document.getElementById('button-d2de7c75-7e86-4cb1-9863-fa664150ccab').style.display = 'none'
"
>
Show Answer
Expand Down
Loading

0 comments on commit 7559566

Please sign in to comment.