Skip to content

Commit

Permalink
Add more instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
bkille committed Sep 3, 2024
1 parent daeb99f commit e2925f8
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
## Pooled testing simulation

Your goal is to implement a pooled testing strategy which minimizes the average number of tests for some specific prevalence _p_ and sample size _n_. Relevant slides can be found [here](https://docs.google.com/presentation/d/1ef4VCuorFMAF8eCewnktcQ7swXsg7pUmOdWHe1swtkQ/edit?usp=sharing).

### Instructions

1. Someone from the group should fork this repository.
2. Copy the `StudentProtocols/Baseline.py` file to `StudentProtocols/<YOUR_GROUP_NAME>.py`.
3. Implement the `isolate_positives` function in your protocol file. Essentially, the `isolate_positives` function is provided a `TestSample` object. Using the `query` method of the sample, you can query any set of numbers `0, 1, ..., n-1`, and the `query` method will return true of any of the queried numbers are "positive". In other words, you provide `query` a _pooled_ sample. Your task is to correctly return the IDs of the positive samples in the provided `TestSample` using as few tests as possible (on average).
4. Run the simulation in the `CovidTester.ipynb` notebook. You should get a table that looks like this

```
+--------------+-------+----------+
| Group Name | Mean | Variance |
+--------------+-------+----------+
| ProjectOwler | 7.129 | 30.643 |
| Baseline | 32.0 | 0.0 |
+--------------+-------+----------+
```

5. Once you are satisfied, create a pull request back to this repo. *Only add+commit your new file!*
```
git add `StudentProtocols/<YOUR_GROUP_NAME>.py`
git commit `StudentProtocols/<YOUR_GROUP_NAME>.py` -m "Updates"
```
5 changes: 5 additions & 0 deletions StudentProtocols/Baseline.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,9 @@ def isolate_positives(self, sample: TestSample) -> set:
# while minimizing the number of calls to sample.query
#
# Not correctly identifying the set of positive samples results in disqualification!
#
# The input will be a TestSample object, which allows you to query
# a subset of 0 ... n-1
#
# sample.query([1, 3, 4]) will return True if any of 1, 3, or 4 are positive
return {i for i in range(self.n) if sample.query(set([i]))}

0 comments on commit e2925f8

Please sign in to comment.