Skip to content

Commit

Permalink
fixed [-1, 1]
Browse files Browse the repository at this point in the history
  • Loading branch information
dylstockard committed Feb 6, 2024
1 parent 6434a8a commit 3094175
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions docs/fa23-final/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ <h3 id="problem-2.1">Problem 2.1</h3>
given credit. Pick one of the two.</em></p>
<p><strong>Simulation procedure</strong>:</p>
<ul class="task-list">
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([0, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([-1, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> B.
<code>np.random.choice(bus['late'], bus.shape[0], replace = True)</code></p></li>
<li><p><input type="radio" disabled="" /> C. Randomly permute the <code>'late'</code> column</p></li>
Expand Down Expand Up @@ -329,14 +329,14 @@ <h3 id="problem-2.2">Problem 2.2</h3>
statistic were given credit. Pick one of the two.</em></p>
<p><strong>Simulation procedure</strong>:</p>
<ul class="task-list">
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([0, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([-1, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> B.
<code>np.random.choice(bus['late'], bus.shape[0], replace = True)</code></p></li>
<li><p><input type="radio" disabled="" /> C. Randomly permute the <code>'late'</code> column</p></li>
</ul>
<p><strong>Test statistic</strong></p>
<ul class="task-list">
<li><p><input type="radio" disabled="" /> A. Number of values below <span class="math inline">1</span></p></li>
<li><p><input type="radio" disabled="" /> A. Number of values below <span class="math inline">0</span></p></li>
<li><p><input type="radio" disabled="" /> B. <code>np.mean</code></p></li>
<li><p><input type="radio" disabled="" /> C. <code>np.std</code></p></li>
<li><p><input type="radio" disabled="" /> D. TVD</p></li>
Expand All @@ -361,14 +361,14 @@ <h1 class="title"> </h1>
population, which is just all buses. We then want to see if a sample is
from that population, so we conduct a hypothesis test under the null.
The null would be that buses are equally likely to be early or late, so
we can simulate this by randomly generating <code>[0, 1]</code> for all
we can simulate this by randomly generating <code>[-1, 1]</code> for all
buses. This is what option A) does. <strong>Test statistic</strong>:
Since we know the number of buses, we can use the number of values below
<span class="math inline">1</span> to determine whether we have more
<span class="math inline">0</span> to determine whether we have more
early buses, more late buses, or the same amount. Similarly, the mean
will give us a value between <span class="math inline">0</span> and
<span class="math inline">1</span>, where <span class="math inline">0.5</span> means we have the equal early and late
buses, while <span class="math inline">0</span> represents only early
will give us a value between <span class="math inline">-1</span> and
<span class="math inline">1</span>, where <span class="math inline">0</span> means we have the equal early and late
buses, while <span class="math inline">-1</span> represents only early
buses, and <span class="math inline">1</span> represents only late
buses.</p>
</div>
Expand All @@ -381,7 +381,7 @@ <h3 id="problem-2.3">Problem 2.3</h3>
<code>'line'</code> column?</p>
<p><strong>Simulation procedure</strong>:</p>
<ul class="task-list">
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([0, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([-1, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> B.
<code>np.random.choice(bus['late'], bus.shape[0], replace = True)</code></p></li>
<li><p><input type="radio" disabled="" /> C. Randomly permute the <code>'late'</code> column</p></li>
Expand Down Expand Up @@ -427,7 +427,7 @@ <h3 id="problem-2.4">Problem 2.4</h3>
<code>'time'</code> column?</p>
<p><strong>Simulation procedure</strong>:</p>
<ul class="task-list">
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([0, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> A. <code>np.random.choice([-1, 1], bus.shape[0])</code></p></li>
<li><p><input type="radio" disabled="" /> B.
<code>np.random.choice(bus['late'], bus.shape[0], replace = True)</code></p></li>
<li><p><input type="radio" disabled="" /> C. Randomly permute the <code>'late'</code> column</p></li>
Expand Down
14 changes: 7 additions & 7 deletions problems/fa23-final/fa23-final-q03.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Are buses more likely to be late in the morning (before $12$pm) or the afternoon

**Simulation procedure**:

( ) A. `np.random.choice([0, 1], bus.shape[0])`
( ) A. `np.random.choice([-1, 1], bus.shape[0])`
( ) B. `np.random.choice(bus['late'], bus.shape[0], replace = True)`
( ) C. Randomly permute the `'late'` column

Expand All @@ -33,13 +33,13 @@ Are buses equally likely to be early or late?

**Simulation procedure**:

( ) A. `np.random.choice([0, 1], bus.shape[0])`
( ) A. `np.random.choice([-1, 1], bus.shape[0])`
( ) B. `np.random.choice(bus['late'], bus.shape[0], replace = True)`
( ) C. Randomly permute the `'late'` column

**Test statistic**

( ) A. Number of values below $1$
( ) A. Number of values below $0$
( ) B. `np.mean`
( ) C. `np.std`
( ) D. TVD
Expand All @@ -48,9 +48,9 @@ Are buses equally likely to be early or late?
**Answer**: Simulation procedure - A). Test statistic - A) or B).

**Simulation procedure**:
We now have only one population, which is just all buses. We then want to see if a sample is from that population, so we conduct a hypothesis test under the null. The null would be that buses are equally likely to be early or late, so we can simulate this by randomly generating `[0, 1]` for all buses. This is what option A) does.
We now have only one population, which is just all buses. We then want to see if a sample is from that population, so we conduct a hypothesis test under the null. The null would be that buses are equally likely to be early or late, so we can simulate this by randomly generating `[-1, 1]` for all buses. This is what option A) does.
**Test statistic**:
Since we know the number of buses, we can use the number of values below $1$ to determine whether we have more early buses, more late buses, or the same amount. Similarly, the mean will give us a value between $0$ and $1$, where $0.5$ means we have the equal early and late buses, while $0$ represents only early buses, and $1$ represents only late buses.
Since we know the number of buses, we can use the number of values below $0$ to determine whether we have more early buses, more late buses, or the same amount. Similarly, the mean will give us a value between $-1$ and $1$, where $0$ means we have the equal early and late buses, while $-1$ represents only early buses, and $1$ represents only late buses.
# END SOLN
# END SUBPROB

Expand All @@ -59,7 +59,7 @@ Is the `'late'` column MAR dependent on the `'line'` column?

**Simulation procedure**:

( ) A. `np.random.choice([0, 1], bus.shape[0])`
( ) A. `np.random.choice([-1, 1], bus.shape[0])`
( ) B. `np.random.choice(bus['late'], bus.shape[0], replace = True)`
( ) C. Randomly permute the `'late'` column

Expand All @@ -84,7 +84,7 @@ Is the `'late'` column MAR dependent on the `'time'` column?

**Simulation procedure**:

( ) A. `np.random.choice([0, 1], bus.shape[0])`
( ) A. `np.random.choice([-1, 1], bus.shape[0])`
( ) B. `np.random.choice(bus['late'], bus.shape[0], replace = True)`
( ) C. Randomly permute the `'late'` column

Expand Down

0 comments on commit 3094175

Please sign in to comment.