Add Practice generators, indices, verification and documentation
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitignore +4 -0
- AUTHORING.md +47 -0
- LICENSE +9 -0
- VALIDATION.md +20 -0
- data/argument-check/eval.jsonl +24 -0
- data/argument-check/train.jsonl +0 -0
- data/class-test/eval.jsonl +24 -0
- data/class-test/train.jsonl +0 -0
- data/emissions-inventory/eval.jsonl +24 -0
- data/emissions-inventory/train.jsonl +0 -0
- data/exposure-assessment/eval.jsonl +24 -0
- data/exposure-assessment/train.jsonl +0 -0
- data/harris-matrix/eval.jsonl +24 -0
- data/harris-matrix/train.jsonl +0 -0
- data/life-table/eval.jsonl +24 -0
- data/life-table/train.jsonl +0 -0
- data/means-test/eval.jsonl +24 -0
- data/means-test/train.jsonl +0 -0
- data/price-index/eval.jsonl +24 -0
- data/price-index/train.jsonl +0 -0
- data/psychometrics/eval.jsonl +24 -0
- data/psychometrics/train.jsonl +0 -0
- data/seat-count/eval.jsonl +24 -0
- data/seat-count/train.jsonl +0 -0
- data/stand-inventory/eval.jsonl +24 -0
- data/stand-inventory/train.jsonl +0 -0
- data/ward-round/eval.jsonl +24 -0
- data/ward-round/train.jsonl +84 -0
- data/zoning-check/eval.jsonl +24 -0
- data/zoning-check/train.jsonl +84 -0
- environments.json +259 -0
- envs/__init__.py +0 -0
- envs/argument_check/__init__.py +0 -0
- envs/argument_check/env.toml +7 -0
- envs/argument_check/gen.py +551 -0
- envs/argument_check/oracle.py +144 -0
- envs/argument_check/validators.py +152 -0
- envs/class_test/__init__.py +0 -0
- envs/class_test/env.toml +7 -0
- envs/class_test/gen.py +571 -0
- envs/class_test/oracle.py +162 -0
- envs/emissions_inventory/__init__.py +0 -0
- envs/emissions_inventory/env.toml +7 -0
- envs/emissions_inventory/gen.py +444 -0
- envs/emissions_inventory/oracle.py +138 -0
- envs/exposure_assessment/__init__.py +0 -0
- envs/exposure_assessment/env.toml +7 -0
- envs/exposure_assessment/gen.py +685 -0
- envs/exposure_assessment/oracle.py +177 -0
- envs/harris_matrix/__init__.py +0 -0
.gitignore
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
__pycache__/
|
| 2 |
+
*.pyc
|
| 3 |
+
.cache/
|
| 4 |
+
.DS_Store
|
AUTHORING.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Authoring a practice environment
|
| 2 |
+
|
| 3 |
+
Each environment teaches a language-model agent a piece of real work from one field of study. The agent gets a folder of files and an instruction, works in a terminal, and writes `answer.json`. A hidden, deterministic verifier scores it from 0 to 1. `envs/ward_round/` is the reference implementation: read `env.toml`, `gen.py` and `oracle.py` there before writing anything, and copy its shape.
|
| 4 |
+
|
| 5 |
+
## Files in `envs/<name>/` (folder name uses underscores)
|
| 6 |
+
|
| 7 |
+
- `__init__.py`: empty.
|
| 8 |
+
- `env.toml`: `name` (kebab-case), `title`, `isced` (4-digit ISCED-F 2013 code), `summary` (one sentence, max 160 characters, says what the agent does), `task_type` (2 to 4 words), `good_for` (1 to 3 short phrases), `families` (list).
|
| 9 |
+
- `gen.py`: `generate(seed, difficulty, family=None) -> practice.core.Task`. Difficulty is 1, 2 or 3. With `family=None` the family is `sorted(FAMILIES)[seed % len(FAMILIES)]`. Three or four families per environment, each a different piece of the field's real work.
|
| 10 |
+
- `oracle.py`: standalone script, Python standard library only, that reads the task files from the current directory exactly as an agent would and writes `answer.json`. It must not import `gen.py` or `practice`. It must work out which family it is facing from the files present.
|
| 11 |
+
- `validators.py`: only if an answer is not unique (a plan, an ordering, a counterexample). Standalone, standard library only. Each function is `name(answer, args) -> bool` (or a float in [0, 1]) and must never raise on malformed answers: return False.
|
| 12 |
+
|
| 13 |
+
## Rules that make the reward trustworthy
|
| 14 |
+
|
| 15 |
+
1. **Two code paths.** `gen.py` computes the expected values from its in-memory data. `oracle.py` recomputes them from the files. They share no code. If they disagree, the instruction or the file format is ambiguous: fix that, do not paper over it.
|
| 16 |
+
2. **The instruction is the contract.** It names every answer key in backticks, with its unit, type and rounding, and gives every rule, formula, constant and threshold the agent needs, either in the instruction or in a reference file in the task folder (as Ward Round ships `news2_rules.md`). Never rely on the agent recalling a constant. Say how to round ("round half up" where it matters) and that numbers are accepted within one unit of the last decimal asked for.
|
| 17 |
+
3. **No knife edges.** When a value decides a category, a flag, a ranking or a rounding, regenerate until it is clearly away from the boundary (see `clear_of`, and the `while True` loops in Ward Round). No ties in rankings or allocations unless the instruction gives a tie-break and the tie-break is tested.
|
| 18 |
+
4. **Every check has teeth.** Prefer numeric and structural answers. Avoid checks an agent could pass by guessing (a lone yes/no). Where a boolean or category is needed, also check the numbers behind it. Weight summary checks (a set of flagged ids) 2.
|
| 19 |
+
5. **The work must be real.** Files should look like the records a practitioner handles: unsorted rows, irrelevant columns or rows that must be filtered out, units to convert, a rule document to apply. Difficulty 1 is a clean small case; difficulty 2 adds volume and one complication; difficulty 3 adds a second complication and a derived or cross-record answer. Do not make it hard by making it vague.
|
| 20 |
+
6. **No leaks.** Expected values never appear in the task files. Reference files give rules, never answers.
|
| 21 |
+
7. **Synthetic data only.** No real persons. Real public methods, formulas and constants are welcome and should be named in the module docstring with their source. If you are not certain of a published constant, put the constant in the task's reference file as "use these values" so correctness does not depend on your memory of it.
|
| 22 |
+
8. **Determinism.** All randomness comes from `rng_for(ENV + "/" + family, seed, difficulty)`. No clocks, no global `random`, no set-ordering dependence (sort before choosing).
|
| 23 |
+
9. **Compatibility.** `gen.py` and tools run on Python 3.9; `oracle.py` and `validators.py` run on 3.9 to 3.12. Standard library only everywhere. No f-string nesting tricks, no `match`, no `X | Y` type syntax.
|
| 24 |
+
10. **Plain language.** Instructions are short, concrete and in British English. No emoji, no em dashes.
|
| 25 |
+
|
| 26 |
+
## Checks
|
| 27 |
+
|
| 28 |
+
Build them with the helpers in `practice/core.py`: `c_int`, `c_num(path, value, decimals)`, `c_str`, `c_bool`, `c_list`, `c_set`, `c_custom(name, args)`. Paths are dotted (`patients.P03.score`). Keys in paths must not contain dots. The answer is always one JSON object. Aim for 6 to 40 checks per task.
|
| 29 |
+
|
| 30 |
+
For a non-unique answer, a `c_custom` validator must check every constraint of the problem against the answer itself (not compare with a stored solution), and `args` carries the problem data the validator needs. Also add ordinary checks for any unique derived values.
|
| 31 |
+
|
| 32 |
+
## Self-test (must pass before you finish)
|
| 33 |
+
|
| 34 |
+
```bash
|
| 35 |
+
python3 tools/selftest.py <folder_name> 60
|
| 36 |
+
```
|
| 37 |
+
|
| 38 |
+
It checks, for 180 tasks: determinism, oracle scores exactly 1.0 from the files alone, junk answers score 0, every non-custom check fails when its value is changed, no leaks, and every top-level answer key is named in the instruction.
|
| 39 |
+
|
| 40 |
+
Then add `tests/test_<folder_name>.py` (plain asserts, runnable with `python3 tests/test_<folder_name>.py`) with:
|
| 41 |
+
|
| 42 |
+
- at least three **hand-worked cases per family**: small inputs whose correct answers you derived by hand or from a published worked example, asserted against the generator's formula functions. This is the guard against a formula that is consistently wrong in both code paths, so take it seriously and show the arithmetic in comments.
|
| 43 |
+
- for each custom validator: at least four wrong answers that must be rejected (each violating a different constraint) and one right answer accepted.
|
| 44 |
+
|
| 45 |
+
## Report back
|
| 46 |
+
|
| 47 |
+
When done, report only: the families, the formulas and constants used with their sources, anything you were unsure about, and the self-test and unit-test output lines. Touch only your own `envs/<name>/` folders and `tests/test_<name>.py`.
|
LICENSE
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2026 Renaissance Labs
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
| 6 |
+
|
| 7 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 8 |
+
|
| 9 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
VALIDATION.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Practice validation
|
| 2 |
+
|
| 3 |
+
Release checked on 23 November 2026. Python 3.9 source tools; Python 3.12 task containers.
|
| 4 |
+
|
| 5 |
+
- 13 environments, 49 task families, 1,404 Harbor task directories.
|
| 6 |
+
- Each environment has 84 training tasks and 24 evaluation tasks. Evaluation seeds start at 10,000 and are disjoint from training seeds. Task IDs are unique.
|
| 7 |
+
- Generator self-tests: 60 seeds at each of three difficulties per environment, 2,340 tasks total, zero failures. These check determinism, independent file-based oracle agreement, junk-answer rejection, per-check mutations, and named answer keys.
|
| 8 |
+
- All nine hand-worked test scripts pass. Harris Matrix also checks that its faulty records have a unique minimal repair at all three difficulties.
|
| 9 |
+
- Exported directories: all 1,404 tested locally, no-op reward 0 and oracle reward 1, zero failures.
|
| 10 |
+
- Docker: one easy task from each of the 49 families, networking disabled, 1 CPU and 1 GB RAM; all no-op rewards 0, all oracle rewards 1. Medium and hard tasks are covered by local checks, not this container smoke test.
|
| 11 |
+
|
| 12 |
+
Reproduce the complete checks:
|
| 13 |
+
|
| 14 |
+
```sh
|
| 15 |
+
python3 tools/export.py
|
| 16 |
+
python3 tools/validate.py --exported --docker
|
| 17 |
+
python3 tools/make_card.py
|
| 18 |
+
```
|
| 19 |
+
|
| 20 |
+
No model baseline or training run has been performed. These checks establish internal correctness and packaging, not practitioner review, realism or training benefit. Data is synthetic; any jurisdiction-dependent rules are fictional and supplied with the task.
|
data/argument-check/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "argument-check-consistency-d1-e0000", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 1, "seed": 10000, "title": "Consistency of 4 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 4 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 15, "path": "tasks/argument-check/argument-check-consistency-d1-e0000"}
|
| 2 |
+
{"id": "argument-check-equivalence-d1-e0001", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 1, "seed": 10001, "title": "Equivalence of 5 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 5 pairs of formulas in propositional logic, `left` and `right`. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).", "checks": 18, "path": "tasks/argument-check/argument-check-equivalence-d1-e0001"}
|
| 3 |
+
{"id": "argument-check-validity-d1-e0002", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 1, "seed": 10002, "title": "Validity of 5 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 5 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 19, "path": "tasks/argument-check/argument-check-validity-d1-e0002"}
|
| 4 |
+
{"id": "argument-check-consistency-d2-e0003", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 2, "seed": 10003, "title": "Consistency of 6 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 6 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none).\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 28, "path": "tasks/argument-check/argument-check-consistency-d2-e0003"}
|
| 5 |
+
{"id": "argument-check-equivalence-d2-e0004", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 2, "seed": 10004, "title": "Equivalence of 6 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 6 pairs of formulas in propositional logic, `left` and `right`. `convert.json` holds 2 further formulas to rewrite in normal form. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted.", "checks": 24, "path": "tasks/argument-check/argument-check-equivalence-d2-e0004"}
|
| 6 |
+
{"id": "argument-check-validity-d2-e0005", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 2, "seed": 10005, "title": "Validity of 8 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 8 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 29, "path": "tasks/argument-check/argument-check-validity-d2-e0005"}
|
| 7 |
+
{"id": "argument-check-consistency-d3-e0006", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 3, "seed": 10006, "title": "Consistency of 7 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 7 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none).\n - `restoring`: for an unsatisfiable set only, the list of sentence numbers (1 for the first sentence in the file, 2 for the second, and so on) such that deleting that one sentence and keeping the others leaves a satisfiable set. Any order; an empty list if none.\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 35, "path": "tasks/argument-check/argument-check-consistency-d3-e0006"}
|
| 8 |
+
{"id": "argument-check-equivalence-d3-e0007", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 3, "seed": 10007, "title": "Equivalence of 6 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 6 pairs of formulas in propositional logic, `left` and `right`. `convert.json` holds 2 further formulas to rewrite in normal form. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `left_only_rows`: the number of rows in which `left` is true and `right` is false, as an integer.\n - `relation`: one of `equivalent`, `left-entails-right` (not equivalent, and `right` is true in every row in which `left` is true), `right-entails-left` (not equivalent, and `left` is true in every row in which `right` is true) or `neither`.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted.\n- `dnf`: the same for disjunctive normal form.", "checks": 38, "path": "tasks/argument-check/argument-check-equivalence-d3-e0007"}
|
| 9 |
+
{"id": "argument-check-validity-d3-e0008", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 3, "seed": 10008, "title": "Validity of 9 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 9 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n - `essential_premises`: for a valid argument only, the list of premise numbers (1 for the first premise in the file, 2 for the second, and so on) that are essential as defined in the reference. Any order; an empty list if none.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 37, "path": "tasks/argument-check/argument-check-validity-d3-e0008"}
|
| 10 |
+
{"id": "argument-check-consistency-d1-e0009", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 1, "seed": 10009, "title": "Consistency of 4 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 4 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 15, "path": "tasks/argument-check/argument-check-consistency-d1-e0009"}
|
| 11 |
+
{"id": "argument-check-equivalence-d1-e0010", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 1, "seed": 10010, "title": "Equivalence of 5 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 5 pairs of formulas in propositional logic, `left` and `right`. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).", "checks": 18, "path": "tasks/argument-check/argument-check-equivalence-d1-e0010"}
|
| 12 |
+
{"id": "argument-check-validity-d1-e0011", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 1, "seed": 10011, "title": "Validity of 5 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 5 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 19, "path": "tasks/argument-check/argument-check-validity-d1-e0011"}
|
| 13 |
+
{"id": "argument-check-consistency-d2-e0012", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 2, "seed": 10012, "title": "Consistency of 6 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 6 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none).\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 28, "path": "tasks/argument-check/argument-check-consistency-d2-e0012"}
|
| 14 |
+
{"id": "argument-check-equivalence-d2-e0013", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 2, "seed": 10013, "title": "Equivalence of 6 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 6 pairs of formulas in propositional logic, `left` and `right`. `convert.json` holds 2 further formulas to rewrite in normal form. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted.", "checks": 24, "path": "tasks/argument-check/argument-check-equivalence-d2-e0013"}
|
| 15 |
+
{"id": "argument-check-validity-d2-e0014", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 2, "seed": 10014, "title": "Validity of 8 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 8 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 29, "path": "tasks/argument-check/argument-check-validity-d2-e0014"}
|
| 16 |
+
{"id": "argument-check-consistency-d3-e0015", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 3, "seed": 10015, "title": "Consistency of 7 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 7 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none).\n - `restoring`: for an unsatisfiable set only, the list of sentence numbers (1 for the first sentence in the file, 2 for the second, and so on) such that deleting that one sentence and keeping the others leaves a satisfiable set. Any order; an empty list if none.\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 37, "path": "tasks/argument-check/argument-check-consistency-d3-e0015"}
|
| 17 |
+
{"id": "argument-check-equivalence-d3-e0016", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 3, "seed": 10016, "title": "Equivalence of 6 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 6 pairs of formulas in propositional logic, `left` and `right`. `convert.json` holds 2 further formulas to rewrite in normal form. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `left_only_rows`: the number of rows in which `left` is true and `right` is false, as an integer.\n - `relation`: one of `equivalent`, `left-entails-right` (not equivalent, and `right` is true in every row in which `left` is true), `right-entails-left` (not equivalent, and `left` is true in every row in which `right` is true) or `neither`.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted.\n- `dnf`: the same for disjunctive normal form.", "checks": 38, "path": "tasks/argument-check/argument-check-equivalence-d3-e0016"}
|
| 18 |
+
{"id": "argument-check-validity-d3-e0017", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 3, "seed": 10017, "title": "Validity of 9 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 9 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n - `essential_premises`: for a valid argument only, the list of premise numbers (1 for the first premise in the file, 2 for the second, and so on) that are essential as defined in the reference. Any order; an empty list if none.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 37, "path": "tasks/argument-check/argument-check-validity-d3-e0017"}
|
| 19 |
+
{"id": "argument-check-consistency-d1-e0018", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 1, "seed": 10018, "title": "Consistency of 4 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 4 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 15, "path": "tasks/argument-check/argument-check-consistency-d1-e0018"}
|
| 20 |
+
{"id": "argument-check-equivalence-d1-e0019", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 1, "seed": 10019, "title": "Equivalence of 5 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 5 pairs of formulas in propositional logic, `left` and `right`. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).", "checks": 18, "path": "tasks/argument-check/argument-check-equivalence-d1-e0019"}
|
| 21 |
+
{"id": "argument-check-validity-d1-e0020", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 1, "seed": 10020, "title": "Validity of 5 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 5 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 18, "path": "tasks/argument-check/argument-check-validity-d1-e0020"}
|
| 22 |
+
{"id": "argument-check-consistency-d2-e0021", "env": "argument-check", "isced_f": "0223", "family": "consistency", "difficulty": 2, "seed": 10021, "title": "Consistency of 6 sets of sentences", "instruction": "# Argument check: consistency\n\n`sentence_sets.json` holds 6 sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every set with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sets`: an object keyed by set id. For each set give\n - `satisfiable`: `true` or `false`.\n - `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).\n - `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).\n - `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none).\n- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).", "checks": 28, "path": "tasks/argument-check/argument-check-consistency-d2-e0021"}
|
| 23 |
+
{"id": "argument-check-equivalence-d2-e0022", "env": "argument-check", "isced_f": "0223", "family": "equivalence", "difficulty": 2, "seed": 10022, "title": "Equivalence of 6 pairs of formulas", "instruction": "# Argument check: equivalence\n\n`pairs.json` holds 6 pairs of formulas in propositional logic, `left` and `right`. `convert.json` holds 2 further formulas to rewrite in normal form. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nCompare the two formulas of every pair with a full truth table over the atoms that occur in either of them.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `pairs`: an object keyed by pair id. For each pair give\n - `equivalent`: `true` or `false`.\n - `left_models`: the number of rows in which `left` is true, as an integer.\n - `right_models`: the number of rows in which `right` is true, as an integer.\n - `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.\n- `equivalent_ids`: list of the ids of the equivalent pairs (any order).\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted.", "checks": 24, "path": "tasks/argument-check/argument-check-equivalence-d2-e0022"}
|
| 24 |
+
{"id": "argument-check-validity-d2-e0023", "env": "argument-check", "isced_f": "0223", "family": "validity", "difficulty": 2, "seed": 10023, "title": "Validity of 8 arguments", "instruction": "# Argument check: validity\n\n`arguments.json` holds 8 arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.\n\nTest every argument with a full truth table over the atoms that occur in it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `arguments`: an object keyed by argument id. For each argument give\n - `valid`: `true` or `false`.\n - `premise_true_rows`: the number of rows in which every premise is true, as an integer.\n - `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).\n - `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.\n- `valid_ids`: list of the ids of the valid arguments (any order).", "checks": 29, "path": "tasks/argument-check/argument-check-validity-d2-e0023"}
|
data/argument-check/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/class-test/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "class-test-distractors-d1-e0000", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 1, "seed": 10000, "title": "Distractor analysis of a 6-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 6 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q6`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D.\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/class-test/class-test-distractors-d1-e0000"}
|
| 2 |
+
{"id": "class-test-item-analysis-d1-e0001", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 1, "seed": 10001, "title": "Item analysis of a 8-item test", "instruction": "# Class test: item analysis\n\n`scores.csv` holds the item scores (1 right, 0 wrong) of 23 students on a 8-item test. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q8`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/class-test/class-test-item-analysis-d1-e0001"}
|
| 3 |
+
{"id": "class-test-marking-d1-e0002", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 1, "seed": 10002, "title": "Mark a 20-item test for 6 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 6 students for a 20-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, an integer.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/class-test/class-test-marking-d1-e0002"}
|
| 4 |
+
{"id": "class-test-moderation-d1-e0003", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 1, "seed": 10003, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`marks.csv` holds the marks of 10 students on a class test. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `raw_mean`: the mean of the marks, 2 decimals.\n- `raw_sd`: the population standard deviation of the marks, 2 decimals.\n- `students`: an object keyed by student id, each with `scaled`: the rescaled mark, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/class-test/class-test-moderation-d1-e0003"}
|
| 5 |
+
{"id": "class-test-distractors-d2-e0004", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 2, "seed": 10004, "title": "Distractor analysis of a 8-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 8 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q8`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D.\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n - `omitted`: the number of students who left the item out, an integer.\n - `key_pct`: the percentage of the `N` students who chose the key, 1 decimal.\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/class-test/class-test-distractors-d2-e0004"}
|
| 6 |
+
{"id": "class-test-item-analysis-d2-e0005", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 2, "seed": 10005, "title": "Item analysis of a 10-item test", "instruction": "# Class test: item analysis\n\n`responses.csv` holds the options chosen by the students of two classes on a 10-item multiple-choice test, and `key.csv` the correct options. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly. Analyse the two classes together as one group.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q10`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n- `too_easy`: list of the items that are too easy (any order; an empty list if none).\n- `too_hard`: list of the items that are too hard (any order; an empty list if none).\n- `kr20`: the KR-20 reliability of the test, 3 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/class-test/class-test-item-analysis-d2-e0005"}
|
| 7 |
+
{"id": "class-test-marking-d2-e0006", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 2, "seed": 10006, "title": "Mark a 24-item test for 9 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 9 students for a 24-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, 2 decimals.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 29, "path": "tasks/class-test/class-test-marking-d2-e0006"}
|
| 8 |
+
{"id": "class-test-moderation-d2-e0007", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 2, "seed": 10007, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`marks.csv` holds the marks of two teaching groups on the same test. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `groups`: an object keyed by teaching group, each with `raw_mean` and `raw_sd` (population standard deviation) of that group's marks, 2 decimals.\n- `students`: an object keyed by student id, for every student with a mark, each with `scaled`: the rescaled mark after any limiting, 1 decimal.\n- `clamped`: list of the student ids whose scaled mark had to be limited to the top or bottom of the range (any order; an empty list if none).\n- `absent`: list of the student ids with no mark (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/class-test/class-test-moderation-d2-e0007"}
|
| 9 |
+
{"id": "class-test-distractors-d3-e0008", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 3, "seed": 10008, "title": "Distractor analysis of a 7-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 7 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q7`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D (and E for a five-option item).\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n - `omitted`: the number of students who left the item out, an integer.\n - `key_pct`: the percentage of the `N` students who chose the key, 1 decimal.\n - `top_distractor`: the letter of the distractor chosen by the most students.\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n- `n_students`: `N`, an integer.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/class-test/class-test-distractors-d3-e0008"}
|
| 10 |
+
{"id": "class-test-item-analysis-d3-e0009", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 3, "seed": 10009, "title": "Item analysis of a 10-item test", "instruction": "# Class test: item analysis\n\n`responses.csv` holds the options chosen by the students of two classes on a 10-item multiple-choice test, and `key.csv` the correct options. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly. Analyse the two classes together as one group.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q10`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n - `point_biserial`: 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n- `too_easy`: list of the items that are too easy (any order; an empty list if none).\n- `too_hard`: list of the items that are too hard (any order; an empty list if none).\n- `kr20`: the KR-20 reliability of the test, 3 decimals.\n- `n_students`: the number of students in the analysis, an integer.\n- `needs_review`: list of the items whose point-biserial is below 0.20 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 37, "path": "tasks/class-test/class-test-item-analysis-d3-e0009"}
|
| 11 |
+
{"id": "class-test-marking-d3-e0010", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 3, "seed": 10010, "title": "Mark a 30-item test for 10 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 10 students for a 30-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, 2 decimals.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n- `grade_counts`: an object with the keys `A`, `B`, `C`, `D`, `U`, each the number of students with that grade (0 if none).\n- `mean_percent`: the mean of the students' unrounded percentages, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/class-test/class-test-marking-d3-e0010"}
|
| 12 |
+
{"id": "class-test-moderation-d3-e0011", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 3, "seed": 10011, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`scripts.csv` holds the marks three markers gave to their scripts, and `moderation_sample.csv` the marks a moderator gave to a sample of those scripts. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `markers`: an object keyed by marker, each with `mean_difference`: the mean of moderator's mark minus marker's mark over that marker's sampled scripts, 2 decimals, with its sign.\n- `adjusted_markers`: list of the markers whose marks were adjusted in step 1 (any order; an empty list if none).\n- `cohort_mean` and `cohort_sd`: the mean and population standard deviation of all students' marks after step 1, 2 decimals.\n- `students`: an object keyed by student id, each with `final`: the mark after step 2, including any limiting, 1 decimal.\n- `clamped`: list of the student ids whose final mark had to be limited to the top or bottom of the range (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/class-test/class-test-moderation-d3-e0011"}
|
| 13 |
+
{"id": "class-test-distractors-d1-e0012", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 1, "seed": 10012, "title": "Distractor analysis of a 6-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 6 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q6`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D.\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/class-test/class-test-distractors-d1-e0012"}
|
| 14 |
+
{"id": "class-test-item-analysis-d1-e0013", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 1, "seed": 10013, "title": "Item analysis of a 8-item test", "instruction": "# Class test: item analysis\n\n`scores.csv` holds the item scores (1 right, 0 wrong) of 22 students on a 8-item test. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q8`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/class-test/class-test-item-analysis-d1-e0013"}
|
| 15 |
+
{"id": "class-test-marking-d1-e0014", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 1, "seed": 10014, "title": "Mark a 20-item test for 6 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 6 students for a 20-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, an integer.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/class-test/class-test-marking-d1-e0014"}
|
| 16 |
+
{"id": "class-test-moderation-d1-e0015", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 1, "seed": 10015, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`marks.csv` holds the marks of 10 students on a class test. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `raw_mean`: the mean of the marks, 2 decimals.\n- `raw_sd`: the population standard deviation of the marks, 2 decimals.\n- `students`: an object keyed by student id, each with `scaled`: the rescaled mark, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/class-test/class-test-moderation-d1-e0015"}
|
| 17 |
+
{"id": "class-test-distractors-d2-e0016", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 2, "seed": 10016, "title": "Distractor analysis of a 8-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 8 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q8`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D.\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n - `omitted`: the number of students who left the item out, an integer.\n - `key_pct`: the percentage of the `N` students who chose the key, 1 decimal.\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/class-test/class-test-distractors-d2-e0016"}
|
| 18 |
+
{"id": "class-test-item-analysis-d2-e0017", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 2, "seed": 10017, "title": "Item analysis of a 10-item test", "instruction": "# Class test: item analysis\n\n`responses.csv` holds the options chosen by the students of two classes on a 10-item multiple-choice test, and `key.csv` the correct options. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly. Analyse the two classes together as one group.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q10`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n- `too_easy`: list of the items that are too easy (any order; an empty list if none).\n- `too_hard`: list of the items that are too hard (any order; an empty list if none).\n- `kr20`: the KR-20 reliability of the test, 3 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/class-test/class-test-item-analysis-d2-e0017"}
|
| 19 |
+
{"id": "class-test-marking-d2-e0018", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 2, "seed": 10018, "title": "Mark a 24-item test for 9 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 9 students for a 24-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, 2 decimals.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 29, "path": "tasks/class-test/class-test-marking-d2-e0018"}
|
| 20 |
+
{"id": "class-test-moderation-d2-e0019", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 2, "seed": 10019, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`marks.csv` holds the marks of two teaching groups on the same test. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `groups`: an object keyed by teaching group, each with `raw_mean` and `raw_sd` (population standard deviation) of that group's marks, 2 decimals.\n- `students`: an object keyed by student id, for every student with a mark, each with `scaled`: the rescaled mark after any limiting, 1 decimal.\n- `clamped`: list of the student ids whose scaled mark had to be limited to the top or bottom of the range (any order; an empty list if none).\n- `absent`: list of the student ids with no mark (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/class-test/class-test-moderation-d2-e0019"}
|
| 21 |
+
{"id": "class-test-distractors-d3-e0020", "env": "class-test", "isced_f": "0111", "family": "distractors", "difficulty": 3, "seed": 10020, "title": "Distractor analysis of a 7-item test", "instruction": "# Class test: distractor analysis\n\n`responses.csv` holds the option each student chose on each of the 7 items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item (`Q1` to `Q7`). Each value has\n - `counts`: a list of integers, the count of each option in the order A, B, C, D (and E for a five-option item).\n - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none).\n - `omitted`: the number of students who left the item out, an integer.\n - `key_pct`: the percentage of the `N` students who chose the key, 1 decimal.\n - `top_distractor`: the letter of the distractor chosen by the most students.\n- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).\n- `key_beaten`: list of the items where at least one distractor beats the key (any order).\n- `n_students`: `N`, an integer.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/class-test/class-test-distractors-d3-e0020"}
|
| 22 |
+
{"id": "class-test-item-analysis-d3-e0021", "env": "class-test", "isced_f": "0111", "family": "item-analysis", "difficulty": 3, "seed": 10021, "title": "Item analysis of a 10-item test", "instruction": "# Class test: item analysis\n\n`responses.csv` holds the options chosen by the students of two classes on a 10-item multiple-choice test, and `key.csv` the correct options. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly. Analyse the two classes together as one group.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `n_group`: the size of the upper group (and of the lower group), an integer.\n- `items`: an object keyed by item (`Q1` to `Q10`). Each value has\n - `facility`: 3 decimals.\n - `discrimination`: the discrimination index, 3 decimals.\n - `point_biserial`: 3 decimals.\n- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).\n- `too_easy`: list of the items that are too easy (any order; an empty list if none).\n- `too_hard`: list of the items that are too hard (any order; an empty list if none).\n- `kr20`: the KR-20 reliability of the test, 3 decimals.\n- `n_students`: the number of students in the analysis, an integer.\n- `needs_review`: list of the items whose point-biserial is below 0.20 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 37, "path": "tasks/class-test/class-test-item-analysis-d3-e0021"}
|
| 23 |
+
{"id": "class-test-marking-d3-e0022", "env": "class-test", "isced_f": "0111", "family": "marking", "difficulty": 3, "seed": 10022, "title": "Mark a 30-item test for 10 students", "instruction": "# Class test: marking\n\n`answer_sheets.csv` holds the answer sheets of 10 students for a 30-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `max_marks`: the maximum total, an integer.\n- `students`: an object keyed by student id. Each value has\n - `marks`: the student's total, 2 decimals.\n - `percent`: the percentage, 1 decimal.\n - `grade`: one of `A`, `B`, `C`, `D`, `U`.\n- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none).\n- `grade_counts`: an object with the keys `A`, `B`, `C`, `D`, `U`, each the number of students with that grade (0 if none).\n- `mean_percent`: the mean of the students' unrounded percentages, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/class-test/class-test-marking-d3-e0022"}
|
| 24 |
+
{"id": "class-test-moderation-d3-e0023", "env": "class-test", "isced_f": "0111", "family": "moderation", "difficulty": 3, "seed": 10023, "title": "Standardise the marks of a class test", "instruction": "# Class test: standardising marks\n\n`scripts.csv` holds the marks three markers gave to their scripts, and `moderation_sample.csv` the marks a moderator gave to a sample of those scripts. `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `markers`: an object keyed by marker, each with `mean_difference`: the mean of moderator's mark minus marker's mark over that marker's sampled scripts, 2 decimals, with its sign.\n- `adjusted_markers`: list of the markers whose marks were adjusted in step 1 (any order; an empty list if none).\n- `cohort_mean` and `cohort_sd`: the mean and population standard deviation of all students' marks after step 1, 2 decimals.\n- `students`: an object keyed by student id, each with `final`: the mark after step 2, including any limiting, 1 decimal.\n- `clamped`: list of the student ids whose final mark had to be limited to the top or bottom of the range (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/class-test/class-test-moderation-d3-e0023"}
|
data/class-test/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/emissions-inventory/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "emissions-inventory-activity-data-d1-e0000", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 1, "seed": 10000, "title": "Activity data to tonnes CO2e, 9 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2019 greenhouse-gas inventory for Lindqvist Castings (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nEvery record belongs to the 2019 reporting year.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d1-e0000"}
|
| 2 |
+
{"id": "emissions-inventory-data-quality-d1-e0001", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 1, "seed": 10001, "title": "Cleaning meter data for 3 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2019 monthly electricity consumption export for the meters of Ostervik Bakery Group (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d1-e0001"}
|
| 3 |
+
{"id": "emissions-inventory-multi-gas-d1-e0002", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 1, "seed": 10002, "title": "CO2, CH4 and N2O for 4 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2019 greenhouse-gas inventory for Tarnwick Borough Council (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nEvery amount is already in the unit of its category's factors.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together as tonnes CO2e), each 2 decimals.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d1-e0002"}
|
| 4 |
+
{"id": "emissions-inventory-time-series-d1-e0003", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 1, "seed": 10003, "title": "Emissions trend over 5 years", "instruction": "# Emissions inventory: trend and target\n\n`annual_emissions.csv` gives the emissions of each year by scope in tonnes CO2e and the year's output (tonnes of product). The rows are in no particular order. `target.md` gives the base year and the reduction target of Ostervik Bakery Group (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2017\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2017.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2017.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2021 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d1-e0003"}
|
| 5 |
+
{"id": "emissions-inventory-activity-data-d2-e0004", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 2, "seed": 10004, "title": "Activity data to tonnes CO2e, 28 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2021 greenhouse-gas inventory for Marrow Vale Housing (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nThe inventory covers the calendar year 2021 only: leave out records whose `invoice_date` falls in another year.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n- `by_site`: an object keyed by site, tonnes CO2e of scopes 1 to 3 together, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d2-e0004"}
|
| 6 |
+
{"id": "emissions-inventory-data-quality-d2-e0005", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 2, "seed": 10005, "title": "Cleaning meter data for 5 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2021 monthly electricity consumption export for the meters of Lindqvist Castings (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n- `filled`: an object keyed by meter id, only for meters that had a missing month. Each value is an object keyed by the missing month (`YYYY-MM`) giving the filled consumption in kWh, 1 decimal.\n- `meters_with_gap`: list of the meter ids that had at least one missing month (any order).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d2-e0005"}
|
| 7 |
+
{"id": "emissions-inventory-multi-gas-d2-e0006", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 2, "seed": 10006, "title": "CO2, CH4 and N2O for 6 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2019 greenhouse-gas inventory for Kestrel Joinery (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nSome amounts are in a different unit from their category's factors: convert first, using 1 m3 = 1000 litres and 1 tonne = 1000 kg.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together as tonnes CO2e), each 2 decimals.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d2-e0006"}
|
| 8 |
+
{"id": "emissions-inventory-time-series-d2-e0007", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 2, "seed": 10007, "title": "Emissions trend over 6 years", "instruction": "# Emissions inventory: trend and target\n\n`emissions_ledger.csv` holds one row per year, site and scope. The `amount` is in tonnes CO2e when `unit` is `t` and in kg CO2e when it is `kg` (1 tonne = 1000 kg). A year's total is the sum over all sites and scopes. `output.csv` gives each year's output (m2 of heated floor area). `target.md` gives the base year and the reduction target of Ostervik Bakery Group (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2018\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2023 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n- `linear_path_latest_t`: where a straight line from the base-year total (in the base year) to the target (in the target year) stands in 2023, tonnes CO2e, 1 decimal.\n- `on_track`: true if the 2023 total is at or below `linear_path_latest_t`, otherwise false.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d2-e0007"}
|
| 9 |
+
{"id": "emissions-inventory-activity-data-d3-e0008", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 3, "seed": 10008, "title": "Activity data to tonnes CO2e, 31 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2024 greenhouse-gas inventory for Kestrel Joinery (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nThe inventory covers the calendar year 2024 only: leave out records whose `invoice_date` falls in another year. Sources classed `outside scopes` in the factor table (biogenic CO2) are reported separately: work out their emissions and list them in `by_source`, but keep them out of `by_scope`, `by_site`, `total_t_co2e`, `scope_share_percent` and `largest_source`.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n- `by_site`: an object keyed by site, tonnes CO2e of scopes 1 to 3 together, 2 decimals.\n- `outside_scopes_t_co2e`: tonnes CO2e of the sources classed `outside scopes`, 2 decimals.\n- `scope_share_percent`: an object with keys `scope_1`, `scope_2` and `scope_3`: each scope's share of `total_t_co2e` in percent, 1 decimal.\n- `largest_source`: the source in scopes 1 to 3 with the largest emissions.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d3-e0008"}
|
| 10 |
+
{"id": "emissions-inventory-data-quality-d3-e0009", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 3, "seed": 10009, "title": "Cleaning meter data for 6 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2020 monthly electricity consumption export for the meters of Lindqvist Castings (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n- `filled`: an object keyed by meter id, only for meters that had a missing month. Each value is an object keyed by the missing month (`YYYY-MM`) giving the filled consumption in kWh, 1 decimal.\n- `meters_with_gap`: list of the meter ids that had at least one missing month (any order).\n- `by_site_t_co2e`: an object keyed by site, tonnes CO2e from the cleaned consumption of that site's meters, 2 decimals.\n- `peak_month`: the month (`YYYY-MM`) with the highest cleaned consumption summed over all meters.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 23, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d3-e0009"}
|
| 11 |
+
{"id": "emissions-inventory-multi-gas-d3-e0010", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 3, "seed": 10010, "title": "CO2, CH4 and N2O for 8 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2023 greenhouse-gas inventory for Brantholm Municipality (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nSome amounts are in a different unit from their category's factors: convert first, using 1 m3 = 1000 litres and 1 tonne = 1000 kg. `refrigerant_log.csv` lists the cooling units serviced in the year: take the refrigerant topped up (`topped_up_kg`) as the amount that leaked, and convert it to CO2e with the GWP of that refrigerant. The charge is for information only.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together, including the refrigerant leaks, as tonnes CO2e), each 2 decimals.\n- `refrigerants_t_co2e`: the refrigerant leaks in tonnes CO2e, 3 decimals.\n- `non_co2_share_percent`: the share of `totals.co2e_t` that does not come from CO2 (CH4, N2O and refrigerants), in percent, 1 decimal.\n- `largest_source`: the `source_id` in `sources.csv` with the largest CO2e.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 39, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d3-e0010"}
|
| 12 |
+
{"id": "emissions-inventory-time-series-d3-e0011", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 3, "seed": 10011, "title": "Emissions trend over 7 years", "instruction": "# Emissions inventory: trend and target\n\n`emissions_ledger.csv` holds one row per year, site and scope. The `amount` is in tonnes CO2e when `unit` is `t` and in kg CO2e when it is `kg` (1 tonne = 1000 kg). A year's total is the sum over all sites and scopes. `output.csv` gives each site's output per year (thousand parcels delivered); a year's output is the sum over sites. Site Cedar was sold in 2021. Under the base-year recalculation policy in `target.md`, leave site Cedar out of every year, in both emissions and output. `target.md` gives the base year and the reduction target of Lindqvist Castings (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2016\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2016.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2016.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2022 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n- `linear_path_latest_t`: where a straight line from the base-year total (in the base year) to the target (in the target year) stands in 2022, tonnes CO2e, 1 decimal.\n- `on_track`: true if the 2022 total is at or below `linear_path_latest_t`, otherwise false.\n- `required_annual_reduction_percent`: the constant percentage cut per year that takes the 2022 total to the target by the target year, 2 decimals: (1 - (target / latest total)^(1 / years left)) x 100.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 31, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d3-e0011"}
|
| 13 |
+
{"id": "emissions-inventory-activity-data-d1-e0012", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 1, "seed": 10012, "title": "Activity data to tonnes CO2e, 14 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2020 greenhouse-gas inventory for Kestrel Joinery (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nEvery record belongs to the 2020 reporting year.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d1-e0012"}
|
| 14 |
+
{"id": "emissions-inventory-data-quality-d1-e0013", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 1, "seed": 10013, "title": "Cleaning meter data for 3 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2019 monthly electricity consumption export for the meters of Kestrel Joinery (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d1-e0013"}
|
| 15 |
+
{"id": "emissions-inventory-multi-gas-d1-e0014", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 1, "seed": 10014, "title": "CO2, CH4 and N2O for 4 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2024 greenhouse-gas inventory for Kestrel Joinery (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nEvery amount is already in the unit of its category's factors.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together as tonnes CO2e), each 2 decimals.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d1-e0014"}
|
| 16 |
+
{"id": "emissions-inventory-time-series-d1-e0015", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 1, "seed": 10015, "title": "Emissions trend over 5 years", "instruction": "# Emissions inventory: trend and target\n\n`annual_emissions.csv` gives the emissions of each year by scope in tonnes CO2e and the year's output (tonnes of product). The rows are in no particular order. `target.md` gives the base year and the reduction target of Ostervik Bakery Group (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2018\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2022 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d1-e0015"}
|
| 17 |
+
{"id": "emissions-inventory-activity-data-d2-e0016", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 2, "seed": 10016, "title": "Activity data to tonnes CO2e, 26 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2020 greenhouse-gas inventory for Harlow Fold Logistics (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nThe inventory covers the calendar year 2020 only: leave out records whose `invoice_date` falls in another year.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n- `by_site`: an object keyed by site, tonnes CO2e of scopes 1 to 3 together, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d2-e0016"}
|
| 18 |
+
{"id": "emissions-inventory-data-quality-d2-e0017", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 2, "seed": 10017, "title": "Cleaning meter data for 5 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2021 monthly electricity consumption export for the meters of Marrow Vale Housing (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n- `filled`: an object keyed by meter id, only for meters that had a missing month. Each value is an object keyed by the missing month (`YYYY-MM`) giving the filled consumption in kWh, 1 decimal.\n- `meters_with_gap`: list of the meter ids that had at least one missing month (any order).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d2-e0017"}
|
| 19 |
+
{"id": "emissions-inventory-multi-gas-d2-e0018", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 2, "seed": 10018, "title": "CO2, CH4 and N2O for 6 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2019 greenhouse-gas inventory for Lindqvist Castings (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nSome amounts are in a different unit from their category's factors: convert first, using 1 m3 = 1000 litres and 1 tonne = 1000 kg.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together as tonnes CO2e), each 2 decimals.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d2-e0018"}
|
| 20 |
+
{"id": "emissions-inventory-time-series-d2-e0019", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 2, "seed": 10019, "title": "Emissions trend over 6 years", "instruction": "# Emissions inventory: trend and target\n\n`emissions_ledger.csv` holds one row per year, site and scope. The `amount` is in tonnes CO2e when `unit` is `t` and in kg CO2e when it is `kg` (1 tonne = 1000 kg). A year's total is the sum over all sites and scopes. `output.csv` gives each year's output (residents). `target.md` gives the base year and the reduction target of Marrow Vale Housing (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2015\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2015.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2015.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2020 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n- `linear_path_latest_t`: where a straight line from the base-year total (in the base year) to the target (in the target year) stands in 2020, tonnes CO2e, 1 decimal.\n- `on_track`: true if the 2020 total is at or below `linear_path_latest_t`, otherwise false.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d2-e0019"}
|
| 21 |
+
{"id": "emissions-inventory-activity-data-d3-e0020", "env": "emissions-inventory", "isced_f": "0521", "family": "activity-data", "difficulty": 3, "seed": 10020, "title": "Activity data to tonnes CO2e, 30 records", "instruction": "# Emissions inventory: activity data\n\nYou are compiling the 2023 greenhouse-gas inventory for Brantholm Municipality (a synthetic organisation).\n\n- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.\n- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.\n- `inventory_boundary.md`: the organisation and the reporting year.\n- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.\n\nThe inventory covers the calendar year 2023 only: leave out records whose `invoice_date` falls in another year. Sources classed `outside scopes` in the factor table (biogenic CO2) are reported separately: work out their emissions and list them in `by_source`, but keep them out of `by_scope`, `by_site`, `total_t_co2e`, `scope_share_percent` and `largest_source`.\n\nFor each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.\n- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.\n- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.\n- `by_site`: an object keyed by site, tonnes CO2e of scopes 1 to 3 together, 2 decimals.\n- `outside_scopes_t_co2e`: tonnes CO2e of the sources classed `outside scopes`, 2 decimals.\n- `scope_share_percent`: an object with keys `scope_1`, `scope_2` and `scope_3`: each scope's share of `total_t_co2e` in percent, 1 decimal.\n- `largest_source`: the source in scopes 1 to 3 with the largest emissions.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/emissions-inventory/emissions-inventory-activity-data-d3-e0020"}
|
| 22 |
+
{"id": "emissions-inventory-data-quality-d3-e0021", "env": "emissions-inventory", "isced_f": "0521", "family": "data-quality", "difficulty": 3, "seed": 10021, "title": "Cleaning meter data for 6 meters", "instruction": "# Emissions inventory: cleaning the meter data\n\n`meter_readings.csv` is the 2022 monthly electricity consumption export for the meters of Brantholm Municipality (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `meters`: an object keyed by meter id, each with\n - `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.\n - `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).\n- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.\n- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.\n- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.\n- `filled`: an object keyed by meter id, only for meters that had a missing month. Each value is an object keyed by the missing month (`YYYY-MM`) giving the filled consumption in kWh, 1 decimal.\n- `meters_with_gap`: list of the meter ids that had at least one missing month (any order).\n- `by_site_t_co2e`: an object keyed by site, tonnes CO2e from the cleaned consumption of that site's meters, 2 decimals.\n- `peak_month`: the month (`YYYY-MM`) with the highest cleaned consumption summed over all meters.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 24, "path": "tasks/emissions-inventory/emissions-inventory-data-quality-d3-e0021"}
|
| 23 |
+
{"id": "emissions-inventory-multi-gas-d3-e0022", "env": "emissions-inventory", "isced_f": "0521", "family": "multi-gas", "difficulty": 3, "seed": 10022, "title": "CO2, CH4 and N2O for 8 sources", "instruction": "# Emissions inventory: three gases\n\nYou are compiling the 2020 greenhouse-gas inventory for Kestrel Joinery (a synthetic organisation), gas by gas.\n\n- `sources.csv`: the emission sources and their activity amounts.\n- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.\n- `gwp_values.md`: the global warming potentials to use.\n\nSome amounts are in a different unit from their category's factors: convert first, using 1 m3 = 1000 litres and 1 tonne = 1000 kg. `refrigerant_log.csv` lists the cooling units serviced in the year: take the refrigerant topped up (`topped_up_kg`) as the amount that leaked, and convert it to CO2e with the GWP of that refrigerant. The charge is for information only.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sources`: an object keyed by `source_id`, each with\n - `co2_t`: CO2 emitted, in tonnes, 2 decimals.\n - `ch4_kg`: CH4 emitted, in kg, 2 decimals.\n - `n2o_kg`: N2O emitted, in kg, 2 decimals.\n - `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.\n- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (everything together, including the refrigerant leaks, as tonnes CO2e), each 2 decimals.\n- `refrigerants_t_co2e`: the refrigerant leaks in tonnes CO2e, 3 decimals.\n- `non_co2_share_percent`: the share of `totals.co2e_t` that does not come from CO2 (CH4, N2O and refrigerants), in percent, 1 decimal.\n- `largest_source`: the `source_id` in `sources.csv` with the largest CO2e.\n\n1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 39, "path": "tasks/emissions-inventory/emissions-inventory-multi-gas-d3-e0022"}
|
| 24 |
+
{"id": "emissions-inventory-time-series-d3-e0023", "env": "emissions-inventory", "isced_f": "0521", "family": "time-series", "difficulty": 3, "seed": 10023, "title": "Emissions trend over 7 years", "instruction": "# Emissions inventory: trend and target\n\n`emissions_ledger.csv` holds one row per year, site and scope. The `amount` is in tonnes CO2e when `unit` is `t` and in kg CO2e when it is `kg` (1 tonne = 1000 kg). A year's total is the sum over all sites and scopes. `output.csv` gives each site's output per year (m2 of heated floor area); a year's output is the sum over sites. Site Birch was sold in 2023. Under the base-year recalculation policy in `target.md`, leave site Birch out of every year, in both emissions and output. `target.md` gives the base year and the reduction target of Vessby Dairy Cooperative (a synthetic organisation).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: an object keyed by year (as a string, for example \"2018\"), each with\n - `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.\n - `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.\n - `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n - `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for 2018.\n- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.\n- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the 2024 total to the target by the target year: (latest total - target) / years left, 1 decimal.\n- `linear_path_latest_t`: where a straight line from the base-year total (in the base year) to the target (in the target year) stands in 2024, tonnes CO2e, 1 decimal.\n- `on_track`: true if the 2024 total is at or below `linear_path_latest_t`, otherwise false.\n- `required_annual_reduction_percent`: the constant percentage cut per year that takes the 2024 total to the target by the target year, 2 decimals: (1 - (target / latest total)^(1 / years left)) x 100.\n\nA percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 31, "path": "tasks/emissions-inventory/emissions-inventory-time-series-d3-e0023"}
|
data/emissions-inventory/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/exposure-assessment/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "exposure-assessment-chemicals-d1-e0000", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 1, "seed": 10000, "title": "Airborne exposure for 3 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the personal air samples taken on three workers during one 8-hour shift: the minutes each sample ran and the concentration it found, in mg/m3. Each worker was sampled for one substance.\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled.\n\nThe 8-hour time-weighted average (TWA) is\n\n TWA = sum( C_i * t_i ) / 480\n\nwith C_i the concentration of sample i and t_i its duration in minutes. Time that was not sampled counts as zero exposure.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.\n - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals.\n- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d1-e0000"}
|
| 2 |
+
{"id": "exposure-assessment-incidents-d1-e0001", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 1, "seed": 10001, "title": "Injury rates for 2024", "instruction": "# Incident statistics\n\n`incident_log.csv` is one site's incident log for 2024 and `hours_worked.csv` gives the hours worked each month. `definitions.md` says what counts as a lost-time injury and how the rates are defined.\n\nWork out the site's figures for the year.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `lti_count`: the number of lost-time injuries, an integer.\n- `days_lost`: the total days lost through those injuries, an integer.\n- `hours_worked`: the total hours worked in the year, an integer.\n- `ltifr`: the frequency rate, 2 decimals.\n- `severity_rate`: the severity rate, 2 decimals.\n- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 6, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d1-e0001"}
|
| 3 |
+
{"id": "exposure-assessment-noise-d1-e0002", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 1, "seed": 10002, "title": "Noise exposure for 3 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working day: the tasks each worker did, the minutes spent on each and the level measured for that task (`laeq_db`, in dB(A)). `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `lex8h_db`: the daily personal noise exposure L_EX,8h in dB(A), 1 decimal.\n - `band`: the band of that exposure, one of the four names in `exposure_values.md`.\n- `at_or_above_upper_action`: list of the worker ids whose L_EX,8h is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/exposure-assessment/exposure-assessment-noise-d1-e0002"}
|
| 4 |
+
{"id": "exposure-assessment-vibration-d1-e0003", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 1, "seed": 10003, "title": "Hand-arm vibration for 4 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` lists the vibrating tools each operator used today, the vibration magnitude measured at the handle (`vibration_m_s2`) and the trigger time in minutes. `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d1-e0003"}
|
| 5 |
+
{"id": "exposure-assessment-chemicals-d2-e0004", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 2, "seed": 10004, "title": "Airborne exposure for 5 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the air samples from one survey day (each worker was sampled for one substance) and `workers.csv` gives each worker's shift length and how to treat the time that was not sampled. Use only the rows with `sample_type` `personal`: static (area) samples and field blanks are not part of a worker's exposure. Some concentrations are in ppm and some in mg/m3 (see `unit`). Convert with\n\n mg/m3 = ppm * M / 24.45 (M is the molar mass in g/mol)\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled.\n\nThe 8-hour time-weighted average (TWA) always uses 480 minutes as the reference period, whatever the shift length. With C_i the concentration of personal sample i in mg/m3 and t_i its duration in minutes:\n\n- `unsampled_time` = `zero`: time outside the samples counts as zero exposure, so TWA = sum( C_i * t_i ) / 480.\n- `unsampled_time` = `as_sampled`: the whole shift is taken to be at the time-weighted mean of the sampled periods, so TWA = ( sum( C_i * t_i ) / sum( t_i ) ) * shift_min / 480.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.\n - `twa_ppm`: the same TWA expressed in ppm, 2 decimals.\n - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals.\n- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d2-e0004"}
|
| 6 |
+
{"id": "exposure-assessment-incidents-d2-e0005", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 2, "seed": 10005, "title": "Injury rates for 2022", "instruction": "# Incident statistics\n\n`incident_log.csv` is a site's incident log for 2022 and `hours_worked.csv` gives the hours worked by each department's employees each month. `definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is.\n\nWork out the figures for each department and for the site as a whole.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `departments`: an object keyed by department name, each with `lti_count` (integer), `days_lost` (integer, total days lost through LTIs), `hours_worked` (integer), `ltifr` (2 decimals) and `severity_rate` (3 decimals).\n- `site`: the same five keys for all departments together.\n- `above_target`: list of the departments whose LTIFR is above the target (any order; an empty list if none).\n- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d2-e0005"}
|
| 7 |
+
{"id": "exposure-assessment-noise-d2-e0006", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 2, "seed": 10006, "title": "Noise exposure for 5 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working day, with a start and end time (24-hour clock) for each task. `task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed). `planned_work.csv` names, for each worker, one task the supervisor would like to add after the work in the diary. `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `lex8h_db`: the daily personal noise exposure L_EX,8h from the diary, in dB(A), 1 decimal.\n - `band`: the band of that exposure, one of the four names in `exposure_values.md`.\n - `extra_minutes`: the largest whole number of minutes of the planned task that can be added to the diary with L_EX,8h staying at or below the limit value. Work out the exact time at which L_EX,8h would equal the limit value and round it down to whole minutes. Give 0 if the diary alone is already above the limit value.\n- `at_or_above_upper_action`: list of the worker ids whose L_EX,8h is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/exposure-assessment/exposure-assessment-noise-d2-e0006"}
|
| 8 |
+
{"id": "exposure-assessment-vibration-d2-e0007", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 2, "seed": 10007, "title": "Hand-arm vibration for 5 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` is today's tool log. Each row is a batch of identical operations with one tool: the exposure time of the row is `operations` times `seconds_per_operation`. An operator may have several rows for the same tool; add their times together. `tools.csv` gives the vibration magnitude of each tool (`vibration_m_s2`). `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nFor each tool in `tools.csv` (whether or not it was used today), also work out how long the tool could be used on its own before A(8) reaches a given value:\n\n time in minutes = 480 * ( value / a )^2\n\nThe result may be longer than a working day; report it as calculated.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n- `tools`: an object keyed by tool id, each with `minutes_to_action`: the minutes of use of that tool alone at which A(8) equals the exposure action value, 1 decimal.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d2-e0007"}
|
| 9 |
+
{"id": "exposure-assessment-chemicals-d3-e0008", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 3, "seed": 10008, "title": "Airborne exposure for 4 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the air samples from one survey day and `workers.csv` gives each worker's shift length and how to treat the time that was not sampled. Use only the rows with `sample_type` `personal`: static (area) samples and field blanks are not part of a worker's exposure. Some concentrations are in ppm and some in mg/m3 (see `unit`). Convert with\n\n mg/m3 = ppm * M / 24.45 (M is the molar mass in g/mol)\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled. Some limits are tabled in ppm and some in mg/m3 (see `oel_unit`); convert the ppm ones to mg/m3 with the same formula.\n\nThe 8-hour time-weighted average (TWA) always uses 480 minutes as the reference period, whatever the shift length. With C_i the concentration of personal sample i in mg/m3 and t_i its duration in minutes:\n\n- `unsampled_time` = `zero`: time outside the samples counts as zero exposure, so TWA = sum( C_i * t_i ) / 480.\n- `unsampled_time` = `as_sampled`: the whole shift is taken to be at the time-weighted mean of the sampled periods, so TWA = ( sum( C_i * t_i ) / sum( t_i ) ) * shift_min / 480.\n\nEach worker was sampled for two or three substances; work out a TWA for each. Substances in the same `effect_group` act together, so for each worker and each effect group add up the exposure indices of that worker's substances in the group (the additive mixture index, sum of C_i / OEL_i). A group with one substance has that substance's index.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `substances`: an object keyed by substance name, each with `twa_mg_m3` (the 8-hour TWA in mg/m3, 2 decimals) and `exposure_index` (the TWA divided by the limit in mg/m3, 2 decimals).\n - `group_index`: an object keyed by effect group (only the groups that worker has a substance in) giving the additive mixture index, 2 decimals.\n- `over_limit`: list of the worker ids with at least one group index above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d3-e0008"}
|
| 10 |
+
{"id": "exposure-assessment-incidents-d3-e0009", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 3, "seed": 10009, "title": "Injury rates for 2023", "instruction": "# Incident statistics\n\n`incident_log.csv` is a site's incident log for 2022 and 2023 and `hours_worked.csv` gives the hours worked in each department each month. `definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is. An incident belongs to the year of its `date`.\n\nWork out the figures for each department for 2023, and for the site as a whole for both years.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `departments`: an object keyed by department name, each with `lti_count` (integer), `days_lost` (integer, total days lost through LTIs, after the cap), `hours_worked` (integer), `ltifr` (2 decimals) and `severity_rate` (3 decimals), all for 2023.\n- `site`: an object keyed by year (`\"2022\"` and `\"2023\"`), each with `lti_count`, `ltifr` and `severity_rate` for all departments together in that year.\n- `ltifr_change`: the site LTIFR for 2023 minus the site LTIFR for 2022, 2 decimals (negative if the rate fell). Use unrounded rates for the subtraction.\n- `above_target`: list of the departments whose 2023 LTIFR is above the target (any order; an empty list if none).\n- `lti_ids`: list of the incident ids counted as lost-time injuries in 2023 (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 29, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d3-e0009"}
|
| 11 |
+
{"id": "exposure-assessment-noise-d3-e0010", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 3, "seed": 10010, "title": "Noise exposure for 4 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working week, with a start and end time (24-hour clock) for each task. Workers do not all work the same days. `task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed). `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker and each day worked the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nThe weekly exposure is normalised to five 8-hour days whatever the number of days worked:\n\n L_EX,w = 10 * log10( (1/5) * sum over the days worked of 10^(L_EX,8h/10) )\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `daily_lex8h_db`: an object keyed by day (`Mon` to `Fri`, only the days that worker worked) giving L_EX,8h for that day in dB(A), 1 decimal.\n - `weekly_lex_db`: the weekly noise exposure in dB(A), 1 decimal.\n - `loudest_day`: the day with the highest L_EX,8h.\n - `band`: the band of the weekly exposure, one of the four names in `exposure_values.md`.\n- `at_or_above_upper_action`: list of the worker ids whose weekly exposure is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/exposure-assessment/exposure-assessment-noise-d3-e0010"}
|
| 12 |
+
{"id": "exposure-assessment-vibration-d3-e0011", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 3, "seed": 10011, "title": "Hand-arm vibration for 5 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` is today's tool log. Each row is a batch of identical operations with one tool: the exposure time of the row is `operations` times `seconds_per_operation`. An operator may have several rows for the same tool; add their times together. `tools.csv` gives each tool's frequency-weighted acceleration on three axes. The magnitude to use for a tool is the vibration total value\n\n a = sqrt( ax^2 + ay^2 + az^2 )\n\nDo not round it before using it. `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nFor each tool in `tools.csv` (whether or not it was used today), also work out how long the tool could be used on its own before A(8) reaches a given value:\n\n time in minutes = 480 * ( value / a )^2\n\nThe result may be longer than a working day; report it as calculated.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n - `dominant_tool`: the tool id that contributes most to this operator's exposure, that is the one with the largest a_i^2 * t_i.\n- `tools`: an object keyed by tool id, each with `minutes_to_action` and `minutes_to_limit`: the minutes of use of that tool alone at which A(8) equals the exposure action value and the exposure limit value, 1 decimal each.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d3-e0011"}
|
| 13 |
+
{"id": "exposure-assessment-chemicals-d1-e0012", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 1, "seed": 10012, "title": "Airborne exposure for 3 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the personal air samples taken on three workers during one 8-hour shift: the minutes each sample ran and the concentration it found, in mg/m3. Each worker was sampled for one substance.\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled.\n\nThe 8-hour time-weighted average (TWA) is\n\n TWA = sum( C_i * t_i ) / 480\n\nwith C_i the concentration of sample i and t_i its duration in minutes. Time that was not sampled counts as zero exposure.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.\n - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals.\n- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d1-e0012"}
|
| 14 |
+
{"id": "exposure-assessment-incidents-d1-e0013", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 1, "seed": 10013, "title": "Injury rates for 2021", "instruction": "# Incident statistics\n\n`incident_log.csv` is one site's incident log for 2021 and `hours_worked.csv` gives the hours worked each month. `definitions.md` says what counts as a lost-time injury and how the rates are defined.\n\nWork out the site's figures for the year.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `lti_count`: the number of lost-time injuries, an integer.\n- `days_lost`: the total days lost through those injuries, an integer.\n- `hours_worked`: the total hours worked in the year, an integer.\n- `ltifr`: the frequency rate, 2 decimals.\n- `severity_rate`: the severity rate, 2 decimals.\n- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 6, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d1-e0013"}
|
| 15 |
+
{"id": "exposure-assessment-noise-d1-e0014", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 1, "seed": 10014, "title": "Noise exposure for 3 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working day: the tasks each worker did, the minutes spent on each and the level measured for that task (`laeq_db`, in dB(A)). `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `lex8h_db`: the daily personal noise exposure L_EX,8h in dB(A), 1 decimal.\n - `band`: the band of that exposure, one of the four names in `exposure_values.md`.\n- `at_or_above_upper_action`: list of the worker ids whose L_EX,8h is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/exposure-assessment/exposure-assessment-noise-d1-e0014"}
|
| 16 |
+
{"id": "exposure-assessment-vibration-d1-e0015", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 1, "seed": 10015, "title": "Hand-arm vibration for 4 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` lists the vibrating tools each operator used today, the vibration magnitude measured at the handle (`vibration_m_s2`) and the trigger time in minutes. `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d1-e0015"}
|
| 17 |
+
{"id": "exposure-assessment-chemicals-d2-e0016", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 2, "seed": 10016, "title": "Airborne exposure for 5 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the air samples from one survey day (each worker was sampled for one substance) and `workers.csv` gives each worker's shift length and how to treat the time that was not sampled. Use only the rows with `sample_type` `personal`: static (area) samples and field blanks are not part of a worker's exposure. Some concentrations are in ppm and some in mg/m3 (see `unit`). Convert with\n\n mg/m3 = ppm * M / 24.45 (M is the molar mass in g/mol)\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled.\n\nThe 8-hour time-weighted average (TWA) always uses 480 minutes as the reference period, whatever the shift length. With C_i the concentration of personal sample i in mg/m3 and t_i its duration in minutes:\n\n- `unsampled_time` = `zero`: time outside the samples counts as zero exposure, so TWA = sum( C_i * t_i ) / 480.\n- `unsampled_time` = `as_sampled`: the whole shift is taken to be at the time-weighted mean of the sampled periods, so TWA = ( sum( C_i * t_i ) / sum( t_i ) ) * shift_min / 480.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.\n - `twa_ppm`: the same TWA expressed in ppm, 2 decimals.\n - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals.\n- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d2-e0016"}
|
| 18 |
+
{"id": "exposure-assessment-incidents-d2-e0017", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 2, "seed": 10017, "title": "Injury rates for 2023", "instruction": "# Incident statistics\n\n`incident_log.csv` is a site's incident log for 2023 and `hours_worked.csv` gives the hours worked by each department's employees each month. `definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is.\n\nWork out the figures for each department and for the site as a whole.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `departments`: an object keyed by department name, each with `lti_count` (integer), `days_lost` (integer, total days lost through LTIs), `hours_worked` (integer), `ltifr` (2 decimals) and `severity_rate` (2 decimals).\n- `site`: the same five keys for all departments together.\n- `above_target`: list of the departments whose LTIFR is above the target (any order; an empty list if none).\n- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d2-e0017"}
|
| 19 |
+
{"id": "exposure-assessment-noise-d2-e0018", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 2, "seed": 10018, "title": "Noise exposure for 5 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working day, with a start and end time (24-hour clock) for each task. `task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed). `planned_work.csv` names, for each worker, one task the supervisor would like to add after the work in the diary. `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `lex8h_db`: the daily personal noise exposure L_EX,8h from the diary, in dB(A), 1 decimal.\n - `band`: the band of that exposure, one of the four names in `exposure_values.md`.\n - `extra_minutes`: the largest whole number of minutes of the planned task that can be added to the diary with L_EX,8h staying at or below the limit value. Work out the exact time at which L_EX,8h would equal the limit value and round it down to whole minutes. Give 0 if the diary alone is already above the limit value.\n- `at_or_above_upper_action`: list of the worker ids whose L_EX,8h is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/exposure-assessment/exposure-assessment-noise-d2-e0018"}
|
| 20 |
+
{"id": "exposure-assessment-vibration-d2-e0019", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 2, "seed": 10019, "title": "Hand-arm vibration for 5 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` is today's tool log. Each row is a batch of identical operations with one tool: the exposure time of the row is `operations` times `seconds_per_operation`. An operator may have several rows for the same tool; add their times together. `tools.csv` gives the vibration magnitude of each tool (`vibration_m_s2`). `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nFor each tool in `tools.csv` (whether or not it was used today), also work out how long the tool could be used on its own before A(8) reaches a given value:\n\n time in minutes = 480 * ( value / a )^2\n\nThe result may be longer than a working day; report it as calculated.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n- `tools`: an object keyed by tool id, each with `minutes_to_action`: the minutes of use of that tool alone at which A(8) equals the exposure action value, 1 decimal.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d2-e0019"}
|
| 21 |
+
{"id": "exposure-assessment-chemicals-d3-e0020", "env": "exposure-assessment", "isced_f": "1022", "family": "chemicals", "difficulty": 3, "seed": 10020, "title": "Airborne exposure for 4 workers", "instruction": "# Airborne chemical exposure\n\n`samples.csv` holds the air samples from one survey day and `workers.csv` gives each worker's shift length and how to treat the time that was not sampled. Use only the rows with `sample_type` `personal`: static (area) samples and field blanks are not part of a worker's exposure. Some concentrations are in ppm and some in mg/m3 (see `unit`). Convert with\n\n mg/m3 = ppm * M / 24.45 (M is the molar mass in g/mol)\n\n`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled. Some limits are tabled in ppm and some in mg/m3 (see `oel_unit`); convert the ppm ones to mg/m3 with the same formula.\n\nThe 8-hour time-weighted average (TWA) always uses 480 minutes as the reference period, whatever the shift length. With C_i the concentration of personal sample i in mg/m3 and t_i its duration in minutes:\n\n- `unsampled_time` = `zero`: time outside the samples counts as zero exposure, so TWA = sum( C_i * t_i ) / 480.\n- `unsampled_time` = `as_sampled`: the whole shift is taken to be at the time-weighted mean of the sampled periods, so TWA = ( sum( C_i * t_i ) / sum( t_i ) ) * shift_min / 480.\n\nEach worker was sampled for two or three substances; work out a TWA for each. Substances in the same `effect_group` act together, so for each worker and each effect group add up the exposure indices of that worker's substances in the group (the additive mixture index, sum of C_i / OEL_i). A group with one substance has that substance's index.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `substances`: an object keyed by substance name, each with `twa_mg_m3` (the 8-hour TWA in mg/m3, 2 decimals) and `exposure_index` (the TWA divided by the limit in mg/m3, 2 decimals).\n - `group_index`: an object keyed by effect group (only the groups that worker has a substance in) giving the additive mixture index, 2 decimals.\n- `over_limit`: list of the worker ids with at least one group index above 1 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/exposure-assessment/exposure-assessment-chemicals-d3-e0020"}
|
| 22 |
+
{"id": "exposure-assessment-incidents-d3-e0021", "env": "exposure-assessment", "isced_f": "1022", "family": "incidents", "difficulty": 3, "seed": 10021, "title": "Injury rates for 2021", "instruction": "# Incident statistics\n\n`incident_log.csv` is a site's incident log for 2020 and 2021 and `hours_worked.csv` gives the hours worked in each department each month. `definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is. An incident belongs to the year of its `date`.\n\nWork out the figures for each department for 2021, and for the site as a whole for both years.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `departments`: an object keyed by department name, each with `lti_count` (integer), `days_lost` (integer, total days lost through LTIs, after the cap), `hours_worked` (integer), `ltifr` (2 decimals) and `severity_rate` (2 decimals), all for 2021.\n- `site`: an object keyed by year (`\"2020\"` and `\"2021\"`), each with `lti_count`, `ltifr` and `severity_rate` for all departments together in that year.\n- `ltifr_change`: the site LTIFR for 2021 minus the site LTIFR for 2020, 2 decimals (negative if the rate fell). Use unrounded rates for the subtraction.\n- `above_target`: list of the departments whose 2021 LTIFR is above the target (any order; an empty list if none).\n- `lti_ids`: list of the incident ids counted as lost-time injuries in 2021 (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 29, "path": "tasks/exposure-assessment/exposure-assessment-incidents-d3-e0021"}
|
| 23 |
+
{"id": "exposure-assessment-noise-d3-e0022", "env": "exposure-assessment", "isced_f": "1022", "family": "noise", "difficulty": 3, "seed": 10022, "title": "Noise exposure for 4 workers", "instruction": "# Noise exposure assessment\n\n`noise_diary.csv` is the task diary for one working week, with a start and end time (24-hour clock) for each task. Workers do not all work the same days. `task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed). `exposure_values.md` gives the action and limit values to use and the band names.\n\nFor each worker and each day worked the daily personal noise exposure is\n\n L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )\n\nwith t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing.\n\nThe weekly exposure is normalised to five 8-hour days whatever the number of days worked:\n\n L_EX,w = 10 * log10( (1/5) * sum over the days worked of 10^(L_EX,8h/10) )\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `workers`: an object keyed by worker id, each with\n - `daily_lex8h_db`: an object keyed by day (`Mon` to `Fri`, only the days that worker worked) giving L_EX,8h for that day in dB(A), 1 decimal.\n - `weekly_lex_db`: the weekly noise exposure in dB(A), 1 decimal.\n - `loudest_day`: the day with the highest L_EX,8h.\n - `band`: the band of the weekly exposure, one of the four names in `exposure_values.md`.\n- `at_or_above_upper_action`: list of the worker ids whose weekly exposure is at or above the upper action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/exposure-assessment/exposure-assessment-noise-d3-e0022"}
|
| 24 |
+
{"id": "exposure-assessment-vibration-d3-e0023", "env": "exposure-assessment", "isced_f": "1022", "family": "vibration", "difficulty": 3, "seed": 10023, "title": "Hand-arm vibration for 5 operators", "instruction": "# Hand-arm vibration assessment\n\n`tool_use.csv` is today's tool log. Each row is a batch of identical operations with one tool: the exposure time of the row is `operations` times `seconds_per_operation`. An operator may have several rows for the same tool; add their times together. `tools.csv` gives each tool's frequency-weighted acceleration on three axes. The magnitude to use for a tool is the vibration total value\n\n a = sqrt( ax^2 + ay^2 + az^2 )\n\nDo not round it before using it. `vibration_values.md` gives the exposure action and limit values to use and the band names.\n\nFor each operator the daily vibration exposure is\n\n A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )\n\nwith a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours.\n\nFor each tool in `tools.csv` (whether or not it was used today), also work out how long the tool could be used on its own before A(8) reaches a given value:\n\n time in minutes = 480 * ( value / a )^2\n\nThe result may be longer than a working day; report it as calculated.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `operators`: an object keyed by operator id, each with\n - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.\n - `band`: one of the three band names in `vibration_values.md`.\n - `dominant_tool`: the tool id that contributes most to this operator's exposure, that is the one with the largest a_i^2 * t_i.\n- `tools`: an object keyed by tool id, each with `minutes_to_action` and `minutes_to_limit`: the minutes of use of that tool alone at which A(8) equals the exposure action value and the exposure limit value, 1 decimal each.\n- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/exposure-assessment/exposure-assessment-vibration-d3-e0023"}
|
data/exposure-assessment/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/harris-matrix/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "harris-matrix-dating-d1-e0000", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 1, "seed": 10000, "title": "Dating 8 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (8 contexts) and `finds.csv` lists the finds from each context. `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).", "checks": 7, "path": "tasks/harris-matrix/harris-matrix-dating-d1-e0000"}
|
| 2 |
+
{"id": "harris-matrix-errors-d1-e0001", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 1, "seed": 10001, "title": "Impossible relations among 8 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (8 contexts, 11 recorded relations). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: one recorded relation is wrong. There is exactly one way to make the record consistent by deleting one row of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the one `relation_id` to delete.\n\nThen delete that row and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 14, "path": "tasks/harris-matrix/harris-matrix-errors-d1-e0001"}
|
| 3 |
+
{"id": "harris-matrix-reduction-d1-e0002", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 1, "seed": 10002, "title": "Reduced matrix for 9 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (9 contexts, 11 recorded relations). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 11, "path": "tasks/harris-matrix/harris-matrix-reduction-d1-e0002"}
|
| 4 |
+
{"id": "harris-matrix-sequence-d1-e0003", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 1, "seed": 10003, "title": "Stratigraphic sequence of 8 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (8 contexts). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 12, "path": "tasks/harris-matrix/harris-matrix-sequence-d1-e0003"}
|
| 5 |
+
{"id": "harris-matrix-dating-d2-e0004", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 2, "seed": 10004, "title": "Dating 13 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (13 contexts) and `finds.csv` lists the finds from each context. Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).", "checks": 10, "path": "tasks/harris-matrix/harris-matrix-dating-d2-e0004"}
|
| 6 |
+
{"id": "harris-matrix-errors-d2-e0005", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 2, "seed": 10005, "title": "Impossible relations among 14 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (14 contexts, 20 recorded relations). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: one recorded relation is wrong. There is exactly one way to make the record consistent by deleting one row of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the one `relation_id` to delete.\n\nThen delete that row and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 20, "path": "tasks/harris-matrix/harris-matrix-errors-d2-e0005"}
|
| 7 |
+
{"id": "harris-matrix-reduction-d2-e0006", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 2, "seed": 10006, "title": "Reduced matrix for 14 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (14 contexts, 19 recorded relations). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 16, "path": "tasks/harris-matrix/harris-matrix-reduction-d2-e0006"}
|
| 8 |
+
{"id": "harris-matrix-sequence-d2-e0007", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 2, "seed": 10007, "title": "Stratigraphic sequence of 16 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (16 contexts). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 20, "path": "tasks/harris-matrix/harris-matrix-sequence-d2-e0007"}
|
| 9 |
+
{"id": "harris-matrix-dating-d3-e0008", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 3, "seed": 10008, "title": "Dating 16 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (16 contexts) and `finds.csv` lists the finds from each context. Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). Some finds carry a flag, and some contexts have a documented year. `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).\n- `taq`: an object keyed by context id giving the terminus ante quem of every context that has one, as an integer year.\n- `no_taq`: list of the contexts that have no TAQ (any order).", "checks": 21, "path": "tasks/harris-matrix/harris-matrix-dating-d3-e0008"}
|
| 10 |
+
{"id": "harris-matrix-errors-d3-e0009", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 3, "seed": 10009, "title": "Impossible relations among 19 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (19 contexts, 26 recorded relations). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: two recorded relations are wrong. There is exactly one way to make the record consistent by deleting two rows of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the two `relation_id`s to delete.\n\nThen delete those rows and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 25, "path": "tasks/harris-matrix/harris-matrix-errors-d3-e0009"}
|
| 11 |
+
{"id": "harris-matrix-reduction-d3-e0010", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 3, "seed": 10010, "title": "Reduced matrix for 21 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (21 contexts, 32 recorded relations). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 23, "path": "tasks/harris-matrix/harris-matrix-reduction-d3-e0010"}
|
| 12 |
+
{"id": "harris-matrix-sequence-d3-e0011", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 3, "seed": 10011, "title": "Stratigraphic sequence of 21 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (21 contexts). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.\n- `unrelated_pairs`: the number of pairs of contexts that are unrelated as the rules define it, as an integer. Count each pair once.", "checks": 26, "path": "tasks/harris-matrix/harris-matrix-sequence-d3-e0011"}
|
| 13 |
+
{"id": "harris-matrix-dating-d1-e0012", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 1, "seed": 10012, "title": "Dating 9 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (9 contexts) and `finds.csv` lists the finds from each context. `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).", "checks": 8, "path": "tasks/harris-matrix/harris-matrix-dating-d1-e0012"}
|
| 14 |
+
{"id": "harris-matrix-errors-d1-e0013", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 1, "seed": 10013, "title": "Impossible relations among 8 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (8 contexts, 10 recorded relations). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: one recorded relation is wrong. There is exactly one way to make the record consistent by deleting one row of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the one `relation_id` to delete.\n\nThen delete that row and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 14, "path": "tasks/harris-matrix/harris-matrix-errors-d1-e0013"}
|
| 15 |
+
{"id": "harris-matrix-reduction-d1-e0014", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 1, "seed": 10014, "title": "Reduced matrix for 9 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (9 contexts, 12 recorded relations). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 11, "path": "tasks/harris-matrix/harris-matrix-reduction-d1-e0014"}
|
| 16 |
+
{"id": "harris-matrix-sequence-d1-e0015", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 1, "seed": 10015, "title": "Stratigraphic sequence of 8 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (8 contexts). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 12, "path": "tasks/harris-matrix/harris-matrix-sequence-d1-e0015"}
|
| 17 |
+
{"id": "harris-matrix-dating-d2-e0016", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 2, "seed": 10016, "title": "Dating 13 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (13 contexts) and `finds.csv` lists the finds from each context. Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).", "checks": 12, "path": "tasks/harris-matrix/harris-matrix-dating-d2-e0016"}
|
| 18 |
+
{"id": "harris-matrix-errors-d2-e0017", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 2, "seed": 10017, "title": "Impossible relations among 14 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (14 contexts, 18 recorded relations). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: one recorded relation is wrong. There is exactly one way to make the record consistent by deleting one row of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the one `relation_id` to delete.\n\nThen delete that row and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 20, "path": "tasks/harris-matrix/harris-matrix-errors-d2-e0017"}
|
| 19 |
+
{"id": "harris-matrix-reduction-d2-e0018", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 2, "seed": 10018, "title": "Reduced matrix for 14 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (14 contexts, 19 recorded relations). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 16, "path": "tasks/harris-matrix/harris-matrix-reduction-d2-e0018"}
|
| 20 |
+
{"id": "harris-matrix-sequence-d2-e0019", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 2, "seed": 10019, "title": "Stratigraphic sequence of 14 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (14 contexts). Some deposits were recorded under more than one context number (`same as`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 18, "path": "tasks/harris-matrix/harris-matrix-sequence-d2-e0019"}
|
| 21 |
+
{"id": "harris-matrix-dating-d3-e0020", "env": "harris-matrix", "isced_f": "0222", "family": "dating", "difficulty": 3, "seed": 10020, "title": "Dating 18 contexts from their finds", "instruction": "# Harris matrix: dating the sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (18 contexts) and `finds.csv` lists the finds from each context. Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). Some finds carry a flag, and some contexts have a documented year. `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines how contexts are dated.\n\nDate every context from the finds in it and beneath it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `tpq`: an object keyed by context id giving the terminus post quem of every context that has one, as an integer year.\n- `no_tpq`: list of the contexts that have no TPQ (any order).\n- `taq`: an object keyed by context id giving the terminus ante quem of every context that has one, as an integer year.\n- `no_taq`: list of the contexts that have no TAQ (any order).", "checks": 27, "path": "tasks/harris-matrix/harris-matrix-dating-d3-e0020"}
|
| 22 |
+
{"id": "harris-matrix-errors-d3-e0021", "env": "harris-matrix", "isced_f": "0222", "family": "errors", "difficulty": 3, "seed": 10021, "title": "Impossible relations among 19 contexts", "instruction": "# Harris matrix: checking a record for impossible relations\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (19 contexts, 29 recorded relations). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nThe record is not consistent: two recorded relations are wrong. There is exactly one way to make the record consistent by deleting two rows of `relations.csv`, and no way to do it by deleting fewer.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cycle_contexts`: list of the contexts that lie on a cycle in the record as it stands (any order).\n- `faulty_relations`: list of the two `relation_id`s to delete.\n\nThen delete those rows and give, for the corrected record:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.", "checks": 25, "path": "tasks/harris-matrix/harris-matrix-errors-d3-e0021"}
|
| 23 |
+
{"id": "harris-matrix-reduction-d3-e0022", "env": "harris-matrix", "isced_f": "0222", "family": "reduction", "difficulty": 3, "seed": 10022, "title": "Reduced matrix for 19 contexts", "instruction": "# Harris matrix: reducing the record\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (19 contexts, 31 recorded relations). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the reduced matrix.\n\nThe site record notes every physical contact, so it holds more relations than the Harris matrix needs. Reduce it.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `redundant`: list of the `relation_id`s of the recorded relations that are redundant (any order).\n- `reduced_lines`: the number of lines in the reduced matrix, as an integer.\n- `directly_earlier`: an object with one entry for every context id. Each value is the list of the contexts that are directly earlier than that context in the reduced matrix (any order; an empty list if there are none). Where a box holds several contexts, list every one of them.", "checks": 21, "path": "tasks/harris-matrix/harris-matrix-reduction-d3-e0022"}
|
| 24 |
+
{"id": "harris-matrix-sequence-d3-e0023", "env": "harris-matrix", "isced_f": "0222", "family": "sequence", "difficulty": 3, "seed": 10023, "title": "Stratigraphic sequence of 20 contexts", "instruction": "# Harris matrix: stratigraphic sequence\n\n`contexts.csv` and `relations.csv` are the stratigraphic record of an excavation (20 contexts). Some deposits were recorded under more than one context number (`same as`). Some relations were entered from the lower context's sheet (`underlies`, `cut by`, `filled by`, `abutted by`). `stratigraphy_rules.md` says what each recorded relation means for the order of the contexts and defines the terms used below.\n\nWork out the order in which the contexts formed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `sequence`: a list of all the context ids, earliest first, that is a valid sequence as the rules define it. Any valid sequence is accepted.\n- `nothing_earlier`: list of the contexts that have no context stratigraphically earlier than them (any order).\n- `nothing_later`: list of the contexts that have no context stratigraphically later than them (any order).\n- `longest_chain`: the length of the longest chain, as an integer number of contexts.\n- `levels`: an object giving the level of every context, as an integer.\n- `unrelated_pairs`: the number of pairs of contexts that are unrelated as the rules define it, as an integer. Count each pair once.", "checks": 25, "path": "tasks/harris-matrix/harris-matrix-sequence-d3-e0023"}
|
data/harris-matrix/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/life-table/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "life-table-age-structure-d1-e0000", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 1, "seed": 10000, "title": "Age structure, 1 area(s)", "instruction": "# Age structure: one municipality\n\n`population.csv` gives the population of Aldermark at the end of 2015 in five-year age groups. `methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_population`: an integer.\n- `share_0_14_percent`, `share_15_64_percent`, `share_65_plus_percent`: each broad age group as a percentage of the total population, 2 decimals.\n- `young_dependency_ratio`, `old_dependency_ratio`, `total_dependency_ratio`: per 100 people of working age, 2 decimals.\n- `ageing_index`: 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/life-table/life-table-age-structure-d1-e0000"}
|
| 2 |
+
{"id": "life-table-fertility-d1-e0001", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 1, "seed": 10001, "title": "Fertility measures, 1 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by age group in Dunholt in 2011 and `births.csv` the live births by age of mother. `registry.json` gives the share of births that were girls.\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/life-table/life-table-fertility-d1-e0001"}
|
| 3 |
+
{"id": "life-table-life-table-d1-e0002", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 1, "seed": 10002, "title": "Abridged life table, 8 age groups", "instruction": "# Life table: one population\n\n`population_deaths.csv` gives the mid-year population and the deaths in 2022 by age group. Build the abridged period life table as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `table`: object keyed by the starting age of each interval as a string (`\"0\"`, `\"1\"`, `\"5\"`, ...), one entry per age group. Each value has\n - `mx_per_1000`: the death rate per 1000 population, 3 decimals.\n - `qx`: the probability of dying in the interval, 6 decimals.\n - `lx`: survivors at the start of the interval out of 100000, to the nearest whole number.\n- `e0`: life expectancy at birth in years, 2 decimals.\n- `e60`: life expectancy at exact age 60, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/life-table/life-table-life-table-d1-e0002"}
|
| 4 |
+
{"id": "life-table-standardisation-d1-e0003", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 1, "seed": 10003, "title": "Standardised death rates, 3 regions", "instruction": "# Age-standardised death rates\n\n`regions.csv` gives the mid-year population and the deaths in 2008 by region and age group, in no particular order. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Aldermark (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/life-table/life-table-standardisation-d1-e0003"}
|
| 5 |
+
{"id": "life-table-age-structure-d2-e0004", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 2, "seed": 10004, "title": "Age structure, 1 area(s)", "instruction": "# Age structure: one municipality by sex\n\n`population.csv` gives the population of Brinmoor at the end of 2020 by five-year age group and sex, in no particular order. `methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_population`: both sexes, an integer.\n- `young_dependency_ratio`, `old_dependency_ratio`, `total_dependency_ratio`: both sexes together, per 100 people of working age, 2 decimals.\n- `ageing_index`: both sexes together, 2 decimals.\n- `sex_ratio`: males per 100 females in the whole population, 2 decimals.\n- `sex_ratio_65_plus`: males per 100 females among people aged 65 and over, 2 decimals.\n- `median_age`: median age of the whole population in years, 2 decimals.\n- `median_age_female`, `median_age_male`: median age of each sex, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 10, "path": "tasks/life-table/life-table-age-structure-d2-e0004"}
|
| 6 |
+
{"id": "life-table-fertility-d2-e0005", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 2, "seed": 10005, "title": "Fertility measures, 4 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by municipality and age group in 2004 and `births.csv` the live births by municipality and age of mother, both in no particular order. `registry.json` gives the sex ratio at birth. A combination with no row in `births.csv` had no births. Compute the measures for the county as a whole (all 4 municipalities together).\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/life-table/life-table-fertility-d2-e0005"}
|
| 7 |
+
{"id": "life-table-life-table-d2-e0006", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 2, "seed": 10006, "title": "Abridged life table, 19 age groups", "instruction": "# Life table: both sexes combined\n\n`population_deaths.csv` gives the mid-year population and the deaths in 2012 by age group and sex, in no particular order. Build one abridged period life table for **both sexes combined** (add the two sexes' populations and deaths in each age group first), as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `table`: object keyed by the starting age of each interval as a string (`\"0\"`, `\"1\"`, `\"5\"`, ..., `\"85\"`), one entry per age group. Each value has\n - `qx`: the probability of dying in the interval, 6 decimals.\n - `lx`: survivors at the start of the interval out of 100000, to the nearest whole number.\n- `e0`: life expectancy at birth in years, 2 decimals.\n- `e65`: life expectancy at exact age 65, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/life-table/life-table-life-table-d2-e0006"}
|
| 8 |
+
{"id": "life-table-standardisation-d2-e0007", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 2, "seed": 10007, "title": "Standardised death rates, 4 regions", "instruction": "# Age-standardised death rates\n\n`population.csv` gives the mid-year population in 2018 by region, age group and sex, and `deaths.csv` the deaths by region, age group, sex and cause of death, both in no particular order. The study is about deaths from the cause `cancer` only, for both sexes together: ignore the other causes and add the two sexes. A combination with no row in `deaths.csv` had no deaths. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Hollinside (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/life-table/life-table-standardisation-d2-e0007"}
|
| 9 |
+
{"id": "life-table-age-structure-d3-e0008", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 3, "seed": 10008, "title": "Age structure, 5 area(s)", "instruction": "# Age structure: a county and its municipalities\n\n`population.csv` gives the population of the 5 municipalities of a county at the end of 2016 by five-year age group and sex, in no particular order. `methods.md` gives the definitions to use. All indicators are for both sexes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `areas`: object keyed by municipality. Each value has\n - `population`: an integer.\n - `young_dependency_ratio` and `old_dependency_ratio`: per 100 people of working age, 2 decimals.\n - `ageing_index`: 2 decimals.\n - `median_age`: in years, 2 decimals.\n- `county`: the same five keys for the county as a whole (all municipalities together).\n- `oldest_area`: the municipality with the highest median age.\n- `above_county_old_dependency`: list of the municipalities whose old-age dependency ratio is higher than the county's (any order).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 32, "path": "tasks/life-table/life-table-age-structure-d3-e0008"}
|
| 10 |
+
{"id": "life-table-fertility-d3-e0009", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 3, "seed": 10009, "title": "Fertility measures, 5 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by municipality and age group in 2011 and `births.csv` the live births by municipality, age of mother and sex of the child, both in no particular order. `female_life_table.csv` gives the person-years column of the female life table (radix 100000). A combination with no row in `births.csv` had no births. Compute the measures for the county as a whole (all 5 municipalities together).\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n- `nrr`: the net reproduction rate, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/life-table/life-table-fertility-d3-e0009"}
|
| 11 |
+
{"id": "life-table-life-table-d3-e0010", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 3, "seed": 10010, "title": "Abridged life table, 19 age groups", "instruction": "# Life table: women and men\n\n`population.csv` gives the mid-2016 population by age group and sex. `deaths.csv` gives the deaths in 2015, 2016 and 2017 by age group and sex. Both are in no particular order. Build a separate abridged period life table for each sex as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `female` and `male`: for each sex an object with\n - `q0`: the probability of dying before exact age 1, 6 decimals.\n - `l15`, `l60`, `l65`: survivors at exact ages 15, 60 and 65 out of 100000, to the nearest whole number.\n - `q15_60`: the probability that a person alive at exact age 15 dies before exact age 60, that is 1 - l60 / l15, 5 decimals.\n - `e0`, `e15`, `e65`: life expectancy at exact ages 0, 15 and 65 in years, 2 decimals.\n- `e0_gap`: female life expectancy at birth minus male life expectancy at birth, in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/life-table/life-table-life-table-d3-e0010"}
|
| 12 |
+
{"id": "life-table-standardisation-d3-e0011", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 3, "seed": 10011, "title": "Standardised death rates, 5 regions", "instruction": "# Age-standardised death rates\n\n`population.csv` gives the mid-year population in 2015 by region, age group and sex, and `deaths.csv` the deaths by region, age group, sex and cause of death, both in no particular order. The study is about deaths from the cause `circulatory` only, for both sexes together: ignore the other causes and add the two sexes. A combination with no row in `deaths.csv` had no deaths. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Aldermark (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n- `ranking`: list of all regions from the highest standardised rate to the lowest.\n- `reversed`: list of the regions that compare differently with the reference region before and after standardisation: the crude rate is higher than the reference region's while the standardised rate is lower, or the other way round (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/life-table/life-table-standardisation-d3-e0011"}
|
| 13 |
+
{"id": "life-table-age-structure-d1-e0012", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 1, "seed": 10012, "title": "Age structure, 1 area(s)", "instruction": "# Age structure: one municipality\n\n`population.csv` gives the population of Aldermark at the end of 2013 in five-year age groups. `methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_population`: an integer.\n- `share_0_14_percent`, `share_15_64_percent`, `share_65_plus_percent`: each broad age group as a percentage of the total population, 2 decimals.\n- `young_dependency_ratio`, `old_dependency_ratio`, `total_dependency_ratio`: per 100 people of working age, 2 decimals.\n- `ageing_index`: 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/life-table/life-table-age-structure-d1-e0012"}
|
| 14 |
+
{"id": "life-table-fertility-d1-e0013", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 1, "seed": 10013, "title": "Fertility measures, 1 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by age group in Calderfell in 2005 and `births.csv` the live births by age of mother. `registry.json` gives the share of births that were girls.\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/life-table/life-table-fertility-d1-e0013"}
|
| 15 |
+
{"id": "life-table-life-table-d1-e0014", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 1, "seed": 10014, "title": "Abridged life table, 8 age groups", "instruction": "# Life table: one population\n\n`population_deaths.csv` gives the mid-year population and the deaths in 2020 by age group. Build the abridged period life table as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `table`: object keyed by the starting age of each interval as a string (`\"0\"`, `\"1\"`, `\"5\"`, ...), one entry per age group. Each value has\n - `mx_per_1000`: the death rate per 1000 population, 3 decimals.\n - `qx`: the probability of dying in the interval, 6 decimals.\n - `lx`: survivors at the start of the interval out of 100000, to the nearest whole number.\n- `e0`: life expectancy at birth in years, 2 decimals.\n- `e60`: life expectancy at exact age 60, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/life-table/life-table-life-table-d1-e0014"}
|
| 16 |
+
{"id": "life-table-standardisation-d1-e0015", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 1, "seed": 10015, "title": "Standardised death rates, 3 regions", "instruction": "# Age-standardised death rates\n\n`regions.csv` gives the mid-year population and the deaths in 2015 by region and age group, in no particular order. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Farrowby (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/life-table/life-table-standardisation-d1-e0015"}
|
| 17 |
+
{"id": "life-table-age-structure-d2-e0016", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 2, "seed": 10016, "title": "Age structure, 1 area(s)", "instruction": "# Age structure: one municipality by sex\n\n`population.csv` gives the population of Glenrath at the end of 2011 by five-year age group and sex, in no particular order. `methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_population`: both sexes, an integer.\n- `young_dependency_ratio`, `old_dependency_ratio`, `total_dependency_ratio`: both sexes together, per 100 people of working age, 2 decimals.\n- `ageing_index`: both sexes together, 2 decimals.\n- `sex_ratio`: males per 100 females in the whole population, 2 decimals.\n- `sex_ratio_65_plus`: males per 100 females among people aged 65 and over, 2 decimals.\n- `median_age`: median age of the whole population in years, 2 decimals.\n- `median_age_female`, `median_age_male`: median age of each sex, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 10, "path": "tasks/life-table/life-table-age-structure-d2-e0016"}
|
| 18 |
+
{"id": "life-table-fertility-d2-e0017", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 2, "seed": 10017, "title": "Fertility measures, 4 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by municipality and age group in 2007 and `births.csv` the live births by municipality and age of mother, both in no particular order. `registry.json` gives the sex ratio at birth. A combination with no row in `births.csv` had no births. Compute the measures for the county as a whole (all 4 municipalities together).\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/life-table/life-table-fertility-d2-e0017"}
|
| 19 |
+
{"id": "life-table-life-table-d2-e0018", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 2, "seed": 10018, "title": "Abridged life table, 19 age groups", "instruction": "# Life table: both sexes combined\n\n`population_deaths.csv` gives the mid-year population and the deaths in 2014 by age group and sex, in no particular order. Build one abridged period life table for **both sexes combined** (add the two sexes' populations and deaths in each age group first), as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `table`: object keyed by the starting age of each interval as a string (`\"0\"`, `\"1\"`, `\"5\"`, ..., `\"85\"`), one entry per age group. Each value has\n - `qx`: the probability of dying in the interval, 6 decimals.\n - `lx`: survivors at the start of the interval out of 100000, to the nearest whole number.\n- `e0`: life expectancy at birth in years, 2 decimals.\n- `e65`: life expectancy at exact age 65, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/life-table/life-table-life-table-d2-e0018"}
|
| 20 |
+
{"id": "life-table-standardisation-d2-e0019", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 2, "seed": 10019, "title": "Standardised death rates, 4 regions", "instruction": "# Age-standardised death rates\n\n`population.csv` gives the mid-year population in 2016 by region, age group and sex, and `deaths.csv` the deaths by region, age group, sex and cause of death, both in no particular order. The study is about deaths from the cause `respiratory` only, for both sexes together: ignore the other causes and add the two sexes. A combination with no row in `deaths.csv` had no deaths. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Eskwater (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/life-table/life-table-standardisation-d2-e0019"}
|
| 21 |
+
{"id": "life-table-age-structure-d3-e0020", "env": "life-table", "isced_f": "0314", "family": "age-structure", "difficulty": 3, "seed": 10020, "title": "Age structure, 5 area(s)", "instruction": "# Age structure: a county and its municipalities\n\n`population.csv` gives the population of the 5 municipalities of a county at the end of 2012 by five-year age group and sex, in no particular order. `methods.md` gives the definitions to use. All indicators are for both sexes together.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `areas`: object keyed by municipality. Each value has\n - `population`: an integer.\n - `young_dependency_ratio` and `old_dependency_ratio`: per 100 people of working age, 2 decimals.\n - `ageing_index`: 2 decimals.\n - `median_age`: in years, 2 decimals.\n- `county`: the same five keys for the county as a whole (all municipalities together).\n- `oldest_area`: the municipality with the highest median age.\n- `above_county_old_dependency`: list of the municipalities whose old-age dependency ratio is higher than the county's (any order).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 32, "path": "tasks/life-table/life-table-age-structure-d3-e0020"}
|
| 22 |
+
{"id": "life-table-fertility-d3-e0021", "env": "life-table", "isced_f": "0314", "family": "fertility", "difficulty": 3, "seed": 10021, "title": "Fertility measures, 5 area(s)", "instruction": "# Fertility measures\n\n`women.csv` gives the mid-year number of women by municipality and age group in 2012 and `births.csv` the live births by municipality, age of mother and sex of the child, both in no particular order. `female_life_table.csv` gives the person-years column of the female life table (radix 100000). A combination with no row in `births.csv` had no births. Compute the measures for the county as a whole (all 5 municipalities together).\n\n`methods.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `total_births`: all live births, an integer.\n- `asfr_per_1000`: object keyed by age group (`15-19`, `20-24`, ..., `45-49`): the age-specific fertility rate per 1000 women, 2 decimals.\n- `peak_age_group`: the age group with the highest rate.\n- `tfr`: the total fertility rate in children per woman, 3 decimals.\n- `grr`: the gross reproduction rate, 3 decimals.\n- `mean_age_at_childbearing`: in years, 2 decimals.\n- `nrr`: the net reproduction rate, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/life-table/life-table-fertility-d3-e0021"}
|
| 23 |
+
{"id": "life-table-life-table-d3-e0022", "env": "life-table", "isced_f": "0314", "family": "life-table", "difficulty": 3, "seed": 10022, "title": "Abridged life table, 19 age groups", "instruction": "# Life table: women and men\n\n`population.csv` gives the mid-2019 population by age group and sex. `deaths.csv` gives the deaths in 2018, 2019 and 2020 by age group and sex. Both are in no particular order. Build a separate abridged period life table for each sex as described in `methods.md`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `female` and `male`: for each sex an object with\n - `q0`: the probability of dying before exact age 1, 6 decimals.\n - `l15`, `l60`, `l65`: survivors at exact ages 15, 60 and 65 out of 100000, to the nearest whole number.\n - `q15_60`: the probability that a person alive at exact age 15 dies before exact age 60, that is 1 - l60 / l15, 5 decimals.\n - `e0`, `e15`, `e65`: life expectancy at exact ages 0, 15 and 65 in years, 2 decimals.\n- `e0_gap`: female life expectancy at birth minus male life expectancy at birth, in years, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/life-table/life-table-life-table-d3-e0022"}
|
| 24 |
+
{"id": "life-table-standardisation-d3-e0023", "env": "life-table", "isced_f": "0314", "family": "standardisation", "difficulty": 3, "seed": 10023, "title": "Standardised death rates, 5 regions", "instruction": "# Age-standardised death rates\n\n`population.csv` gives the mid-year population in 2016 by region, age group and sex, and `deaths.csv` the deaths by region, age group, sex and cause of death, both in no particular order. The study is about deaths from the cause `circulatory` only, for both sexes together: ignore the other causes and add the two sexes. A combination with no row in `deaths.csv` had no deaths. `standard_population.csv` gives the standard population and `methods.md` the definitions. The reference region is Glenrath (also in `study.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `regions`: object keyed by region. Each value has\n - `population`: the region's whole population, an integer.\n - `deaths`: the deaths counted in the study, an integer.\n - `crude_rate`: crude death rate per 100000, 1 decimal.\n - `standardised_rate`: directly age-standardised death rate per 100000, 1 decimal.\n - `srr`: standardised rate ratio against the reference region, 3 decimals.\n- `ranking`: list of all regions from the highest standardised rate to the lowest.\n- `reversed`: list of the regions that compare differently with the reference region before and after standardisation: the crude rate is higher than the reference region's while the standardised rate is lower, or the other way round (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/life-table/life-table-standardisation-d3-e0023"}
|
data/life-table/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/means-test/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "means-test-change-d1-e0000", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 1, "seed": 10000, "title": "Prorate 3 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 3 household case files from the Municipality of Eskermark for 2026-03 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 11, "path": "tasks/means-test/means-test-change-d1-e0000"}
|
| 2 |
+
{"id": "means-test-entitlement-d1-e0001", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 1, "seed": 10001, "title": "Assess 4 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 4 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/means-test/means-test-entitlement-d1-e0001"}
|
| 3 |
+
{"id": "means-test-overpayment-d1-e0002", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 1, "seed": 10002, "title": "Work out overpayments for 3 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 3 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/means-test/means-test-overpayment-d1-e0002"}
|
| 4 |
+
{"id": "means-test-review-d1-e0003", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 1, "seed": 10003, "title": "Review 5 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 5 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 11, "path": "tasks/means-test/means-test-review-d1-e0003"}
|
| 5 |
+
{"id": "means-test-change-d2-e0004", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 2, "seed": 10004, "title": "Prorate 4 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark for 2026-05 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `rent_change`: the monthly rent becomes the amount given.\n- `member_joins`: the person given moves in, with the role shown.\n- `member_leaves`: the named person moves out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/means-test/means-test-change-d2-e0004"}
|
| 6 |
+
{"id": "means-test-entitlement-d2-e0005", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 2, "seed": 10005, "title": "Assess 6 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 6 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `asset_excess`: the asset excess (section 5), 0 if there is none.\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 31, "path": "tasks/means-test/means-test-entitlement-d2-e0005"}
|
| 7 |
+
{"id": "means-test-overpayment-d2-e0006", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 2, "seed": 10006, "title": "Work out overpayments for 4 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery, and section 7 a change that falls inside a month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n- `written_off`: list of the case ids whose overpayment is above 0 but is written off (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/means-test/means-test-overpayment-d2-e0006"}
|
| 8 |
+
{"id": "means-test-review-d2-e0007", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 2, "seed": 10007, "title": "Review 7 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 7 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance, the asset excess and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `asset_excess`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 19, "path": "tasks/means-test/means-test-review-d2-e0007"}
|
| 9 |
+
{"id": "means-test-change-d3-e0008", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 3, "seed": 10008, "title": "Prorate 4 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark for 2026-10 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect (not always listed in date order). Some files have a `claim_date`: see section 7. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `rent_change`: the monthly rent becomes the amount given.\n- `member_joins`: the person given moves in, with the role shown.\n- `member_leaves`: the named person moves out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/means-test/means-test-change-d3-e0008"}
|
| 10 |
+
{"id": "means-test-entitlement-d3-e0009", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 3, "seed": 10009, "title": "Assess 7 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 7 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `asset_excess`: the asset excess (section 5), 0 if there is none.\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n- `total_payable`: the sum of the benefits payable to all the households, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 37, "path": "tasks/means-test/means-test-entitlement-d3-e0009"}
|
| 11 |
+
{"id": "means-test-overpayment-d3-e0010", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 3, "seed": 10010, "title": "Work out overpayments for 5 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 5 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery, and section 7 a change that falls inside a month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `member_joins`: the person given moved in, with the role shown.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n- `written_off`: list of the case ids whose overpayment is above 0 but is written off (any order; an empty list if none).\n- `total_to_recover`: the sum of the total overpayments that will be recovered (leave out those written off), fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/means-test/means-test-overpayment-d3-e0010"}
|
| 12 |
+
{"id": "means-test-review-d3-e0011", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 3, "seed": 10011, "title": "Review 9 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 9 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance, the asset excess and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `asset_excess`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n- `total_underpaid`: the sum of the positive differences, fl with 2 decimals (0 if none).\n- `total_overpaid`: the sum of the negative differences, given as a positive number, fl with 2 decimals (0 if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/means-test/means-test-review-d3-e0011"}
|
| 13 |
+
{"id": "means-test-change-d1-e0012", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 1, "seed": 10012, "title": "Prorate 3 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 3 household case files from the Municipality of Eskermark for 2026-05 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 11, "path": "tasks/means-test/means-test-change-d1-e0012"}
|
| 14 |
+
{"id": "means-test-entitlement-d1-e0013", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 1, "seed": 10013, "title": "Assess 4 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 4 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/means-test/means-test-entitlement-d1-e0013"}
|
| 15 |
+
{"id": "means-test-overpayment-d1-e0014", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 1, "seed": 10014, "title": "Work out overpayments for 3 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 3 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/means-test/means-test-overpayment-d1-e0014"}
|
| 16 |
+
{"id": "means-test-review-d1-e0015", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 1, "seed": 10015, "title": "Review 5 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 5 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 11, "path": "tasks/means-test/means-test-review-d1-e0015"}
|
| 17 |
+
{"id": "means-test-change-d2-e0016", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 2, "seed": 10016, "title": "Prorate 4 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark for 2026-03 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `rent_change`: the monthly rent becomes the amount given.\n- `member_joins`: the person given moves in, with the role shown.\n- `member_leaves`: the named person moves out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/means-test/means-test-change-d2-e0016"}
|
| 18 |
+
{"id": "means-test-entitlement-d2-e0017", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 2, "seed": 10017, "title": "Assess 6 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 6 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `asset_excess`: the asset excess (section 5), 0 if there is none.\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 31, "path": "tasks/means-test/means-test-entitlement-d2-e0017"}
|
| 19 |
+
{"id": "means-test-overpayment-d2-e0018", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 2, "seed": 10018, "title": "Work out overpayments for 4 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery, and section 7 a change that falls inside a month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n- `written_off`: list of the case ids whose overpayment is above 0 but is written off (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/means-test/means-test-overpayment-d2-e0018"}
|
| 20 |
+
{"id": "means-test-review-d2-e0019", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 2, "seed": 10019, "title": "Review 7 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 7 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance, the asset excess and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `asset_excess`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 19, "path": "tasks/means-test/means-test-review-d2-e0019"}
|
| 21 |
+
{"id": "means-test-change-d3-e0020", "env": "means-test", "isced_f": "0923", "family": "change", "difficulty": 3, "seed": 10020, "title": "Prorate 4 cases with a change during the month", "instruction": "# Means test: a change during the month\n\n`cases.json` holds 4 household case files from the Municipality of Eskermark for 2026-03 (31 days). Each file shows the household as it was on the first day of the month and a list of `changes`, each with the date it takes effect (not always listed in date order). Some files have a `claim_date`: see section 7. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 7 says how to handle a change during the month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `rent_change`: the monthly rent becomes the amount given.\n- `member_joins`: the person given moves in, with the role shown.\n- `member_leaves`: the named person moves out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `days`: a list of integers, the number of days in each period, in date order.\n - `rates`: a list of numbers, the monthly entitlement (section 6) of each period, in the same order, fl with 2 decimals.\n - `payable`: the benefit payable for the month, fl with 2 decimals.\n- `nothing_payable`: list of the case ids for which nothing is payable for the month (any order; an empty list if none).\n- `total_payable`: the sum of `payable` over all the cases, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 14, "path": "tasks/means-test/means-test-change-d3-e0020"}
|
| 22 |
+
{"id": "means-test-entitlement-d3-e0021", "env": "means-test", "isced_f": "0923", "family": "entitlement", "difficulty": 3, "seed": 10021, "title": "Assess 7 households", "instruction": "# Means test: monthly entitlement\n\n`cases.json` holds the case files of 7 households that have applied for local support in the Municipality of Eskermark. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changes during the month.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: an object keyed by case id. Each value has, in fl with 2 decimals,\n - `norm`: the norm (section 2).\n - `countable_income`: the countable income (section 4).\n - `housing_allowance`: the housing allowance (section 3).\n - `asset_excess`: the asset excess (section 5), 0 if there is none.\n - `benefit`: the benefit payable for the month (section 6), 0 if there is no entitlement.\n- `no_entitlement`: list of the case ids of the households with no entitlement (any order; an empty list if none).\n- `total_payable`: the sum of the benefits payable to all the households, fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 37, "path": "tasks/means-test/means-test-entitlement-d3-e0021"}
|
| 23 |
+
{"id": "means-test-overpayment-d3-e0022", "env": "means-test", "isced_f": "0923", "family": "overpayment", "difficulty": 3, "seed": 10022, "title": "Work out overpayments for 5 cases", "instruction": "# Means test: overpayments\n\n`cases.json` holds 5 household case files from the Municipality of Eskermark. Each shows the household as it was declared, the benefit paid for each month under review (`benefit_paid`), and a `discovered_change`: a change that in fact took effect on the date given but was only found out afterwards. From that date on, the true circumstances are the declared ones with the change applied. `regulation.md` is the ordinance to apply (it is fictional; use its rules and amounts exactly). Section 8 covers overpayments and recovery, and section 7 a change that falls inside a month.\n\nThe kinds of change are:\n\n- `income_change`: the named person's whole income list is replaced by the list given.\n- `member_joins`: the person given moved in, with the role shown.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `cases`: an object keyed by case id. Each value has\n - `correct`: an object keyed by month (for example `2026-03`), giving the correct benefit for each month under review, fl with 2 decimals.\n - `total_overpayment`: the total overpayment, fl with 2 decimals (0 if there is none).\n - `deductions`: the number of monthly deductions needed to recover it, an integer (0 if nothing is recovered).\n - `last_deduction`: the amount of the last deduction, fl with 2 decimals. Leave it out if nothing is recovered.\n- `written_off`: list of the case ids whose overpayment is above 0 but is written off (any order; an empty list if none).\n- `total_to_recover`: the sum of the total overpayments that will be recovered (leave out those written off), fl with 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 31, "path": "tasks/means-test/means-test-overpayment-d3-e0022"}
|
| 24 |
+
{"id": "means-test-review-d3-e0023", "env": "means-test", "isced_f": "0923", "family": "review", "difficulty": 3, "seed": 10023, "title": "Review 9 benefit decisions", "instruction": "# Means test: review of decisions\n\n`decisions.json` holds 9 household case files from the Municipality of Eskermark, each with the `decision` a caseworker made for the month: the norm, the countable income, the housing allowance, the asset excess and the benefit. `regulation.md` is the ordinance (it is fictional; use its rules and amounts exactly, sections 1 to 6). Nothing changed during the month.\n\nRe-assess every household. A decision is wrong if any of its figures differs from the correct figure by more than 0.01 fl. Some of the decisions are wrong.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `wrong_decisions`: list of the case ids whose decision is wrong (any order).\n- `corrected`: an object keyed by case id, for the wrong decisions only. Each value has the correct figures, fl with 2 decimals: `norm`, `countable_income`, `housing_allowance`, `asset_excess`, `benefit`, and\n - `difference`: the correct benefit minus the benefit in the decision (negative if the household was paid too much).\n- `total_underpaid`: the sum of the positive differences, fl with 2 decimals (0 if none).\n- `total_overpaid`: the sum of the negative differences, given as a positive number, fl with 2 decimals (0 if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 27, "path": "tasks/means-test/means-test-review-d3-e0023"}
|
data/means-test/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/price-index/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "price-index-basket-indices-d1-e0000", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 1, "seed": 10000, "title": "Price indices, 5 items over 3 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price per unit and the quantity bought of each item in 3 years. Prices are in crowns (CRN).\n\nThe base year is 2016, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2016\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 3 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/price-index/price-index-basket-indices-d1-e0000"}
|
| 2 |
+
{"id": "price-index-income-distribution-d1-e0001", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 1, "seed": 10001, "title": "Income distribution, 30 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual disposable income of 30 households from a survey. Each household is one observation.\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the households, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 households). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: the number of households, an integer.\n- `mean_income` and `median_income`: of household disposable income, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 10, "path": "tasks/price-index/price-index-income-distribution-d1-e0001"}
|
| 3 |
+
{"id": "price-index-inflation-contributions-d1-e0002", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 1, "seed": 10002, "title": "Inflation contributions, 5 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives the weight of each category in parts per thousand. `indices.csv` gives each category's price index in two months. Every category's index equals 100 in the period the weights refer to.\n\nCompare 2012-03 (the current month) with 2012-02 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2012-02\"` and `\"2012-03\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2012-02 to 2012-03, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/price-index/price-index-inflation-contributions-d1-e0002"}
|
| 4 |
+
{"id": "price-index-national-accounts-d1-e0003", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 1, "seed": 10003, "title": "GDP for 3 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each final good or service in a small economy over 3 years. The base year is 2017 (also in `accounts.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2017\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2017, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `real_growth_percent`: percentage change of real GDP from the year before, 2 decimals (leave it out for 2017).\n - `inflation_percent`: percentage change of the deflator from the year before, 2 decimals (leave it out for 2017).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-national-accounts-d1-e0003"}
|
| 5 |
+
{"id": "price-index-basket-indices-d2-e0004", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 2, "seed": 10004, "title": "Price indices, 8 items over 4 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price per unit and the quantity bought of each item in 4 years, in no particular order. Some items are imported and priced in a foreign currency. Convert every price to crowns (CRN) with the rate for the same period in `exchange_rates.csv` (crowns per one unit of the foreign currency). Prices already in CRN need no conversion.\n\nThe base year is 2019, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2019\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 4 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-basket-indices-d2-e0004"}
|
| 6 |
+
{"id": "price-index-income-distribution-d2-e0005", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 2, "seed": 10005, "title": "Income distribution, 40 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual income components of 40 households from a survey. Each household is one observation. Disposable income = `wages` + `self_employment_income` + `pensions_and_benefits` - `taxes_paid`.\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the households, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 households). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: the number of households, an integer.\n- `mean_income` and `median_income`: of household disposable income, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n- `poverty_threshold`: 60% of the median income, 2 decimals.\n- `households_at_risk`: the number of households with an income strictly below the threshold, an integer.\n- `at_risk_of_poverty_rate_percent`: that number as a percentage of all households, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-income-distribution-d2-e0005"}
|
| 7 |
+
{"id": "price-index-inflation-contributions-d2-e0006", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 2, "seed": 10006, "title": "Inflation contributions, 8 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives each category's weight as household spending (in millions) in the period the weights refer to; the weights do not add up to 1 or to 1000, so divide by their sum. `indices.csv` gives each category's monthly price index, in no particular order and for more months than you need. Every category's index equals 100 in the period the weights refer to.\n\nCompare 2023-07 (the current month) with 2022-07 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2022-07\"` and `\"2023-07\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2022-07 to 2023-07, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n- `smallest_contributor`: the category with the smallest contribution (the most negative one if any are negative).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-inflation-contributions-d2-e0006"}
|
| 8 |
+
{"id": "price-index-national-accounts-d2-e0007", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 2, "seed": 10007, "title": "GDP for 5 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each product in a small economy over 5 years, in no particular order. GDP here is the value of **final** goods and services only: rows whose `use` is `intermediate` are inputs already contained in the value of the final products, so leave them out of every calculation. The base year for constant prices is 2013 and the reference year of the chain-linked index is 2011 (both also in `accounts.json`).\n\nThe chain-linked volume index links each year to the year before at the earlier year's prices:\n\n- link(t) = sum(p_(t-1) x q_t) / sum(p_(t-1) x q_(t-1))\n- index(2011) = 100, and index(t) = index(t-1) x link(t) for each later year.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2011\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2013, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `chain_index`: the chain-linked volume index, with 2011 = 100, 2 decimals.\n - `real_growth_percent`: percentage change of real GDP from the year before, 2 decimals (leave it out for 2011).\n - `chain_growth_percent`: percentage change of the chain-linked index from the year before, 2 decimals (leave it out for 2011).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/price-index/price-index-national-accounts-d2-e0007"}
|
| 9 |
+
{"id": "price-index-basket-indices-d3-e0008", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 3, "seed": 10008, "title": "Price indices, 10 items over 5 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price and the quantity bought of each item in up to 5 years, in no particular order. Some items are imported and priced in a foreign currency. Convert every price to crowns (CRN) with the rate for the same period in `exchange_rates.csv` (crowns per one unit of the foreign currency). Prices already in CRN need no conversion.\n\n`price` is the price of one pack of `pack_size` `pack_unit`, and the pack on sale can change from one year to the next. `quantity` is the amount bought, in `quantity_unit` (kg, litre or each). Before anything else, turn every price into a price per `quantity_unit`: 1 kg = 1000 g; 1 litre = 100 cl = 1000 ml; 1 dozen = 12 items (`each`).\n\nSome items were not on sale, or not priced, in every year. Use only the items that have a row in all 5 years, and leave the others out of every calculation, in every year.\n\nThe base year is 2015, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2015\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 5 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n- `excluded_items`: list of the items left out because they lack a row in some year (any order).\n- `fisher_change_percent`: object keyed by year, for every year after the base year: the percentage change of the Fisher index from the year before (the base-year index is 100), 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/price-index/price-index-basket-indices-d3-e0008"}
|
| 10 |
+
{"id": "price-index-income-distribution-d3-e0009", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 3, "seed": 10009, "title": "Income distribution, 40 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual income components and the composition of 40 households from a survey. Disposable income = `wages` + `self_employment_income` + `pensions_and_benefits` - `taxes_paid`.\n\nWork with **equivalised** income per **person**. A household's equivalence scale is 1.0 for the first member aged 14 or over, plus 0.5 for each further member aged 14 or over, plus 0.3 for each child under 14. Its equivalised income is its disposable income divided by that scale. Every member of the household, children included, is then one observation with the household's equivalised income: a household of four people counts four times. All the measures below are computed over persons (n = the number of persons).\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the persons, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 persons). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `persons`: the number of persons, an integer.\n- `mean_income` and `median_income`: of equivalised disposable income per person, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n- `poverty_threshold`: 60% of the median income, 2 decimals.\n- `persons_at_risk`: the number of persons with an income strictly below the threshold, an integer.\n- `at_risk_of_poverty_rate_percent`: that number as a percentage of all persons, 2 decimals.\n- `children_at_risk`: the number of children under 14 living in households below the threshold, an integer.\n- `child_at_risk_rate_percent`: that number as a percentage of all children under 14, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/price-index/price-index-income-distribution-d3-e0009"}
|
| 11 |
+
{"id": "price-index-inflation-contributions-d3-e0010", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 3, "seed": 10010, "title": "Inflation contributions, 11 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives each category's weight as household spending (in millions) in 2021-02, the month the weights refer to; divide by the sum of the weights you are using. It also marks each category as `food`, `energy` or `other`. `indices.csv` gives each category's monthly price index as published, in no particular order and for more months than you need. The published series do not all equal 100 in the same month. First rebase every category so that it equals 100 in 2021-02: rebased index = 100 x published index / published index of the same category in 2021-02. Use the rebased indices everywhere below.\n\nCompare 2022-04 (the current month) with 2021-04 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2021-04\"` and `\"2022-04\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2021-04 to 2022-04, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n- `smallest_contributor`: the category with the smallest contribution (the most negative one if any are negative).\n- `core_index`: object keyed by the same two months: the index of the core aggregate, which is the categories marked `other` only (no food, no energy), built like the all-items index but with those categories and their weights alone, 2 decimals.\n- `core_inflation_percent`: the percentage change of the core index between the two months, 2 decimals.\n- `group_contributions`: object with keys `food`, `energy` and `other`: the sum of the contributions (to all-items inflation, as above) of the categories in each group, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/price-index/price-index-inflation-contributions-d3-e0010"}
|
| 12 |
+
{"id": "price-index-national-accounts-d3-e0011", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 3, "seed": 10011, "title": "GDP for 5 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each product in a small economy over 5 years, in no particular order. GDP here is the value of **final** goods and services only: rows whose `use` is `intermediate` are inputs already contained in the value of the final products, so leave them out of every calculation. The base year for constant prices is 2014 and the reference year of the chain-linked index is 2013 (both also in `accounts.json`).\n\nThe chain-linked volume index links each year to the year before at the earlier year's prices:\n\n- link(t) = sum(p_(t-1) x q_t) / sum(p_(t-1) x q_(t-1))\n- index(2013) = 100, and index(t) = index(t-1) x link(t) for each later year. For the years before 2013 work backwards: index(t-1) = index(t) / link(t).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2011\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2014, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `chain_index`: the chain-linked volume index, with 2013 = 100, 2 decimals.\n - `chained_volume_gdp`: GDP in chained volume terms, nominal GDP of 2013 x chain index / 100, 2 decimals.\n - `real_gdp_per_capita`: real GDP (at 2014 prices) divided by the year's population in `population.csv`, 2 decimals.\n- `average_real_growth_percent`: the average annual growth rate of real GDP from 2011 to 2015, ((last / first)^(1/4) - 1) x 100, 2 decimals.\n- `average_chain_growth_percent`: the same average annual growth rate computed from the chain-linked index, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 32, "path": "tasks/price-index/price-index-national-accounts-d3-e0011"}
|
| 13 |
+
{"id": "price-index-basket-indices-d1-e0012", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 1, "seed": 10012, "title": "Price indices, 5 items over 3 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price per unit and the quantity bought of each item in 3 years. Prices are in crowns (CRN).\n\nThe base year is 2012, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2012\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 3 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/price-index/price-index-basket-indices-d1-e0012"}
|
| 14 |
+
{"id": "price-index-income-distribution-d1-e0013", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 1, "seed": 10013, "title": "Income distribution, 20 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual disposable income of 20 households from a survey. Each household is one observation.\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the households, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 households). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: the number of households, an integer.\n- `mean_income` and `median_income`: of household disposable income, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 10, "path": "tasks/price-index/price-index-income-distribution-d1-e0013"}
|
| 15 |
+
{"id": "price-index-inflation-contributions-d1-e0014", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 1, "seed": 10014, "title": "Inflation contributions, 5 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives the weight of each category in parts per thousand. `indices.csv` gives each category's price index in two months. Every category's index equals 100 in the period the weights refer to.\n\nCompare 2018-09 (the current month) with 2018-08 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2018-08\"` and `\"2018-09\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2018-08 to 2018-09, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/price-index/price-index-inflation-contributions-d1-e0014"}
|
| 16 |
+
{"id": "price-index-national-accounts-d1-e0015", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 1, "seed": 10015, "title": "GDP for 3 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each final good or service in a small economy over 3 years. The base year is 2019 (also in `accounts.json`).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2019\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2019, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `real_growth_percent`: percentage change of real GDP from the year before, 2 decimals (leave it out for 2019).\n - `inflation_percent`: percentage change of the deflator from the year before, 2 decimals (leave it out for 2019).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-national-accounts-d1-e0015"}
|
| 17 |
+
{"id": "price-index-basket-indices-d2-e0016", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 2, "seed": 10016, "title": "Price indices, 8 items over 4 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price per unit and the quantity bought of each item in 4 years, in no particular order. Some items are imported and priced in a foreign currency. Convert every price to crowns (CRN) with the rate for the same period in `exchange_rates.csv` (crowns per one unit of the foreign currency). Prices already in CRN need no conversion.\n\nThe base year is 2011, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2011\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 4 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-basket-indices-d2-e0016"}
|
| 18 |
+
{"id": "price-index-income-distribution-d2-e0017", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 2, "seed": 10017, "title": "Income distribution, 40 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual income components of 40 households from a survey. Each household is one observation. Disposable income = `wages` + `self_employment_income` + `pensions_and_benefits` - `taxes_paid`.\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the households, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 households). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `households`: the number of households, an integer.\n- `mean_income` and `median_income`: of household disposable income, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n- `poverty_threshold`: 60% of the median income, 2 decimals.\n- `households_at_risk`: the number of households with an income strictly below the threshold, an integer.\n- `at_risk_of_poverty_rate_percent`: that number as a percentage of all households, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-income-distribution-d2-e0017"}
|
| 19 |
+
{"id": "price-index-inflation-contributions-d2-e0018", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 2, "seed": 10018, "title": "Inflation contributions, 8 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives each category's weight as household spending (in millions) in the period the weights refer to; the weights do not add up to 1 or to 1000, so divide by their sum. `indices.csv` gives each category's monthly price index, in no particular order and for more months than you need. Every category's index equals 100 in the period the weights refer to.\n\nCompare 2014-02 (the current month) with 2013-02 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2013-02\"` and `\"2014-02\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2013-02 to 2014-02, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n- `smallest_contributor`: the category with the smallest contribution (the most negative one if any are negative).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/price-index/price-index-inflation-contributions-d2-e0018"}
|
| 20 |
+
{"id": "price-index-national-accounts-d2-e0019", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 2, "seed": 10019, "title": "GDP for 5 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each product in a small economy over 5 years, in no particular order. GDP here is the value of **final** goods and services only: rows whose `use` is `intermediate` are inputs already contained in the value of the final products, so leave them out of every calculation. The base year for constant prices is 2014 and the reference year of the chain-linked index is 2014 (both also in `accounts.json`).\n\nThe chain-linked volume index links each year to the year before at the earlier year's prices:\n\n- link(t) = sum(p_(t-1) x q_t) / sum(p_(t-1) x q_(t-1))\n- index(2014) = 100, and index(t) = index(t-1) x link(t) for each later year.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2014\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2014, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `chain_index`: the chain-linked volume index, with 2014 = 100, 2 decimals.\n - `real_growth_percent`: percentage change of real GDP from the year before, 2 decimals (leave it out for 2014).\n - `chain_growth_percent`: percentage change of the chain-linked index from the year before, 2 decimals (leave it out for 2014).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 28, "path": "tasks/price-index/price-index-national-accounts-d2-e0019"}
|
| 21 |
+
{"id": "price-index-basket-indices-d3-e0020", "env": "price-index", "isced_f": "0311", "family": "basket-indices", "difficulty": 3, "seed": 10020, "title": "Price indices, 10 items over 5 years", "instruction": "# Price indices for a household basket\n\n`basket.csv` gives, for a reference household, the price and the quantity bought of each item in up to 5 years, in no particular order. Some items are imported and priced in a foreign currency. Convert every price to crowns (CRN) with the rate for the same period in `exchange_rates.csv` (crowns per one unit of the foreign currency). Prices already in CRN need no conversion.\n\n`price` is the price of one pack of `pack_size` `pack_unit`, and the pack on sale can change from one year to the next. `quantity` is the amount bought, in `quantity_unit` (kg, litre or each). Before anything else, turn every price into a price per `quantity_unit`: 1 kg = 1000 g; 1 litre = 100 cl = 1000 ml; 1 dozen = 12 items (`each`).\n\nSome items were not on sale, or not priced, in every year. Use only the items that have a row in all 5 years, and leave the others out of every calculation, in every year.\n\nThe base year is 2015, the earliest year. With p for price, q for quantity, 0 for the base year and t for the year in question, and sums running over the items:\n\n- Laspeyres index = 100 x sum(p_t x q_0) / sum(p_0 x q_0)\n- Paasche index = 100 x sum(p_t x q_t) / sum(p_0 x q_t)\n- Fisher index = square root of (Laspeyres x Paasche)\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `basket_cost`: object keyed by year (as a string, for example `\"2015\"`): what the household spent that year, the sum of price x quantity in crowns, 2 decimals. One entry for each of the 5 years.\n- `indices`: object keyed by year, for every year after the base year. Each value has `laspeyres`, `paasche` and `fisher`, 2 decimals.\n- `excluded_items`: list of the items left out because they lack a row in some year (any order).\n- `fisher_change_percent`: object keyed by year, for every year after the base year: the percentage change of the Fisher index from the year before (the base-year index is 100), 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/price-index/price-index-basket-indices-d3-e0020"}
|
| 22 |
+
{"id": "price-index-income-distribution-d3-e0021", "env": "price-index", "isced_f": "0311", "family": "income-distribution", "difficulty": 3, "seed": 10021, "title": "Income distribution, 40 households", "instruction": "# Income distribution from a household survey\n\n`households.csv` gives the annual income components and the composition of 40 households from a survey. Disposable income = `wages` + `self_employment_income` + `pensions_and_benefits` - `taxes_paid`.\n\nWork with **equivalised** income per **person**. A household's equivalence scale is 1.0 for the first member aged 14 or over, plus 0.5 for each further member aged 14 or over, plus 0.3 for each child under 14. Its equivalised income is its disposable income divided by that scale. Every member of the household, children included, is then one observation with the household's equivalised income: a household of four people counts four times. All the measures below are computed over persons (n = the number of persons).\n\nGini coefficient: sort the incomes from lowest to highest and number them i = 1, 2, ..., n. Then\n\n G = 2 x sum(i x income_i) / (n x sum(income_i)) - (n + 1) / n\n\nQuintile shares: with the incomes sorted from lowest to highest, Q1 is the poorest fifth of the persons, Q5 the richest fifth (n is a multiple of 5, so each fifth holds exactly n / 5 persons). A quintile's share is its total income as a percentage of everyone's total income. S80/S20 is the total income of Q5 divided by the total income of Q1.\n\nMedian: the middle value of the sorted incomes; with an even n, the mean of the two middle values.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `persons`: the number of persons, an integer.\n- `mean_income` and `median_income`: of equivalised disposable income per person, 2 decimals.\n- `gini`: the Gini coefficient, 4 decimals.\n- `quintile_shares_percent`: object with keys `Q1` to `Q5`: each quintile's share of total income in per cent, 2 decimals.\n- `s80_s20`: the income quintile share ratio, 2 decimals.\n- `poverty_threshold`: 60% of the median income, 2 decimals.\n- `persons_at_risk`: the number of persons with an income strictly below the threshold, an integer.\n- `at_risk_of_poverty_rate_percent`: that number as a percentage of all persons, 2 decimals.\n- `children_at_risk`: the number of children under 14 living in households below the threshold, an integer.\n- `child_at_risk_rate_percent`: that number as a percentage of all children under 14, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/price-index/price-index-income-distribution-d3-e0021"}
|
| 23 |
+
{"id": "price-index-inflation-contributions-d3-e0022", "env": "price-index", "isced_f": "0311", "family": "inflation-contributions", "difficulty": 3, "seed": 10022, "title": "Inflation contributions, 11 categories", "instruction": "# Contributions to inflation\n\n`weights.csv` gives each category's weight as household spending (in millions) in 2014-01, the month the weights refer to; divide by the sum of the weights you are using. It also marks each category as `food`, `energy` or `other`. `indices.csv` gives each category's monthly price index as published, in no particular order and for more months than you need. The published series do not all equal 100 in the same month. First rebase every category so that it equals 100 in 2014-01: rebased index = 100 x published index / published index of the same category in 2014-01. Use the rebased indices everywhere below.\n\nCompare 2015-03 (the current month) with 2014-03 (the comparison month); both are named in `request.json`. This is a fixed-weight index, so:\n\n- All-items index in a month = sum(w_i x I_i) / sum(w_i), where w_i is the weight of category i and I_i its index in that month.\n- Inflation rate = (all-items index in the current month / all-items index in the comparison month - 1) x 100.\n- Contribution of category i = (w_i / sum(w)) x (I_i in the current month - I_i in the comparison month) / (all-items index in the comparison month) x 100.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `all_items_index`: object with the all-items index for the two months, keyed by month (`\"2014-03\"` and `\"2015-03\"`), 2 decimals.\n- `inflation_percent`: the percentage change of the all-items index from 2014-03 to 2015-03, 2 decimals.\n- `contributions`: object keyed by category: its contribution to that change in percentage points, 3 decimals (negative if its prices fell). The contributions add up to the inflation rate.\n- `largest_contributor`: the category with the largest contribution.\n- `smallest_contributor`: the category with the smallest contribution (the most negative one if any are negative).\n- `core_index`: object keyed by the same two months: the index of the core aggregate, which is the categories marked `other` only (no food, no energy), built like the all-items index but with those categories and their weights alone, 2 decimals.\n- `core_inflation_percent`: the percentage change of the core index between the two months, 2 decimals.\n- `group_contributions`: object with keys `food`, `energy` and `other`: the sum of the contributions (to all-items inflation, as above) of the categories in each group, 3 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 22, "path": "tasks/price-index/price-index-inflation-contributions-d3-e0022"}
|
| 24 |
+
{"id": "price-index-national-accounts-d3-e0023", "env": "price-index", "isced_f": "0311", "family": "national-accounts", "difficulty": 3, "seed": 10023, "title": "GDP for 5 years", "instruction": "# National accounts: nominal, real and chain-linked GDP\n\n`output.csv` gives the quantity produced and the unit price of each product in a small economy over 5 years, in no particular order. GDP here is the value of **final** goods and services only: rows whose `use` is `intermediate` are inputs already contained in the value of the final products, so leave them out of every calculation. The base year for constant prices is 2011 and the reference year of the chain-linked index is 2012 (both also in `accounts.json`).\n\nThe chain-linked volume index links each year to the year before at the earlier year's prices:\n\n- link(t) = sum(p_(t-1) x q_t) / sum(p_(t-1) x q_(t-1))\n- index(2012) = 100, and index(t) = index(t-1) x link(t) for each later year. For the years before 2012 work backwards: index(t-1) = index(t) / link(t).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `years`: object keyed by year (as a string, for example `\"2010\"`). Each value has\n - `nominal_gdp`: the year's output valued at the year's own prices, sum(p_t x q_t), 2 decimals.\n - `real_gdp`: the year's output valued at the prices of the base year 2011, sum(p_base x q_t), 2 decimals.\n - `deflator`: the GDP deflator, 100 x nominal GDP / real GDP, 2 decimals.\n - `chain_index`: the chain-linked volume index, with 2012 = 100, 2 decimals.\n - `chained_volume_gdp`: GDP in chained volume terms, nominal GDP of 2012 x chain index / 100, 2 decimals.\n - `real_gdp_per_capita`: real GDP (at 2011 prices) divided by the year's population in `population.csv`, 2 decimals.\n- `average_real_growth_percent`: the average annual growth rate of real GDP from 2010 to 2014, ((last / first)^(1/4) - 1) x 100, 2 decimals.\n- `average_chain_growth_percent`: the same average annual growth rate computed from the chain-linked index, 2 decimals.\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 32, "path": "tasks/price-index/price-index-national-accounts-d3-e0023"}
|
data/price-index/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/psychometrics/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "psychometrics-norms-d1-e0000", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 1, "seed": 10000, "title": "Norm-referenced scores for 6 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on the Irritability Scale. `norms.csv` is the norm table and `norms_guide.md` says how to use it.\n\nConvert every raw score using the norm group that matches the client's age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/psychometrics/psychometrics-norms-d1-e0000"}
|
| 2 |
+
{"id": "psychometrics-reliability-d1-e0001", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 1, "seed": 10001, "title": "Reliability of a 5-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 12 people to the 5 items of the Work Engagement Scale, one row per respondent. `reliability_notes.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q5`). Each value has\n - `mean`: the mean of the item, 2 decimals.\n - `variance`: the variance of the item scores, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 5-item scale, 3 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/psychometrics/psychometrics-reliability-d1-e0001"}
|
| 3 |
+
{"id": "psychometrics-reliable-change-d1-e0002", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 1, "seed": 10002, "title": "Reliable change for 6 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 6 clients on one instrument, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/psychometrics/psychometrics-reliable-change-d1-e0002"}
|
| 4 |
+
{"id": "psychometrics-scoring-d1-e0003", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 1, "seed": 10003, "title": "Score the Stress Checklist for 5 clients", "instruction": "# Questionnaire scoring: Stress Checklist\n\n`responses.csv` holds the item responses of 5 clients to the Stress Checklist, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer.\n - `total`: the total score, an integer.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).", "checks": 21, "path": "tasks/psychometrics/psychometrics-scoring-d1-e0003"}
|
| 5 |
+
{"id": "psychometrics-norms-d2-e0004", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 2, "seed": 10004, "title": "Norm-referenced scores for 8 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on the Irritability Scale. `norms.csv` is the norm table and `norms_guide.md` says how to use it.\n\nConvert every raw score using the norm group that matches the client's age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id, for every client who has a norm group. Each value has\n - `age`: age in completed years on the test date, an integer.\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n- `no_norm_group`: list of the client ids whose age is outside every age band (any order). Give no scores for them.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/psychometrics/psychometrics-norms-d2-e0004"}
|
| 6 |
+
{"id": "psychometrics-reliability-d2-e0005", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 2, "seed": 10005, "title": "Reliability of a 7-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 24 people to the 7 items of the Work Engagement Scale, one row per respondent. `reliability_notes.md` gives the definitions to use, including which items are reverse-keyed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q7`). Each value has\n - `variance`: the variance of the item scores, 3 decimals.\n - `item_rest_r`: the corrected item-total correlation, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 7-item scale, 3 decimals.\n- `weak_items`: list of the items whose corrected item-total correlation is below 0.30 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/psychometrics/psychometrics-reliability-d2-e0005"}
|
| 7 |
+
{"id": "psychometrics-reliable-change-d2-e0006", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 2, "seed": 10006, "title": "Reliable change for 8 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 8 clients on 2 instruments, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules. Some clients left treatment early and have no post score on an instrument: give no result for those rows and list them in `no_post`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n- `no_post`: list of `\"<client id>:<instrument code>\"` strings for the rows without a post score (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/psychometrics/psychometrics-reliable-change-d2-e0006"}
|
| 8 |
+
{"id": "psychometrics-scoring-d2-e0007", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 2, "seed": 10007, "title": "Score the Daily Strain Scale for 7 clients", "instruction": "# Questionnaire scoring: Daily Strain Scale\n\n`responses.csv` holds the item responses of 7 clients to the Daily Strain Scale, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer. Leave out a subscale that is not scorable.\n - `total`: the total score, an integer. Leave it out if it is not scorable.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`. Leave it out if the total is not scorable.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).\n- `unscorable`: list of strings of the form `\"<client id>:<subscale code>\"`, one for every subscale that is not scorable (any order; an empty list if none).", "checks": 31, "path": "tasks/psychometrics/psychometrics-scoring-d2-e0007"}
|
| 9 |
+
{"id": "psychometrics-norms-d3-e0008", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 3, "seed": 10008, "title": "Norm-referenced scores for 5 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on 2 scales (one row per client and scale). `norms.csv` is the norm table and `norms_guide.md` says how to use it. The norm table also lists a scale that nobody here took.\n\nConvert every raw score using the norm group that matches the client's scale, age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id, for every client who has a norm group. Each value has\n - `age`: age in completed years on the test date, an integer.\n - `scales`: an object keyed by scale code, each with\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n - `range`: one of `very-high`, `high`, `average`, `low`.\n- `no_norm_group`: list of the client ids whose age is outside every age band (any order). Give no scores for them.\n- `high_or_above`: list of strings of the form `\"<client id>:<scale code>\"` for every score in the `high` or `very-high` range (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/psychometrics/psychometrics-norms-d3-e0008"}
|
| 10 |
+
{"id": "psychometrics-reliability-d3-e0009", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 3, "seed": 10009, "title": "Reliability of a 8-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 33 people to the 8 items of the Study Motivation Scale, one row per respondent. `reliability_notes.md` gives the definitions to use, including which items are reverse-keyed and what to do with incomplete rows.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q8`). Each value has\n - `variance`: the variance of the item scores, 3 decimals.\n - `item_rest_r`: the corrected item-total correlation, 3 decimals.\n - `alpha_if_deleted`: Cronbach's alpha of the scale without this item, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 8-item scale, 3 decimals.\n- `weak_items`: list of the items whose corrected item-total correlation is below 0.30 (any order; an empty list if none).\n- `n_used`: the number of respondents kept in the analysis, an integer.\n- `best_item_to_drop`: the item with the highest alpha if item deleted.\n- `alpha_gain`: that item's alpha if item deleted minus `alpha`, 3 decimals (negative if dropping it would lower alpha).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/psychometrics/psychometrics-reliability-d3-e0009"}
|
| 11 |
+
{"id": "psychometrics-reliable-change-d3-e0010", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 3, "seed": 10010, "title": "Reliable change for 6 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 6 clients on 3 instruments, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules. Some clients left treatment early and have no post score on an instrument: give no result for those rows and list them in `no_post`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n - `recovered_pct`: the percentage of the clients with both a pre and a post score on this instrument whose status is `recovered`, 1 decimal.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n- `no_post`: list of `\"<client id>:<instrument code>\"` strings for the rows without a post score (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 43, "path": "tasks/psychometrics/psychometrics-reliable-change-d3-e0010"}
|
| 12 |
+
{"id": "psychometrics-scoring-d3-e0011", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 3, "seed": 10011, "title": "Score the Worry Questionnaire for 7 clients", "instruction": "# Questionnaire scoring: Worry Questionnaire\n\n`responses.csv` holds the item responses of 7 clients to the Worry Questionnaire, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly. Some clients filled in the questionnaire more than once: score only each client's most recent administration (the latest `administered` date).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer. Leave out a subscale that is not scorable.\n - `total`: the total score, an integer. Leave it out if it is not scorable.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`. Leave it out if the total is not scorable.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).\n- `unscorable`: list of strings of the form `\"<client id>:<subscale code>\"`, one for every subscale that is not scorable (any order; an empty list if none).\n- `risk_flagged`: list of the client ids flagged on the risk item (any order; an empty list if none).", "checks": 39, "path": "tasks/psychometrics/psychometrics-scoring-d3-e0011"}
|
| 13 |
+
{"id": "psychometrics-norms-d1-e0012", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 1, "seed": 10012, "title": "Norm-referenced scores for 6 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on the Irritability Scale. `norms.csv` is the norm table and `norms_guide.md` says how to use it.\n\nConvert every raw score using the norm group that matches the client's age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/psychometrics/psychometrics-norms-d1-e0012"}
|
| 14 |
+
{"id": "psychometrics-reliability-d1-e0013", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 1, "seed": 10013, "title": "Reliability of a 5-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 12 people to the 5 items of the Everyday Coping Scale, one row per respondent. `reliability_notes.md` gives the definitions to use.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q5`). Each value has\n - `mean`: the mean of the item, 2 decimals.\n - `variance`: the variance of the item scores, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 5-item scale, 3 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/psychometrics/psychometrics-reliability-d1-e0013"}
|
| 15 |
+
{"id": "psychometrics-reliable-change-d1-e0014", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 1, "seed": 10014, "title": "Reliable change for 6 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 6 clients on one instrument, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/psychometrics/psychometrics-reliable-change-d1-e0014"}
|
| 16 |
+
{"id": "psychometrics-scoring-d1-e0015", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 1, "seed": 10015, "title": "Score the Daily Strain Scale for 5 clients", "instruction": "# Questionnaire scoring: Daily Strain Scale\n\n`responses.csv` holds the item responses of 5 clients to the Daily Strain Scale, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer.\n - `total`: the total score, an integer.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).", "checks": 21, "path": "tasks/psychometrics/psychometrics-scoring-d1-e0015"}
|
| 17 |
+
{"id": "psychometrics-norms-d2-e0016", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 2, "seed": 10016, "title": "Norm-referenced scores for 8 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on the Fatigue Scale. `norms.csv` is the norm table and `norms_guide.md` says how to use it.\n\nConvert every raw score using the norm group that matches the client's age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id, for every client who has a norm group. Each value has\n - `age`: age in completed years on the test date, an integer.\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n- `no_norm_group`: list of the client ids whose age is outside every age band (any order). Give no scores for them.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/psychometrics/psychometrics-norms-d2-e0016"}
|
| 18 |
+
{"id": "psychometrics-reliability-d2-e0017", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 2, "seed": 10017, "title": "Reliability of a 7-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 24 people to the 7 items of the Everyday Coping Scale, one row per respondent. `reliability_notes.md` gives the definitions to use, including which items are reverse-keyed.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q7`). Each value has\n - `variance`: the variance of the item scores, 3 decimals.\n - `item_rest_r`: the corrected item-total correlation, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 7-item scale, 3 decimals.\n- `weak_items`: list of the items whose corrected item-total correlation is below 0.30 (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 17, "path": "tasks/psychometrics/psychometrics-reliability-d2-e0017"}
|
| 19 |
+
{"id": "psychometrics-reliable-change-d2-e0018", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 2, "seed": 10018, "title": "Reliable change for 8 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 8 clients on 2 instruments, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules. Some clients left treatment early and have no post score on an instrument: give no result for those rows and list them in `no_post`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n- `no_post`: list of `\"<client id>:<instrument code>\"` strings for the rows without a post score (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 35, "path": "tasks/psychometrics/psychometrics-reliable-change-d2-e0018"}
|
| 20 |
+
{"id": "psychometrics-scoring-d2-e0019", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 2, "seed": 10019, "title": "Score the Daily Strain Scale for 7 clients", "instruction": "# Questionnaire scoring: Daily Strain Scale\n\n`responses.csv` holds the item responses of 7 clients to the Daily Strain Scale, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer. Leave out a subscale that is not scorable.\n - `total`: the total score, an integer. Leave it out if it is not scorable.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`. Leave it out if the total is not scorable.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).\n- `unscorable`: list of strings of the form `\"<client id>:<subscale code>\"`, one for every subscale that is not scorable (any order; an empty list if none).", "checks": 34, "path": "tasks/psychometrics/psychometrics-scoring-d2-e0019"}
|
| 21 |
+
{"id": "psychometrics-norms-d3-e0020", "env": "psychometrics", "isced_f": "0313", "family": "norms", "difficulty": 3, "seed": 10020, "title": "Norm-referenced scores for 5 clients", "instruction": "# Norm-referenced scores\n\n`clients.csv` holds raw scores on 2 scales (one row per client and scale). `norms.csv` is the norm table and `norms_guide.md` says how to use it. The norm table also lists a scale that nobody here took.\n\nConvert every raw score using the norm group that matches the client's scale, age and sex.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id, for every client who has a norm group. Each value has\n - `age`: age in completed years on the test date, an integer.\n - `scales`: an object keyed by scale code, each with\n - `z`: the z score, 2 decimals.\n - `t_score`: the T score, 1 decimal.\n - `percentile`: the percentile rank, 1 decimal.\n - `range`: one of `very-high`, `high`, `average`, `low`.\n- `no_norm_group`: list of the client ids whose age is outside every age band (any order). Give no scores for them.\n- `high_or_above`: list of strings of the form `\"<client id>:<scale code>\"` for every score in the `high` or `very-high` range (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 38, "path": "tasks/psychometrics/psychometrics-norms-d3-e0020"}
|
| 22 |
+
{"id": "psychometrics-reliability-d3-e0021", "env": "psychometrics", "isced_f": "0313", "family": "reliability", "difficulty": 3, "seed": 10021, "title": "Reliability of a 8-item scale", "instruction": "# Reliability of a scale\n\n`item_responses.csv` holds the responses of 34 people to the 8 items of the Everyday Coping Scale, one row per respondent. `reliability_notes.md` gives the definitions to use, including which items are reverse-keyed and what to do with incomplete rows.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `items`: an object keyed by item name (`q1` to `q8`). Each value has\n - `variance`: the variance of the item scores, 3 decimals.\n - `item_rest_r`: the corrected item-total correlation, 3 decimals.\n - `alpha_if_deleted`: Cronbach's alpha of the scale without this item, 3 decimals.\n- `total_variance`: the variance of the respondents' totals, 3 decimals.\n- `alpha`: Cronbach's alpha of the 8-item scale, 3 decimals.\n- `weak_items`: list of the items whose corrected item-total correlation is below 0.30 (any order; an empty list if none).\n- `n_used`: the number of respondents kept in the analysis, an integer.\n- `best_item_to_drop`: the item with the highest alpha if item deleted.\n- `alpha_gain`: that item's alpha if item deleted minus `alpha`, 3 decimals (negative if dropping it would lower alpha).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/psychometrics/psychometrics-reliability-d3-e0021"}
|
| 23 |
+
{"id": "psychometrics-reliable-change-d3-e0022", "env": "psychometrics", "isced_f": "0313", "family": "reliable-change", "difficulty": 3, "seed": 10022, "title": "Reliable change for 6 clients", "instruction": "# Outcome review: reliable change\n\n`outcomes.csv` holds pre-treatment and post-treatment scores for 6 clients on 3 instruments, in no particular order. `instruments.csv` gives each instrument's standard deviation, reliability and clinical cut-off. `rci_rules.md` gives the formula and the classification rules. Some clients left treatment early and have no post score on an instrument: give no result for those rows and list them in `no_post`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `instruments`: an object keyed by instrument code, for every instrument that appears in `outcomes.csv`. Each value has\n - `s_diff`: the standard error of the difference, 2 decimals.\n - `recovered_pct`: the percentage of the clients with both a pre and a post score on this instrument whose status is `recovered`, 1 decimal.\n- `results`: an object keyed by client id, then by instrument code. Each value has\n - `rci`: the reliable change index, 2 decimals, with its sign.\n - `status`: one of `recovered`, `improved`, `unchanged`, `deteriorated`.\n- `recovered`: list of strings of the form `\"<client id>:<instrument code>\"` for every result with status `recovered` (any order; an empty list if none).\n- `deteriorated`: the same for status `deteriorated`.\n- `no_post`: list of `\"<client id>:<instrument code>\"` strings for the rows without a post score (any order).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 41, "path": "tasks/psychometrics/psychometrics-reliable-change-d3-e0022"}
|
| 24 |
+
{"id": "psychometrics-scoring-d3-e0023", "env": "psychometrics", "isced_f": "0313", "family": "scoring", "difficulty": 3, "seed": 10023, "title": "Score the Daily Strain Scale for 7 clients", "instruction": "# Questionnaire scoring: Daily Strain Scale\n\n`responses.csv` holds the item responses of 7 clients to the Daily Strain Scale, one row per administration, in no particular order. `scoring_manual.md` is the scoring manual: follow it exactly. Some clients filled in the questionnaire more than once: score only each client's most recent administration (the latest `administered` date).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `clients`: an object keyed by client id. Each value has\n - `subscales`: an object keyed by subscale code, giving each subscale score as an integer. Leave out a subscale that is not scorable.\n - `total`: the total score, an integer. Leave it out if it is not scorable.\n - `band`: the severity band, one of `minimal`, `mild`, `moderate`, `severe`. Leave it out if the total is not scorable.\n- `moderate_or_severe`: list of the client ids whose band is `moderate` or `severe` (any order; an empty list if none).\n- `unscorable`: list of strings of the form `\"<client id>:<subscale code>\"`, one for every subscale that is not scorable (any order; an empty list if none).\n- `risk_flagged`: list of the client ids flagged on the risk item (any order; an empty list if none).", "checks": 39, "path": "tasks/psychometrics/psychometrics-scoring-d3-e0023"}
|
data/psychometrics/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/seat-count/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "seat-count-constituencies-d1-e0000", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10000, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0000"}
|
| 2 |
+
{"id": "seat-count-highest-averages-d1-e0001", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10001, "title": "7 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 7 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 7 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0001"}
|
| 3 |
+
{"id": "seat-count-largest-remainder-d1-e0002", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10002, "title": "9 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 9 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0002"}
|
| 4 |
+
{"id": "seat-count-constituencies-d2-e0003", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10003, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 3% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0003"}
|
| 5 |
+
{"id": "seat-count-highest-averages-d2-e0004", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10004, "title": "17 seats by modified-sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 17 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 17 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0004"}
|
| 6 |
+
{"id": "seat-count-largest-remainder-d2-e0005", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10005, "title": "12 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 12 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 4% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0005"}
|
| 7 |
+
{"id": "seat-count-constituencies-d3-e0006", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 3, "seed": 10006, "title": "7 constituencies, 7 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.4, 3, 5, 7, ...: the first divisor is 1.4 instead of 1): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nOn top of the 57 fixed constituency seats there are 4 levelling seats, 61 seats in all. They are shared out like this:\n\n1. Allocate the fixed seats in each constituency as described above.\n2. Allocate all 61 seats among the qualifying parties by their national votes, with the same method. This is each party's entitlement.\n3. If a party has won more fixed seats than its entitlement, it keeps its fixed seats and gets no levelling seats. Set every such party aside, take its fixed seats off the 61, and repeat step 2 for the remaining parties and the remaining seats. Repeat until no remaining party has more fixed seats than its entitlement.\n4. Each remaining party gets levelling seats equal to its entitlement minus its fixed seats.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `fixed_seats`: object keyed by party: fixed seats summed over the constituencies, an integer for every party (0 if none).\n- `levelling_seats`: object keyed by party: levelling seats, an integer for every party (0 if none).\n- `total_seats`: object keyed by party: fixed plus levelling seats.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats (fixed plus levelling). Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/seat-count/seat-count-constituencies-d3-e0006"}
|
| 8 |
+
{"id": "seat-count-highest-averages-d3-e0007", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 3, "seed": 10007, "title": "47 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 7 counting districts in an election for 47 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 3% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 47 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n- `comparison_seats`: object keyed by party: the seats each party would get if the method were Sainte-Lague (divisors 1, 3, 5, 7, ...) instead, with the same threshold.\n- `changed`: list of the parties whose seat count differs between the two methods (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/seat-count/seat-count-highest-averages-d3-e0007"}
|
| 9 |
+
{"id": "seat-count-largest-remainder-d3-e0008", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 3, "seed": 10008, "title": "15 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 6 counting districts in an election for 15 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 5% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n- `comparison_quota`: the quota if the election used the Droop quota, Q = floor(V / (S + 1)) + 1 instead, 2 decimals.\n- `comparison_seats`: object keyed by party: total seats under that other quota, with the same threshold.\n- `changed`: list of the parties whose total differs between the two quotas (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/seat-count/seat-count-largest-remainder-d3-e0008"}
|
| 10 |
+
{"id": "seat-count-constituencies-d1-e0009", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10009, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0009"}
|
| 11 |
+
{"id": "seat-count-highest-averages-d1-e0010", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10010, "title": "13 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 13 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 3% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 13 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0010"}
|
| 12 |
+
{"id": "seat-count-largest-remainder-d1-e0011", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10011, "title": "7 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 7 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0011"}
|
| 13 |
+
{"id": "seat-count-constituencies-d2-e0012", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10012, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0012"}
|
| 14 |
+
{"id": "seat-count-highest-averages-d2-e0013", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10013, "title": "18 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 18 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 18 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0013"}
|
| 15 |
+
{"id": "seat-count-largest-remainder-d2-e0014", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10014, "title": "17 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 17 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 2% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0014"}
|
| 16 |
+
{"id": "seat-count-constituencies-d3-e0015", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 3, "seed": 10015, "title": "7 constituencies, 7 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nOn top of the 51 fixed constituency seats there are 4 levelling seats, 55 seats in all. They are shared out like this:\n\n1. Allocate the fixed seats in each constituency as described above.\n2. Allocate all 55 seats among the qualifying parties by their national votes, with the same method. This is each party's entitlement.\n3. If a party has won more fixed seats than its entitlement, it keeps its fixed seats and gets no levelling seats. Set every such party aside, take its fixed seats off the 55, and repeat step 2 for the remaining parties and the remaining seats. Repeat until no remaining party has more fixed seats than its entitlement.\n4. Each remaining party gets levelling seats equal to its entitlement minus its fixed seats.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `fixed_seats`: object keyed by party: fixed seats summed over the constituencies, an integer for every party (0 if none).\n- `levelling_seats`: object keyed by party: levelling seats, an integer for every party (0 if none).\n- `total_seats`: object keyed by party: fixed plus levelling seats.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats (fixed plus levelling). Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 25, "path": "tasks/seat-count/seat-count-constituencies-d3-e0015"}
|
| 17 |
+
{"id": "seat-count-highest-averages-d3-e0016", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 3, "seed": 10016, "title": "32 seats by sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 7 counting districts in an election for 32 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 32 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n- `comparison_seats`: object keyed by party: the seats each party would get if the method were modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1) instead, with the same threshold.\n- `changed`: list of the parties whose seat count differs between the two methods (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 34, "path": "tasks/seat-count/seat-count-highest-averages-d3-e0016"}
|
| 18 |
+
{"id": "seat-count-largest-remainder-d3-e0017", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 3, "seed": 10017, "title": "24 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 6 counting districts in an election for 24 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 2% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n- `comparison_quota`: the quota if the election used the Droop quota, Q = floor(V / (S + 1)) + 1 instead, 2 decimals.\n- `comparison_seats`: object keyed by party: total seats under that other quota, with the same threshold.\n- `changed`: list of the parties whose total differs between the two quotas (any order; an empty list if none).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 30, "path": "tasks/seat-count/seat-count-largest-remainder-d3-e0017"}
|
| 19 |
+
{"id": "seat-count-constituencies-d1-e0018", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 1, "seed": 10018, "title": "3 constituencies, 4 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `vote_share_percent`: object keyed by party: share of the national valid votes in per cent, 2 decimals.\n- `seat_share_percent`: object keyed by party: share of all seats in per cent, 2 decimals.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 26, "path": "tasks/seat-count/seat-count-constituencies-d1-e0018"}
|
| 20 |
+
{"id": "seat-count-highest-averages-d1-e0019", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 1, "seed": 10019, "title": "12 seats by dhondt", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the votes for each party in an election for 12 seats.\n\nThe seats are allocated by the highest-averages method D'Hondt (divisors 1, 2, 3, 4, ...). A party takes part in the allocation only if it has at least 5% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 12 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 16, "path": "tasks/seat-count/seat-count-highest-averages-d1-e0019"}
|
| 21 |
+
{"id": "seat-count-largest-remainder-d1-e0020", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 1, "seed": 10020, "title": "9 seats by hare quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the votes for each party in an election for 9 seats. Every party takes part in the allocation.\n\nThe seats are allocated by the largest-remainder method with the Hare quota, Q = V / S (not rounded). S is the number of seats and V is the total vote of the parties that take part in the allocation. The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/seat-count/seat-count-largest-remainder-d1-e0020"}
|
| 22 |
+
{"id": "seat-count-constituencies-d2-e0021", "env": "seat-count", "isced_f": "0312", "family": "constituencies", "difficulty": 2, "seed": 10021, "title": "5 constituencies, 6 parties", "instruction": "# Seat count: constituencies\n\n`votes.csv` gives the votes by constituency and party, in no particular order, and `constituencies.csv` gives the number of seats filled in each constituency. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share. A party takes part in the allocation, in every constituency, only if it has at least 4% of the valid votes in the whole country. A party with no row in a constituency did not stand there and has no votes there.\n\nWithin each constituency the seats are allocated by the highest-averages method Sainte-Lague (divisors 1, 3, 5, 7, ...): divide each qualifying party's votes in the constituency by each divisor in turn; the largest quotients, as many as the constituency has seats, win one seat each. The settings are also in `election.json`.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes in the whole country, an integer.\n- `turnout_percent`: all ballots cast in the country (valid, blank and invalid) as a percentage of all registered voters (`registered_voters` in `constituencies.csv`), 2 decimals.\n- `qualified`: list of the parties that reach the national threshold (any order).\n- `constituency_seats`: object keyed by constituency, each an object keyed by party with the seats won there, an integer (0 where a party wins none; list every party in every constituency).\n- `national_seats`: object keyed by party: seats summed over the constituencies.\n- `gallagher_index`: the Gallagher least-squares index of disproportionality, sqrt(0.5 x sum of (v - s)^2), 2 decimals. For each party v is its percentage of the national valid votes and s is its percentage of all seats. Include every party on the ballot as its own term, also those with no seats; blank and invalid ballots are not a party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/seat-count/seat-count-constituencies-d2-e0021"}
|
| 23 |
+
{"id": "seat-count-highest-averages-d2-e0022", "env": "seat-count", "isced_f": "0312", "family": "highest-averages", "difficulty": 2, "seed": 10022, "title": "15 seats by modified-sainte-lague", "instruction": "# Seat count: highest averages\n\n`results.csv` gives the count from 4 counting districts in an election for 15 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nThe seats are allocated by the highest-averages method modified Sainte-Lague (divisors 1.2, 3, 5, 7, ...: the first divisor is 1.2 instead of 1). A party takes part in the allocation only if it has at least 4% of the valid votes. These settings are also in `election.json`.\n\nHow the method works: divide each qualifying party's votes by each divisor in turn. The 15 largest quotients over all parties win one seat each.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `vote_share_percent`: object keyed by party: each party's share of the valid votes in per cent, 2 decimals (every party, also those under the threshold).\n- `qualified`: list of the parties that reach the threshold (any order).\n- `seats`: object keyed by party: seats won, an integer (0 for parties with none, including those under the threshold).\n- `last_seat_party`: the party that wins the last seat, that is the party holding the smallest winning quotient.\n- `last_winning_quotient`: that quotient, 2 decimals.\n- `runner_up_party`: the party holding the largest quotient that does not win a seat.\n- `first_losing_quotient`: that quotient, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 20, "path": "tasks/seat-count/seat-count-highest-averages-d2-e0022"}
|
| 24 |
+
{"id": "seat-count-largest-remainder-d2-e0023", "env": "seat-count", "isced_f": "0312", "family": "largest-remainder", "difficulty": 2, "seed": 10023, "title": "24 seats by droop quota", "instruction": "# Seat count: largest remainder\n\n`count.csv` gives the count from 4 counting districts in an election for 24 seats, in no particular order. Add the districts together. Rows whose `party` is `BLANK` or `INVALID` are ballots that are not valid votes: leave them out of the valid votes and of every share.\n\nA party takes part in the allocation only if it has at least 3% of the valid votes.\n\nThe seats are allocated by the largest-remainder method with the Droop quota, Q = floor(V / (S + 1)) + 1. S is the number of seats and V is the total vote of the parties that take part in the allocation (votes for parties under the threshold are not part of V). The settings are also in `election.json`.\n\nHow the method works: each party first gets one seat for every whole quota in its vote, floor(votes / Q). The seats still unfilled go, one each, to the parties with the largest remainders, votes - (automatic seats x Q).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `valid_votes`: total valid votes, an integer.\n- `qualified`: list of the parties that reach the threshold (any order).\n- `quota`: the quota Q, 2 decimals.\n- `automatic_seats`: object keyed by party: seats won by whole quotas, an integer (0 for parties with none, including those under the threshold).\n- `remainder_seat_parties`: list of the parties that win a remainder seat (any order).\n- `seats`: object keyed by party: total seats, an integer for every party.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 18, "path": "tasks/seat-count/seat-count-largest-remainder-d2-e0023"}
|
data/seat-count/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/stand-inventory/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "stand-inventory-growth-d1-e0000", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 1, "seed": 10000, "title": "Increment for 4 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds two inventories of each stand, in no particular order. Nothing was cut in these stands. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/stand-inventory/stand-inventory-growth-d1-e0000"}
|
| 2 |
+
{"id": "stand-inventory-plots-d1-e0001", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 1, "seed": 10001, "title": "Sample plot summary for 3 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 3 circular sample plots in stand Tallheden 4. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nEvery tallied tree is alive and stands inside its plot, so every row counts.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/stand-inventory/stand-inventory-plots-d1-e0001"}
|
| 3 |
+
{"id": "stand-inventory-thinning-d1-e0002", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 1, "seed": 10002, "title": "Thinning from below on a 400 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Kvarnmon 16. `thinning_prescription.md` gives the plot area, the target and the rules. Every tree on the plot is alive.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/stand-inventory/stand-inventory-thinning-d1-e0002"}
|
| 4 |
+
{"id": "stand-inventory-volume-d1-e0003", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 1, "seed": 10003, "title": "Stand volume from 1 plot", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on one sample plot in stand Granliden 27. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nEvery tree's height was measured.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/stand-inventory/stand-inventory-volume-d1-e0003"}
|
| 5 |
+
{"id": "stand-inventory-growth-d2-e0004", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 2, "seed": 10004, "title": "Increment for 6 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds two inventories of each stand, in no particular order, and `removals.csv` lists the volumes cut. The removals file also covers stands that are not in this inventory; ignore those. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/stand-inventory/stand-inventory-growth-d2-e0004"}
|
| 6 |
+
{"id": "stand-inventory-plots-d2-e0005", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 2, "seed": 10005, "title": "Sample plot summary for 5 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 5 circular sample plots in stand Norrmyran 12. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nCount a tree only if it is alive (`status` is `live`) and stands inside the plot: a tree is inside when its `dist_m` (horizontal distance from the plot centre) is not more than the plot radius. Dead trees and trees outside the plot are left out of everything.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n- `understocked`: list of the plot ids whose basal area per hectare is below the understocked threshold in the notes (any order).\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 24, "path": "tasks/stand-inventory/stand-inventory-plots-d2-e0005"}
|
| 7 |
+
{"id": "stand-inventory-thinning-d2-e0006", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 2, "seed": 10006, "title": "Thinning from below on a 400 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Granliden 27. `thinning_prescription.md` gives the plot area, the target and the rules. The plot also holds dead trees and marked retention trees; the prescription says how to treat them.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/stand-inventory/stand-inventory-thinning-d2-e0006"}
|
| 8 |
+
{"id": "stand-inventory-volume-d2-e0007", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 2, "seed": 10007, "title": "Stand volume from 3 plots", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on 3 sample plots of equal size in stand Storskogen 31. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nHeights were measured on sample trees only. Use the measured `height_m` where there is one; where it is blank, take the height from the height-diameter curve in the reference file, without rounding it.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n- `trees_with_curve_height`: the number of trees whose height you took from the curve, as an integer.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/stand-inventory/stand-inventory-volume-d2-e0007"}
|
| 9 |
+
{"id": "stand-inventory-growth-d3-e0008", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 3, "seed": 10008, "title": "Increment for 8 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds three inventories of each stand, in no particular order, and `removals.csv` lists the volumes cut. The removals file also covers stands that are not in this inventory; ignore those. Use only the two most recent inventories of each stand as V1 and V2; the oldest one matters only in that removals before it still count in the mean annual increment. `targets.csv` gives a target standing volume for each stand. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n - `growth_percent`: Pressler's growth percent, in percent per year, 2 decimals.\n - `years_to_target`: whole years after the later inventory until the target volume is reached under the compound model in the notes, as an integer.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/stand-inventory/stand-inventory-growth-d3-e0008"}
|
| 10 |
+
{"id": "stand-inventory-plots-d3-e0009", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 3, "seed": 10009, "title": "Sample plot summary for 7 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 7 circular sample plots in stand Langtjarn 5. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nCount a tree only if it is alive (`status` is `live`) and stands inside the plot: a tree is inside when its `dist_m` (horizontal distance from the plot centre) is not more than the plot radius. Dead trees and trees outside the plot are left out of everything. `plots.csv` gives each plot's radius and the unit its crew recorded `dbh` in (`cm` or `mm`); convert to cm first.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n- `understocked`: list of the plot ids whose basal area per hectare is below the understocked threshold in the notes (any order).\n- `species_basal_area`: an object keyed by species, for every species with at least one counted tree. Each value is that species' stand mean basal area in m2 per hectare, 2 decimals: the mean over all 7 plots of the species' basal area per hectare on each plot, counting 0 for plots where it does not occur.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 36, "path": "tasks/stand-inventory/stand-inventory-plots-d3-e0009"}
|
| 11 |
+
{"id": "stand-inventory-thinning-d3-e0010", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 3, "seed": 10010, "title": "Thinning from below on a 600 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Bjorkbacken 8. `thinning_prescription.md` gives the plot area, the target and the rules. The plot also holds dead trees and marked retention trees; the prescription says how to treat them.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n- `removed_by_species`: an object keyed by species giving the number of trees removed, as integers. Include every species that has a live tree on the plot, with 0 if none is removed.\n- `residual_qmd_cm`: quadratic mean dbh of the live trees left standing, in cm, 1 decimal.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 10, "path": "tasks/stand-inventory/stand-inventory-thinning-d3-e0010"}
|
| 12 |
+
{"id": "stand-inventory-volume-d3-e0011", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 3, "seed": 10011, "title": "Stand volume from 4 plots", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on 4 sample plots of equal size in stand Tallheden 4. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nHeights were measured on sample trees only. Use the measured `height_m` where there is one; where it is blank, take the height from the height-diameter curve in the reference file, without rounding it. Leave out dead trees (`status` is `dead`) altogether. Aspen uses the form-factor rule in the reference file instead of the volume equation.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n- `trees_with_curve_height`: the number of live trees whose height you took from the curve, as an integer.\n- `lorey_height_m`: Lorey's mean height of the stand in m, 1 decimal: the mean height of all live trees on all plots, each tree weighted by its basal area pi x (d / 200)^2, using the same heights as for the volumes.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/stand-inventory/stand-inventory-volume-d3-e0011"}
|
| 13 |
+
{"id": "stand-inventory-growth-d1-e0012", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 1, "seed": 10012, "title": "Increment for 4 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds two inventories of each stand, in no particular order. Nothing was cut in these stands. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/stand-inventory/stand-inventory-growth-d1-e0012"}
|
| 14 |
+
{"id": "stand-inventory-plots-d1-e0013", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 1, "seed": 10013, "title": "Sample plot summary for 3 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 3 circular sample plots in stand Storskogen 31. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nEvery tallied tree is alive and stands inside its plot, so every row counts.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 15, "path": "tasks/stand-inventory/stand-inventory-plots-d1-e0013"}
|
| 15 |
+
{"id": "stand-inventory-thinning-d1-e0014", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 1, "seed": 10014, "title": "Thinning from below on a 400 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Ravasen 22. `thinning_prescription.md` gives the plot area, the target and the rules. Every tree on the plot is alive.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/stand-inventory/stand-inventory-thinning-d1-e0014"}
|
| 16 |
+
{"id": "stand-inventory-volume-d1-e0015", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 1, "seed": 10015, "title": "Stand volume from 1 plot", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on one sample plot in stand Langtjarn 5. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nEvery tree's height was measured.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/stand-inventory/stand-inventory-volume-d1-e0015"}
|
| 17 |
+
{"id": "stand-inventory-growth-d2-e0016", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 2, "seed": 10016, "title": "Increment for 6 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds two inventories of each stand, in no particular order, and `removals.csv` lists the volumes cut. The removals file also covers stands that are not in this inventory; ignore those. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 13, "path": "tasks/stand-inventory/stand-inventory-growth-d2-e0016"}
|
| 18 |
+
{"id": "stand-inventory-plots-d2-e0017", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 2, "seed": 10017, "title": "Sample plot summary for 5 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 5 circular sample plots in stand Storskogen 31. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nCount a tree only if it is alive (`status` is `live`) and stands inside the plot: a tree is inside when its `dist_m` (horizontal distance from the plot centre) is not more than the plot radius. Dead trees and trees outside the plot are left out of everything.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n- `understocked`: list of the plot ids whose basal area per hectare is below the understocked threshold in the notes (any order).\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 24, "path": "tasks/stand-inventory/stand-inventory-plots-d2-e0017"}
|
| 19 |
+
{"id": "stand-inventory-thinning-d2-e0018", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 2, "seed": 10018, "title": "Thinning from below on a 400 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Kvarnmon 16. `thinning_prescription.md` gives the plot area, the target and the rules. The plot also holds dead trees and marked retention trees; the prescription says how to treat them.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 7, "path": "tasks/stand-inventory/stand-inventory-thinning-d2-e0018"}
|
| 20 |
+
{"id": "stand-inventory-volume-d2-e0019", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 2, "seed": 10019, "title": "Stand volume from 3 plots", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on 3 sample plots of equal size in stand Kvarnmon 16. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nHeights were measured on sample trees only. Use the measured `height_m` where there is one; where it is blank, take the height from the height-diameter curve in the reference file, without rounding it.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n- `trees_with_curve_height`: the number of trees whose height you took from the curve, as an integer.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 9, "path": "tasks/stand-inventory/stand-inventory-volume-d2-e0019"}
|
| 21 |
+
{"id": "stand-inventory-growth-d3-e0020", "env": "stand-inventory", "isced_f": "0821", "family": "growth", "difficulty": 3, "seed": 10020, "title": "Increment for 8 stands", "instruction": "# Stand inventory: growth and yield\n\n`inventories.csv` holds three inventories of each stand, in no particular order, and `removals.csv` lists the volumes cut. The removals file also covers stands that are not in this inventory; ignore those. Use only the two most recent inventories of each stand as V1 and V2; the oldest one matters only in that removals before it still count in the mean annual increment. `targets.csv` gives a target standing volume for each stand. `growth_notes.md` gives the formulas.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `stands`: an object keyed by stand id, each with\n - `periodic_annual_increment`: in m3 per hectare per year, 2 decimals.\n - `mean_annual_increment`: in m3 per hectare per year at the later inventory, 2 decimals.\n - `growth_percent`: Pressler's growth percent, in percent per year, 2 decimals.\n - `years_to_target`: whole years after the later inventory until the target volume is reached under the compound model in the notes, as an integer.\n- `past_culmination`: list of the stand ids whose periodic annual increment is below their mean annual increment (any order; an empty list if none).\n\nDo not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 33, "path": "tasks/stand-inventory/stand-inventory-growth-d3-e0020"}
|
| 22 |
+
{"id": "stand-inventory-plots-d3-e0021", "env": "stand-inventory", "isced_f": "0821", "family": "plots", "difficulty": 3, "seed": 10021, "title": "Sample plot summary for 7 plots", "instruction": "# Stand inventory: sample plots\n\n`tally.csv` is the tree tally from 7 circular sample plots in stand Storskogen 31. `inventory_notes.md` gives the plot radius and the formulas to use.\n\nCount a tree only if it is alive (`status` is `live`) and stands inside the plot: a tree is inside when its `dist_m` (horizontal distance from the plot centre) is not more than the plot radius. Dead trees and trees outside the plot are left out of everything. `plots.csv` gives each plot's radius and the unit its crew recorded `dbh` in (`cm` or `mm`); convert to cm first.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `plots`: an object keyed by plot id, each with\n - `trees_counted`: the number of trees that count, as an integer.\n - `stems_per_ha`: stems per hectare, 1 decimal.\n - `basal_area_m2_per_ha`: basal area in m2 per hectare, 2 decimals.\n - `qmd_cm`: quadratic mean diameter in cm, 1 decimal.\n- `stand`: an object with `stems_per_ha` (1 decimal) and `basal_area_m2_per_ha` (2 decimals), each the arithmetic mean of the plot values with every plot weighted equally, and `qmd_cm` (1 decimal), worked out from those two stand means with the quadratic mean diameter formula.\n- `understocked`: list of the plot ids whose basal area per hectare is below the understocked threshold in the notes (any order).\n- `species_basal_area`: an object keyed by species, for every species with at least one counted tree. Each value is that species' stand mean basal area in m2 per hectare, 2 decimals: the mean over all 7 plots of the species' basal area per hectare on each plot, counting 0 for plots where it does not occur.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 36, "path": "tasks/stand-inventory/stand-inventory-plots-d3-e0021"}
|
| 23 |
+
{"id": "stand-inventory-thinning-d3-e0022", "env": "stand-inventory", "isced_f": "0821", "family": "thinning", "difficulty": 3, "seed": 10022, "title": "Thinning from below on a 400 m2 plot", "instruction": "# Stand inventory: marking a thinning\n\n`plot_trees.csv` lists the trees on one marking plot in stand Langtjarn 5. `thinning_prescription.md` gives the plot area, the target and the rules. The plot also holds dead trees and marked retention trees; the prescription says how to treat them.\n\nApply the rules exactly and write `answer.json` in this folder, a JSON object with:\n\n- `removed_trees`: list of the tree numbers to remove, as integers (any order).\n- `stems_removed`: how many trees are removed, as an integer.\n- `basal_area_before_m2_per_ha`: basal area of the live trees before thinning, in m2 per hectare, 2 decimals.\n- `residual_basal_area_m2_per_ha`: basal area of the live trees left standing, in m2 per hectare, 2 decimals.\n- `residual_stems_per_ha`: live stems left standing per hectare, 1 decimal.\n- `basal_area_removed_percent`: basal area removed as a percentage of the basal area before thinning, 1 decimal.\n- `thinning_ratio`: quadratic mean dbh of the removed trees divided by the quadratic mean dbh of all live trees before thinning, 2 decimals.\n- `removed_by_species`: an object keyed by species giving the number of trees removed, as integers. Include every species that has a live tree on the plot, with 0 if none is removed.\n- `residual_qmd_cm`: quadratic mean dbh of the live trees left standing, in cm, 1 decimal.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 11, "path": "tasks/stand-inventory/stand-inventory-thinning-d3-e0022"}
|
| 24 |
+
{"id": "stand-inventory-volume-d3-e0023", "env": "stand-inventory", "isced_f": "0821", "family": "volume", "difficulty": 3, "seed": 10023, "title": "Stand volume from 4 plots", "instruction": "# Stand inventory: volume\n\n`trees.csv` lists the trees callipered on 4 sample plots of equal size in stand Granliden 27. `volume_reference.md` gives the plot area, the volume equation and its coefficients.\n\nHeights were measured on sample trees only. Use the measured `height_m` where there is one; where it is blank, take the height from the height-diameter curve in the reference file, without rounding it. Leave out dead trees (`status` is `dead`) altogether. Aspen uses the form-factor rule in the reference file instead of the volume equation.\n\nWork out each tree's volume, then scale to the hectare: volume per hectare = sum of tree volumes on all plots x 10000 / (number of plots x plot area in m2).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `species`: an object keyed by species, each with\n - `volume_m3_per_ha`: that species' volume in m3 per hectare, 1 decimal.\n - `share_percent`: its share of the total volume in percent, 1 decimal.\n- `total_volume_m3_per_ha`: the volume of all species together in m3 per hectare, 1 decimal.\n- `dominant_species`: the species with the largest volume.\n- `trees_with_curve_height`: the number of live trees whose height you took from the curve, as an integer.\n- `lorey_height_m`: Lorey's mean height of the stand in m, 1 decimal: the mean height of all live trees on all plots, each tree weighted by its basal area pi x (d / 200)^2, using the same heights as for the volumes.\n\nUse pi at full precision and do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.", "checks": 12, "path": "tasks/stand-inventory/stand-inventory-volume-d3-e0023"}
|
data/stand-inventory/train.jsonl
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
data/ward-round/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "ward-round-dosing-d1-e0000", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 10000, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-e0000"}
|
| 2 |
+
{"id": "ward-round-fluid-balance-d1-e0001", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 10001, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-e0001"}
|
| 3 |
+
{"id": "ward-round-news2-d1-e0002", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 10002, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-e0002"}
|
| 4 |
+
{"id": "ward-round-dosing-d2-e0003", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 10003, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-e0003"}
|
| 5 |
+
{"id": "ward-round-fluid-balance-d2-e0004", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 10004, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-e0004"}
|
| 6 |
+
{"id": "ward-round-news2-d2-e0005", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 10005, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-e0005"}
|
| 7 |
+
{"id": "ward-round-dosing-d3-e0006", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 10006, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-e0006"}
|
| 8 |
+
{"id": "ward-round-fluid-balance-d3-e0007", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 10007, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-e0007"}
|
| 9 |
+
{"id": "ward-round-news2-d3-e0008", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 10008, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-e0008"}
|
| 10 |
+
{"id": "ward-round-dosing-d1-e0009", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 10009, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-e0009"}
|
| 11 |
+
{"id": "ward-round-fluid-balance-d1-e0010", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 10010, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-e0010"}
|
| 12 |
+
{"id": "ward-round-news2-d1-e0011", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 10011, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-e0011"}
|
| 13 |
+
{"id": "ward-round-dosing-d2-e0012", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 10012, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-e0012"}
|
| 14 |
+
{"id": "ward-round-fluid-balance-d2-e0013", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 10013, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-e0013"}
|
| 15 |
+
{"id": "ward-round-news2-d2-e0014", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 10014, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-e0014"}
|
| 16 |
+
{"id": "ward-round-dosing-d3-e0015", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 10015, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-e0015"}
|
| 17 |
+
{"id": "ward-round-fluid-balance-d3-e0016", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 10016, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-e0016"}
|
| 18 |
+
{"id": "ward-round-news2-d3-e0017", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 10017, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-e0017"}
|
| 19 |
+
{"id": "ward-round-dosing-d1-e0018", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 10018, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-e0018"}
|
| 20 |
+
{"id": "ward-round-fluid-balance-d1-e0019", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 10019, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-e0019"}
|
| 21 |
+
{"id": "ward-round-news2-d1-e0020", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 10020, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-e0020"}
|
| 22 |
+
{"id": "ward-round-dosing-d2-e0021", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 10021, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-e0021"}
|
| 23 |
+
{"id": "ward-round-fluid-balance-d2-e0022", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 10022, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-e0022"}
|
| 24 |
+
{"id": "ward-round-news2-d2-e0023", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 10023, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-e0023"}
|
data/ward-round/train.jsonl
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "ward-round-dosing-d1-t0000", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 0, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0000"}
|
| 2 |
+
{"id": "ward-round-fluid-balance-d1-t0001", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 1, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0001"}
|
| 3 |
+
{"id": "ward-round-news2-d1-t0002", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 2, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0002"}
|
| 4 |
+
{"id": "ward-round-dosing-d2-t0003", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 3, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0003"}
|
| 5 |
+
{"id": "ward-round-fluid-balance-d2-t0004", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 4, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0004"}
|
| 6 |
+
{"id": "ward-round-news2-d2-t0005", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 5, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0005"}
|
| 7 |
+
{"id": "ward-round-dosing-d3-t0006", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 6, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0006"}
|
| 8 |
+
{"id": "ward-round-fluid-balance-d3-t0007", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 7, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0007"}
|
| 9 |
+
{"id": "ward-round-news2-d3-t0008", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 8, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0008"}
|
| 10 |
+
{"id": "ward-round-dosing-d1-t0009", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 9, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0009"}
|
| 11 |
+
{"id": "ward-round-fluid-balance-d1-t0010", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 10, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0010"}
|
| 12 |
+
{"id": "ward-round-news2-d1-t0011", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 11, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0011"}
|
| 13 |
+
{"id": "ward-round-dosing-d2-t0012", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 12, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0012"}
|
| 14 |
+
{"id": "ward-round-fluid-balance-d2-t0013", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 13, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0013"}
|
| 15 |
+
{"id": "ward-round-news2-d2-t0014", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 14, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0014"}
|
| 16 |
+
{"id": "ward-round-dosing-d3-t0015", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 15, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0015"}
|
| 17 |
+
{"id": "ward-round-fluid-balance-d3-t0016", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 16, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0016"}
|
| 18 |
+
{"id": "ward-round-news2-d3-t0017", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 17, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0017"}
|
| 19 |
+
{"id": "ward-round-dosing-d1-t0018", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 18, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0018"}
|
| 20 |
+
{"id": "ward-round-fluid-balance-d1-t0019", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 19, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0019"}
|
| 21 |
+
{"id": "ward-round-news2-d1-t0020", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 20, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0020"}
|
| 22 |
+
{"id": "ward-round-dosing-d2-t0021", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 21, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0021"}
|
| 23 |
+
{"id": "ward-round-fluid-balance-d2-t0022", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 22, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0022"}
|
| 24 |
+
{"id": "ward-round-news2-d2-t0023", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 23, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0023"}
|
| 25 |
+
{"id": "ward-round-dosing-d3-t0024", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 24, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0024"}
|
| 26 |
+
{"id": "ward-round-fluid-balance-d3-t0025", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 25, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0025"}
|
| 27 |
+
{"id": "ward-round-news2-d3-t0026", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 26, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0026"}
|
| 28 |
+
{"id": "ward-round-dosing-d1-t0027", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 27, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0027"}
|
| 29 |
+
{"id": "ward-round-fluid-balance-d1-t0028", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 28, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0028"}
|
| 30 |
+
{"id": "ward-round-news2-d1-t0029", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 29, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0029"}
|
| 31 |
+
{"id": "ward-round-dosing-d2-t0030", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 30, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0030"}
|
| 32 |
+
{"id": "ward-round-fluid-balance-d2-t0031", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 31, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0031"}
|
| 33 |
+
{"id": "ward-round-news2-d2-t0032", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 32, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0032"}
|
| 34 |
+
{"id": "ward-round-dosing-d3-t0033", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 33, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0033"}
|
| 35 |
+
{"id": "ward-round-fluid-balance-d3-t0034", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 34, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0034"}
|
| 36 |
+
{"id": "ward-round-news2-d3-t0035", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 35, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0035"}
|
| 37 |
+
{"id": "ward-round-dosing-d1-t0036", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 36, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0036"}
|
| 38 |
+
{"id": "ward-round-fluid-balance-d1-t0037", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 37, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0037"}
|
| 39 |
+
{"id": "ward-round-news2-d1-t0038", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 38, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0038"}
|
| 40 |
+
{"id": "ward-round-dosing-d2-t0039", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 39, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0039"}
|
| 41 |
+
{"id": "ward-round-fluid-balance-d2-t0040", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 40, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0040"}
|
| 42 |
+
{"id": "ward-round-news2-d2-t0041", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 41, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0041"}
|
| 43 |
+
{"id": "ward-round-dosing-d3-t0042", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 42, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0042"}
|
| 44 |
+
{"id": "ward-round-fluid-balance-d3-t0043", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 43, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0043"}
|
| 45 |
+
{"id": "ward-round-news2-d3-t0044", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 44, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0044"}
|
| 46 |
+
{"id": "ward-round-dosing-d1-t0045", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 45, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0045"}
|
| 47 |
+
{"id": "ward-round-fluid-balance-d1-t0046", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 46, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0046"}
|
| 48 |
+
{"id": "ward-round-news2-d1-t0047", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 47, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0047"}
|
| 49 |
+
{"id": "ward-round-dosing-d2-t0048", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 48, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0048"}
|
| 50 |
+
{"id": "ward-round-fluid-balance-d2-t0049", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 49, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0049"}
|
| 51 |
+
{"id": "ward-round-news2-d2-t0050", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 50, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0050"}
|
| 52 |
+
{"id": "ward-round-dosing-d3-t0051", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 51, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0051"}
|
| 53 |
+
{"id": "ward-round-fluid-balance-d3-t0052", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 52, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0052"}
|
| 54 |
+
{"id": "ward-round-news2-d3-t0053", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 53, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0053"}
|
| 55 |
+
{"id": "ward-round-dosing-d1-t0054", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 54, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0054"}
|
| 56 |
+
{"id": "ward-round-fluid-balance-d1-t0055", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 55, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0055"}
|
| 57 |
+
{"id": "ward-round-news2-d1-t0056", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 56, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0056"}
|
| 58 |
+
{"id": "ward-round-dosing-d2-t0057", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 57, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0057"}
|
| 59 |
+
{"id": "ward-round-fluid-balance-d2-t0058", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 58, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0058"}
|
| 60 |
+
{"id": "ward-round-news2-d2-t0059", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 59, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0059"}
|
| 61 |
+
{"id": "ward-round-dosing-d3-t0060", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 60, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0060"}
|
| 62 |
+
{"id": "ward-round-fluid-balance-d3-t0061", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 61, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0061"}
|
| 63 |
+
{"id": "ward-round-news2-d3-t0062", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 62, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0062"}
|
| 64 |
+
{"id": "ward-round-dosing-d1-t0063", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 63, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0063"}
|
| 65 |
+
{"id": "ward-round-fluid-balance-d1-t0064", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 64, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0064"}
|
| 66 |
+
{"id": "ward-round-news2-d1-t0065", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 65, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0065"}
|
| 67 |
+
{"id": "ward-round-dosing-d2-t0066", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 66, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0066"}
|
| 68 |
+
{"id": "ward-round-fluid-balance-d2-t0067", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 67, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0067"}
|
| 69 |
+
{"id": "ward-round-news2-d2-t0068", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 68, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0068"}
|
| 70 |
+
{"id": "ward-round-dosing-d3-t0069", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 69, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0069"}
|
| 71 |
+
{"id": "ward-round-fluid-balance-d3-t0070", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 70, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0070"}
|
| 72 |
+
{"id": "ward-round-news2-d3-t0071", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 71, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0071"}
|
| 73 |
+
{"id": "ward-round-dosing-d1-t0072", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 72, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0072"}
|
| 74 |
+
{"id": "ward-round-fluid-balance-d1-t0073", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 73, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0073"}
|
| 75 |
+
{"id": "ward-round-news2-d1-t0074", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 74, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0074"}
|
| 76 |
+
{"id": "ward-round-dosing-d2-t0075", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 2, "seed": 75, "title": "Doses and infusion rates for 7 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 21, "path": "tasks/ward-round/ward-round-dosing-d2-t0075"}
|
| 77 |
+
{"id": "ward-round-fluid-balance-d2-t0076", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 2, "seed": 76, "title": "Fluid balance for 5 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 21, "path": "tasks/ward-round/ward-round-fluid-balance-d2-t0076"}
|
| 78 |
+
{"id": "ward-round-news2-d2-t0077", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 2, "seed": 77, "title": "Early-warning scores for 9 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (2 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 20, "path": "tasks/ward-round/ward-round-news2-d2-t0077"}
|
| 79 |
+
{"id": "ward-round-dosing-d3-t0078", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 3, "seed": 78, "title": "Doses and infusion rates for 10 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Each dose is then given in an infusion bag. The bag volume is the total volume to infuse; do not add the drug volume to it.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n- `pump_rate_ml_per_h`: the pump rate that delivers the whole bag (`bag_volume_ml`) in `infuse_over_min` minutes, in ml per hour, 1 decimal.\n- `drops_per_min`: for a gravity set with the given `drop_factor_gtt_per_ml`, the drip rate that delivers the bag in the same time, as a whole number of drops per minute (round half up).\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 40, "path": "tasks/ward-round/ward-round-dosing-d3-t0078"}
|
| 80 |
+
{"id": "ward-round-fluid-balance-d3-t0079", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 3, "seed": 79, "title": "Fluid balance for 8 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59). The chart also carries some entries from yesterday; leave those out.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n - `urine_ml_per_kg_per_h`: urine output today divided by weight and by 24 hours, 2 decimals.\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 33, "path": "tasks/ward-round/ward-round-fluid-balance-d3-t0079"}
|
| 81 |
+
{"id": "ward-round-news2-d3-t0080", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 3, "seed": 80, "title": "Early-warning scores for 14 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today (3 sets per patient, in no particular order). `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).\n- `rising`: list of patient ids whose total at their latest observation set is at least 2 points higher than at the set before it.", "checks": 30, "path": "tasks/ward-round/ward-round-news2-d3-t0080"}
|
| 82 |
+
{"id": "ward-round-dosing-d1-t0081", "env": "ward-round", "isced_f": "0913", "family": "dosing", "difficulty": 1, "seed": 81, "title": "Doses and infusion rates for 4 orders", "instruction": "# Ward round: doses and infusions\n\n`orders.csv` lists today's weight-based medication orders. Give the drug as a single dose drawn up from the stock solution.\n\nWrite `answer.json` in this folder: a JSON object with one key, `orders`, an object keyed by order id. For each order give:\n\n- `dose_mg`: the single dose in mg, 2 decimals. It is `dose_mg_per_kg` times `weight_kg`, but never more than `max_single_dose_mg`.\n- `volume_ml`: the volume of stock solution that holds that dose, in ml, 2 decimals.\n\nNumbers are accepted within one unit of the last decimal place asked for.", "checks": 8, "path": "tasks/ward-round/ward-round-dosing-d1-t0081"}
|
| 83 |
+
{"id": "ward-round-fluid-balance-d1-t0082", "env": "ward-round", "isced_f": "0913", "family": "fluid-balance", "difficulty": 1, "seed": 82, "title": "Fluid balance for 3 patients", "instruction": "# Ward round: 24-hour fluid balance\n\n`fluid_chart.csv` is the ward's intake and output chart and `patients.csv` gives each patient's weight. Work out the fluid balance for **today** (00:00 to 23:59).\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id, each with\n - `intake_ml`: total of all `in` entries, as an integer.\n - `output_ml`: total of all `out` entries (urine, drains, vomit and stool), as an integer.\n - `balance_ml`: intake minus output (negative if output is larger).\n- `oliguria`: list of the patient ids whose urine output today is below 0.5 ml per kg per hour, averaged over the 24 hours (any order; an empty list if none).", "checks": 10, "path": "tasks/ward-round/ward-round-fluid-balance-d1-t0082"}
|
| 84 |
+
{"id": "ward-round-news2-d1-t0083", "env": "ward-round", "isced_f": "0913", "family": "news2", "difficulty": 1, "seed": 83, "title": "Early-warning scores for 5 patients", "instruction": "# Ward round: early-warning scores\n\n`observations.csv` holds the observation sets charted on the ward today. `news2_rules.md` gives the scoring rules.\n\nFor every patient, score their **latest** observation set and work out the response band.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n- `patients`: an object keyed by patient id. Each value is `{\"score\": <integer total>, \"band\": \"<low | low-medium | medium | high>\"}`.\n- `medium_or_high`: list of the patient ids whose band is `medium` or `high` (any order).", "checks": 11, "path": "tasks/ward-round/ward-round-news2-d1-t0083"}
|
data/zoning-check/eval.jsonl
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "zoning-check-capacity-d1-e0000", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 10000, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-e0000"}
|
| 2 |
+
{"id": "zoning-check-compliance-d1-e0001", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 10001, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-e0001"}
|
| 3 |
+
{"id": "zoning-check-geometry-d1-e0002", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 10002, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-e0002"}
|
| 4 |
+
{"id": "zoning-check-mixed-use-d1-e0003", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 10003, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-e0003"}
|
| 5 |
+
{"id": "zoning-check-capacity-d2-e0004", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 10004, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-e0004"}
|
| 6 |
+
{"id": "zoning-check-compliance-d2-e0005", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 10005, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-e0005"}
|
| 7 |
+
{"id": "zoning-check-geometry-d2-e0006", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 10006, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-e0006"}
|
| 8 |
+
{"id": "zoning-check-mixed-use-d2-e0007", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 10007, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-e0007"}
|
| 9 |
+
{"id": "zoning-check-capacity-d3-e0008", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 10008, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-e0008"}
|
| 10 |
+
{"id": "zoning-check-compliance-d3-e0009", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 10009, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-e0009"}
|
| 11 |
+
{"id": "zoning-check-geometry-d3-e0010", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 10010, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-e0010"}
|
| 12 |
+
{"id": "zoning-check-mixed-use-d3-e0011", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 10011, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-e0011"}
|
| 13 |
+
{"id": "zoning-check-capacity-d1-e0012", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 10012, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-e0012"}
|
| 14 |
+
{"id": "zoning-check-compliance-d1-e0013", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 10013, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-e0013"}
|
| 15 |
+
{"id": "zoning-check-geometry-d1-e0014", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 10014, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-e0014"}
|
| 16 |
+
{"id": "zoning-check-mixed-use-d1-e0015", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 10015, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-e0015"}
|
| 17 |
+
{"id": "zoning-check-capacity-d2-e0016", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 10016, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-e0016"}
|
| 18 |
+
{"id": "zoning-check-compliance-d2-e0017", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 10017, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-e0017"}
|
| 19 |
+
{"id": "zoning-check-geometry-d2-e0018", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 10018, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-e0018"}
|
| 20 |
+
{"id": "zoning-check-mixed-use-d2-e0019", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 10019, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-e0019"}
|
| 21 |
+
{"id": "zoning-check-capacity-d3-e0020", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 10020, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-e0020"}
|
| 22 |
+
{"id": "zoning-check-compliance-d3-e0021", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 10021, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-e0021"}
|
| 23 |
+
{"id": "zoning-check-geometry-d3-e0022", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 10022, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-e0022"}
|
| 24 |
+
{"id": "zoning-check-mixed-use-d3-e0023", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 10023, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-e0023"}
|
data/zoning-check/train.jsonl
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{"id": "zoning-check-capacity-d1-t0000", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 0, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0000"}
|
| 2 |
+
{"id": "zoning-check-compliance-d1-t0001", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 1, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0001"}
|
| 3 |
+
{"id": "zoning-check-geometry-d1-t0002", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 2, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0002"}
|
| 4 |
+
{"id": "zoning-check-mixed-use-d1-t0003", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 3, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0003"}
|
| 5 |
+
{"id": "zoning-check-capacity-d2-t0004", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 4, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0004"}
|
| 6 |
+
{"id": "zoning-check-compliance-d2-t0005", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 5, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0005"}
|
| 7 |
+
{"id": "zoning-check-geometry-d2-t0006", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 6, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0006"}
|
| 8 |
+
{"id": "zoning-check-mixed-use-d2-t0007", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 7, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0007"}
|
| 9 |
+
{"id": "zoning-check-capacity-d3-t0008", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 8, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0008"}
|
| 10 |
+
{"id": "zoning-check-compliance-d3-t0009", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 9, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0009"}
|
| 11 |
+
{"id": "zoning-check-geometry-d3-t0010", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 10, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0010"}
|
| 12 |
+
{"id": "zoning-check-mixed-use-d3-t0011", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 11, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0011"}
|
| 13 |
+
{"id": "zoning-check-capacity-d1-t0012", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 12, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0012"}
|
| 14 |
+
{"id": "zoning-check-compliance-d1-t0013", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 13, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0013"}
|
| 15 |
+
{"id": "zoning-check-geometry-d1-t0014", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 14, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0014"}
|
| 16 |
+
{"id": "zoning-check-mixed-use-d1-t0015", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 15, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0015"}
|
| 17 |
+
{"id": "zoning-check-capacity-d2-t0016", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 16, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0016"}
|
| 18 |
+
{"id": "zoning-check-compliance-d2-t0017", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 17, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0017"}
|
| 19 |
+
{"id": "zoning-check-geometry-d2-t0018", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 18, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0018"}
|
| 20 |
+
{"id": "zoning-check-mixed-use-d2-t0019", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 19, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0019"}
|
| 21 |
+
{"id": "zoning-check-capacity-d3-t0020", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 20, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0020"}
|
| 22 |
+
{"id": "zoning-check-compliance-d3-t0021", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 21, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0021"}
|
| 23 |
+
{"id": "zoning-check-geometry-d3-t0022", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 22, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0022"}
|
| 24 |
+
{"id": "zoning-check-mixed-use-d3-t0023", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 23, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0023"}
|
| 25 |
+
{"id": "zoning-check-capacity-d1-t0024", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 24, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0024"}
|
| 26 |
+
{"id": "zoning-check-compliance-d1-t0025", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 25, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0025"}
|
| 27 |
+
{"id": "zoning-check-geometry-d1-t0026", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 26, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0026"}
|
| 28 |
+
{"id": "zoning-check-mixed-use-d1-t0027", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 27, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0027"}
|
| 29 |
+
{"id": "zoning-check-capacity-d2-t0028", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 28, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0028"}
|
| 30 |
+
{"id": "zoning-check-compliance-d2-t0029", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 29, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0029"}
|
| 31 |
+
{"id": "zoning-check-geometry-d2-t0030", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 30, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0030"}
|
| 32 |
+
{"id": "zoning-check-mixed-use-d2-t0031", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 31, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0031"}
|
| 33 |
+
{"id": "zoning-check-capacity-d3-t0032", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 32, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0032"}
|
| 34 |
+
{"id": "zoning-check-compliance-d3-t0033", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 33, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0033"}
|
| 35 |
+
{"id": "zoning-check-geometry-d3-t0034", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 34, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0034"}
|
| 36 |
+
{"id": "zoning-check-mixed-use-d3-t0035", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 35, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0035"}
|
| 37 |
+
{"id": "zoning-check-capacity-d1-t0036", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 36, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0036"}
|
| 38 |
+
{"id": "zoning-check-compliance-d1-t0037", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 37, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0037"}
|
| 39 |
+
{"id": "zoning-check-geometry-d1-t0038", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 38, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0038"}
|
| 40 |
+
{"id": "zoning-check-mixed-use-d1-t0039", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 39, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0039"}
|
| 41 |
+
{"id": "zoning-check-capacity-d2-t0040", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 40, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0040"}
|
| 42 |
+
{"id": "zoning-check-compliance-d2-t0041", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 41, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0041"}
|
| 43 |
+
{"id": "zoning-check-geometry-d2-t0042", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 42, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0042"}
|
| 44 |
+
{"id": "zoning-check-mixed-use-d2-t0043", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 43, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0043"}
|
| 45 |
+
{"id": "zoning-check-capacity-d3-t0044", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 44, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0044"}
|
| 46 |
+
{"id": "zoning-check-compliance-d3-t0045", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 45, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0045"}
|
| 47 |
+
{"id": "zoning-check-geometry-d3-t0046", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 46, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0046"}
|
| 48 |
+
{"id": "zoning-check-mixed-use-d3-t0047", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 47, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0047"}
|
| 49 |
+
{"id": "zoning-check-capacity-d1-t0048", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 48, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0048"}
|
| 50 |
+
{"id": "zoning-check-compliance-d1-t0049", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 49, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0049"}
|
| 51 |
+
{"id": "zoning-check-geometry-d1-t0050", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 50, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0050"}
|
| 52 |
+
{"id": "zoning-check-mixed-use-d1-t0051", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 51, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0051"}
|
| 53 |
+
{"id": "zoning-check-capacity-d2-t0052", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 52, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0052"}
|
| 54 |
+
{"id": "zoning-check-compliance-d2-t0053", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 53, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0053"}
|
| 55 |
+
{"id": "zoning-check-geometry-d2-t0054", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 54, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0054"}
|
| 56 |
+
{"id": "zoning-check-mixed-use-d2-t0055", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 55, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0055"}
|
| 57 |
+
{"id": "zoning-check-capacity-d3-t0056", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 56, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0056"}
|
| 58 |
+
{"id": "zoning-check-compliance-d3-t0057", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 57, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0057"}
|
| 59 |
+
{"id": "zoning-check-geometry-d3-t0058", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 58, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0058"}
|
| 60 |
+
{"id": "zoning-check-mixed-use-d3-t0059", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 59, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0059"}
|
| 61 |
+
{"id": "zoning-check-capacity-d1-t0060", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 60, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0060"}
|
| 62 |
+
{"id": "zoning-check-compliance-d1-t0061", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 61, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0061"}
|
| 63 |
+
{"id": "zoning-check-geometry-d1-t0062", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 62, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0062"}
|
| 64 |
+
{"id": "zoning-check-mixed-use-d1-t0063", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 63, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0063"}
|
| 65 |
+
{"id": "zoning-check-capacity-d2-t0064", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 64, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0064"}
|
| 66 |
+
{"id": "zoning-check-compliance-d2-t0065", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 65, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0065"}
|
| 67 |
+
{"id": "zoning-check-geometry-d2-t0066", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 66, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0066"}
|
| 68 |
+
{"id": "zoning-check-mixed-use-d2-t0067", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 67, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0067"}
|
| 69 |
+
{"id": "zoning-check-capacity-d3-t0068", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 68, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0068"}
|
| 70 |
+
{"id": "zoning-check-compliance-d3-t0069", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 69, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0069"}
|
| 71 |
+
{"id": "zoning-check-geometry-d3-t0070", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 70, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0070"}
|
| 72 |
+
{"id": "zoning-check-mixed-use-d3-t0071", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 71, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0071"}
|
| 73 |
+
{"id": "zoning-check-capacity-d1-t0072", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 1, "seed": 72, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 15, "path": "tasks/zoning-check/zoning-check-capacity-d1-t0072"}
|
| 74 |
+
{"id": "zoning-check-compliance-d1-t0073", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 1, "seed": 73, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 12, "path": "tasks/zoning-check/zoning-check-compliance-d1-t0073"}
|
| 75 |
+
{"id": "zoning-check-geometry-d1-t0074", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 1, "seed": 74, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 9, "path": "tasks/zoning-check/zoning-check-geometry-d1-t0074"}
|
| 76 |
+
{"id": "zoning-check-mixed-use-d1-t0075", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 1, "seed": 75, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 12, "path": "tasks/zoning-check/zoning-check-mixed-use-d1-t0075"}
|
| 77 |
+
{"id": "zoning-check-capacity-d2-t0076", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 2, "seed": 76, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 20, "path": "tasks/zoning-check/zoning-check-capacity-d2-t0076"}
|
| 78 |
+
{"id": "zoning-check-compliance-d2-t0077", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 2, "seed": 77, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 16, "path": "tasks/zoning-check/zoning-check-compliance-d2-t0077"}
|
| 79 |
+
{"id": "zoning-check-geometry-d2-t0078", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 2, "seed": 78, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 12, "path": "tasks/zoning-check/zoning-check-geometry-d2-t0078"}
|
| 80 |
+
{"id": "zoning-check-mixed-use-d2-t0079", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 2, "seed": 79, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 16, "path": "tasks/zoning-check/zoning-check-mixed-use-d2-t0079"}
|
| 81 |
+
{"id": "zoning-check-capacity-d3-t0080", "env": "zoning-check", "isced_f": "0731", "family": "capacity", "difficulty": 3, "seed": 80, "title": "Planning review: capacity", "instruction": "# Zoning Check: capacity\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. Find the largest gross floor area for each rectangular plot with the stated number of storeys. Ignore parking and height in this exercise. Floor area cannot exceed any of: site area times max_far; site area times max_coverage times storeys; or max(0,width-2*setback) times max(0,depth-2*setback) times storeys. The smallest is binding; no ties occur.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id. Each value has `max_floor_m2`, `binding` (`far`, `coverage` or `setbacks`), and the three limits `far_limit_m2`, `coverage_limit_m2`, `setbacks_limit_m2`, all areas in square metres.", "checks": 25, "path": "tasks/zoning-check/zoning-check-capacity-d3-t0080"}
|
| 82 |
+
{"id": "zoning-check-compliance-d3-t0081", "env": "zoning-check", "isced_f": "0731", "family": "compliance", "difficulty": 3, "seed": 81, "title": "Planning review: compliance", "instruction": "# Zoning Check: compliance\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `proposals.csv` lists rectangular plots and proposed buildings. Gross floor area includes every storey. Limits are inclusive: equality passes. Flag a setback violation if any of the four setbacks is too small.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `site_m2` (width times depth), `far` (gross floor area divided by site area), `coverage_percent` (100 times footprint divided by site area), and `violations` (distinct strings from `far`, `coverage`, `setback`, `height`, or an empty list).", "checks": 20, "path": "tasks/zoning-check/zoning-check-compliance-d3-t0081"}
|
| 83 |
+
{"id": "zoning-check-geometry-d3-t0082", "env": "zoning-check", "isced_f": "0731", "family": "geometry", "difficulty": 3, "seed": 82, "title": "Planning review: geometry", "instruction": "# Zoning Check: geometry\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `boundaries.json` gives each simple plot polygon as ordered [x,y] pairs in metres. The last point joins back to the first; orientation can vary. Compute area with the shoelace formula: half the absolute value of sum(x_i*y_next-x_next*y_i). `buildings.csv` supplies proposed floor and footprint areas.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `plots` is keyed by plot id, with `site_m2`, `far` (floor/site area) and `coverage_percent` (100*footprint/site area).", "checks": 15, "path": "tasks/zoning-check/zoning-check-geometry-d3-t0082"}
|
| 84 |
+
{"id": "zoning-check-mixed-use-d3-t0083", "env": "zoning-check", "isced_f": "0731", "family": "mixed-use", "difficulty": 3, "seed": 83, "title": "Planning review: mixed-use", "instruction": "# Zoning Check: mixed-use\n\nAll records are synthetic. Apply only the fictional limits in `zoning_code.json`. `uses.csv` lists mixed-use proposals. Required spaces = ceil(dwellings*parking_per_dwelling + shop_m2/shop_m2_per_space + office_m2/office_m2_per_space). Round upward once, after summing uses. Each space requires parking_area_m2 of land. Notes are irrelevant.\n\nWrite `answer.json` as one JSON object. Round numbers to 2 decimal places without rounding intermediate calculations; numbers are accepted within 0.01. `proposals` is keyed by proposal id. Each value has `unrounded_spaces` (the sum before ceiling), `required_spaces` (integer), `shortfall` (max(0, required minus provided), integer), and `required_parking_m2`.", "checks": 20, "path": "tasks/zoning-check/zoning-check-mixed-use-d3-t0083"}
|
environments.json
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
[
|
| 2 |
+
{
|
| 3 |
+
"name": "argument-check",
|
| 4 |
+
"title": "Argument Check",
|
| 5 |
+
"isced": "0223",
|
| 6 |
+
"summary": "Mark a logic problem sheet: test arguments for validity, sentence sets for consistency and formula pairs for equivalence, with counterexamples and normal forms.",
|
| 7 |
+
"task_type": "formal logic checking",
|
| 8 |
+
"good_for": [
|
| 9 |
+
"Exhaustive truth-table reasoning",
|
| 10 |
+
"Parsing a formal syntax with stated precedence",
|
| 11 |
+
"Answers that must be verified, not guessed"
|
| 12 |
+
],
|
| 13 |
+
"families": [
|
| 14 |
+
"validity",
|
| 15 |
+
"consistency",
|
| 16 |
+
"equivalence"
|
| 17 |
+
],
|
| 18 |
+
"tasks": 108,
|
| 19 |
+
"folder": "argument_check"
|
| 20 |
+
},
|
| 21 |
+
{
|
| 22 |
+
"name": "class-test",
|
| 23 |
+
"title": "Class Test",
|
| 24 |
+
"isced": "0111",
|
| 25 |
+
"summary": "Analyse a class test as a teacher would: mark answer sheets, run item and distractor analysis, and standardise or moderate the marks.",
|
| 26 |
+
"task_type": "assessment analysis",
|
| 27 |
+
"good_for": [
|
| 28 |
+
"Classical test theory on small classes",
|
| 29 |
+
"Applying a marking scheme exactly",
|
| 30 |
+
"Counting and filtering tabular records"
|
| 31 |
+
],
|
| 32 |
+
"families": [
|
| 33 |
+
"marking",
|
| 34 |
+
"item-analysis",
|
| 35 |
+
"distractors",
|
| 36 |
+
"moderation"
|
| 37 |
+
],
|
| 38 |
+
"tasks": 108,
|
| 39 |
+
"folder": "class_test"
|
| 40 |
+
},
|
| 41 |
+
{
|
| 42 |
+
"name": "emissions-inventory",
|
| 43 |
+
"title": "Emissions Inventory",
|
| 44 |
+
"isced": "0521",
|
| 45 |
+
"summary": "Compile a greenhouse-gas inventory from activity records: unit conversion, emission factors, scopes, CO2e from several gases, trends and data cleaning.",
|
| 46 |
+
"task_type": "emissions accounting",
|
| 47 |
+
"good_for": [
|
| 48 |
+
"Unit conversion and table lookup before aggregation",
|
| 49 |
+
"Using supplied factors rather than remembered ones",
|
| 50 |
+
"Cleaning duplicated and missing records by a stated rule"
|
| 51 |
+
],
|
| 52 |
+
"families": [
|
| 53 |
+
"activity-data",
|
| 54 |
+
"multi-gas",
|
| 55 |
+
"time-series",
|
| 56 |
+
"data-quality"
|
| 57 |
+
],
|
| 58 |
+
"tasks": 108,
|
| 59 |
+
"folder": "emissions_inventory"
|
| 60 |
+
},
|
| 61 |
+
{
|
| 62 |
+
"name": "exposure-assessment",
|
| 63 |
+
"title": "Exposure Assessment",
|
| 64 |
+
"isced": "1022",
|
| 65 |
+
"summary": "Do an occupational hygienist's sums from workplace records: noise dose, airborne chemical averages, hand-arm vibration and injury rates against given limits.",
|
| 66 |
+
"task_type": "exposure calculation",
|
| 67 |
+
"good_for": [
|
| 68 |
+
"Logarithmic and root-sum-square arithmetic on logs",
|
| 69 |
+
"Filtering records by a written definition",
|
| 70 |
+
"Comparing results with supplied limit values"
|
| 71 |
+
],
|
| 72 |
+
"families": [
|
| 73 |
+
"noise",
|
| 74 |
+
"chemicals",
|
| 75 |
+
"vibration",
|
| 76 |
+
"incidents"
|
| 77 |
+
],
|
| 78 |
+
"tasks": 108,
|
| 79 |
+
"folder": "exposure_assessment"
|
| 80 |
+
},
|
| 81 |
+
{
|
| 82 |
+
"name": "harris-matrix",
|
| 83 |
+
"title": "Harris Matrix",
|
| 84 |
+
"isced": "0222",
|
| 85 |
+
"summary": "Work an excavation archive after the dig: order the contexts, reduce the Harris matrix, date deposits from finds and find impossible relations.",
|
| 86 |
+
"task_type": "stratigraphic analysis",
|
| 87 |
+
"good_for": [
|
| 88 |
+
"Reasoning over partial orders from tabular records",
|
| 89 |
+
"Applying a written recording convention exactly",
|
| 90 |
+
"Answers checked by a constraint validator"
|
| 91 |
+
],
|
| 92 |
+
"families": [
|
| 93 |
+
"sequence",
|
| 94 |
+
"reduction",
|
| 95 |
+
"dating",
|
| 96 |
+
"errors"
|
| 97 |
+
],
|
| 98 |
+
"tasks": 108,
|
| 99 |
+
"folder": "harris_matrix"
|
| 100 |
+
},
|
| 101 |
+
{
|
| 102 |
+
"name": "life-table",
|
| 103 |
+
"title": "Life Table",
|
| 104 |
+
"isced": "0314",
|
| 105 |
+
"summary": "Do a demographer's core calculations from population registers: life tables, fertility rates, age-standardised death rates and age-structure indicators.",
|
| 106 |
+
"task_type": "demographic calculation",
|
| 107 |
+
"good_for": [
|
| 108 |
+
"Chained column-by-column calculations",
|
| 109 |
+
"Applying a methods note exactly",
|
| 110 |
+
"Aggregating and filtering register tables"
|
| 111 |
+
],
|
| 112 |
+
"families": [
|
| 113 |
+
"life-table",
|
| 114 |
+
"fertility",
|
| 115 |
+
"standardisation",
|
| 116 |
+
"age-structure"
|
| 117 |
+
],
|
| 118 |
+
"tasks": 108,
|
| 119 |
+
"folder": "life_table"
|
| 120 |
+
},
|
| 121 |
+
{
|
| 122 |
+
"name": "means-test",
|
| 123 |
+
"title": "Means Test",
|
| 124 |
+
"isced": "0923",
|
| 125 |
+
"summary": "Apply a written (fictional) benefit regulation to household case files: entitlement, mid-month changes, overpayments and review of past decisions.",
|
| 126 |
+
"task_type": "benefit assessment",
|
| 127 |
+
"good_for": [
|
| 128 |
+
"Applying a rule document to case files",
|
| 129 |
+
"Multi-step money arithmetic with caps and disregards",
|
| 130 |
+
"Auditing earlier decisions"
|
| 131 |
+
],
|
| 132 |
+
"families": [
|
| 133 |
+
"entitlement",
|
| 134 |
+
"change",
|
| 135 |
+
"overpayment",
|
| 136 |
+
"review"
|
| 137 |
+
],
|
| 138 |
+
"tasks": 108,
|
| 139 |
+
"folder": "means_test"
|
| 140 |
+
},
|
| 141 |
+
{
|
| 142 |
+
"name": "price-index",
|
| 143 |
+
"title": "Price Index",
|
| 144 |
+
"isced": "0311",
|
| 145 |
+
"summary": "Compute an economic statistician's measures from raw tables: price indices, real GDP and chain-linked volumes, inequality and poverty, and inflation contributions.",
|
| 146 |
+
"task_type": "economic statistics calculation",
|
| 147 |
+
"good_for": [
|
| 148 |
+
"Index-number formulas applied exactly",
|
| 149 |
+
"Unit and currency conversion in tabular data",
|
| 150 |
+
"Multi-step aggregation with graded reward"
|
| 151 |
+
],
|
| 152 |
+
"families": [
|
| 153 |
+
"basket-indices",
|
| 154 |
+
"national-accounts",
|
| 155 |
+
"income-distribution",
|
| 156 |
+
"inflation-contributions"
|
| 157 |
+
],
|
| 158 |
+
"tasks": 108,
|
| 159 |
+
"folder": "price_index"
|
| 160 |
+
},
|
| 161 |
+
{
|
| 162 |
+
"name": "psychometrics",
|
| 163 |
+
"title": "Psychometrics",
|
| 164 |
+
"isced": "0313",
|
| 165 |
+
"summary": "Score questionnaires from a manual, judge reliable change, convert raw scores with norm tables and compute scale reliability, as a psychologist's assistant.",
|
| 166 |
+
"task_type": "psychometric scoring",
|
| 167 |
+
"good_for": [
|
| 168 |
+
"Applying a scoring manual exactly",
|
| 169 |
+
"Statistics on small clinical data sets",
|
| 170 |
+
"Handling missing data by a stated rule"
|
| 171 |
+
],
|
| 172 |
+
"families": [
|
| 173 |
+
"scoring",
|
| 174 |
+
"reliable-change",
|
| 175 |
+
"norms",
|
| 176 |
+
"reliability"
|
| 177 |
+
],
|
| 178 |
+
"tasks": 108,
|
| 179 |
+
"folder": "psychometrics"
|
| 180 |
+
},
|
| 181 |
+
{
|
| 182 |
+
"name": "seat-count",
|
| 183 |
+
"title": "Seat Count",
|
| 184 |
+
"isced": "0312",
|
| 185 |
+
"summary": "Turn election results into seats: apply thresholds, divisor and quota methods, constituency and levelling seats, and measure disproportionality.",
|
| 186 |
+
"task_type": "electoral seat allocation",
|
| 187 |
+
"good_for": [
|
| 188 |
+
"Applying a written allocation rule exactly",
|
| 189 |
+
"Aggregating and filtering count records",
|
| 190 |
+
"Multi-step procedures with graded reward"
|
| 191 |
+
],
|
| 192 |
+
"families": [
|
| 193 |
+
"highest-averages",
|
| 194 |
+
"largest-remainder",
|
| 195 |
+
"constituencies"
|
| 196 |
+
],
|
| 197 |
+
"tasks": 108,
|
| 198 |
+
"folder": "seat_count"
|
| 199 |
+
},
|
| 200 |
+
{
|
| 201 |
+
"name": "stand-inventory",
|
| 202 |
+
"title": "Stand Inventory",
|
| 203 |
+
"isced": "0821",
|
| 204 |
+
"summary": "Do a forester's office work after a field inventory: plot expansion, basal area, tree and stand volume, a thinning rule and increment.",
|
| 205 |
+
"task_type": "forest mensuration",
|
| 206 |
+
"good_for": [
|
| 207 |
+
"Applying supplied equations to tallied records",
|
| 208 |
+
"Filtering and unit conversion before aggregation",
|
| 209 |
+
"Rule-following selection with a deterministic tie-break"
|
| 210 |
+
],
|
| 211 |
+
"families": [
|
| 212 |
+
"plots",
|
| 213 |
+
"volume",
|
| 214 |
+
"thinning",
|
| 215 |
+
"growth"
|
| 216 |
+
],
|
| 217 |
+
"tasks": 108,
|
| 218 |
+
"folder": "stand_inventory"
|
| 219 |
+
},
|
| 220 |
+
{
|
| 221 |
+
"name": "ward-round",
|
| 222 |
+
"title": "Ward Round",
|
| 223 |
+
"isced": "0913",
|
| 224 |
+
"summary": "Do a nurse's bedside calculations from ward charts: early-warning scores, infusion rates, weight-based doses and 24-hour fluid balance.",
|
| 225 |
+
"task_type": "clinical calculation",
|
| 226 |
+
"good_for": [
|
| 227 |
+
"Careful multi-step arithmetic on tabular records",
|
| 228 |
+
"Applying a written scoring rule exactly",
|
| 229 |
+
"Small-model RL with graded reward"
|
| 230 |
+
],
|
| 231 |
+
"families": [
|
| 232 |
+
"news2",
|
| 233 |
+
"dosing",
|
| 234 |
+
"fluid-balance"
|
| 235 |
+
],
|
| 236 |
+
"tasks": 108,
|
| 237 |
+
"folder": "ward_round"
|
| 238 |
+
},
|
| 239 |
+
{
|
| 240 |
+
"name": "zoning-check",
|
| 241 |
+
"title": "Zoning Check",
|
| 242 |
+
"isced": "0731",
|
| 243 |
+
"summary": "Check building proposals against a fictional town's zoning code: floor area ratio, coverage, setbacks, parking, plot capacity and areas from coordinates.",
|
| 244 |
+
"task_type": "rule compliance check",
|
| 245 |
+
"good_for": [
|
| 246 |
+
"Applying a written code to structured records",
|
| 247 |
+
"Plane geometry from coordinate lists",
|
| 248 |
+
"Finding the binding constraint among several limits"
|
| 249 |
+
],
|
| 250 |
+
"families": [
|
| 251 |
+
"compliance",
|
| 252 |
+
"capacity",
|
| 253 |
+
"geometry",
|
| 254 |
+
"mixed-use"
|
| 255 |
+
],
|
| 256 |
+
"tasks": 108,
|
| 257 |
+
"folder": "zoning_check"
|
| 258 |
+
}
|
| 259 |
+
]
|
envs/__init__.py
ADDED
|
File without changes
|
envs/argument_check/__init__.py
ADDED
|
File without changes
|
envs/argument_check/env.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name = "argument-check"
|
| 2 |
+
title = "Argument Check"
|
| 3 |
+
isced = "0223"
|
| 4 |
+
summary = "Mark a logic problem sheet: test arguments for validity, sentence sets for consistency and formula pairs for equivalence, with counterexamples and normal forms."
|
| 5 |
+
task_type = "formal logic checking"
|
| 6 |
+
good_for = ["Exhaustive truth-table reasoning", "Parsing a formal syntax with stated precedence", "Answers that must be verified, not guessed"]
|
| 7 |
+
families = ["validity", "consistency", "equivalence"]
|
envs/argument_check/gen.py
ADDED
|
@@ -0,0 +1,551 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Argument Check (ISCED-F 0223 Philosophy and ethics).
|
| 2 |
+
|
| 3 |
+
Classical two-valued propositional logic as taught in a first logic course. Three task families:
|
| 4 |
+
validity for each argument: valid or not, truth-table row counts, and a counterexample valuation if invalid
|
| 5 |
+
consistency for each set of sentences: satisfiable or not, number of models, a model if there is one
|
| 6 |
+
equivalence for each pair of formulas: equivalent or not, model counts, a distinguishing valuation;
|
| 7 |
+
at higher difficulty also a conjunctive (and disjunctive) normal form of given formulas
|
| 8 |
+
|
| 9 |
+
Definitions are the standard ones (e.g. forall x: An Introduction to Formal Logic, P. D. Magnus, chapters on
|
| 10 |
+
truth tables; an argument is valid iff no valuation makes every premise true and the conclusion false; a set is
|
| 11 |
+
jointly satisfiable iff some valuation makes every member true; two sentences are equivalent iff they agree on
|
| 12 |
+
every valuation). The plain-text syntax and its precedence (~, &, |, ->, <-> from tightest to loosest, -> and
|
| 13 |
+
<-> grouping to the right) are this environment's own convention and are shipped with every task in
|
| 14 |
+
logic_reference.md, so nothing depends on a textbook's choice of symbols.
|
| 15 |
+
|
| 16 |
+
This module builds formulas as trees, prints them, and computes every expected value from the trees.
|
| 17 |
+
oracle.py and validators.py each have their own, separately written parser and evaluator.
|
| 18 |
+
"""
|
| 19 |
+
import itertools
|
| 20 |
+
from practice.core import Task, rng_for, to_json, c_int, c_bool, c_set, c_str, c_custom
|
| 21 |
+
|
| 22 |
+
ENV = "argument-check"
|
| 23 |
+
|
| 24 |
+
REFERENCE = """# Logic reference
|
| 25 |
+
|
| 26 |
+
## Formulas
|
| 27 |
+
|
| 28 |
+
- An atom is a single capital letter, `A` to `Z`.
|
| 29 |
+
- `~X` means not X.
|
| 30 |
+
- `X & Y` means X and Y.
|
| 31 |
+
- `X | Y` means X or Y (inclusive: one or the other or both).
|
| 32 |
+
- `X -> Y` means if X then Y.
|
| 33 |
+
- `X <-> Y` means X if and only if Y.
|
| 34 |
+
- Parentheses `(` and `)` group. Spaces between symbols are optional and carry no meaning.
|
| 35 |
+
|
| 36 |
+
## Reading a formula that is not fully parenthesised
|
| 37 |
+
|
| 38 |
+
The connectives bind in this order, from tightest to loosest: `~`, then `&`, then `|`, then `->`, then `<->`.
|
| 39 |
+
|
| 40 |
+
- `~` applies to the shortest formula that follows it: an atom, a parenthesised formula or another negation. So `~A & B` is `(~A) & B`.
|
| 41 |
+
- `A & B | C` is `(A & B) | C`, and `A | B & C` is `A | (B & C)`.
|
| 42 |
+
- `A | B -> C & D` is `(A | B) -> (C & D)`.
|
| 43 |
+
- `A -> B <-> C` is `(A -> B) <-> C`.
|
| 44 |
+
- `&` and `|` group to the left: `A & B & C` is `(A & B) & C`.
|
| 45 |
+
- `->` and `<->` group to the right: `A -> B -> C` is `A -> (B -> C)`, and `A <-> B <-> C` is `A <-> (B <-> C)`.
|
| 46 |
+
|
| 47 |
+
## Truth conditions
|
| 48 |
+
|
| 49 |
+
| X | Y | ~X | X & Y | X \\| Y | X -> Y | X <-> Y |
|
| 50 |
+
|---|---|---|---|---|---|---|
|
| 51 |
+
| true | true | false | true | true | true | true |
|
| 52 |
+
| true | false | false | false | true | false | false |
|
| 53 |
+
| false | true | true | false | true | true | false |
|
| 54 |
+
| false | false | true | false | false | true | true |
|
| 55 |
+
|
| 56 |
+
## Valuations and rows
|
| 57 |
+
|
| 58 |
+
A valuation gives each atom the value true or false. For one problem (one argument, one set of sentences or one pair of formulas) the atoms that occur are the atoms that appear in at least one of its formulas. The truth table of the problem has one row for each valuation of the atoms that occur: 2 to the power n rows for n atoms. Every count of rows or valuations asked for is a count over this table.
|
| 59 |
+
|
| 60 |
+
In `answer.json` a valuation is a JSON object whose keys are exactly the atoms that occur in the problem and whose values are the JSON booleans `true` and `false`, for example `{"A": true, "B": false}`. Leave no atom out and add none.
|
| 61 |
+
|
| 62 |
+
## Definitions
|
| 63 |
+
|
| 64 |
+
- An argument is **valid** if there is no row in which every premise is true and the conclusion is false. Otherwise it is invalid, and any such row is a **counterexample**. An argument whose premises are never all true together is therefore valid.
|
| 65 |
+
- A premise of a valid argument is **essential** if the argument becomes invalid when that one premise is deleted and the others are kept.
|
| 66 |
+
- A set of sentences is **satisfiable** (consistent) if at least one row makes every sentence in it true. Such a row is a **model** of the set.
|
| 67 |
+
- An atom is **forced true** by a satisfiable set if it is true in every model of the set, and **forced false** if it is false in every model.
|
| 68 |
+
- Two formulas are **equivalent** if they have the same truth value in every row. A row in which they differ is a **distinguishing valuation**.
|
| 69 |
+
- A **literal** is an atom or `~` followed by an atom (`~~A` is not a literal).
|
| 70 |
+
- A formula is in **conjunctive normal form (CNF)** if, once parsed by the rules above, it is a conjunction (`&`) of one or more clauses, where each clause is a disjunction (`|`) of one or more literals. `(A | ~B) & C` and `A | B` and `~A` are in CNF. `A | B & C` is not: it parses as `A | (B & C)`. `->` and `<->` do not occur in a CNF.
|
| 71 |
+
- A formula is in **disjunctive normal form (DNF)** if, once parsed, it is a disjunction (`|`) of one or more terms, where each term is a conjunction (`&`) of one or more literals. `A & ~B | C` and `A & B` are in DNF.
|
| 72 |
+
"""
|
| 73 |
+
|
| 74 |
+
# ---------------------------------------------------------------- formulas
|
| 75 |
+
# A formula is an atom (a one-letter string) or a tuple: ("~", x) or (op, x, y) with op in & | -> <->.
|
| 76 |
+
PREC = {"<->": 1, "->": 2, "|": 3, "&": 4}
|
| 77 |
+
RIGHT = ("->", "<->")
|
| 78 |
+
|
| 79 |
+
def tokenize(s):
|
| 80 |
+
out, i = [], 0
|
| 81 |
+
while i < len(s):
|
| 82 |
+
ch = s[i]
|
| 83 |
+
if ch in " \t": i += 1
|
| 84 |
+
elif s.startswith("<->", i): out.append("<->"); i += 3
|
| 85 |
+
elif s.startswith("->", i): out.append("->"); i += 2
|
| 86 |
+
elif ch in "~&|()" or ("A" <= ch <= "Z"): out.append(ch); i += 1
|
| 87 |
+
else: raise ValueError("bad character %r" % ch)
|
| 88 |
+
return out
|
| 89 |
+
|
| 90 |
+
def parse(s):
|
| 91 |
+
"""Recursive descent: iff := imp [<-> iff]; imp := or [-> imp]; or := and {| and}; and := neg {& neg}."""
|
| 92 |
+
toks = tokenize(s); pos = [0]
|
| 93 |
+
def peek(): return toks[pos[0]] if pos[0] < len(toks) else None
|
| 94 |
+
def take(): pos[0] += 1; return toks[pos[0] - 1]
|
| 95 |
+
def p_iff():
|
| 96 |
+
left = p_imp()
|
| 97 |
+
if peek() == "<->": take(); return ("<->", left, p_iff())
|
| 98 |
+
return left
|
| 99 |
+
def p_imp():
|
| 100 |
+
left = p_or()
|
| 101 |
+
if peek() == "->": take(); return ("->", left, p_imp())
|
| 102 |
+
return left
|
| 103 |
+
def p_or():
|
| 104 |
+
left = p_and()
|
| 105 |
+
while peek() == "|": take(); left = ("|", left, p_and())
|
| 106 |
+
return left
|
| 107 |
+
def p_and():
|
| 108 |
+
left = p_neg()
|
| 109 |
+
while peek() == "&": take(); left = ("&", left, p_neg())
|
| 110 |
+
return left
|
| 111 |
+
def p_neg():
|
| 112 |
+
t = peek()
|
| 113 |
+
if t == "~": take(); return ("~", p_neg())
|
| 114 |
+
if t == "(":
|
| 115 |
+
take(); x = p_iff()
|
| 116 |
+
if peek() != ")": raise ValueError("missing )")
|
| 117 |
+
take(); return x
|
| 118 |
+
if t is not None and len(t) == 1 and "A" <= t <= "Z": return take()
|
| 119 |
+
raise ValueError("unexpected %r" % (t,))
|
| 120 |
+
f = p_iff()
|
| 121 |
+
if pos[0] != len(toks): raise ValueError("trailing input")
|
| 122 |
+
return f
|
| 123 |
+
|
| 124 |
+
def ev(f, v):
|
| 125 |
+
if isinstance(f, str): return v[f]
|
| 126 |
+
if f[0] == "~": return not ev(f[1], v)
|
| 127 |
+
a, b = ev(f[1], v), ev(f[2], v)
|
| 128 |
+
if f[0] == "&": return a and b
|
| 129 |
+
if f[0] == "|": return a or b
|
| 130 |
+
if f[0] == "->": return (not a) or b
|
| 131 |
+
return a == b
|
| 132 |
+
|
| 133 |
+
def atoms_of(fs):
|
| 134 |
+
acc = set()
|
| 135 |
+
def walk(f):
|
| 136 |
+
if isinstance(f, str): acc.add(f)
|
| 137 |
+
else:
|
| 138 |
+
for x in f[1:]: walk(x)
|
| 139 |
+
for f in fs: walk(f)
|
| 140 |
+
return sorted(acc)
|
| 141 |
+
|
| 142 |
+
def table(atoms):
|
| 143 |
+
return [dict(zip(atoms, bits)) for bits in itertools.product((True, False), repeat=len(atoms))]
|
| 144 |
+
|
| 145 |
+
def show(f, style="lean", r=None):
|
| 146 |
+
"""Print a tree. 'full' brackets every two-place subformula; 'lean' uses only the brackets the precedence
|
| 147 |
+
rules need (plus a few harmless extra ones when an rng is given). Either way parse(show(f)) == f."""
|
| 148 |
+
if isinstance(f, str): return f
|
| 149 |
+
if f[0] == "~":
|
| 150 |
+
x = f[1]; inner = show(x, style, r)
|
| 151 |
+
return "~" + (inner if isinstance(x, str) or x[0] == "~" else "(" + inner + ")")
|
| 152 |
+
op, parts = f[0], []
|
| 153 |
+
for side in (0, 1):
|
| 154 |
+
x = f[1 + side]; s = show(x, style, r)
|
| 155 |
+
if not isinstance(x, str) and x[0] != "~":
|
| 156 |
+
if style == "full": need = True
|
| 157 |
+
else:
|
| 158 |
+
need = PREC[x[0]] < PREC[op] or (PREC[x[0]] == PREC[op] and ((op in RIGHT) == (side == 0)))
|
| 159 |
+
if not need and r is not None and r.random() < 0.2: need = True
|
| 160 |
+
if need: s = "(" + s + ")"
|
| 161 |
+
parts.append(s)
|
| 162 |
+
return parts[0] + " " + op + " " + parts[1]
|
| 163 |
+
|
| 164 |
+
def depth(f):
|
| 165 |
+
return 0 if isinstance(f, str) else 1 + max(depth(x) for x in f[1:])
|
| 166 |
+
|
| 167 |
+
def neg(x):
|
| 168 |
+
return x[1] if (not isinstance(x, str) and x[0] == "~") else ("~", x)
|
| 169 |
+
|
| 170 |
+
def rand_formula(r, atoms, d):
|
| 171 |
+
"""Random formula of depth at most d (a negated atom counts as depth 0 here)."""
|
| 172 |
+
if d <= 0:
|
| 173 |
+
a = r.choice(atoms)
|
| 174 |
+
return ("~", a) if r.random() < 0.3 else a
|
| 175 |
+
op = r.choices(["&", "|", "->", "<->", "~"], weights=[3, 3, 3, 1.5, 1.5])[0]
|
| 176 |
+
if op == "~":
|
| 177 |
+
return neg(rand_formula(r, atoms, d - 1))
|
| 178 |
+
for attempt in range(200):
|
| 179 |
+
a, b = rand_formula(r, atoms, d - 1), rand_formula(r, atoms, r.randint(0, d - 1))
|
| 180 |
+
if r.random() < 0.5: a, b = b, a
|
| 181 |
+
if a == b or a == neg(b): continue
|
| 182 |
+
# avoid padding such as J & (J | L), where one side is a literal whose atom the other side already uses
|
| 183 |
+
if attempt < 100 and any(is_literal(x) and atoms_of([x])[0] in atoms_of([y]) for x, y in ((a, b), (b, a))): continue
|
| 184 |
+
return (op, a, b)
|
| 185 |
+
return (op, a, b)
|
| 186 |
+
|
| 187 |
+
def contingent(f):
|
| 188 |
+
vals = [ev(f, v) for v in table(atoms_of([f]))]
|
| 189 |
+
return any(vals) and not all(vals)
|
| 190 |
+
|
| 191 |
+
# ---------------------------------------------------------------- the formulas behind the answers
|
| 192 |
+
def arg_stats(premises, conclusion):
|
| 193 |
+
"""(atoms, rows with all premises true, rows with all premises true and the conclusion false)."""
|
| 194 |
+
atoms = atoms_of(premises + [conclusion]); p = c = 0
|
| 195 |
+
for v in table(atoms):
|
| 196 |
+
if all(ev(x, v) for x in premises):
|
| 197 |
+
p += 1
|
| 198 |
+
if not ev(conclusion, v): c += 1
|
| 199 |
+
return atoms, p, c
|
| 200 |
+
|
| 201 |
+
def essential_premises(premises, conclusion):
|
| 202 |
+
"""1-based numbers of the premises whose deletion on its own makes a valid argument invalid."""
|
| 203 |
+
return [i + 1 for i in range(len(premises)) if arg_stats(premises[:i] + premises[i + 1:], conclusion)[2] > 0]
|
| 204 |
+
|
| 205 |
+
def set_stats(sentences):
|
| 206 |
+
"""models, most sentences true together, atoms forced true / false (satisfiable sets), and the sentence
|
| 207 |
+
numbers whose deletion on its own leaves a satisfiable set (unsatisfiable sets)."""
|
| 208 |
+
atoms = atoms_of(sentences); rows = table(atoms)
|
| 209 |
+
models = [v for v in rows if all(ev(s, v) for s in sentences)]
|
| 210 |
+
most = max(sum(1 for s in sentences if ev(s, v)) for v in rows)
|
| 211 |
+
ft = [a for a in atoms if models and all(v[a] for v in models)]
|
| 212 |
+
ff = [a for a in atoms if models and not any(v[a] for v in models)]
|
| 213 |
+
restoring = []
|
| 214 |
+
if not models:
|
| 215 |
+
for i in range(len(sentences)):
|
| 216 |
+
rest = sentences[:i] + sentences[i + 1:]
|
| 217 |
+
if any(all(ev(s, v) for s in rest) for v in rows): restoring.append(i + 1)
|
| 218 |
+
return {"atoms": atoms, "models": len(models), "most": most, "forced_true": ft, "forced_false": ff, "restoring": restoring}
|
| 219 |
+
|
| 220 |
+
def pair_stats(left, right):
|
| 221 |
+
atoms = atoms_of([left, right]); lm = rm = lo = ro = 0
|
| 222 |
+
for v in table(atoms):
|
| 223 |
+
a, b = ev(left, v), ev(right, v)
|
| 224 |
+
lm += a; rm += b; lo += (a and not b); ro += (b and not a)
|
| 225 |
+
rel = "equivalent" if lo == 0 and ro == 0 else "left-entails-right" if lo == 0 else "right-entails-left" if ro == 0 else "neither"
|
| 226 |
+
return {"atoms": atoms, "left_models": lm, "right_models": rm, "left_only": lo, "right_only": ro, "relation": rel}
|
| 227 |
+
|
| 228 |
+
def is_literal(f):
|
| 229 |
+
return isinstance(f, str) or (f[0] == "~" and isinstance(f[1], str))
|
| 230 |
+
|
| 231 |
+
def is_normal_form(f, form):
|
| 232 |
+
outer, inner = ("&", "|") if form == "cnf" else ("|", "&")
|
| 233 |
+
def flat(x, op):
|
| 234 |
+
return flat(x[1], op) + flat(x[2], op) if (not isinstance(x, str) and x[0] == op) else [x]
|
| 235 |
+
return all(is_literal(lit) for part in flat(f, outer) for lit in flat(part, inner))
|
| 236 |
+
|
| 237 |
+
# ---------------------------------------------------------------- shared generation helpers
|
| 238 |
+
POOL = "ABCDEFGHJKLMNPQRST"
|
| 239 |
+
|
| 240 |
+
def printer(r, d):
|
| 241 |
+
"""Difficulty 1 prints every bracket; 2 and 3 rely on precedence; 3 also drops the spaces now and then."""
|
| 242 |
+
def out(f):
|
| 243 |
+
if d == 1: s = show(f, "full")
|
| 244 |
+
else:
|
| 245 |
+
s = show(f, "lean", r)
|
| 246 |
+
if d == 3 and r.random() < 0.2: s = s.replace(" ", "")
|
| 247 |
+
assert parse(s) == f, s
|
| 248 |
+
return s
|
| 249 |
+
return out
|
| 250 |
+
|
| 251 |
+
# ---------------------------------------------------------------- validity
|
| 252 |
+
def T(premises, conclusion): return ([parse(p) for p in premises], parse(conclusion))
|
| 253 |
+
VALID_FORMS = [T(["X -> Y", "X"], "Y"), T(["X -> Y", "~Y"], "~X"), T(["X -> Y", "Y -> Z"], "X -> Z"), T(["X | Y", "~X"], "Y"),
|
| 254 |
+
T(["X | Y", "X -> Z", "Y -> Z"], "Z"), T(["X | Y", "X -> Z", "Y -> W"], "Z | W"), T(["X <-> Y", "~X"], "~Y"),
|
| 255 |
+
T(["X -> Y", "X -> Z"], "X -> Y & Z"), T(["X -> Y", "X -> ~Y"], "~X"), T(["X & Y -> Z", "X"], "Y -> Z"),
|
| 256 |
+
T(["~(X & Y)", "X"], "~Y"), T(["X -> (Y -> Z)", "Y"], "X -> Z"), T(["X -> Y", "~X -> Z"], "Y | Z"),
|
| 257 |
+
T(["X -> Y | Z", "~Y"], "X -> Z")]
|
| 258 |
+
OTHER_FORMS = [T(["X -> Y", "Y"], "X"), T(["X -> Y", "~X"], "~Y"), T(["X | Y", "X"], "~Y"), T(["X -> Y", "Z -> Y"], "X -> Z"),
|
| 259 |
+
T(["~(X & Y)", "~X"], "Y"), T(["X -> Y", "Y -> Z"], "Z -> X"), T(["X -> Y | Z", "~Y"], "~X"),
|
| 260 |
+
T(["X <-> Y", "X | Z"], "Y"), T(["X -> Y", "X -> Z"], "Y -> Z"), T(["X & Y -> Z", "~Z"], "~X"),
|
| 261 |
+
T(["X | Y", "X -> Z"], "Z"), T(["X -> Y", "~Y | Z"], "Z -> X")]
|
| 262 |
+
|
| 263 |
+
def subst(f, m):
|
| 264 |
+
if isinstance(f, str): return m[f]
|
| 265 |
+
if f[0] == "~": return neg(subst(f[1], m))
|
| 266 |
+
return (f[0], subst(f[1], m), subst(f[2], m))
|
| 267 |
+
|
| 268 |
+
def gen_validity(seed, d):
|
| 269 |
+
r = rng_for(ENV + "/validity", seed, d)
|
| 270 |
+
n = {1: 5, 2: 8, 3: 9}[d]
|
| 271 |
+
lo, hi = {1: (2, 3), 2: (3, 4), 3: (4, 6)}[d]
|
| 272 |
+
out = printer(r, d)
|
| 273 |
+
n_valid = n // 2 + (1 if n % 2 and r.random() < 0.5 else 0)
|
| 274 |
+
kinds = ["valid"] * n_valid + ["invalid"] * (n - n_valid)
|
| 275 |
+
if d == 3 and r.random() < 0.7: kinds[0] = "vacuous" # premises that cannot all be true: valid, with 0 premise rows
|
| 276 |
+
r.shuffle(kinds)
|
| 277 |
+
letters = sorted(r.sample(POOL, hi))
|
| 278 |
+
args, seen = [], set()
|
| 279 |
+
for kind in kinds:
|
| 280 |
+
while True:
|
| 281 |
+
atoms = sorted(r.sample(letters, r.randint(lo, hi)))
|
| 282 |
+
if r.random() < 0.6 and kind != "vacuous":
|
| 283 |
+
prem, concl = r.choice(VALID_FORMS if kind == "valid" else OTHER_FORMS)
|
| 284 |
+
metas = atoms_of(prem + [concl]); m = {}
|
| 285 |
+
for x in metas:
|
| 286 |
+
for _ in range(20): # distinct parts that are not each other's negation
|
| 287 |
+
g = rand_formula(r, atoms, 0 if d == 1 else r.choice([0, 0, 1]))
|
| 288 |
+
if g not in m.values() and neg(g) not in m.values(): m[x] = g; break
|
| 289 |
+
if len(m) < len(metas): continue
|
| 290 |
+
prem, concl = [subst(p, m) for p in prem], subst(concl, m)
|
| 291 |
+
if d == 3 and r.random() < 0.5: prem.append(rand_formula(r, atoms, r.choice([1, 2])))
|
| 292 |
+
r.shuffle(prem)
|
| 293 |
+
else:
|
| 294 |
+
k = {1: 2, 2: r.choice([2, 3]), 3: r.choice([3, 4])}[d]
|
| 295 |
+
prem = [rand_formula(r, atoms, 1 if d == 1 else r.choice([1, 2])) for _ in range(k)]
|
| 296 |
+
concl = rand_formula(r, atoms, r.choice([0, 1]) if d == 1 else 1)
|
| 297 |
+
if not all(contingent(p) for p in prem) or not contingent(concl): continue
|
| 298 |
+
if concl in prem or len(set(prem)) < len(prem): continue
|
| 299 |
+
used, p_rows, cex = arg_stats(prem, concl)
|
| 300 |
+
if not (lo <= len(used) <= hi) or depth(concl) > 3 or any(depth(p) > 3 for p in prem): continue
|
| 301 |
+
if kind == "valid" and not (cex == 0 and p_rows >= 1): continue
|
| 302 |
+
if kind == "vacuous" and not (p_rows == 0 and len(prem) >= 3 and len(essential_premises(prem, concl)) >= 1): continue
|
| 303 |
+
if kind == "invalid" and not (1 <= cex <= max(1, 2 ** len(used) // 4)): continue
|
| 304 |
+
if kind == "valid" and len(prem) > 1 and all(arg_stats([p], concl)[2] == 0 for p in prem): continue
|
| 305 |
+
key = (tuple(sorted(show(p) for p in prem)), show(concl))
|
| 306 |
+
if key in seen: continue
|
| 307 |
+
seen.add(key); args.append((prem, concl, used, p_rows, cex)); break
|
| 308 |
+
recs, checks, valid_ids = [], [], []
|
| 309 |
+
for i, (prem, concl, used, p_rows, cex) in enumerate(args):
|
| 310 |
+
aid = "ARG%02d" % (i + 1)
|
| 311 |
+
recs.append({"id": aid, "source": "Sheet %d, question %d" % (r.randint(1, 9), r.randint(1, 20)),
|
| 312 |
+
"premises": [out(p) for p in prem], "conclusion": out(concl)})
|
| 313 |
+
base = "arguments.%s." % aid
|
| 314 |
+
checks += [c_bool(base + "valid", cex == 0), c_int(base + "premise_true_rows", p_rows), c_int(base + "counterexample_rows", cex)]
|
| 315 |
+
if cex == 0:
|
| 316 |
+
valid_ids.append(aid)
|
| 317 |
+
if d == 3: checks.append(c_set(base + "essential_premises", essential_premises(prem, concl), item="int"))
|
| 318 |
+
else:
|
| 319 |
+
checks.append(c_custom("counterexample", {"id": aid, "premises": recs[-1]["premises"], "conclusion": recs[-1]["conclusion"]}))
|
| 320 |
+
checks.append(c_set("valid_ids", valid_ids, weight=2))
|
| 321 |
+
extra = ""
|
| 322 |
+
if d == 3:
|
| 323 |
+
extra = "\n - `essential_premises`: for a valid argument only, the list of premise numbers (1 for the first premise in the file, 2 for the second, and so on) that are essential as defined in the reference. Any order; an empty list if none."
|
| 324 |
+
inst = """# Argument check: validity
|
| 325 |
+
|
| 326 |
+
`arguments.json` holds %d arguments in propositional logic, each with its premises and a conclusion. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.
|
| 327 |
+
|
| 328 |
+
Test every argument with a full truth table over the atoms that occur in it.
|
| 329 |
+
|
| 330 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 331 |
+
|
| 332 |
+
- `arguments`: an object keyed by argument id. For each argument give
|
| 333 |
+
- `valid`: `true` or `false`.
|
| 334 |
+
- `premise_true_rows`: the number of rows in which every premise is true, as an integer.
|
| 335 |
+
- `counterexample_rows`: the number of rows in which every premise is true and the conclusion is false, as an integer (0 for a valid argument).
|
| 336 |
+
- `counterexample`: for an invalid argument, one counterexample written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the argument). Any counterexample is accepted. For a valid argument give `null`.%s
|
| 337 |
+
- `valid_ids`: list of the ids of the valid arguments (any order).
|
| 338 |
+
""" % (n, extra)
|
| 339 |
+
return Task(ENV, "validity", seed, d, "Validity of %d arguments" % n, inst,
|
| 340 |
+
{"arguments.json": to_json(recs), "logic_reference.md": REFERENCE}, checks, {"arguments": n, "valid": len(valid_ids)})
|
| 341 |
+
|
| 342 |
+
# ---------------------------------------------------------------- consistency
|
| 343 |
+
def gen_consistency(seed, d):
|
| 344 |
+
r = rng_for(ENV + "/consistency", seed, d)
|
| 345 |
+
n = {1: 4, 2: 6, 3: 7}[d]
|
| 346 |
+
lo, hi = {1: (2, 3), 2: (3, 4), 3: (4, 6)}[d]
|
| 347 |
+
out = printer(r, d)
|
| 348 |
+
n_sat = n // 2 + (1 if n % 2 and r.random() < 0.5 else 0)
|
| 349 |
+
kinds = ["sat"] * n_sat + ["unsat"] * (n - n_sat)
|
| 350 |
+
r.shuffle(kinds)
|
| 351 |
+
letters = sorted(r.sample(POOL, hi))
|
| 352 |
+
sets, seen = [], set()
|
| 353 |
+
for kind in kinds:
|
| 354 |
+
while True:
|
| 355 |
+
atoms = sorted(r.sample(letters, r.randint(lo, hi)))
|
| 356 |
+
k = len(atoms) + r.choice([0, 1]) if d < 3 else min(6, len(atoms) + r.choice([-1, 0]))
|
| 357 |
+
sents = [rand_formula(r, atoms, 1 if d == 1 else r.choice([1, 1, 2])) for _ in range(k)]
|
| 358 |
+
if len(set(sents)) < k or not all(contingent(s) for s in sents): continue
|
| 359 |
+
st = set_stats(sents)
|
| 360 |
+
if len(st["atoms"]) != len(atoms): continue
|
| 361 |
+
if kind == "sat" and not (1 <= st["models"] <= (2 if len(atoms) <= 3 else 3)): continue
|
| 362 |
+
if kind == "unsat" and st["models"] != 0: continue
|
| 363 |
+
key = tuple(sorted(show(s) for s in sents))
|
| 364 |
+
if key in seen: continue
|
| 365 |
+
seen.add(key); sets.append((sents, st)); break
|
| 366 |
+
recs, checks, unsat_ids = [], [], []
|
| 367 |
+
for i, (sents, st) in enumerate(sets):
|
| 368 |
+
sid = "SET%02d" % (i + 1)
|
| 369 |
+
recs.append({"id": sid, "source": "Sheet %d, question %d" % (r.randint(1, 9), r.randint(1, 20)), "sentences": [out(s) for s in sents]})
|
| 370 |
+
base = "sets.%s." % sid
|
| 371 |
+
checks += [c_bool(base + "satisfiable", st["models"] > 0), c_int(base + "models", st["models"]), c_int(base + "most_true_together", st["most"])]
|
| 372 |
+
if st["models"]:
|
| 373 |
+
checks.append(c_custom("satisfying_valuation", {"id": sid, "sentences": recs[-1]["sentences"]}))
|
| 374 |
+
if d >= 2: checks += [c_set(base + "forced_true", st["forced_true"]), c_set(base + "forced_false", st["forced_false"])]
|
| 375 |
+
else:
|
| 376 |
+
unsat_ids.append(sid)
|
| 377 |
+
if d == 3: checks.append(c_set(base + "restoring", st["restoring"], item="int"))
|
| 378 |
+
checks.append(c_set("unsatisfiable_ids", unsat_ids, weight=2))
|
| 379 |
+
extra = ""
|
| 380 |
+
if d >= 2:
|
| 381 |
+
extra += "\n - `forced_true` and `forced_false`: for a satisfiable set only, the lists of atoms that are true in every model of the set and false in every model of the set (any order; empty lists if none)."
|
| 382 |
+
if d == 3:
|
| 383 |
+
extra += "\n - `restoring`: for an unsatisfiable set only, the list of sentence numbers (1 for the first sentence in the file, 2 for the second, and so on) such that deleting that one sentence and keeping the others leaves a satisfiable set. Any order; an empty list if none."
|
| 384 |
+
inst = """# Argument check: consistency
|
| 385 |
+
|
| 386 |
+
`sentence_sets.json` holds %d sets of sentences in propositional logic. `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.
|
| 387 |
+
|
| 388 |
+
Test every set with a full truth table over the atoms that occur in it.
|
| 389 |
+
|
| 390 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 391 |
+
|
| 392 |
+
- `sets`: an object keyed by set id. For each set give
|
| 393 |
+
- `satisfiable`: `true` or `false`.
|
| 394 |
+
- `models`: the number of rows in which every sentence of the set is true, as an integer (0 if unsatisfiable).
|
| 395 |
+
- `most_true_together`: the largest number of sentences of the set that are true in one and the same row, as an integer (for a satisfiable set this is the number of sentences).
|
| 396 |
+
- `valuation`: for a satisfiable set, one model written as a valuation (an object giving `true` or `false` to exactly the atoms that occur in the set). Any model is accepted. For an unsatisfiable set give `null`.%s
|
| 397 |
+
- `unsatisfiable_ids`: list of the ids of the unsatisfiable sets (any order).
|
| 398 |
+
""" % (n, extra)
|
| 399 |
+
return Task(ENV, "consistency", seed, d, "Consistency of %d sets of sentences" % n, inst,
|
| 400 |
+
{"sentence_sets.json": to_json(recs), "logic_reference.md": REFERENCE}, checks, {"sets": n, "unsatisfiable": len(unsat_ids)})
|
| 401 |
+
|
| 402 |
+
# ---------------------------------------------------------------- equivalence
|
| 403 |
+
def rewrites(f, good):
|
| 404 |
+
"""Results of rewriting the top connective of f by a sound law (good) or by a classic slip (not good).
|
| 405 |
+
The caller always confirms the outcome with a truth table, so a 'slip' that happens to be sound is harmless."""
|
| 406 |
+
if isinstance(f, str): return []
|
| 407 |
+
op, res = f[0], []
|
| 408 |
+
if op == "~":
|
| 409 |
+
x = f[1]
|
| 410 |
+
if isinstance(x, str): return []
|
| 411 |
+
if x[0] == "~": return [x[1]] if good else [] # double negation
|
| 412 |
+
a, b = x[1], x[2]
|
| 413 |
+
if x[0] == "&": res.append(("|", neg(a), neg(b)) if good else ("&", neg(a), neg(b)))
|
| 414 |
+
if x[0] == "|": res.append(("&", neg(a), neg(b)) if good else ("|", neg(a), neg(b)))
|
| 415 |
+
if x[0] == "->": res += [("&", a, neg(b))] if good else [("&", neg(a), b), ("->", neg(a), neg(b))]
|
| 416 |
+
if x[0] == "<->": res.append(("<->", a, neg(b)) if good else ("<->", neg(a), neg(b)))
|
| 417 |
+
return res
|
| 418 |
+
a, b = f[1], f[2]
|
| 419 |
+
if op == "&":
|
| 420 |
+
if good:
|
| 421 |
+
res += [("~", ("|", neg(a), neg(b))), ("~", ("->", a, neg(b)))]
|
| 422 |
+
if not isinstance(b, str) and b[0] == "|": res.append(("|", ("&", a, b[1]), ("&", a, b[2])))
|
| 423 |
+
else:
|
| 424 |
+
res.append(("~", ("|", neg(a), b)))
|
| 425 |
+
if not isinstance(b, str) and b[0] == "|": res.append(("|", ("&", a, b[1]), b[2]))
|
| 426 |
+
if op == "|":
|
| 427 |
+
if good:
|
| 428 |
+
res += [("~", ("&", neg(a), neg(b))), ("->", neg(a), b)]
|
| 429 |
+
if not isinstance(b, str) and b[0] == "&": res.append(("&", ("|", a, b[1]), ("|", a, b[2])))
|
| 430 |
+
else:
|
| 431 |
+
res += [("->", a, b), ("~", ("&", neg(a), b))]
|
| 432 |
+
if not isinstance(b, str) and b[0] == "&": res.append(("&", ("|", a, b[1]), b[2]))
|
| 433 |
+
if op == "->":
|
| 434 |
+
if good:
|
| 435 |
+
res += [("|", neg(a), b), ("->", neg(b), neg(a)), ("~", ("&", a, neg(b)))]
|
| 436 |
+
if not isinstance(a, str) and a[0] == "&": res.append(("->", a[1], ("->", a[2], b)))
|
| 437 |
+
if not isinstance(a, str) and a[0] == "|": res.append(("&", ("->", a[1], b), ("->", a[2], b)))
|
| 438 |
+
else:
|
| 439 |
+
res += [("->", b, a), ("->", neg(a), neg(b)), ("|", a, neg(b)), ("~", ("&", neg(a), b))]
|
| 440 |
+
if not isinstance(a, str) and a[0] == "&": res.append(("&", ("->", a[1], b), ("->", a[2], b)))
|
| 441 |
+
if not isinstance(a, str) and a[0] == "|": res.append(("|", ("->", a[1], b), ("->", a[2], b)))
|
| 442 |
+
if op == "<->":
|
| 443 |
+
if good: res += [("&", ("->", a, b), ("->", b, a)), ("|", ("&", a, b), ("&", neg(a), neg(b))), ("<->", neg(a), neg(b))]
|
| 444 |
+
else: res += [("->", a, b), ("|", ("&", a, b), ("&", neg(a), b)), ("<->", neg(a), b), ("&", ("->", a, b), ("->", neg(b), a))]
|
| 445 |
+
return res
|
| 446 |
+
|
| 447 |
+
def paths(f, here=()):
|
| 448 |
+
if isinstance(f, str): return [here]
|
| 449 |
+
out = [here]
|
| 450 |
+
for i, x in enumerate(f[1:]): out += paths(x, here + (i + 1,))
|
| 451 |
+
return out
|
| 452 |
+
|
| 453 |
+
def get_at(f, p):
|
| 454 |
+
for i in p: f = f[i]
|
| 455 |
+
return f
|
| 456 |
+
|
| 457 |
+
def put_at(f, p, new):
|
| 458 |
+
if not p: return new
|
| 459 |
+
parts = list(f); parts[p[0]] = put_at(f[p[0]], p[1:], new)
|
| 460 |
+
return tuple(parts)
|
| 461 |
+
|
| 462 |
+
def rewrite_somewhere(r, f, good):
|
| 463 |
+
spots = [(p, alt) for p in paths(f) for alt in rewrites(get_at(f, p), good)]
|
| 464 |
+
if not spots: return None
|
| 465 |
+
p, alt = r.choice(spots)
|
| 466 |
+
return put_at(f, p, alt)
|
| 467 |
+
|
| 468 |
+
def gen_equivalence(seed, d):
|
| 469 |
+
r = rng_for(ENV + "/equivalence", seed, d)
|
| 470 |
+
n = {1: 5, 2: 6, 3: 6}[d]
|
| 471 |
+
lo, hi = {1: (2, 3), 2: (3, 4), 3: (4, 6)}[d]
|
| 472 |
+
out = printer(r, d)
|
| 473 |
+
n_eq = n // 2 + (1 if n % 2 and r.random() < 0.5 else 0)
|
| 474 |
+
kinds = ["eq"] * n_eq + ["diff"] * (n - n_eq)
|
| 475 |
+
r.shuffle(kinds)
|
| 476 |
+
letters = sorted(r.sample(POOL, hi))
|
| 477 |
+
pairs, seen = [], set()
|
| 478 |
+
for kind in kinds:
|
| 479 |
+
while True:
|
| 480 |
+
atoms = sorted(r.sample(letters, r.randint(lo, hi)))
|
| 481 |
+
left = rand_formula(r, atoms, 2 if d == 1 else r.choice([2, 3]))
|
| 482 |
+
if len(atoms_of([left])) != len(atoms) or not contingent(left): continue
|
| 483 |
+
right = left
|
| 484 |
+
steps = [kind == "eq"] if d == 1 else [kind == "eq", True] if r.random() < 0.6 else [kind == "eq"]
|
| 485 |
+
r.shuffle(steps)
|
| 486 |
+
for good in steps:
|
| 487 |
+
right = rewrite_somewhere(r, right, good) if right is not None else None
|
| 488 |
+
if right is None or right == left or depth(right) > 5 or len(show(right)) > 64 or len(show(left)) > 48: continue
|
| 489 |
+
st = pair_stats(left, right)
|
| 490 |
+
if (st["relation"] == "equivalent") != (kind == "eq"): continue
|
| 491 |
+
if r.random() < 0.5: left, right = right, left; st = pair_stats(left, right)
|
| 492 |
+
key = (show(left), show(right))
|
| 493 |
+
if key in seen: continue
|
| 494 |
+
seen.add(key); pairs.append((left, right, st)); break
|
| 495 |
+
recs, checks, eq_ids = [], [], []
|
| 496 |
+
for i, (left, right, st) in enumerate(pairs):
|
| 497 |
+
pid = "PAIR%02d" % (i + 1)
|
| 498 |
+
recs.append({"id": pid, "left": out(left), "right": out(right)})
|
| 499 |
+
base = "pairs.%s." % pid
|
| 500 |
+
checks += [c_bool(base + "equivalent", st["relation"] == "equivalent"), c_int(base + "left_models", st["left_models"]), c_int(base + "right_models", st["right_models"])]
|
| 501 |
+
if d == 3: checks += [c_int(base + "left_only_rows", st["left_only"]), c_str(base + "relation", st["relation"])]
|
| 502 |
+
if st["relation"] == "equivalent": eq_ids.append(pid)
|
| 503 |
+
else: checks.append(c_custom("distinguishing_valuation", {"id": pid, "left": recs[-1]["left"], "right": recs[-1]["right"]}))
|
| 504 |
+
checks.append(c_set("equivalent_ids", eq_ids, weight=2))
|
| 505 |
+
files = {"pairs.json": to_json(recs), "logic_reference.md": REFERENCE}
|
| 506 |
+
extra, more, intro = "", "", ""
|
| 507 |
+
if d == 3:
|
| 508 |
+
extra = """
|
| 509 |
+
- `left_only_rows`: the number of rows in which `left` is true and `right` is false, as an integer.
|
| 510 |
+
- `relation`: one of `equivalent`, `left-entails-right` (not equivalent, and `right` is true in every row in which `left` is true), `right-entails-left` (not equivalent, and `left` is true in every row in which `right` is true) or `neither`."""
|
| 511 |
+
if d >= 2:
|
| 512 |
+
forms = ["cnf"] if d == 2 else ["cnf", "dnf"]
|
| 513 |
+
conv = []
|
| 514 |
+
while len(conv) < 2:
|
| 515 |
+
atoms = sorted(r.sample(letters, 3 if d == 2 else 4))
|
| 516 |
+
f = rand_formula(r, atoms, r.choice([2, 3]))
|
| 517 |
+
st = set_stats([f])
|
| 518 |
+
if len(st["atoms"]) != len(atoms) or not (2 <= st["models"] <= 2 ** len(atoms) - 2): continue
|
| 519 |
+
if is_normal_form(f, "cnf") or is_normal_form(f, "dnf") or len(show(f)) > 48 or f in [c for c in conv]: continue
|
| 520 |
+
if not any(get_at(f, p)[0] in ("->", "<->") for p in paths(f) if not isinstance(get_at(f, p), str)): continue
|
| 521 |
+
conv.append(f)
|
| 522 |
+
crecs = [{"id": "F%02d" % (i + 1), "formula": out(f)} for i, f in enumerate(conv)]
|
| 523 |
+
files["convert.json"] = to_json(crecs)
|
| 524 |
+
for form in forms:
|
| 525 |
+
for c in crecs: checks.append(c_custom("normal_form", {"id": c["id"], "formula": c["formula"], "form": form}, weight=2))
|
| 526 |
+
intro = " `convert.json` holds %d further formulas to rewrite in normal form." % len(crecs)
|
| 527 |
+
more = "\n- `cnf`: an object keyed by the ids in `convert.json`. Each value is a string: a formula in the syntax of the reference that is in conjunctive normal form, is equivalent to the given formula and uses no atom that the given formula does not contain. Any such formula of at most 2000 characters is accepted."
|
| 528 |
+
if d == 3:
|
| 529 |
+
more += "\n- `dnf`: the same for disjunctive normal form."
|
| 530 |
+
inst = """# Argument check: equivalence
|
| 531 |
+
|
| 532 |
+
`pairs.json` holds %d pairs of formulas in propositional logic, `left` and `right`.%s `logic_reference.md` gives the formula syntax, including how to read formulas that are not fully parenthesised, and the definitions to apply.
|
| 533 |
+
|
| 534 |
+
Compare the two formulas of every pair with a full truth table over the atoms that occur in either of them.
|
| 535 |
+
|
| 536 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 537 |
+
|
| 538 |
+
- `pairs`: an object keyed by pair id. For each pair give
|
| 539 |
+
- `equivalent`: `true` or `false`.
|
| 540 |
+
- `left_models`: the number of rows in which `left` is true, as an integer.
|
| 541 |
+
- `right_models`: the number of rows in which `right` is true, as an integer.%s
|
| 542 |
+
- `distinguishing`: for a pair that is not equivalent, one distinguishing valuation (an object giving `true` or `false` to exactly the atoms that occur in the pair). Any row in which the two formulas differ is accepted. For an equivalent pair give `null`.
|
| 543 |
+
- `equivalent_ids`: list of the ids of the equivalent pairs (any order).%s
|
| 544 |
+
""" % (n, intro, extra, more)
|
| 545 |
+
return Task(ENV, "equivalence", seed, d, "Equivalence of %d pairs of formulas" % n, inst, files, checks, {"pairs": n, "equivalent": len(eq_ids)})
|
| 546 |
+
|
| 547 |
+
FAMILIES = {"validity": gen_validity, "consistency": gen_consistency, "equivalence": gen_equivalence}
|
| 548 |
+
|
| 549 |
+
def generate(seed, difficulty, family=None):
|
| 550 |
+
fam = family or sorted(FAMILIES)[seed % len(FAMILIES)]
|
| 551 |
+
return FAMILIES[fam](seed, difficulty)
|
envs/argument_check/oracle.py
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Reference solution for Argument Check. Works only from the files in the current directory.
|
| 3 |
+
|
| 4 |
+
Formulas are read with a shunting-yard pass into reverse Polish notation and evaluated on a stack,
|
| 5 |
+
following the precedence and grouping rules of logic_reference.md.
|
| 6 |
+
"""
|
| 7 |
+
import json, os
|
| 8 |
+
|
| 9 |
+
BINDING = {"~": 5, "&": 4, "|": 3, "->": 2, "<->": 1}
|
| 10 |
+
GROUPS_RIGHT = {"~", "->", "<->"}
|
| 11 |
+
|
| 12 |
+
def lex(text):
|
| 13 |
+
toks, i = [], 0
|
| 14 |
+
while i < len(text):
|
| 15 |
+
c = text[i]
|
| 16 |
+
if c.isspace(): i += 1; continue
|
| 17 |
+
if text[i:i + 3] == "<->": toks.append("<->"); i += 3; continue
|
| 18 |
+
if text[i:i + 2] == "->": toks.append("->"); i += 2; continue
|
| 19 |
+
if c in "~&|()" or (len(c) == 1 and "A" <= c <= "Z"): toks.append(c); i += 1; continue
|
| 20 |
+
raise ValueError("cannot read %r" % text)
|
| 21 |
+
return toks
|
| 22 |
+
|
| 23 |
+
def to_rpn(text):
|
| 24 |
+
out, ops = [], []
|
| 25 |
+
expect_operand = True
|
| 26 |
+
for t in lex(text):
|
| 27 |
+
if t not in BINDING and t not in "()": # an atom
|
| 28 |
+
if not expect_operand: raise ValueError(text)
|
| 29 |
+
out.append(t); expect_operand = False
|
| 30 |
+
elif t == "~":
|
| 31 |
+
if not expect_operand: raise ValueError(text)
|
| 32 |
+
ops.append(t)
|
| 33 |
+
elif t == "(":
|
| 34 |
+
if not expect_operand: raise ValueError(text)
|
| 35 |
+
ops.append(t)
|
| 36 |
+
elif t == ")":
|
| 37 |
+
if expect_operand: raise ValueError(text)
|
| 38 |
+
while ops and ops[-1] != "(": out.append(ops.pop())
|
| 39 |
+
if not ops: raise ValueError(text)
|
| 40 |
+
ops.pop()
|
| 41 |
+
else: # a two-place connective
|
| 42 |
+
if expect_operand: raise ValueError(text)
|
| 43 |
+
while ops and ops[-1] != "(" and (BINDING[ops[-1]] > BINDING[t] or (BINDING[ops[-1]] == BINDING[t] and t not in GROUPS_RIGHT)):
|
| 44 |
+
out.append(ops.pop())
|
| 45 |
+
ops.append(t); expect_operand = True
|
| 46 |
+
if expect_operand: raise ValueError(text)
|
| 47 |
+
while ops:
|
| 48 |
+
if ops[-1] == "(": raise ValueError(text)
|
| 49 |
+
out.append(ops.pop())
|
| 50 |
+
return out
|
| 51 |
+
|
| 52 |
+
def run(rpn, val):
|
| 53 |
+
st = []
|
| 54 |
+
for t in rpn:
|
| 55 |
+
if t == "~": st.append(not st.pop())
|
| 56 |
+
elif t in BINDING:
|
| 57 |
+
y = st.pop(); x = st.pop()
|
| 58 |
+
st.append((x and y) if t == "&" else (x or y) if t == "|" else ((not x) or y) if t == "->" else (x == y))
|
| 59 |
+
else: st.append(val[t])
|
| 60 |
+
assert len(st) == 1
|
| 61 |
+
return st[0]
|
| 62 |
+
|
| 63 |
+
def letters(rpns):
|
| 64 |
+
return sorted(set(t for rpn in rpns for t in rpn if t not in BINDING))
|
| 65 |
+
|
| 66 |
+
def all_rows(atoms):
|
| 67 |
+
rows = []
|
| 68 |
+
for k in range(2 ** len(atoms)):
|
| 69 |
+
rows.append(dict((a, bool((k >> i) & 1)) for i, a in enumerate(atoms)))
|
| 70 |
+
return rows
|
| 71 |
+
|
| 72 |
+
def load(name):
|
| 73 |
+
with open(name) as f: return json.load(f)
|
| 74 |
+
|
| 75 |
+
def validity():
|
| 76 |
+
ans = {"arguments": {}, "valid_ids": []}
|
| 77 |
+
for arg in load("arguments.json"):
|
| 78 |
+
prem = [to_rpn(p) for p in arg["premises"]]; concl = to_rpn(arg["conclusion"])
|
| 79 |
+
rows = all_rows(letters(prem + [concl]))
|
| 80 |
+
def bad_rows(ps):
|
| 81 |
+
return [v for v in rows if all(run(p, v) for p in ps) and not run(concl, v)]
|
| 82 |
+
p_true = sum(1 for v in rows if all(run(p, v) for p in prem))
|
| 83 |
+
cex = bad_rows(prem)
|
| 84 |
+
rec = {"valid": not cex, "premise_true_rows": p_true, "counterexample_rows": len(cex), "counterexample": cex[0] if cex else None}
|
| 85 |
+
if not cex:
|
| 86 |
+
rec["essential_premises"] = [i + 1 for i in range(len(prem)) if bad_rows(prem[:i] + prem[i + 1:])]
|
| 87 |
+
ans["valid_ids"].append(arg["id"])
|
| 88 |
+
ans["arguments"][arg["id"]] = rec
|
| 89 |
+
return ans
|
| 90 |
+
|
| 91 |
+
def consistency():
|
| 92 |
+
ans = {"sets": {}, "unsatisfiable_ids": []}
|
| 93 |
+
for s in load("sentence_sets.json"):
|
| 94 |
+
sents = [to_rpn(x) for x in s["sentences"]]
|
| 95 |
+
atoms = letters(sents); rows = all_rows(atoms)
|
| 96 |
+
truth = [[run(x, v) for x in sents] for v in rows]
|
| 97 |
+
models = [v for v, t in zip(rows, truth) if all(t)]
|
| 98 |
+
rec = {"satisfiable": bool(models), "models": len(models), "most_true_together": max(sum(t) for t in truth),
|
| 99 |
+
"valuation": models[0] if models else None}
|
| 100 |
+
if models:
|
| 101 |
+
rec["forced_true"] = [a for a in atoms if all(m[a] for m in models)]
|
| 102 |
+
rec["forced_false"] = [a for a in atoms if not any(m[a] for m in models)]
|
| 103 |
+
else:
|
| 104 |
+
rec["restoring"] = [i + 1 for i in range(len(sents)) if any(all(t[:i] + t[i + 1:]) for t in truth)]
|
| 105 |
+
ans["unsatisfiable_ids"].append(s["id"])
|
| 106 |
+
ans["sets"][s["id"]] = rec
|
| 107 |
+
return ans
|
| 108 |
+
|
| 109 |
+
def lit(atom, positive):
|
| 110 |
+
return atom if positive else "~" + atom
|
| 111 |
+
|
| 112 |
+
def equivalence():
|
| 113 |
+
ans = {"pairs": {}, "equivalent_ids": []}
|
| 114 |
+
for p in load("pairs.json"):
|
| 115 |
+
left, right = to_rpn(p["left"]), to_rpn(p["right"])
|
| 116 |
+
rows = all_rows(letters([left, right]))
|
| 117 |
+
l_only = [v for v in rows if run(left, v) and not run(right, v)]
|
| 118 |
+
r_only = [v for v in rows if run(right, v) and not run(left, v)]
|
| 119 |
+
same = not l_only and not r_only
|
| 120 |
+
ans["pairs"][p["id"]] = {
|
| 121 |
+
"equivalent": same, "left_models": sum(1 for v in rows if run(left, v)), "right_models": sum(1 for v in rows if run(right, v)),
|
| 122 |
+
"left_only_rows": len(l_only),
|
| 123 |
+
"relation": "equivalent" if same else "left-entails-right" if not l_only else "right-entails-left" if not r_only else "neither",
|
| 124 |
+
"distinguishing": None if same else (l_only + r_only)[0]}
|
| 125 |
+
if same: ans["equivalent_ids"].append(p["id"])
|
| 126 |
+
if os.path.exists("convert.json"):
|
| 127 |
+
ans["cnf"], ans["dnf"] = {}, {}
|
| 128 |
+
for c in load("convert.json"):
|
| 129 |
+
f = to_rpn(c["formula"]); atoms = letters([f]); rows = all_rows(atoms)
|
| 130 |
+
# one clause per false row (the clause is false in exactly that row); one term per true row
|
| 131 |
+
clauses = ["(" + " | ".join(lit(a, not v[a]) for a in atoms) + ")" for v in rows if not run(f, v)]
|
| 132 |
+
terms = ["(" + " & ".join(lit(a, v[a]) for a in atoms) + ")" for v in rows if run(f, v)]
|
| 133 |
+
ans["cnf"][c["id"]] = " & ".join(clauses)
|
| 134 |
+
ans["dnf"][c["id"]] = " | ".join(terms)
|
| 135 |
+
return ans
|
| 136 |
+
|
| 137 |
+
def main():
|
| 138 |
+
if os.path.exists("arguments.json"): answer = validity()
|
| 139 |
+
elif os.path.exists("sentence_sets.json"): answer = consistency()
|
| 140 |
+
else: answer = equivalence()
|
| 141 |
+
with open("answer.json", "w") as f: json.dump(answer, f, indent=1)
|
| 142 |
+
|
| 143 |
+
if __name__ == "__main__":
|
| 144 |
+
main()
|
envs/argument_check/validators.py
ADDED
|
@@ -0,0 +1,152 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Custom checks for Argument Check. Standalone, standard library only.
|
| 2 |
+
|
| 3 |
+
Every function reads the candidate from the answer, evaluates the formulas of the problem itself
|
| 4 |
+
(the formulas arrive in `args` as text) and returns True only if the candidate really has the
|
| 5 |
+
property asked for. Nothing is compared with a stored solution. Malformed answers return False.
|
| 6 |
+
"""
|
| 7 |
+
|
| 8 |
+
_LEVEL = {"<->": 1, "->": 2, "|": 3, "&": 4}
|
| 9 |
+
_MAX_LEN = 2000
|
| 10 |
+
|
| 11 |
+
class _Bad(Exception):
|
| 12 |
+
pass
|
| 13 |
+
|
| 14 |
+
def _scan(text):
|
| 15 |
+
if not isinstance(text, str): raise _Bad()
|
| 16 |
+
toks, i, n = [], 0, len(text)
|
| 17 |
+
while i < n:
|
| 18 |
+
c = text[i]
|
| 19 |
+
if c == " " or c == "\t": i += 1
|
| 20 |
+
elif c == "<" and text[i:i + 3] == "<->": toks.append("<->"); i += 3
|
| 21 |
+
elif c == "-" and text[i:i + 2] == "->": toks.append("->"); i += 2
|
| 22 |
+
elif c in ("~", "&", "|", "(", ")"): toks.append(c); i += 1
|
| 23 |
+
elif c in "ABCDEFGHIJKLMNOPQRSTUVWXYZ": toks.append(c); i += 1
|
| 24 |
+
else: raise _Bad()
|
| 25 |
+
return toks
|
| 26 |
+
|
| 27 |
+
def _read(text):
|
| 28 |
+
"""Precedence climbing. Tree nodes: ("atom", A), ("not", x), ("bin", op, x, y)."""
|
| 29 |
+
toks = _scan(text)
|
| 30 |
+
state = {"i": 0}
|
| 31 |
+
def primary():
|
| 32 |
+
i = state["i"]
|
| 33 |
+
if i >= len(toks): raise _Bad()
|
| 34 |
+
t = toks[i]; state["i"] = i + 1
|
| 35 |
+
if t == "~": return ("not", primary())
|
| 36 |
+
if t == "(":
|
| 37 |
+
x = climb(1)
|
| 38 |
+
if state["i"] >= len(toks) or toks[state["i"]] != ")": raise _Bad()
|
| 39 |
+
state["i"] += 1
|
| 40 |
+
return x
|
| 41 |
+
if len(t) == 1 and t.isalpha(): return ("atom", t)
|
| 42 |
+
raise _Bad()
|
| 43 |
+
def climb(min_level):
|
| 44 |
+
left = primary()
|
| 45 |
+
while state["i"] < len(toks):
|
| 46 |
+
op = toks[state["i"]]
|
| 47 |
+
lv = _LEVEL.get(op)
|
| 48 |
+
if lv is None or lv < min_level: break
|
| 49 |
+
state["i"] += 1
|
| 50 |
+
# & and | group to the left, so the right operand must bind tighter; -> and <-> group to the right
|
| 51 |
+
right = climb(lv if op in ("->", "<->") else lv + 1)
|
| 52 |
+
left = ("bin", op, left, right)
|
| 53 |
+
return left
|
| 54 |
+
tree = climb(1)
|
| 55 |
+
if state["i"] != len(toks): raise _Bad()
|
| 56 |
+
return tree
|
| 57 |
+
|
| 58 |
+
def _value(t, v):
|
| 59 |
+
kind = t[0]
|
| 60 |
+
if kind == "atom": return v[t[1]]
|
| 61 |
+
if kind == "not": return not _value(t[1], v)
|
| 62 |
+
op, x, y = t[1], _value(t[2], v), _value(t[3], v)
|
| 63 |
+
if op == "&": return x and y
|
| 64 |
+
if op == "|": return x or y
|
| 65 |
+
if op == "->": return y or not x
|
| 66 |
+
return x is y
|
| 67 |
+
|
| 68 |
+
def _atoms(trees):
|
| 69 |
+
found, stack = set(), list(trees)
|
| 70 |
+
while stack:
|
| 71 |
+
t = stack.pop()
|
| 72 |
+
if t[0] == "atom": found.add(t[1])
|
| 73 |
+
elif t[0] == "not": stack.append(t[1])
|
| 74 |
+
else: stack.append(t[2]); stack.append(t[3])
|
| 75 |
+
return found
|
| 76 |
+
|
| 77 |
+
def _valuation(obj, atoms):
|
| 78 |
+
"""The candidate must be an object with exactly the atoms that occur as keys and booleans as values."""
|
| 79 |
+
if not isinstance(obj, dict) or set(obj.keys()) != set(atoms): return None
|
| 80 |
+
for k in obj:
|
| 81 |
+
if obj[k] is not True and obj[k] is not False: return None
|
| 82 |
+
return obj
|
| 83 |
+
|
| 84 |
+
def _dig(answer, keys):
|
| 85 |
+
cur = answer
|
| 86 |
+
for k in keys:
|
| 87 |
+
if not isinstance(cur, dict) or k not in cur: return None
|
| 88 |
+
cur = cur[k]
|
| 89 |
+
return cur
|
| 90 |
+
|
| 91 |
+
def counterexample(answer, args):
|
| 92 |
+
"""answer.arguments.<id>.counterexample makes every premise true and the conclusion false."""
|
| 93 |
+
try:
|
| 94 |
+
prem = [_read(p) for p in args["premises"]]; concl = _read(args["conclusion"])
|
| 95 |
+
v = _valuation(_dig(answer, ["arguments", args["id"], "counterexample"]), _atoms(prem + [concl]))
|
| 96 |
+
if v is None: return False
|
| 97 |
+
return all(_value(p, v) for p in prem) and not _value(concl, v)
|
| 98 |
+
except Exception:
|
| 99 |
+
return False
|
| 100 |
+
|
| 101 |
+
def satisfying_valuation(answer, args):
|
| 102 |
+
"""answer.sets.<id>.valuation makes every sentence of the set true."""
|
| 103 |
+
try:
|
| 104 |
+
sents = [_read(s) for s in args["sentences"]]
|
| 105 |
+
v = _valuation(_dig(answer, ["sets", args["id"], "valuation"]), _atoms(sents))
|
| 106 |
+
if v is None: return False
|
| 107 |
+
return all(_value(s, v) for s in sents)
|
| 108 |
+
except Exception:
|
| 109 |
+
return False
|
| 110 |
+
|
| 111 |
+
def distinguishing_valuation(answer, args):
|
| 112 |
+
"""answer.pairs.<id>.distinguishing gives the two formulas different truth values."""
|
| 113 |
+
try:
|
| 114 |
+
left, right = _read(args["left"]), _read(args["right"])
|
| 115 |
+
v = _valuation(_dig(answer, ["pairs", args["id"], "distinguishing"]), _atoms([left, right]))
|
| 116 |
+
if v is None: return False
|
| 117 |
+
return _value(left, v) is not _value(right, v)
|
| 118 |
+
except Exception:
|
| 119 |
+
return False
|
| 120 |
+
|
| 121 |
+
def _flatten(t, op):
|
| 122 |
+
parts, stack = [], [t]
|
| 123 |
+
while stack:
|
| 124 |
+
x = stack.pop()
|
| 125 |
+
if x[0] == "bin" and x[1] == op: stack.append(x[3]); stack.append(x[2])
|
| 126 |
+
else: parts.append(x)
|
| 127 |
+
return parts
|
| 128 |
+
|
| 129 |
+
def _is_literal(t):
|
| 130 |
+
return t[0] == "atom" or (t[0] == "not" and t[1][0] == "atom")
|
| 131 |
+
|
| 132 |
+
def normal_form(answer, args):
|
| 133 |
+
"""answer.<form>.<id> is a formula in the normal form asked for (args.form is "cnf" or "dnf"), equivalent to
|
| 134 |
+
args.formula, built only from atoms of args.formula, and at most 2000 characters long."""
|
| 135 |
+
try:
|
| 136 |
+
form = args["form"]
|
| 137 |
+
if form not in ("cnf", "dnf"): return False
|
| 138 |
+
text = _dig(answer, [form, args["id"]])
|
| 139 |
+
if not isinstance(text, str) or len(text) > _MAX_LEN: return False
|
| 140 |
+
orig = _read(args["formula"]); cand = _read(text)
|
| 141 |
+
atoms = sorted(_atoms([orig]))
|
| 142 |
+
if not _atoms([cand]) <= set(atoms): return False
|
| 143 |
+
outer, inner = ("&", "|") if form == "cnf" else ("|", "&")
|
| 144 |
+
for part in _flatten(cand, outer):
|
| 145 |
+
for leaf in _flatten(part, inner):
|
| 146 |
+
if not _is_literal(leaf): return False
|
| 147 |
+
for k in range(2 ** len(atoms)):
|
| 148 |
+
v = dict((a, bool((k >> i) & 1)) for i, a in enumerate(atoms))
|
| 149 |
+
if _value(orig, v) is not _value(cand, v): return False
|
| 150 |
+
return True
|
| 151 |
+
except Exception:
|
| 152 |
+
return False
|
envs/class_test/__init__.py
ADDED
|
File without changes
|
envs/class_test/env.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name = "class-test"
|
| 2 |
+
title = "Class Test"
|
| 3 |
+
isced = "0111"
|
| 4 |
+
summary = "Analyse a class test as a teacher would: mark answer sheets, run item and distractor analysis, and standardise or moderate the marks."
|
| 5 |
+
task_type = "assessment analysis"
|
| 6 |
+
good_for = ["Classical test theory on small classes", "Applying a marking scheme exactly", "Counting and filtering tabular records"]
|
| 7 |
+
families = ["marking", "item-analysis", "distractors", "moderation"]
|
envs/class_test/gen.py
ADDED
|
@@ -0,0 +1,571 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Class Test (ISCED-F 0111 Education science: educational assessment).
|
| 2 |
+
|
| 3 |
+
Four task families, all on synthetic classes (student ids only):
|
| 4 |
+
marking mark multiple-choice answer sheets against a key: per-item marks, negative marking,
|
| 5 |
+
withdrawn items, percentages and grades from grade boundaries
|
| 6 |
+
item-analysis item facility, upper-lower discrimination index (27% groups), KR-20, point-biserial
|
| 7 |
+
distractors option counts per item, non-functioning distractors, items where a distractor beats the key
|
| 8 |
+
moderation rescale marks to a target mean and SD, per teaching group, and adjust markers after
|
| 9 |
+
a moderation sample
|
| 10 |
+
|
| 11 |
+
Methods and sources
|
| 12 |
+
Facility (p value) = proportion correct. Discrimination index D = (U - L) / n with upper and lower
|
| 13 |
+
groups of 27% of the class: Kelley, T. L. (1939). The selection of upper and lower groups for the
|
| 14 |
+
validation of test items. J. Educ. Psychol. 30, 17-24.
|
| 15 |
+
KR-20 = k/(k-1) * (1 - sum(p*q) / variance of totals), population variance: Kuder, G. F. &
|
| 16 |
+
Richardson, M. W. (1937). The theory of the estimation of test reliability. Psychometrika 2, 151-160.
|
| 17 |
+
Point-biserial r = (M1 - M0) / s * sqrt(p*q), s the population SD of the totals (equal to the Pearson
|
| 18 |
+
correlation between the 0/1 item score and the total).
|
| 19 |
+
A distractor chosen by under 5% of candidates is non-functioning: Haladyna, T. M. & Downing, S. M.
|
| 20 |
+
(1993). How many options is enough for a multiple-choice test item? Educ. Psychol. Meas. 53, 999-1010.
|
| 21 |
+
Linear rescaling to a target mean and SD: scaled = target mean + (x - mean) / SD * target SD.
|
| 22 |
+
The flagging thresholds, grade boundaries and the marker-adjustment rule are stated in each task's
|
| 23 |
+
notes file; they are conventions chosen for these tasks.
|
| 24 |
+
"""
|
| 25 |
+
import math
|
| 26 |
+
from practice.core import Task, rng_for, to_csv, c_int, c_num, c_str, c_set, c_list, clear_of
|
| 27 |
+
|
| 28 |
+
ENV = "class-test"
|
| 29 |
+
|
| 30 |
+
def sid_list(r, n): return ["S%03d" % i for i in sorted(r.sample(range(1, 400), n))]
|
| 31 |
+
|
| 32 |
+
# ---------------------------------------------------------------- marking
|
| 33 |
+
def mark_sheet(resp, key, marks, penalty=0.0):
|
| 34 |
+
"""resp: one answer per item ('' = blank). key: the correct option per item, or 'VOID' for a withdrawn item.
|
| 35 |
+
penalty: fraction of the item's marks lost for a wrong answer. Returns the total, never below 0."""
|
| 36 |
+
total = 0.0
|
| 37 |
+
for a, k, m in zip(resp, key, marks):
|
| 38 |
+
if k == "VOID" or a == "": continue
|
| 39 |
+
total += m if a == k else -penalty * m
|
| 40 |
+
return max(0.0, total)
|
| 41 |
+
|
| 42 |
+
def max_marks(key, marks): return sum(m for k, m in zip(key, marks) if k != "VOID")
|
| 43 |
+
|
| 44 |
+
def grade_for(percent, bounds):
|
| 45 |
+
"""bounds: list of (grade, minimum percent), highest first. Below the last minimum the grade is U."""
|
| 46 |
+
for g, lo in bounds:
|
| 47 |
+
if percent >= lo: return g
|
| 48 |
+
return "U"
|
| 49 |
+
|
| 50 |
+
def marking_scheme(d, bounds, penalty):
|
| 51 |
+
L = ["# Marking scheme", "", "Each item has one correct option, given in `answer_key.csv` with the marks it carries.", "",
|
| 52 |
+
"- A correct answer earns the item's marks."]
|
| 53 |
+
if d == 1:
|
| 54 |
+
L += ["- A wrong answer or an unanswered item (empty cell) earns 0."]
|
| 55 |
+
else:
|
| 56 |
+
L += ["- A wrong answer loses %s of the item's marks (negative marking)." % {0.25: "one quarter", 0.5: "one half"}[penalty],
|
| 57 |
+
"- An unanswered item (empty cell) earns 0 and loses nothing.",
|
| 58 |
+
"- If a student's total comes out below 0, it is recorded as 0."]
|
| 59 |
+
if d >= 3:
|
| 60 |
+
L += ["- A cell with more than one letter (for example `BD`) means the student marked more than one option: treat it as a wrong answer.",
|
| 61 |
+
"- An item whose key is `VOID` has been withdrawn. It earns and loses nothing for anyone, and its marks are not part of the maximum."]
|
| 62 |
+
L += ["", "The maximum is the sum of the marks of all items%s. The percentage is the student's total divided by the maximum, times 100." % (" that have not been withdrawn" if d >= 3 else ""),
|
| 63 |
+
"", "## Grade boundaries", "", "The grade is decided on the exact percentage, before any rounding.", "", "| Grade | Percentage |", "|---|---|"]
|
| 64 |
+
for g, lo in bounds: L.append("| %s | %d or more |" % (g, lo))
|
| 65 |
+
L.append("| U | under %d |" % bounds[-1][1])
|
| 66 |
+
return "\n".join(L) + "\n"
|
| 67 |
+
|
| 68 |
+
def gen_marking(seed, d):
|
| 69 |
+
r = rng_for(ENV + "/marking", seed, d)
|
| 70 |
+
k, n = {1: (20, 6), 2: (24, 9), 3: (30, 10)}[d]
|
| 71 |
+
penalty = 0.0 if d == 1 else r.choice([0.25, 0.5])
|
| 72 |
+
key = [r.choice("ABCD") for _ in range(k)]
|
| 73 |
+
marks = [1] * k if d == 1 else [r.choice([1, 1, 2, 2, 3]) for _ in range(k)]
|
| 74 |
+
if d >= 3:
|
| 75 |
+
for j in r.sample(range(k), r.randint(1, 2)): key[j] = "VOID"
|
| 76 |
+
bounds = [("A", r.choice([75, 80])), ("B", r.choice([60, 65])), ("C", r.choice([50, 55])), ("D", r.choice([35, 40, 45]))]
|
| 77 |
+
top = max_marks(key, marks)
|
| 78 |
+
sids = sid_list(r, n)
|
| 79 |
+
sheets, res = {}, {}
|
| 80 |
+
for i, s in enumerate(sids):
|
| 81 |
+
while True:
|
| 82 |
+
p = r.choice([0.3, 0.45, 0.55, 0.65, 0.75, 0.85, 0.93]) if i else 0.15 # the first student mostly guesses
|
| 83 |
+
resp = []
|
| 84 |
+
for j in range(k):
|
| 85 |
+
right = key[j] if key[j] != "VOID" else r.choice("ABCD")
|
| 86 |
+
u = r.random()
|
| 87 |
+
if u < p: a = right
|
| 88 |
+
elif u < p + (1 - p) * (0.15 if d == 1 else 0.3): a = ""
|
| 89 |
+
else: a = r.choice([x for x in "ABCD" if x != right])
|
| 90 |
+
if d >= 3 and a and r.random() < 0.04: a = "".join(sorted(set([a, r.choice("ABCD")]) | set(r.choice("ABCD"))))
|
| 91 |
+
resp.append(a)
|
| 92 |
+
total = mark_sheet(resp, key, marks, penalty)
|
| 93 |
+
pct = 100.0 * total / top
|
| 94 |
+
if clear_of(pct, [b for _, b in bounds], 0.5): break
|
| 95 |
+
sheets[s] = resp; res[s] = (total, pct, grade_for(pct, bounds))
|
| 96 |
+
order = sids[:]; r.shuffle(order)
|
| 97 |
+
rows = []
|
| 98 |
+
for s in order:
|
| 99 |
+
row = {"student_id": s, "form": r.choice(["9A", "9B"])}
|
| 100 |
+
for j in range(k): row["Q%d" % (j + 1)] = sheets[s][j]
|
| 101 |
+
rows.append(row)
|
| 102 |
+
krows = [{"item": "Q%d" % (j + 1), "key": key[j], "marks": marks[j]} for j in range(k)]
|
| 103 |
+
checks = [c_int("max_marks", top)]
|
| 104 |
+
for s in sids:
|
| 105 |
+
total, pct, g = res[s]
|
| 106 |
+
checks.append(c_int("students.%s.marks" % s, total) if d == 1 else c_num("students.%s.marks" % s, total, 2))
|
| 107 |
+
checks += [c_num("students.%s.percent" % s, pct, 1), c_str("students.%s.grade" % s, g)]
|
| 108 |
+
checks.append(c_set("grade_u", [s for s in sids if res[s][2] == "U"], weight=2))
|
| 109 |
+
lines = ["- `max_marks`: the maximum total, an integer.",
|
| 110 |
+
"- `students`: an object keyed by student id. Each value has",
|
| 111 |
+
" - `marks`: the student's total, %s." % ("an integer" if d == 1 else "2 decimals"),
|
| 112 |
+
" - `percent`: the percentage, 1 decimal.",
|
| 113 |
+
" - `grade`: one of `A`, `B`, `C`, `D`, `U`.",
|
| 114 |
+
"- `grade_u`: list of the student ids with grade `U` (any order; an empty list if none)."]
|
| 115 |
+
if d >= 3:
|
| 116 |
+
for g in "ABCDU": checks.append(c_int("grade_counts.%s" % g, sum(1 for s in sids if res[s][2] == g)))
|
| 117 |
+
checks.append(c_num("mean_percent", sum(res[s][1] for s in sids) / n, 1))
|
| 118 |
+
lines += ["- `grade_counts`: an object with the keys `A`, `B`, `C`, `D`, `U`, each the number of students with that grade (0 if none).",
|
| 119 |
+
"- `mean_percent`: the mean of the students' unrounded percentages, 1 decimal."]
|
| 120 |
+
inst = """# Class test: marking
|
| 121 |
+
|
| 122 |
+
`answer_sheets.csv` holds the answer sheets of %d students for a %d-item multiple-choice test. `answer_key.csv` gives the key and the marks for each item. `marking_scheme.md` gives the marking rules and the grade boundaries: follow it exactly.
|
| 123 |
+
|
| 124 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 125 |
+
|
| 126 |
+
%s
|
| 127 |
+
|
| 128 |
+
Numbers are accepted within one unit of the last decimal place asked for.
|
| 129 |
+
""" % (n, k, "\n".join(lines))
|
| 130 |
+
files = {"answer_sheets.csv": to_csv(rows, ["student_id", "form"] + ["Q%d" % (j + 1) for j in range(k)]),
|
| 131 |
+
"answer_key.csv": to_csv(krows, ["item", "key", "marks"]), "marking_scheme.md": marking_scheme(d, bounds, penalty)}
|
| 132 |
+
return Task(ENV, "marking", seed, d, "Mark a %d-item test for %d students" % (k, n), inst, files, checks, {"students": n, "items": k})
|
| 133 |
+
|
| 134 |
+
# ---------------------------------------------------------------- item analysis
|
| 135 |
+
def facility(matrix, j):
|
| 136 |
+
return sum(row[j] for row in matrix) / float(len(matrix))
|
| 137 |
+
|
| 138 |
+
def group_size(n):
|
| 139 |
+
"""27% of the class, rounded to the nearest whole number (half up)."""
|
| 140 |
+
return int(math.floor(0.27 * n + 0.5))
|
| 141 |
+
|
| 142 |
+
def ranked(ids, matrix):
|
| 143 |
+
"""Indices of the students, highest total first; equal totals in ascending order of student id."""
|
| 144 |
+
return sorted(range(len(ids)), key=lambda i: (-sum(matrix[i]), ids[i]))
|
| 145 |
+
|
| 146 |
+
def discrimination(ids, matrix, j):
|
| 147 |
+
g = group_size(len(ids)); order = ranked(ids, matrix)
|
| 148 |
+
up = sum(matrix[i][j] for i in order[:g]); low = sum(matrix[i][j] for i in order[-g:])
|
| 149 |
+
return (up - low) / float(g)
|
| 150 |
+
|
| 151 |
+
def var_p(xs):
|
| 152 |
+
"""Population variance (N in the denominator)."""
|
| 153 |
+
m = sum(xs) / float(len(xs))
|
| 154 |
+
return sum((x - m) ** 2 for x in xs) / float(len(xs))
|
| 155 |
+
|
| 156 |
+
def kr20(matrix):
|
| 157 |
+
k = len(matrix[0])
|
| 158 |
+
pq = sum(facility(matrix, j) * (1 - facility(matrix, j)) for j in range(k))
|
| 159 |
+
return k / (k - 1.0) * (1.0 - pq / var_p([sum(row) for row in matrix]))
|
| 160 |
+
|
| 161 |
+
def point_biserial(matrix, j):
|
| 162 |
+
tot = [sum(row) for row in matrix]
|
| 163 |
+
one = [t for t, row in zip(tot, matrix) if row[j] == 1]; zero = [t for t, row in zip(tot, matrix) if row[j] == 0]
|
| 164 |
+
p = len(one) / float(len(matrix))
|
| 165 |
+
return (sum(one) / float(len(one)) - sum(zero) / float(len(zero))) / math.sqrt(var_p(tot)) * math.sqrt(p * (1 - p))
|
| 166 |
+
|
| 167 |
+
def item_notes(d):
|
| 168 |
+
t = """# Item analysis: definitions
|
| 169 |
+
|
| 170 |
+
A student's item score is 1 if the answer is correct and 0 otherwise%s. A student's total is the sum of the item scores. `N` is the number of students%s.
|
| 171 |
+
|
| 172 |
+
## Facility
|
| 173 |
+
|
| 174 |
+
The facility of an item is the proportion of the `N` students who got it right.
|
| 175 |
+
|
| 176 |
+
## Discrimination index
|
| 177 |
+
|
| 178 |
+
1. Put the students in order of total, highest first. Students with the same total are ordered by student id, ascending (`S012` before `S105`).
|
| 179 |
+
2. The group size `n_group` is 27%% of `N`, rounded to the nearest whole number (round half up).
|
| 180 |
+
3. The upper group is the first `n_group` students in that order and the lower group is the last `n_group` students.
|
| 181 |
+
4. Discrimination = (number in the upper group who got the item right - number in the lower group who got it right) / `n_group`.
|
| 182 |
+
|
| 183 |
+
An item has poor discrimination if its discrimination index is below 0.20.
|
| 184 |
+
""" % ("" if d == 1 else " (an empty cell is an unanswered item and counts as wrong)", "" if d < 3 else " who sat the test. Rows with status `absent` are not part of the analysis")
|
| 185 |
+
if d >= 2:
|
| 186 |
+
t += """
|
| 187 |
+
## Easy and hard items
|
| 188 |
+
|
| 189 |
+
An item is too easy if its facility is above 0.85 and too hard if its facility is below 0.30.
|
| 190 |
+
|
| 191 |
+
## KR-20 reliability
|
| 192 |
+
|
| 193 |
+
With `k` items, facility `p_j` for item `j`, and `var` the variance of the students' totals computed with `N` in the denominator (population variance):
|
| 194 |
+
|
| 195 |
+
KR-20 = k / (k - 1) * (1 - sum over items of p_j * (1 - p_j) / var)
|
| 196 |
+
|
| 197 |
+
(the sum is taken first, then divided by `var`).
|
| 198 |
+
"""
|
| 199 |
+
if d >= 3:
|
| 200 |
+
t += """
|
| 201 |
+
## Point-biserial correlation
|
| 202 |
+
|
| 203 |
+
For an item with facility `p`, let `M1` be the mean total of the students who got it right, `M0` the mean total of the students who got it wrong, and `s` the standard deviation of all `N` totals (square root of the population variance above). The total includes the item itself.
|
| 204 |
+
|
| 205 |
+
r_pb = (M1 - M0) / s * sqrt(p * (1 - p))
|
| 206 |
+
|
| 207 |
+
An item needs review if its point-biserial is below 0.20.
|
| 208 |
+
"""
|
| 209 |
+
return t
|
| 210 |
+
|
| 211 |
+
def gen_items(seed, d):
|
| 212 |
+
r = rng_for(ENV + "/item-analysis", seed, d)
|
| 213 |
+
k = {1: 8, 2: 10, 3: 10}[d]
|
| 214 |
+
while True:
|
| 215 |
+
n = r.randint(18, 26) if d == 1 else r.randint(30, 45)
|
| 216 |
+
if abs((0.27 * n) % 1 - 0.5) > 0.1: break
|
| 217 |
+
ids = sid_list(r, n)
|
| 218 |
+
while True:
|
| 219 |
+
b = [r.uniform(-1.2, 1.2) for _ in range(k)]; a = [r.uniform(0.8, 2.0) for _ in range(k)]
|
| 220 |
+
special = r.sample(range(k), 3)
|
| 221 |
+
b[special[0]] = -2.6 # an easy item
|
| 222 |
+
if d >= 2: b[special[1]] = 2.2 # a hard item
|
| 223 |
+
a[special[2]] = r.choice([0.0, 0.1, -0.5]) # an item that does not discriminate
|
| 224 |
+
matrix = []
|
| 225 |
+
for _ in ids:
|
| 226 |
+
th = r.gauss(0, 1)
|
| 227 |
+
matrix.append([1 if r.random() < 1.0 / (1.0 + math.exp(-a[j] * (th - b[j]))) else 0 for j in range(k)])
|
| 228 |
+
fac = [facility(matrix, j) for j in range(k)]
|
| 229 |
+
if not all(0 < f < 1 and clear_of(f, [0.30, 0.85], 0.012) for f in fac): continue
|
| 230 |
+
dis = [discrimination(ids, matrix, j) for j in range(k)]
|
| 231 |
+
if not all(clear_of(x, [0.20], 0.02) for x in dis): continue
|
| 232 |
+
if var_p([sum(row) for row in matrix]) < 1.0: continue
|
| 233 |
+
pb = [point_biserial(matrix, j) for j in range(k)]
|
| 234 |
+
if d >= 3 and not all(clear_of(x, [0.20], 0.02) for x in pb): continue
|
| 235 |
+
if not any(x < 0.20 for x in dis): continue
|
| 236 |
+
break
|
| 237 |
+
items = ["Q%d" % (j + 1) for j in range(k)]
|
| 238 |
+
files = {"item_analysis_notes.md": item_notes(d)}
|
| 239 |
+
if d == 1:
|
| 240 |
+
rows = [dict([("student_id", s)] + list(zip(items, matrix[i]))) for i, s in enumerate(ids)]
|
| 241 |
+
r.shuffle(rows)
|
| 242 |
+
files["scores.csv"] = to_csv(rows, ["student_id"] + items)
|
| 243 |
+
else:
|
| 244 |
+
key = [r.choice("ABCD") for _ in range(k)]
|
| 245 |
+
rows = []
|
| 246 |
+
for i, s in enumerate(ids):
|
| 247 |
+
row = {"student_id": s, "class": r.choice(["8X", "8Y"]), "status": "present"}
|
| 248 |
+
for j in range(k):
|
| 249 |
+
row[items[j]] = key[j] if matrix[i][j] else ("" if r.random() < 0.08 else r.choice([x for x in "ABCD" if x != key[j]]))
|
| 250 |
+
rows.append(row)
|
| 251 |
+
if d >= 3:
|
| 252 |
+
for s in ["S%03d" % x for x in r.sample(range(400, 500), r.randint(2, 4))]:
|
| 253 |
+
row = {"student_id": s, "class": r.choice(["8X", "8Y"]), "status": "absent"}
|
| 254 |
+
for q in items: row[q] = ""
|
| 255 |
+
rows.append(row)
|
| 256 |
+
r.shuffle(rows)
|
| 257 |
+
files["responses.csv"] = to_csv(rows, ["student_id", "class"] + (["status"] if d >= 3 else []) + items)
|
| 258 |
+
files["key.csv"] = to_csv([{"item": q, "key": key[j]} for j, q in enumerate(items)], ["item", "key"])
|
| 259 |
+
checks = [c_int("n_group", group_size(n))]
|
| 260 |
+
for j, q in enumerate(items):
|
| 261 |
+
checks += [c_num("items.%s.facility" % q, fac[j], 3), c_num("items.%s.discrimination" % q, dis[j], 3)]
|
| 262 |
+
if d >= 3: checks.append(c_num("items.%s.point_biserial" % q, pb[j], 3))
|
| 263 |
+
checks.append(c_set("poor_discrimination", [q for j, q in enumerate(items) if dis[j] < 0.20], weight=2))
|
| 264 |
+
lines = ["- `n_group`: the size of the upper group (and of the lower group), an integer.",
|
| 265 |
+
"- `items`: an object keyed by item (`Q1` to `Q%d`). Each value has" % k,
|
| 266 |
+
" - `facility`: 3 decimals.", " - `discrimination`: the discrimination index, 3 decimals."]
|
| 267 |
+
if d >= 3: lines.append(" - `point_biserial`: 3 decimals.")
|
| 268 |
+
lines.append("- `poor_discrimination`: list of the items with poor discrimination (any order; an empty list if none).")
|
| 269 |
+
if d >= 2:
|
| 270 |
+
checks += [c_set("too_easy", [q for j, q in enumerate(items) if fac[j] > 0.85], weight=2),
|
| 271 |
+
c_set("too_hard", [q for j, q in enumerate(items) if fac[j] < 0.30], weight=2), c_num("kr20", kr20(matrix), 3, weight=2)]
|
| 272 |
+
lines += ["- `too_easy`: list of the items that are too easy (any order; an empty list if none).",
|
| 273 |
+
"- `too_hard`: list of the items that are too hard (any order; an empty list if none).",
|
| 274 |
+
"- `kr20`: the KR-20 reliability of the test, 3 decimals."]
|
| 275 |
+
if d >= 3:
|
| 276 |
+
checks += [c_int("n_students", n), c_set("needs_review", [q for j, q in enumerate(items) if pb[j] < 0.20], weight=2)]
|
| 277 |
+
lines += ["- `n_students`: the number of students in the analysis, an integer.",
|
| 278 |
+
"- `needs_review`: list of the items whose point-biserial is below 0.20 (any order; an empty list if none)."]
|
| 279 |
+
src = "`scores.csv` holds the item scores (1 right, 0 wrong) of %d students on a %d-item test" % (n, k) if d == 1 else \
|
| 280 |
+
"`responses.csv` holds the options chosen by the students of two classes on a %d-item multiple-choice test, and `key.csv` the correct options" % k
|
| 281 |
+
inst = """# Class test: item analysis
|
| 282 |
+
|
| 283 |
+
%s. The rows are in no particular order. `item_analysis_notes.md` defines every statistic: follow it exactly.%s
|
| 284 |
+
|
| 285 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 286 |
+
|
| 287 |
+
%s
|
| 288 |
+
|
| 289 |
+
Numbers are accepted within one unit of the last decimal place asked for.
|
| 290 |
+
""" % (src, " Analyse the two classes together as one group." if d >= 2 else "", "\n".join(lines))
|
| 291 |
+
return Task(ENV, "item-analysis", seed, d, "Item analysis of a %d-item test" % k, inst, files, checks, {"students": n, "items": k})
|
| 292 |
+
|
| 293 |
+
# ---------------------------------------------------------------- distractors
|
| 294 |
+
def option_counts(responses, options):
|
| 295 |
+
"""responses: one string per student ('' = omitted). Returns the count for each option, in order."""
|
| 296 |
+
return [sum(1 for a in responses if a == o) for o in options]
|
| 297 |
+
|
| 298 |
+
def non_functioning(counts, options, key, n):
|
| 299 |
+
"""Distractors chosen by under 5% of the n students."""
|
| 300 |
+
return [o for o, c in zip(options, counts) if o != key and 20 * c < n]
|
| 301 |
+
|
| 302 |
+
def beaten(counts, options, key):
|
| 303 |
+
kc = counts[options.index(key)]
|
| 304 |
+
return any(c > kc for o, c in zip(options, counts) if o != key)
|
| 305 |
+
|
| 306 |
+
def distractor_notes(d):
|
| 307 |
+
t = """# Distractor analysis: definitions
|
| 308 |
+
|
| 309 |
+
For each item, the key is the correct option and the other options are its distractors. `N` is the number of students who sat the test%s.
|
| 310 |
+
|
| 311 |
+
- The count of an option is the number of students who chose it.
|
| 312 |
+
- A distractor is non-functioning if it was chosen by under 5%% of the `N` students (count divided by `N` below 0.05).
|
| 313 |
+
- A distractor beats the key if it was chosen by more students than the key was.
|
| 314 |
+
""" % (" (an empty cell means the student left the item out; such students still count in `N`)" if d >= 2 else "")
|
| 315 |
+
if d >= 3:
|
| 316 |
+
t += "- Rows with status `absent` did not sit the test: they are not part of `N` or of any count.\n- Some items have five options (A to E); `key.csv` gives the number of options of each item.\n"
|
| 317 |
+
return t
|
| 318 |
+
|
| 319 |
+
def gen_distractors(seed, d):
|
| 320 |
+
r = rng_for(ENV + "/distractors", seed, d)
|
| 321 |
+
k = {1: 6, 2: 8, 3: 7}[d]
|
| 322 |
+
while True:
|
| 323 |
+
n = r.randint(32, 58) if d == 1 else r.randint(45, 95)
|
| 324 |
+
if n % 20: break
|
| 325 |
+
items = ["Q%d" % (j + 1) for j in range(k)]
|
| 326 |
+
while True:
|
| 327 |
+
spec, cols, ok = [], [], True
|
| 328 |
+
for j in range(k):
|
| 329 |
+
opts = "ABCDE" if (d >= 3 and r.random() < 0.4) else "ABCD"
|
| 330 |
+
key = r.choice(opts)
|
| 331 |
+
dist = [o for o in opts if o != key]; r.shuffle(dist)
|
| 332 |
+
kind = r.choice(["normal", "normal", "dead", "dead", "beaten", "two-dead"])
|
| 333 |
+
w = {key: r.uniform(0.5, 0.75)}
|
| 334 |
+
rest = [r.uniform(0.5, 1.5) for _ in dist]
|
| 335 |
+
if kind in ("dead", "two-dead"): rest[0] = r.choice([0.0, 0.03, 0.06])
|
| 336 |
+
if kind == "two-dead": rest[1] = r.choice([0.0, 0.04])
|
| 337 |
+
if kind == "beaten": w[key] = r.uniform(0.2, 0.3); rest[0] = 3.5
|
| 338 |
+
for o, x in zip(dist, rest): w[o] = (1 - w[key]) * x / sum(rest)
|
| 339 |
+
omit = 0.0 if d == 1 else r.choice([0.0, 0.03, 0.08])
|
| 340 |
+
col = []
|
| 341 |
+
for _ in range(n):
|
| 342 |
+
u = r.random()
|
| 343 |
+
if u < omit: col.append(""); continue
|
| 344 |
+
u = r.random(); acc = 0.0; pick = opts[-1]
|
| 345 |
+
for o in opts:
|
| 346 |
+
acc += w[o]
|
| 347 |
+
if u < acc: pick = o; break
|
| 348 |
+
col.append(pick)
|
| 349 |
+
cnt = option_counts(col, opts)
|
| 350 |
+
dc = sorted([c for o, c in zip(opts, cnt) if o != key], reverse=True)
|
| 351 |
+
if dc[0] == cnt[opts.index(key)] or (d >= 3 and dc[0] == dc[1]): ok = False
|
| 352 |
+
spec.append((opts, key)); cols.append(col)
|
| 353 |
+
if not ok: continue
|
| 354 |
+
nf = [non_functioning(option_counts(cols[j], spec[j][0]), spec[j][0], spec[j][1], n) for j in range(k)]
|
| 355 |
+
bt = [beaten(option_counts(cols[j], spec[j][0]), spec[j][0], spec[j][1]) for j in range(k)]
|
| 356 |
+
if 1 <= sum(1 for x in nf if x) < k and 1 <= sum(bt) < k and (d == 1 or any("" in c for c in cols)): break
|
| 357 |
+
ids = sid_list(r, n)
|
| 358 |
+
rows = []
|
| 359 |
+
for i, s in enumerate(ids):
|
| 360 |
+
row = {"student_id": s, "class": r.choice(["10P", "10Q", "10R"]), "status": "present"}
|
| 361 |
+
for j, q in enumerate(items): row[q] = cols[j][i]
|
| 362 |
+
rows.append(row)
|
| 363 |
+
if d >= 3:
|
| 364 |
+
for s in ["S%03d" % x for x in r.sample(range(400, 500), r.randint(2, 5))]:
|
| 365 |
+
row = {"student_id": s, "class": r.choice(["10P", "10Q", "10R"]), "status": "absent"}
|
| 366 |
+
for q in items: row[q] = ""
|
| 367 |
+
rows.append(row)
|
| 368 |
+
r.shuffle(rows)
|
| 369 |
+
krows = [{"item": q, "key": spec[j][1], "n_options": len(spec[j][0])} for j, q in enumerate(items)]
|
| 370 |
+
checks = []
|
| 371 |
+
for j, q in enumerate(items):
|
| 372 |
+
opts, key = spec[j]; cnt = option_counts(cols[j], opts)
|
| 373 |
+
checks += [c_list("items.%s.counts" % q, cnt, item="int"), c_set("items.%s.non_functioning" % q, nf[j])]
|
| 374 |
+
if d >= 2:
|
| 375 |
+
checks += [c_int("items.%s.omitted" % q, cols[j].count("")), c_num("items.%s.key_pct" % q, 100.0 * cnt[opts.index(key)] / n, 1)]
|
| 376 |
+
if d >= 3:
|
| 377 |
+
best = max((c, o) for o, c in zip(opts, cnt) if o != key)[1]
|
| 378 |
+
checks.append(c_str("items.%s.top_distractor" % q, best))
|
| 379 |
+
checks += [c_set("has_non_functioning", [q for j, q in enumerate(items) if nf[j]], weight=2),
|
| 380 |
+
c_set("key_beaten", [q for j, q in enumerate(items) if bt[j]], weight=2)]
|
| 381 |
+
lines = ["- `items`: an object keyed by item (`Q1` to `Q%d`). Each value has" % k,
|
| 382 |
+
" - `counts`: a list of integers, the count of each option in the order A, B, C, D%s." % (" (and E for a five-option item)" if d >= 3 else ""),
|
| 383 |
+
" - `non_functioning`: a list of the option letters of the item's non-functioning distractors (any order; an empty list if none)."]
|
| 384 |
+
if d >= 2:
|
| 385 |
+
lines += [" - `omitted`: the number of students who left the item out, an integer.",
|
| 386 |
+
" - `key_pct`: the percentage of the `N` students who chose the key, 1 decimal."]
|
| 387 |
+
if d >= 3: lines.append(" - `top_distractor`: the letter of the distractor chosen by the most students.")
|
| 388 |
+
lines += ["- `has_non_functioning`: list of the items that have at least one non-functioning distractor (any order).",
|
| 389 |
+
"- `key_beaten`: list of the items where at least one distractor beats the key (any order)."]
|
| 390 |
+
if d >= 3:
|
| 391 |
+
checks.append(c_int("n_students", n)); lines.append("- `n_students`: `N`, an integer.")
|
| 392 |
+
inst = """# Class test: distractor analysis
|
| 393 |
+
|
| 394 |
+
`responses.csv` holds the option each student chose on each of the %d items of a multiple-choice test (three classes, rows in no particular order). `key.csv` gives the correct option of each item. `distractor_notes.md` gives the definitions: follow them exactly. Analyse all classes together.
|
| 395 |
+
|
| 396 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 397 |
+
|
| 398 |
+
%s
|
| 399 |
+
|
| 400 |
+
Numbers are accepted within one unit of the last decimal place asked for.
|
| 401 |
+
""" % (k, "\n".join(lines))
|
| 402 |
+
files = {"responses.csv": to_csv(rows, ["student_id", "class"] + (["status"] if d >= 3 else []) + items),
|
| 403 |
+
"key.csv": to_csv(krows, ["item", "key"] + (["n_options"] if d >= 3 else [])), "distractor_notes.md": distractor_notes(d)}
|
| 404 |
+
return Task(ENV, "distractors", seed, d, "Distractor analysis of a %d-item test" % k, inst, files, checks, {"students": n, "items": k})
|
| 405 |
+
|
| 406 |
+
# ---------------------------------------------------------------- moderation
|
| 407 |
+
def pmean(xs): return sum(xs) / float(len(xs))
|
| 408 |
+
def psd(xs): return math.sqrt(var_p(xs))
|
| 409 |
+
|
| 410 |
+
def rescale(x, mean, sd, target_mean, target_sd, top=None):
|
| 411 |
+
"""Linear rescaling; if `top` is given the result is limited to the range 0 to top."""
|
| 412 |
+
y = target_mean + (x - mean) / sd * target_sd
|
| 413 |
+
if top is not None: y = min(float(top), max(0.0, y))
|
| 414 |
+
return y
|
| 415 |
+
|
| 416 |
+
def marker_adjustment(pairs, tolerance):
|
| 417 |
+
"""pairs: (marker's mark, moderator's mark) for the sampled scripts of one marker.
|
| 418 |
+
Returns (mean difference moderator - marker, amount added to all that marker's marks)."""
|
| 419 |
+
diff = pmean([m - x for x, m in pairs])
|
| 420 |
+
return diff, (diff if abs(diff) > tolerance else 0.0)
|
| 421 |
+
|
| 422 |
+
def moderation_notes(d, top, tm, ts, tol):
|
| 423 |
+
t = """# Standardising marks
|
| 424 |
+
|
| 425 |
+
The test is marked out of %d.
|
| 426 |
+
|
| 427 |
+
## Rescaling to a target mean and standard deviation
|
| 428 |
+
|
| 429 |
+
The target mean is %d and the target standard deviation is %d. For a set of marks with mean `M` and standard deviation `SD`, a mark `x` becomes
|
| 430 |
+
|
| 431 |
+
scaled = %d + (x - M) / SD * %d
|
| 432 |
+
|
| 433 |
+
`SD` is the population standard deviation: the square root of the mean squared deviation from `M`, with the number of marks in the denominator (not one less).
|
| 434 |
+
""" % (top, tm, ts, tm, ts)
|
| 435 |
+
if d == 2:
|
| 436 |
+
t += """
|
| 437 |
+
Each teaching group is rescaled separately, with its own `M` and `SD`. A student with no mark was absent and is left out of everything.
|
| 438 |
+
|
| 439 |
+
A scaled mark above %d is set to %d, and a scaled mark below 0 is set to 0.
|
| 440 |
+
""" % (top, top)
|
| 441 |
+
if d >= 3:
|
| 442 |
+
t += """
|
| 443 |
+
## Step 1: moderation of markers
|
| 444 |
+
|
| 445 |
+
A moderator has re-marked a sample of each marker's scripts (`moderation_sample.csv`). For each marker:
|
| 446 |
+
|
| 447 |
+
1. For each sampled script of that marker, take the moderator's mark minus the marker's mark.
|
| 448 |
+
2. The marker's mean difference is the mean of these differences.
|
| 449 |
+
3. If the mean difference is more than %.1f marks in either direction (above %.1f or below -%.1f), add the unrounded mean difference to **every** mark given by that marker, sampled or not. Otherwise leave that marker's marks as they are.
|
| 450 |
+
|
| 451 |
+
Do not limit or round the marks at this step. The moderator's own marks are used only to work out the mean difference.
|
| 452 |
+
|
| 453 |
+
## Step 2: rescaling
|
| 454 |
+
|
| 455 |
+
Take the marks of all students after step 1 as one set (all markers together), and rescale them to the target mean and standard deviation with the formula above. A scaled mark above %d is set to %d, and a scaled mark below 0 is set to 0.
|
| 456 |
+
""" % (tol, tol, tol, top, top)
|
| 457 |
+
return t
|
| 458 |
+
|
| 459 |
+
def gen_moderation(seed, d):
|
| 460 |
+
r = rng_for(ENV + "/moderation", seed, d)
|
| 461 |
+
top = r.choice([50, 60, 80, 100])
|
| 462 |
+
tm, ts = int(round(top * r.choice([0.62, 0.65]))), int(round(top * r.choice([0.17, 0.19])))
|
| 463 |
+
tol = r.choice([1.5, 2.0, 2.5])
|
| 464 |
+
files, checks, lines = {}, [], []
|
| 465 |
+
|
| 466 |
+
def cluster(n, outlier):
|
| 467 |
+
c = r.uniform(0.3, 0.5) * top; s = r.uniform(0.06, 0.1) * top
|
| 468 |
+
xs = [int(min(top, max(0, round(r.gauss(c, s))))) for _ in range(n)]
|
| 469 |
+
if outlier: xs[0] = int(min(top, round(c + 5.5 * s)))
|
| 470 |
+
return xs
|
| 471 |
+
|
| 472 |
+
def clamp_ok(v): return clear_of(v, [0, top], 0.3)
|
| 473 |
+
|
| 474 |
+
if d == 1:
|
| 475 |
+
n = 10; ids = sid_list(r, n)
|
| 476 |
+
while True:
|
| 477 |
+
xs = cluster(n, False)
|
| 478 |
+
if psd(xs) > 0.05 * top and all(0 < rescale(x, pmean(xs), psd(xs), tm, ts) < top for x in xs): break
|
| 479 |
+
rows = [{"student_id": s, "seat": r.randint(1, 30), "mark": x} for s, x in zip(ids, xs)]
|
| 480 |
+
r.shuffle(rows)
|
| 481 |
+
files["marks.csv"] = to_csv(rows, ["student_id", "seat", "mark"])
|
| 482 |
+
checks += [c_num("raw_mean", pmean(xs), 2), c_num("raw_sd", psd(xs), 2)]
|
| 483 |
+
checks += [c_num("students.%s.scaled" % s, rescale(x, pmean(xs), psd(xs), tm, ts), 1) for s, x in zip(ids, xs)]
|
| 484 |
+
lines = ["- `raw_mean`: the mean of the marks, 2 decimals.", "- `raw_sd`: the population standard deviation of the marks, 2 decimals.",
|
| 485 |
+
"- `students`: an object keyed by student id, each with `scaled`: the rescaled mark, 1 decimal."]
|
| 486 |
+
what = "`marks.csv` holds the marks of %d students on a class test." % n
|
| 487 |
+
elif d == 2:
|
| 488 |
+
groups = r.sample(["7A", "7B", "7C", "7D"], 2); ids = sid_list(r, 18); r.shuffle(ids)
|
| 489 |
+
member = dict((g, sorted(ids[i * 8:(i + 1) * 8])) for i, g in enumerate(groups)); absent = sorted(ids[16:])
|
| 490 |
+
while True:
|
| 491 |
+
marks, scaled, clamped, ok = {}, {}, [], True
|
| 492 |
+
for gi, g in enumerate(groups):
|
| 493 |
+
xs = cluster(8, gi == 0 or r.random() < 0.3)
|
| 494 |
+
order = member[g][:]; r.shuffle(order)
|
| 495 |
+
for s, x in zip(order, xs):
|
| 496 |
+
raw = rescale(x, pmean(xs), psd(xs), tm, ts)
|
| 497 |
+
marks[s] = x; scaled[s] = rescale(x, pmean(xs), psd(xs), tm, ts, top)
|
| 498 |
+
if not clamp_ok(raw): ok = False
|
| 499 |
+
if raw != scaled[s]: clamped.append(s)
|
| 500 |
+
if psd(xs) < 0.04 * top: ok = False
|
| 501 |
+
if ok and clamped: break
|
| 502 |
+
rows = [{"student_id": s, "group": g, "mark": marks[s]} for g in groups for s in member[g]]
|
| 503 |
+
rows += [{"student_id": s, "group": r.choice(groups), "mark": ""} for s in absent]
|
| 504 |
+
r.shuffle(rows)
|
| 505 |
+
files["marks.csv"] = to_csv(rows, ["student_id", "group", "mark"])
|
| 506 |
+
for g in sorted(groups):
|
| 507 |
+
xs = [marks[s] for s in member[g]]
|
| 508 |
+
checks += [c_num("groups.%s.raw_mean" % g, pmean(xs), 2), c_num("groups.%s.raw_sd" % g, psd(xs), 2)]
|
| 509 |
+
checks += [c_num("students.%s.scaled" % s, scaled[s], 1) for s in sorted(marks)]
|
| 510 |
+
checks += [c_set("clamped", clamped, weight=2), c_set("absent", absent, weight=2)]
|
| 511 |
+
lines = ["- `groups`: an object keyed by teaching group, each with `raw_mean` and `raw_sd` (population standard deviation) of that group's marks, 2 decimals.",
|
| 512 |
+
"- `students`: an object keyed by student id, for every student with a mark, each with `scaled`: the rescaled mark after any limiting, 1 decimal.",
|
| 513 |
+
"- `clamped`: list of the student ids whose scaled mark had to be limited to the top or bottom of the range (any order; an empty list if none).",
|
| 514 |
+
"- `absent`: list of the student ids with no mark (any order)."]
|
| 515 |
+
what = "`marks.csv` holds the marks of two teaching groups on the same test."
|
| 516 |
+
else:
|
| 517 |
+
markers = ["M1", "M2", "M3"]; ids = sid_list(r, 21); r.shuffle(ids)
|
| 518 |
+
scripts = dict((m, sorted(ids[i * 7:(i + 1) * 7])) for i, m in enumerate(markers))
|
| 519 |
+
while True:
|
| 520 |
+
bias = dict((m, r.choice([-0.09, -0.06, 0.0, 0.0, 0.05, 0.08]) * top) for m in markers)
|
| 521 |
+
marks, sample, diffs, add = {}, {}, {}, {}
|
| 522 |
+
for mi, m in enumerate(markers):
|
| 523 |
+
xs = cluster(7, mi == 0)
|
| 524 |
+
order = scripts[m][:]; r.shuffle(order)
|
| 525 |
+
for s, x in zip(order, xs): marks[s] = x
|
| 526 |
+
chosen = r.sample(scripts[m], r.randint(3, 4))
|
| 527 |
+
for s in chosen: sample[s] = int(min(top, max(0, round(marks[s] + bias[m] + r.gauss(0, 0.02 * top)))))
|
| 528 |
+
diffs[m], add[m] = marker_adjustment([(marks[s], sample[s]) for s in chosen], tol)
|
| 529 |
+
if not all(clear_of(abs(diffs[m]), [tol], 0.3) for m in markers): continue
|
| 530 |
+
if not 1 <= sum(1 for m in markers if add[m]) <= 2: continue
|
| 531 |
+
adj = dict((s, marks[s] + add[m]) for m in markers for s in scripts[m])
|
| 532 |
+
vals = [adj[s] for s in sorted(adj)]; M, SD = pmean(vals), psd(vals)
|
| 533 |
+
raw = dict((s, rescale(adj[s], M, SD, tm, ts)) for s in adj)
|
| 534 |
+
if not all(clamp_ok(v) for v in raw.values()): continue
|
| 535 |
+
final = dict((s, rescale(adj[s], M, SD, tm, ts, top)) for s in adj)
|
| 536 |
+
clamped = [s for s in adj if final[s] != raw[s]]
|
| 537 |
+
if clamped or r.random() < 0.3: break
|
| 538 |
+
rows = [{"student_id": s, "marker": m, "mark": marks[s]} for m in markers for s in scripts[m]]
|
| 539 |
+
r.shuffle(rows)
|
| 540 |
+
srows = [{"student_id": s, "moderator_mark": v} for s, v in sample.items()]
|
| 541 |
+
r.shuffle(srows)
|
| 542 |
+
files["scripts.csv"] = to_csv(rows, ["student_id", "marker", "mark"])
|
| 543 |
+
files["moderation_sample.csv"] = to_csv(srows, ["student_id", "moderator_mark"])
|
| 544 |
+
checks += [c_num("markers.%s.mean_difference" % m, diffs[m], 2) for m in markers]
|
| 545 |
+
checks += [c_set("adjusted_markers", [m for m in markers if add[m]], weight=2), c_num("cohort_mean", M, 2), c_num("cohort_sd", SD, 2)]
|
| 546 |
+
checks += [c_num("students.%s.final" % s, final[s], 1) for s in sorted(final)]
|
| 547 |
+
checks.append(c_set("clamped", clamped, weight=2))
|
| 548 |
+
lines = ["- `markers`: an object keyed by marker, each with `mean_difference`: the mean of moderator's mark minus marker's mark over that marker's sampled scripts, 2 decimals, with its sign.",
|
| 549 |
+
"- `adjusted_markers`: list of the markers whose marks were adjusted in step 1 (any order; an empty list if none).",
|
| 550 |
+
"- `cohort_mean` and `cohort_sd`: the mean and population standard deviation of all students' marks after step 1, 2 decimals.",
|
| 551 |
+
"- `students`: an object keyed by student id, each with `final`: the mark after step 2, including any limiting, 1 decimal.",
|
| 552 |
+
"- `clamped`: list of the student ids whose final mark had to be limited to the top or bottom of the range (any order; an empty list if none)."]
|
| 553 |
+
what = "`scripts.csv` holds the marks three markers gave to their scripts, and `moderation_sample.csv` the marks a moderator gave to a sample of those scripts."
|
| 554 |
+
inst = """# Class test: standardising marks
|
| 555 |
+
|
| 556 |
+
%s `moderation_notes.md` gives the procedure, the targets and the formula: follow it exactly.
|
| 557 |
+
|
| 558 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 559 |
+
|
| 560 |
+
%s
|
| 561 |
+
|
| 562 |
+
Numbers are accepted within one unit of the last decimal place asked for.
|
| 563 |
+
""" % (what, "\n".join(lines))
|
| 564 |
+
files["moderation_notes.md"] = moderation_notes(d, top, tm, ts, tol)
|
| 565 |
+
return Task(ENV, "moderation", seed, d, "Standardise the marks of a class test", inst, files, checks, {"max_mark": top})
|
| 566 |
+
|
| 567 |
+
FAMILIES = {"marking": gen_marking, "item-analysis": gen_items, "distractors": gen_distractors, "moderation": gen_moderation}
|
| 568 |
+
|
| 569 |
+
def generate(seed, difficulty, family=None):
|
| 570 |
+
fam = family or sorted(FAMILIES)[seed % len(FAMILIES)]
|
| 571 |
+
return FAMILIES[fam](seed, difficulty)
|
envs/class_test/oracle.py
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Reference solution for Class Test. Works only from the files in the current directory."""
|
| 3 |
+
import csv, json, math, os, re
|
| 4 |
+
from decimal import Decimal, ROUND_HALF_UP
|
| 5 |
+
from fractions import Fraction
|
| 6 |
+
|
| 7 |
+
def rows(name):
|
| 8 |
+
with open(name, newline="") as f: return list(csv.DictReader(f))
|
| 9 |
+
|
| 10 |
+
def text(name):
|
| 11 |
+
with open(name) as f: return f.read()
|
| 12 |
+
|
| 13 |
+
def item_cols(row):
|
| 14 |
+
return sorted([c for c in row if re.match(r"^Q\d+$", c)], key=lambda c: int(c[1:]))
|
| 15 |
+
|
| 16 |
+
# ---------------------------------------------------------------- marking
|
| 17 |
+
def marking():
|
| 18 |
+
scheme = text("marking_scheme.md")
|
| 19 |
+
penalty = Fraction(0)
|
| 20 |
+
if "one quarter" in scheme: penalty = Fraction(1, 4)
|
| 21 |
+
elif "one half" in scheme: penalty = Fraction(1, 2)
|
| 22 |
+
bounds = [(g, int(lo)) for g, lo in re.findall(r"^\| ([A-D]) \| (\d+) or more \|", scheme, re.M)]
|
| 23 |
+
bounds.sort(key=lambda b: -b[1])
|
| 24 |
+
key = dict((r["item"], (r["key"].strip(), int(r["marks"]))) for r in rows("answer_key.csv"))
|
| 25 |
+
live = [q for q in key if key[q][0] != "VOID"]
|
| 26 |
+
top = sum(key[q][1] for q in live)
|
| 27 |
+
ans = {"max_marks": top, "students": {}, "grade_u": [], "grade_counts": dict((g, 0) for g in "ABCDU")}
|
| 28 |
+
pcts = []
|
| 29 |
+
for r in rows("answer_sheets.csv"):
|
| 30 |
+
total = Fraction(0)
|
| 31 |
+
for q in live:
|
| 32 |
+
a = r[q].strip()
|
| 33 |
+
if a == "": continue
|
| 34 |
+
if a == key[q][0]: total += key[q][1]
|
| 35 |
+
else: total -= penalty * key[q][1]
|
| 36 |
+
if total < 0: total = Fraction(0)
|
| 37 |
+
pct = total * 100 / top
|
| 38 |
+
grade = "U"
|
| 39 |
+
for g, lo in bounds:
|
| 40 |
+
if pct >= lo:
|
| 41 |
+
grade = g; break
|
| 42 |
+
ans["students"][r["student_id"]] = {"marks": float(total), "percent": round(float(pct), 1), "grade": grade}
|
| 43 |
+
ans["grade_counts"][grade] += 1
|
| 44 |
+
if grade == "U": ans["grade_u"].append(r["student_id"])
|
| 45 |
+
pcts.append(pct)
|
| 46 |
+
ans["mean_percent"] = round(float(sum(pcts) / len(pcts)), 1)
|
| 47 |
+
return ans
|
| 48 |
+
|
| 49 |
+
# ---------------------------------------------------------------- item analysis
|
| 50 |
+
def item_analysis():
|
| 51 |
+
if os.path.exists("scores.csv"):
|
| 52 |
+
data = rows("scores.csv"); items = item_cols(data[0])
|
| 53 |
+
score = dict((r["student_id"], [int(r[q]) for q in items]) for r in data)
|
| 54 |
+
else:
|
| 55 |
+
key = dict((r["item"], r["key"].strip()) for r in rows("key.csv"))
|
| 56 |
+
data = [r for r in rows("responses.csv") if r.get("status", "present") != "absent"]
|
| 57 |
+
items = item_cols(data[0])
|
| 58 |
+
score = dict((r["student_id"], [1 if r[q].strip() == key[q] else 0 for q in items]) for r in data)
|
| 59 |
+
n, k = len(score), len(items)
|
| 60 |
+
total = dict((s, sum(v)) for s, v in score.items())
|
| 61 |
+
order = sorted(score, key=lambda s: s)
|
| 62 |
+
order.sort(key=lambda s: total[s], reverse=True) # stable: equal totals stay in id order
|
| 63 |
+
g = int((Decimal(27) * n / Decimal(100)).quantize(Decimal(1), rounding=ROUND_HALF_UP))
|
| 64 |
+
upper, lower = order[:g], order[n - g:]
|
| 65 |
+
mean_t = sum(total.values()) / n
|
| 66 |
+
var_t = sum((t - mean_t) ** 2 for t in total.values()) / n
|
| 67 |
+
ans = {"n_group": g, "n_students": n, "items": {}, "poor_discrimination": [], "too_easy": [], "too_hard": [], "needs_review": []}
|
| 68 |
+
sum_pq = 0.0
|
| 69 |
+
for j, q in enumerate(items):
|
| 70 |
+
right = [s for s in score if score[s][j] == 1]; wrong = [s for s in score if score[s][j] == 0]
|
| 71 |
+
p = len(right) / n
|
| 72 |
+
disc = (sum(score[s][j] for s in upper) - sum(score[s][j] for s in lower)) / g
|
| 73 |
+
m1 = sum(total[s] for s in right) / len(right); m0 = sum(total[s] for s in wrong) / len(wrong)
|
| 74 |
+
rpb = (m1 - m0) / math.sqrt(var_t) * math.sqrt(p * (1 - p))
|
| 75 |
+
sum_pq += p * (1 - p)
|
| 76 |
+
ans["items"][q] = {"facility": round(p, 3), "discrimination": round(disc, 3), "point_biserial": round(rpb, 3)}
|
| 77 |
+
if disc < 0.20: ans["poor_discrimination"].append(q)
|
| 78 |
+
if p > 0.85: ans["too_easy"].append(q)
|
| 79 |
+
if p < 0.30: ans["too_hard"].append(q)
|
| 80 |
+
if rpb < 0.20: ans["needs_review"].append(q)
|
| 81 |
+
ans["kr20"] = round(k / (k - 1) * (1 - sum_pq / var_t), 3)
|
| 82 |
+
return ans
|
| 83 |
+
|
| 84 |
+
# ---------------------------------------------------------------- distractors
|
| 85 |
+
def distractors():
|
| 86 |
+
keys = rows("key.csv")
|
| 87 |
+
data = [r for r in rows("responses.csv") if r.get("status", "present") != "absent"]
|
| 88 |
+
n = len(data)
|
| 89 |
+
ans = {"items": {}, "has_non_functioning": [], "key_beaten": [], "n_students": n}
|
| 90 |
+
for kr in keys:
|
| 91 |
+
q, key = kr["item"], kr["key"].strip()
|
| 92 |
+
opts = "ABCDE"[:int(kr.get("n_options") or 4)]
|
| 93 |
+
tally = dict((o, 0) for o in opts); omitted = 0
|
| 94 |
+
for r in data:
|
| 95 |
+
a = r[q].strip()
|
| 96 |
+
if a == "": omitted += 1
|
| 97 |
+
else: tally[a] += 1
|
| 98 |
+
dead = [o for o in opts if o != key and Fraction(tally[o], n) < Fraction(5, 100)]
|
| 99 |
+
others = sorted([o for o in opts if o != key], key=lambda o: -tally[o])
|
| 100 |
+
ans["items"][q] = {"counts": [tally[o] for o in opts], "non_functioning": dead, "omitted": omitted,
|
| 101 |
+
"key_pct": round(100.0 * tally[key] / n, 1), "top_distractor": others[0]}
|
| 102 |
+
if dead: ans["has_non_functioning"].append(q)
|
| 103 |
+
if tally[others[0]] > tally[key]: ans["key_beaten"].append(q)
|
| 104 |
+
return ans
|
| 105 |
+
|
| 106 |
+
# ---------------------------------------------------------------- moderation
|
| 107 |
+
def stats(xs):
|
| 108 |
+
m = sum(xs) / len(xs)
|
| 109 |
+
return m, math.sqrt(sum((x - m) ** 2 for x in xs) / len(xs))
|
| 110 |
+
|
| 111 |
+
def moderation():
|
| 112 |
+
notes = text("moderation_notes.md")
|
| 113 |
+
top = float(re.search(r"marked out of (\d+)", notes).group(1))
|
| 114 |
+
tm = float(re.search(r"target mean is (\d+)", notes).group(1))
|
| 115 |
+
ts = float(re.search(r"target standard deviation is (\d+)", notes).group(1))
|
| 116 |
+
def limit(v): return min(top, max(0.0, v))
|
| 117 |
+
if os.path.exists("scripts.csv"):
|
| 118 |
+
tol = float(re.search(r"more than ([\d.]+) marks", notes).group(1))
|
| 119 |
+
scripts = rows("scripts.csv")
|
| 120 |
+
mark = dict((r["student_id"], float(r["mark"])) for r in scripts)
|
| 121 |
+
marker = dict((r["student_id"], r["marker"]) for r in scripts)
|
| 122 |
+
diffs = {}
|
| 123 |
+
for r in rows("moderation_sample.csv"):
|
| 124 |
+
diffs.setdefault(marker[r["student_id"]], []).append(float(r["moderator_mark"]) - mark[r["student_id"]])
|
| 125 |
+
ans = {"markers": {}, "adjusted_markers": [], "students": {}, "clamped": []}
|
| 126 |
+
shift = {}
|
| 127 |
+
for m in sorted(set(marker.values())):
|
| 128 |
+
md = sum(diffs[m]) / len(diffs[m])
|
| 129 |
+
ans["markers"][m] = {"mean_difference": round(md, 2)}
|
| 130 |
+
shift[m] = md if (md > tol or md < -tol) else 0.0
|
| 131 |
+
if shift[m]: ans["adjusted_markers"].append(m)
|
| 132 |
+
adj = dict((s, mark[s] + shift[marker[s]]) for s in mark)
|
| 133 |
+
M, SD = stats(list(adj.values()))
|
| 134 |
+
ans["cohort_mean"], ans["cohort_sd"] = round(M, 2), round(SD, 2)
|
| 135 |
+
for s, x in adj.items():
|
| 136 |
+
v = tm + (x - M) / SD * ts
|
| 137 |
+
ans["students"][s] = {"final": round(limit(v), 1)}
|
| 138 |
+
if v > top or v < 0: ans["clamped"].append(s)
|
| 139 |
+
return ans
|
| 140 |
+
data = rows("marks.csv")
|
| 141 |
+
if "group" not in data[0]:
|
| 142 |
+
xs = [float(r["mark"]) for r in data]
|
| 143 |
+
M, SD = stats(xs)
|
| 144 |
+
return {"raw_mean": round(M, 2), "raw_sd": round(SD, 2),
|
| 145 |
+
"students": dict((r["student_id"], {"scaled": round(tm + (float(r["mark"]) - M) / SD * ts, 1)}) for r in data)}
|
| 146 |
+
ans = {"groups": {}, "students": {}, "clamped": [], "absent": [r["student_id"] for r in data if r["mark"].strip() == ""]}
|
| 147 |
+
present = [r for r in data if r["mark"].strip() != ""]
|
| 148 |
+
for g in sorted(set(r["group"] for r in present)):
|
| 149 |
+
mine = [r for r in present if r["group"] == g]
|
| 150 |
+
M, SD = stats([float(r["mark"]) for r in mine])
|
| 151 |
+
ans["groups"][g] = {"raw_mean": round(M, 2), "raw_sd": round(SD, 2)}
|
| 152 |
+
for r in mine:
|
| 153 |
+
v = tm + (float(r["mark"]) - M) / SD * ts
|
| 154 |
+
ans["students"][r["student_id"]] = {"scaled": round(limit(v), 1)}
|
| 155 |
+
if v > top or v < 0: ans["clamped"].append(r["student_id"])
|
| 156 |
+
return ans
|
| 157 |
+
|
| 158 |
+
if os.path.exists("answer_sheets.csv"): answer = marking()
|
| 159 |
+
elif os.path.exists("item_analysis_notes.md"): answer = item_analysis()
|
| 160 |
+
elif os.path.exists("distractor_notes.md"): answer = distractors()
|
| 161 |
+
else: answer = moderation()
|
| 162 |
+
with open("answer.json", "w") as f: json.dump(answer, f, indent=1)
|
envs/emissions_inventory/__init__.py
ADDED
|
File without changes
|
envs/emissions_inventory/env.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name = "emissions-inventory"
|
| 2 |
+
title = "Emissions Inventory"
|
| 3 |
+
isced = "0521"
|
| 4 |
+
summary = "Compile a greenhouse-gas inventory from activity records: unit conversion, emission factors, scopes, CO2e from several gases, trends and data cleaning."
|
| 5 |
+
task_type = "emissions accounting"
|
| 6 |
+
good_for = ["Unit conversion and table lookup before aggregation", "Using supplied factors rather than remembered ones", "Cleaning duplicated and missing records by a stated rule"]
|
| 7 |
+
families = ["activity-data", "multi-gas", "time-series", "data-quality"]
|
envs/emissions_inventory/gen.py
ADDED
|
@@ -0,0 +1,444 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Emissions Inventory (ISCED-F 0521 Environmental sciences).
|
| 2 |
+
|
| 3 |
+
Four task families, all for synthetic organisations:
|
| 4 |
+
activity-data activity data in mixed units times emission factors, by source, by scope and in total
|
| 5 |
+
multi-gas CO2, CH4 and N2O per source converted to CO2e with a supplied GWP table; refrigerant leaks
|
| 6 |
+
time-series year-on-year change, change against a base year, intensity, and the cut needed to hit a target
|
| 7 |
+
data-quality meter readings with duplicated rows, missing months and mixed units, cleaned by stated rules
|
| 8 |
+
|
| 9 |
+
Methods: emissions = activity data x emission factor, and CO2e = sum of gas mass x GWP, as in the GHG Protocol
|
| 10 |
+
Corporate Accounting and Reporting Standard (WRI/WBCSD, revised edition 2004) and the 2006 IPCC Guidelines for
|
| 11 |
+
National Greenhouse Gas Inventories. Scopes 1, 2 and 3, biogenic CO2 reported outside the scopes, and base-year
|
| 12 |
+
recalculation after a divestment also follow the GHG Protocol Corporate Standard.
|
| 13 |
+
The 100-year GWP values shipped in tasks are those of the IPCC Fourth Assessment Report (2007: CH4 25, N2O 298,
|
| 14 |
+
HFC-134a 1430, HFC-32 675, SF6 22800) or Fifth Assessment Report (2013: CH4 28, N2O 265, HFC-134a 1300,
|
| 15 |
+
HFC-32 677, SF6 23500); each task ships the table it wants used. Emission factors are synthetic, of realistic
|
| 16 |
+
size, and are always shipped with the task.
|
| 17 |
+
"""
|
| 18 |
+
from practice.core import Task, rng_for, to_csv, c_int, c_num, c_str, c_set, c_bool
|
| 19 |
+
|
| 20 |
+
ENV = "emissions-inventory"
|
| 21 |
+
ORGS = ["Brantholm Municipality", "Kestrel Joinery", "Vessby Dairy Cooperative", "Harlow Fold Logistics", "Tarnwick Borough Council", "Lindqvist Castings", "Ostervik Bakery Group", "Marrow Vale Housing"]
|
| 22 |
+
|
| 23 |
+
def md_table(header, rows):
|
| 24 |
+
out = ["| " + " | ".join(header) + " |", "|" + "|".join(["---"] * len(header)) + "|"]
|
| 25 |
+
for row in rows: out.append("| " + " | ".join(str(x) for x in row) + " |")
|
| 26 |
+
return "\n".join(out)
|
| 27 |
+
|
| 28 |
+
def sig3(x): return float("%.3g" % x)
|
| 29 |
+
|
| 30 |
+
# ---------------------------------------------------------------- formulas
|
| 31 |
+
def emission_t(quantity, to_factor_unit, factor_kg_per_unit):
|
| 32 |
+
"""Tonnes CO2e for a quantity in its recorded unit: convert to the factor's unit, multiply, kg to tonnes."""
|
| 33 |
+
return quantity * to_factor_unit * factor_kg_per_unit / 1000.0
|
| 34 |
+
|
| 35 |
+
def gas_masses(amount, co2_kg_per_unit, ch4_g_per_unit, n2o_g_per_unit):
|
| 36 |
+
"""(tonnes CO2, kg CH4, kg N2O) for an amount in the factor's unit."""
|
| 37 |
+
return amount * co2_kg_per_unit / 1000.0, amount * ch4_g_per_unit / 1000.0, amount * n2o_g_per_unit / 1000.0
|
| 38 |
+
|
| 39 |
+
def co2e_t(co2_t, ch4_kg, n2o_kg, gwp_ch4, gwp_n2o):
|
| 40 |
+
return co2_t + ch4_kg * gwp_ch4 / 1000.0 + n2o_kg * gwp_n2o / 1000.0
|
| 41 |
+
|
| 42 |
+
def percent_change(new, old):
|
| 43 |
+
return (new - old) / float(old) * 100.0
|
| 44 |
+
|
| 45 |
+
def intensity_kg_per_unit(total_t, output):
|
| 46 |
+
return total_t * 1000.0 / output
|
| 47 |
+
|
| 48 |
+
def target_level(base_total, cut_percent):
|
| 49 |
+
return base_total * (1 - cut_percent / 100.0)
|
| 50 |
+
|
| 51 |
+
def linear_annual_cut(latest, target, years_left):
|
| 52 |
+
return (latest - target) / float(years_left)
|
| 53 |
+
|
| 54 |
+
def compound_annual_cut_percent(latest, target, years_left):
|
| 55 |
+
return (1 - (target / float(latest)) ** (1.0 / years_left)) * 100.0
|
| 56 |
+
|
| 57 |
+
def linear_path(base_total, target, base_year, target_year, year):
|
| 58 |
+
return base_total - (base_total - target) * (year - base_year) / float(target_year - base_year)
|
| 59 |
+
|
| 60 |
+
def fill_gap(before, after):
|
| 61 |
+
return (before + after) / 2.0
|
| 62 |
+
|
| 63 |
+
# ---------------------------------------------------------------- activity data
|
| 64 |
+
SRC = [("diesel_fleet", "litre", 2.66, "1", ["litre", "litre", "m3"], (3000, 40000)),
|
| 65 |
+
("petrol_fleet", "litre", 2.31, "1", ["litre"], (1500, 20000)),
|
| 66 |
+
("natural_gas", "kWh", 0.183, "1", ["kWh", "MWh", "m3"], (60000, 600000)),
|
| 67 |
+
("heating_oil", "litre", 2.54, "1", ["litre", "m3"], (3000, 30000)),
|
| 68 |
+
("company_cars", "km", 0.171, "1", ["km", "mile"], (20000, 300000)),
|
| 69 |
+
("purchased_electricity", "kWh", 0.233, "2", ["kWh", "MWh"], (80000, 900000)),
|
| 70 |
+
("district_heating", "kWh", 0.098, "2", ["kWh", "MWh", "GJ"], (50000, 500000)),
|
| 71 |
+
("business_flights", "km", 0.158, "3", ["km", "mile"], (20000, 400000)),
|
| 72 |
+
("rail_travel", "km", 0.035, "3", ["km"], (10000, 200000)),
|
| 73 |
+
("waste_to_landfill", "tonne", 446.0, "3", ["tonne", "kg"], (5, 120))]
|
| 74 |
+
OUTSIDE = [("wood_pellets", "tonne", 1650.0, "outside scopes", ["tonne", "kg"], (10, 150)),
|
| 75 |
+
("biodiesel_b100", "litre", 2.49, "outside scopes", ["litre", "m3"], (2000, 20000))]
|
| 76 |
+
LIQUID = "diesel_fleet;petrol_fleet;heating_oil;biodiesel_b100"
|
| 77 |
+
DECIMALS = {"kWh": 0, "MWh": 3, "GJ": 1, "litre": 1, "m3": 3, "km": 0, "mile": 0, "tonne": 2, "kg": 0}
|
| 78 |
+
SITES = ["head_office", "depot", "workshop", "warehouse"]
|
| 79 |
+
|
| 80 |
+
def gen_activity(seed, d):
|
| 81 |
+
r = rng_for(ENV + "/activity-data", seed, d)
|
| 82 |
+
org, year = r.choice(ORGS), r.randint(2019, 2024)
|
| 83 |
+
gas_cv = round(r.uniform(10.3, 11.2), 2)
|
| 84 |
+
conv = [("MWh", "kWh", 1000, "all"), ("GJ", "kWh", 277.78, "all"), ("m3", "kWh", gas_cv, "natural_gas"), ("m3", "litre", 1000, LIQUID),
|
| 85 |
+
("mile", "km", 1.609344, "all"), ("kg", "tonne", 0.001, "all"), ("therm", "kWh", 29.3071, "all"), ("gallon_uk", "litre", 4.54609, LIQUID)]
|
| 86 |
+
def mult(source, unit, funit):
|
| 87 |
+
if unit == funit: return 1.0
|
| 88 |
+
for a, b, m, who in conv:
|
| 89 |
+
if a == unit and b == funit and (who == "all" or source in who.split(";")): return float(m)
|
| 90 |
+
while True:
|
| 91 |
+
table = [(s, u, sig3(f * r.uniform(0.9, 1.1)), sc, units, rng) for s, u, f, sc, units, rng in SRC + (OUTSIDE if d == 3 else [])]
|
| 92 |
+
by_scope_src = dict((sc, [t for t in table if t[3] == sc]) for sc in ("1", "2", "3", "outside scopes"))
|
| 93 |
+
used = [r.choice(by_scope_src[sc]) for sc in ("1", "2", "3")]
|
| 94 |
+
rest = [t for t in table if t not in used and t[3] != "outside scopes"]
|
| 95 |
+
used += r.sample(rest, {1: 2, 2: 4, 3: 5}[d])
|
| 96 |
+
if d == 3: used += r.sample(by_scope_src["outside scopes"], r.randint(1, 2))
|
| 97 |
+
sites = SITES[:1] if d == 1 else sorted(r.sample(SITES, r.randint(2, 3)))
|
| 98 |
+
rows, by_source, by_scope, by_site = [], {}, {"1": 0.0, "2": 0.0, "3": 0.0, "outside scopes": 0.0}, dict((s, 0.0) for s in sites)
|
| 99 |
+
for s, funit, f, sc, units, (lo, hi) in used:
|
| 100 |
+
annual = r.uniform(lo, hi)
|
| 101 |
+
parts = [r.uniform(0.5, 1.5) for _ in range(r.randint(1, 3) if d == 1 else r.randint(2, 4))]
|
| 102 |
+
for w in parts:
|
| 103 |
+
unit = r.choice(units) if (d >= 2 or r.random() < 0.6) else funit
|
| 104 |
+
m = mult(s, unit, funit)
|
| 105 |
+
qty = round(annual * w / sum(parts) / m, DECIMALS[unit])
|
| 106 |
+
if DECIMALS[unit] == 0: qty = int(qty)
|
| 107 |
+
site = r.choice(sites)
|
| 108 |
+
rows.append({"site": site, "invoice_date": "%d-%02d-%02d" % (year, r.randint(1, 12), r.randint(1, 28)), "source": s, "quantity": qty, "unit": unit})
|
| 109 |
+
e = emission_t(qty, m, f)
|
| 110 |
+
by_source[s] = by_source.get(s, 0.0) + e; by_scope[sc] += e
|
| 111 |
+
if sc != "outside scopes": by_site[site] += e
|
| 112 |
+
if d >= 2:
|
| 113 |
+
for _ in range(r.randint(3, 5)):
|
| 114 |
+
s, funit, f, sc, units, (lo, hi) = r.choice(used)
|
| 115 |
+
unit = r.choice(units)
|
| 116 |
+
qty = round(r.uniform(lo, hi) / 4 / mult(s, unit, funit), DECIMALS[unit])
|
| 117 |
+
other = r.choice(["%d-%02d-%02d" % (year - 1, r.choice([11, 12]), r.randint(1, 28)), "%d-%02d-%02d" % (year + 1, r.choice([1, 2]), r.randint(1, 28))])
|
| 118 |
+
rows.append({"site": r.choice(sites), "invoice_date": other, "source": s, "quantity": int(qty) if DECIMALS[unit] == 0 else qty, "unit": unit})
|
| 119 |
+
total = by_scope["1"] + by_scope["2"] + by_scope["3"]
|
| 120 |
+
rank = sorted(((v, s) for s, v in by_source.items() if s not in [o[0] for o in OUTSIDE]), reverse=True)
|
| 121 |
+
if min(by_site.values()) <= 0: continue
|
| 122 |
+
if d == 3 and rank[0][0] - rank[1][0] < 0.03 * rank[0][0]: continue
|
| 123 |
+
break
|
| 124 |
+
r.shuffle(rows)
|
| 125 |
+
for i, row in enumerate(rows): row["record_id"] = "R%03d" % (i + 1); row["supplier_ref"] = "INV-%05d" % r.randint(10000, 99999)
|
| 126 |
+
checks = [c_num("by_source.%s" % s, by_source[s], 2) for s in sorted(by_source)]
|
| 127 |
+
checks += [c_num("by_scope.scope_%s" % k, by_scope[k], 2) for k in "123"] + [c_num("total_t_co2e", total, 2, weight=2)]
|
| 128 |
+
only = "Every record belongs to the %d reporting year." % year
|
| 129 |
+
more = ""
|
| 130 |
+
if d >= 2:
|
| 131 |
+
only = "The inventory covers the calendar year %d only: leave out records whose `invoice_date` falls in another year." % year
|
| 132 |
+
checks += [c_num("by_site.%s" % s, by_site[s], 2) for s in sites]
|
| 133 |
+
more += "\n- `by_site`: an object keyed by site, tonnes CO2e of scopes 1 to 3 together, 2 decimals."
|
| 134 |
+
if d == 3:
|
| 135 |
+
only += (" Sources classed `outside scopes` in the factor table (biogenic CO2) are reported separately: work out their emissions and list them in `by_source`, "
|
| 136 |
+
"but keep them out of `by_scope`, `by_site`, `total_t_co2e`, `scope_share_percent` and `largest_source`.")
|
| 137 |
+
checks += [c_num("outside_scopes_t_co2e", by_scope["outside scopes"], 2), c_str("largest_source", rank[0][1], weight=2)]
|
| 138 |
+
checks += [c_num("scope_share_percent.scope_%s" % k, by_scope[k] / total * 100, 1) for k in "123"]
|
| 139 |
+
more += ("\n- `outside_scopes_t_co2e`: tonnes CO2e of the sources classed `outside scopes`, 2 decimals."
|
| 140 |
+
"\n- `scope_share_percent`: an object with keys `scope_1`, `scope_2` and `scope_3`: each scope's share of `total_t_co2e` in percent, 1 decimal."
|
| 141 |
+
"\n- `largest_source`: the source in scopes 1 to 3 with the largest emissions.")
|
| 142 |
+
files = {"activity_data.csv": to_csv(rows, ["record_id", "site", "invoice_date", "source", "quantity", "unit", "supplier_ref"]),
|
| 143 |
+
"emission_factors.csv": to_csv([(t[0], t[2], t[1], t[3]) for t in sorted(table)], ["source", "factor_kg_co2e_per_unit", "unit", "scope"]),
|
| 144 |
+
"unit_conversions.csv": to_csv(conv, ["from_unit", "to_unit", "multiply_by", "applies_to"]),
|
| 145 |
+
"inventory_boundary.md": "# Inventory boundary\n\n- Organisation: %s\n- Reporting year: %d (calendar year, by invoice date)\n- Reported: scopes 1, 2 and 3 in tonnes CO2e\n" % (org, year)}
|
| 146 |
+
inst = """# Emissions inventory: activity data
|
| 147 |
+
|
| 148 |
+
You are compiling the %d greenhouse-gas inventory for %s (a synthetic organisation).
|
| 149 |
+
|
| 150 |
+
- `activity_data.csv`: the activity records (fuel, energy, travel and waste), in whatever unit the supplier used.
|
| 151 |
+
- `emission_factors.csv`: for each source, the emission factor in kg CO2e per unit, the unit it applies to, and the scope the source belongs to. Use these factors and this classification.
|
| 152 |
+
- `inventory_boundary.md`: the organisation and the reporting year.
|
| 153 |
+
- `unit_conversions.csv`: multiply a quantity in `from_unit` by `multiply_by` to get `to_unit`. A row applies to every source if `applies_to` is `all`, otherwise only to the sources listed there (separated by semicolons). Use these values.
|
| 154 |
+
|
| 155 |
+
%s
|
| 156 |
+
|
| 157 |
+
For each record, convert the quantity to the unit of its source's emission factor if it is not already in that unit, multiply by the factor, and convert kg to tonnes (1 tonne = 1000 kg).
|
| 158 |
+
|
| 159 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 160 |
+
|
| 161 |
+
- `by_source`: an object keyed by source, tonnes CO2e, 2 decimals. Include only sources that have records in the reporting year.
|
| 162 |
+
- `by_scope`: an object with keys `scope_1`, `scope_2` and `scope_3`, tonnes CO2e, 2 decimals.
|
| 163 |
+
- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 2 decimals.%s
|
| 164 |
+
|
| 165 |
+
Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.
|
| 166 |
+
""" % (year, org, only, more)
|
| 167 |
+
return Task(ENV, "activity-data", seed, d, "Activity data to tonnes CO2e, %d records" % len(rows), inst, files, checks, {"records": len(rows)})
|
| 168 |
+
|
| 169 |
+
# ---------------------------------------------------------------- multi-gas
|
| 170 |
+
GWP = {"AR4": ("IPCC Fourth Assessment Report (2007)", {"CO2": 1, "CH4": 25, "N2O": 298, "HFC-134a": 1430, "HFC-32": 675, "SF6": 22800}),
|
| 171 |
+
"AR5": ("IPCC Fifth Assessment Report (2013)", {"CO2": 1, "CH4": 28, "N2O": 265, "HFC-134a": 1300, "HFC-32": 677, "SF6": 23500})}
|
| 172 |
+
CATS = [("diesel_combustion", "litre", 2.68, 0.11, 0.14, ("m3", 1000.0), (5000, 60000), "diesel for vehicles and plant"),
|
| 173 |
+
("petrol_combustion", "litre", 2.30, 0.80, 0.25, None, (2000, 20000), "petrol for pool cars"),
|
| 174 |
+
("heating_oil_boiler", "litre", 2.54, 0.35, 0.021, ("m3", 1000.0), (3000, 40000), "heating oil burned in boilers"),
|
| 175 |
+
("natural_gas_boiler", "m3", 2.02, 0.19, 0.036, None, (20000, 200000), "natural gas burned in boilers"),
|
| 176 |
+
("wood_chip_boiler", "tonne", 0.0, 310.0, 41.0, ("kg", 0.001), (50, 800), "wood chips burned (biogenic CO2 not counted)"),
|
| 177 |
+
("landfilled_waste", "tonne", 0.0, 52000.0, 0.0, ("kg", 0.001), (200, 5000), "municipal waste sent to landfill"),
|
| 178 |
+
("dairy_cattle", "head", 0.0, 128000.0, 950.0, None, (40, 600), "dairy cows kept over the year"),
|
| 179 |
+
("nitrogen_fertiliser", "tonne", 0.0, 0.0, 15700.0, ("kg", 0.001), (5, 80), "nitrogen applied as mineral fertiliser"),
|
| 180 |
+
("wastewater_treatment", "person", 0.0, 410.0, 62.0, None, (2000, 40000), "people connected to the treatment works")]
|
| 181 |
+
|
| 182 |
+
def gen_multigas(seed, d):
|
| 183 |
+
r = rng_for(ENV + "/multi-gas", seed, d)
|
| 184 |
+
org, year = r.choice(ORGS), r.randint(2019, 2024)
|
| 185 |
+
label, gwp = GWP[r.choice(sorted(GWP))]
|
| 186 |
+
n = {1: 4, 2: 6, 3: 8}[d]
|
| 187 |
+
while True:
|
| 188 |
+
cats = [(c[0], c[1], sig3(c[2] * r.uniform(0.95, 1.05)), sig3(c[3] * r.uniform(0.8, 1.2)), sig3(c[4] * r.uniform(0.8, 1.2))) + c[5:] for c in CATS]
|
| 189 |
+
picks = [r.choice(cats[:4]), r.choice(cats[4:])] + [r.choice(cats) for _ in range(n - 2)]
|
| 190 |
+
r.shuffle(picks)
|
| 191 |
+
rows, res, tot = [], {}, [0.0, 0.0, 0.0]
|
| 192 |
+
for i, (cat, unit, f1, f2, f3, alt, (lo, hi), desc) in enumerate(picks):
|
| 193 |
+
sid = "E%02d" % (i + 1)
|
| 194 |
+
amount = r.uniform(lo, hi)
|
| 195 |
+
if alt and d >= 2 and r.random() < 0.5:
|
| 196 |
+
rec_unit, m = alt
|
| 197 |
+
amount = round(amount / m, 3 if rec_unit == "m3" else 0)
|
| 198 |
+
else:
|
| 199 |
+
rec_unit, m = unit, 1.0
|
| 200 |
+
amount = round(amount, 1 if unit in ("litre", "tonne") else 0)
|
| 201 |
+
if amount == int(amount): amount = int(amount)
|
| 202 |
+
rows.append({"source_id": sid, "category": cat, "description": desc, "amount": amount, "unit": rec_unit})
|
| 203 |
+
co2, ch4, n2o = gas_masses(amount * m, f1, f2, f3)
|
| 204 |
+
res[sid] = (co2, ch4, n2o, co2e_t(co2, ch4, n2o, gwp["CH4"], gwp["N2O"]))
|
| 205 |
+
tot[0] += co2; tot[1] += ch4 * gwp["CH4"] / 1000.0; tot[2] += n2o * gwp["N2O"] / 1000.0
|
| 206 |
+
rank = sorted(((v[3], s) for s, v in res.items()), reverse=True)
|
| 207 |
+
if d < 3 or rank[0][0] - rank[1][0] >= 0.03 * rank[0][0]: break
|
| 208 |
+
checks = []
|
| 209 |
+
for sid in sorted(res):
|
| 210 |
+
co2, ch4, n2o, e = res[sid]
|
| 211 |
+
checks += [c_num("sources.%s.co2_t" % sid, co2, 2), c_num("sources.%s.ch4_kg" % sid, ch4, 2), c_num("sources.%s.n2o_kg" % sid, n2o, 2), c_num("sources.%s.co2e_t" % sid, e, 2)]
|
| 212 |
+
files = {"sources.csv": to_csv(rows, ["source_id", "category", "description", "amount", "unit"]),
|
| 213 |
+
"gas_factors.csv": to_csv([c[:5] for c in cats], ["category", "unit", "co2_kg_per_unit", "ch4_g_per_unit", "n2o_g_per_unit"]),
|
| 214 |
+
"gwp_values.md": "# Global warming potentials\n\n100-year values from the %s. Use these values, not any others you may know.\n\n%s\n\nCO2e of a gas = mass of the gas x its GWP.\n"
|
| 215 |
+
% (label, md_table(["gas", "GWP"], [(g, gwp[g]) for g in ["CO2", "CH4", "N2O", "HFC-134a", "HFC-32", "SF6"]]))}
|
| 216 |
+
units = "Every amount is already in the unit of its category's factors."
|
| 217 |
+
if d >= 2: units = "Some amounts are in a different unit from their category's factors: convert first, using 1 m3 = 1000 litres and 1 tonne = 1000 kg."
|
| 218 |
+
hfc, more, grand = 0.0, "", sum(v[3] for v in res.values())
|
| 219 |
+
if d == 3:
|
| 220 |
+
fr = []
|
| 221 |
+
for i in range(r.randint(3, 5)):
|
| 222 |
+
gas, top = r.choice(["HFC-134a", "HFC-32"]), round(r.uniform(0.2, 6.0), 1)
|
| 223 |
+
fr.append({"unit_id": "AC%02d" % (i + 1), "location": r.choice(SITES), "refrigerant": gas, "charge_kg": round(top * r.uniform(2, 8), 1), "topped_up_kg": top})
|
| 224 |
+
hfc += top * gwp[gas] / 1000.0
|
| 225 |
+
files["refrigerant_log.csv"] = to_csv(fr, ["unit_id", "location", "refrigerant", "charge_kg", "topped_up_kg"])
|
| 226 |
+
units += (" `refrigerant_log.csv` lists the cooling units serviced in the year: take the refrigerant topped up (`topped_up_kg`) as the amount that leaked, "
|
| 227 |
+
"and convert it to CO2e with the GWP of that refrigerant. The charge is for information only.")
|
| 228 |
+
grand += hfc
|
| 229 |
+
checks += [c_num("refrigerants_t_co2e", hfc, 3), c_num("non_co2_share_percent", (grand - tot[0]) / grand * 100, 1), c_str("largest_source", rank[0][1], weight=2)]
|
| 230 |
+
more = ("\n- `refrigerants_t_co2e`: the refrigerant leaks in tonnes CO2e, 3 decimals."
|
| 231 |
+
"\n- `non_co2_share_percent`: the share of `totals.co2e_t` that does not come from CO2 (CH4, N2O and refrigerants), in percent, 1 decimal."
|
| 232 |
+
"\n- `largest_source`: the `source_id` in `sources.csv` with the largest CO2e.")
|
| 233 |
+
checks += [c_num("totals.co2_t", tot[0], 2), c_num("totals.ch4_t_co2e", tot[1], 2), c_num("totals.n2o_t_co2e", tot[2], 2), c_num("totals.co2e_t", grand, 2, weight=2)]
|
| 234 |
+
inst = """# Emissions inventory: three gases
|
| 235 |
+
|
| 236 |
+
You are compiling the %d greenhouse-gas inventory for %s (a synthetic organisation), gas by gas.
|
| 237 |
+
|
| 238 |
+
- `sources.csv`: the emission sources and their activity amounts.
|
| 239 |
+
- `gas_factors.csv`: for each category, the emissions per unit of activity: CO2 in kg, CH4 in grams and N2O in grams.
|
| 240 |
+
- `gwp_values.md`: the global warming potentials to use.
|
| 241 |
+
|
| 242 |
+
%s
|
| 243 |
+
|
| 244 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 245 |
+
|
| 246 |
+
- `sources`: an object keyed by `source_id`, each with
|
| 247 |
+
- `co2_t`: CO2 emitted, in tonnes, 2 decimals.
|
| 248 |
+
- `ch4_kg`: CH4 emitted, in kg, 2 decimals.
|
| 249 |
+
- `n2o_kg`: N2O emitted, in kg, 2 decimals.
|
| 250 |
+
- `co2e_t`: the three gases together in tonnes CO2e, 2 decimals.
|
| 251 |
+
- `totals`: an object with `co2_t` (all CO2, tonnes), `ch4_t_co2e` (all CH4 as tonnes CO2e), `n2o_t_co2e` (all N2O as tonnes CO2e) and `co2e_t` (%s), each 2 decimals.%s
|
| 252 |
+
|
| 253 |
+
1 tonne = 1000 kg = 1 000 000 g. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.
|
| 254 |
+
""" % (year, org, units, "everything together, including the refrigerant leaks, as tonnes CO2e" if d == 3 else "everything together as tonnes CO2e", more)
|
| 255 |
+
return Task(ENV, "multi-gas", seed, d, "CO2, CH4 and N2O for %d sources" % n, inst, files, checks, {"sources": n})
|
| 256 |
+
|
| 257 |
+
# ---------------------------------------------------------------- time series
|
| 258 |
+
OUTPUTS = [("tonnes of product", 4000, 60000), ("m2 of heated floor area", 20000, 300000), ("residents", 8000, 120000), ("thousand parcels delivered", 500, 20000)]
|
| 259 |
+
|
| 260 |
+
def gen_series(seed, d):
|
| 261 |
+
r = rng_for(ENV + "/time-series", seed, d)
|
| 262 |
+
org = r.choice(ORGS)
|
| 263 |
+
n_years = {1: 5, 2: 6, 3: 7}[d]
|
| 264 |
+
out_name, lo, hi = r.choice(OUTPUTS)
|
| 265 |
+
while True:
|
| 266 |
+
y0 = r.randint(2014, 2018)
|
| 267 |
+
years = list(range(y0, y0 + n_years))
|
| 268 |
+
sites = ["all"] if d == 1 else sorted(r.sample(["Alder", "Birch", "Cedar", "Dunlin", "Elm"], r.randint(3, 4)))
|
| 269 |
+
sold = r.choice(sites) if d == 3 else None
|
| 270 |
+
level = dict(((s, k), r.uniform(300, 9000) / len(sites)) for s in sites for k in "123")
|
| 271 |
+
out_level = dict((s, r.uniform(lo, hi) / len(sites)) for s in sites)
|
| 272 |
+
ledger, outputs, totals, out_tot = [], [], {}, {}
|
| 273 |
+
for y in years:
|
| 274 |
+
totals[y], out_tot[y] = 0.0, 0
|
| 275 |
+
for s in sites:
|
| 276 |
+
gone = s == sold and y >= sold_year(years) if sold else False
|
| 277 |
+
if gone: continue
|
| 278 |
+
for k in "123":
|
| 279 |
+
level[(s, k)] *= r.uniform(0.89, 1.06)
|
| 280 |
+
amount = round(level[(s, k)], 1)
|
| 281 |
+
unit = "kg" if (d >= 2 and r.random() < 0.3) else "t"
|
| 282 |
+
ledger.append({"year": y, "site": s, "scope": k, "amount": int(round(amount * 1000)) if unit == "kg" else amount, "unit": unit})
|
| 283 |
+
if s != sold: totals[y] += amount
|
| 284 |
+
out_level[s] *= r.uniform(0.95, 1.07)
|
| 285 |
+
o = int(round(out_level[s]))
|
| 286 |
+
outputs.append({"year": y, "site": s, "output": o})
|
| 287 |
+
if s != sold: out_tot[y] += o
|
| 288 |
+
base, latest = years[0], years[-1]
|
| 289 |
+
cut = r.choice([25, 30, 35, 40, 42, 45, 50])
|
| 290 |
+
target_year = latest + r.randint(4, 9)
|
| 291 |
+
target = target_level(totals[base], cut)
|
| 292 |
+
path = linear_path(totals[base], target, base, target_year, latest)
|
| 293 |
+
if totals[latest] < target * 1.05 or abs(totals[latest] - path) < 0.015 * path: continue
|
| 294 |
+
break
|
| 295 |
+
checks = []
|
| 296 |
+
for i, y in enumerate(years):
|
| 297 |
+
checks += [c_num("years.%d.total_t_co2e" % y, totals[y], 1), c_num("years.%d.intensity_kg_per_unit" % y, intensity_kg_per_unit(totals[y], out_tot[y]), 1)]
|
| 298 |
+
if i: checks += [c_num("years.%d.change_vs_previous_percent" % y, percent_change(totals[y], totals[years[i - 1]]), 1),
|
| 299 |
+
c_num("years.%d.change_vs_base_percent" % y, percent_change(totals[y], totals[base]), 1)]
|
| 300 |
+
left = target_year - latest
|
| 301 |
+
checks += [c_num("target_t_co2e", target, 1), c_num("required_annual_reduction_t", linear_annual_cut(totals[latest], target, left), 1)]
|
| 302 |
+
tfile = ("# Emissions target: %s\n\n- Base year: %d\n- Target year: %d\n- Target: total emissions (scopes 1 to 3) %d %% below the base-year total.\n- Output measure: %s.\n"
|
| 303 |
+
% (org, base, target_year, cut, out_name))
|
| 304 |
+
more = ""
|
| 305 |
+
if d == 1:
|
| 306 |
+
rows = [{"year": y, "scope_1_t": None, "scope_2_t": None, "scope_3_t": None, "output": out_tot[y]} for y in years]
|
| 307 |
+
for row in rows:
|
| 308 |
+
for e in ledger:
|
| 309 |
+
if e["year"] == row["year"]: row["scope_%s_t" % e["scope"]] = e["amount"]
|
| 310 |
+
r.shuffle(rows)
|
| 311 |
+
files = {"annual_emissions.csv": to_csv(rows, ["year", "scope_1_t", "scope_2_t", "scope_3_t", "output"])}
|
| 312 |
+
data = "`annual_emissions.csv` gives the emissions of each year by scope in tonnes CO2e and the year's output (%s). The rows are in no particular order." % out_name
|
| 313 |
+
else:
|
| 314 |
+
r.shuffle(ledger)
|
| 315 |
+
files = {"emissions_ledger.csv": to_csv(ledger, ["year", "site", "scope", "amount", "unit"])}
|
| 316 |
+
data = ("`emissions_ledger.csv` holds one row per year, site and scope. The `amount` is in tonnes CO2e when `unit` is `t` and in kg CO2e when it is `kg` (1 tonne = 1000 kg). "
|
| 317 |
+
"A year's total is the sum over all sites and scopes.")
|
| 318 |
+
if d == 2:
|
| 319 |
+
agg = [{"year": y, "output": out_tot[y]} for y in years]; r.shuffle(agg)
|
| 320 |
+
files["output.csv"] = to_csv(agg, ["year", "output"])
|
| 321 |
+
data += " `output.csv` gives each year's output (%s)." % out_name
|
| 322 |
+
else:
|
| 323 |
+
r.shuffle(outputs)
|
| 324 |
+
files["output.csv"] = to_csv(outputs, ["year", "site", "output"])
|
| 325 |
+
data += (" `output.csv` gives each site's output per year (%s); a year's output is the sum over sites. Site %s was sold in %d. Under the base-year recalculation policy "
|
| 326 |
+
"in `target.md`, leave site %s out of every year, in both emissions and output." % (out_name, sold, sold_year(years), sold))
|
| 327 |
+
tfile += "- Divested site: %s (sold in %d)\n" % (sold, sold_year(years))
|
| 328 |
+
tfile += ("- Base-year recalculation policy: when a site is sold, its emissions and output are removed from every year of the series, the base year included, "
|
| 329 |
+
"so that all years cover the same sites.\n")
|
| 330 |
+
checks += [c_num("linear_path_latest_t", path, 1), c_bool("on_track", totals[latest] <= path)]
|
| 331 |
+
more = ("\n- `linear_path_latest_t`: where a straight line from the base-year total (in the base year) to the target (in the target year) stands in %d, tonnes CO2e, 1 decimal."
|
| 332 |
+
"\n- `on_track`: true if the %d total is at or below `linear_path_latest_t`, otherwise false." % (latest, latest))
|
| 333 |
+
if d == 3:
|
| 334 |
+
checks.append(c_num("required_annual_reduction_percent", compound_annual_cut_percent(totals[latest], target, left), 2))
|
| 335 |
+
more += ("\n- `required_annual_reduction_percent`: the constant percentage cut per year that takes the %d total to the target by the target year, 2 decimals: "
|
| 336 |
+
"(1 - (target / latest total)^(1 / years left)) x 100." % latest)
|
| 337 |
+
files["target.md"] = tfile
|
| 338 |
+
inst = """# Emissions inventory: trend and target
|
| 339 |
+
|
| 340 |
+
%s `target.md` gives the base year and the reduction target of %s (a synthetic organisation).
|
| 341 |
+
|
| 342 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 343 |
+
|
| 344 |
+
- `years`: an object keyed by year (as a string, for example "%d"), each with
|
| 345 |
+
- `total_t_co2e`: scopes 1 to 3 together, tonnes CO2e, 1 decimal.
|
| 346 |
+
- `intensity_kg_per_unit`: kg CO2e per unit of output (total x 1000 / output), 1 decimal.
|
| 347 |
+
- `change_vs_previous_percent`: change in the total against the year before, in percent, 1 decimal (negative for a fall). Leave it out for %d.
|
| 348 |
+
- `change_vs_base_percent`: change in the total against the base year, in percent, 1 decimal (negative for a fall). Leave it out for %d.
|
| 349 |
+
- `target_t_co2e`: the total allowed in the target year, tonnes CO2e, 1 decimal.
|
| 350 |
+
- `required_annual_reduction_t`: the equal cut in tonnes CO2e per year that takes the %d total to the target by the target year: (latest total - target) / years left, 1 decimal.%s
|
| 351 |
+
|
| 352 |
+
A percentage change is (new - old) / old x 100. Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.
|
| 353 |
+
""" % (data, org, base, base, base, latest, more)
|
| 354 |
+
return Task(ENV, "time-series", seed, d, "Emissions trend over %d years" % n_years, inst, files, checks, {"years": n_years})
|
| 355 |
+
|
| 356 |
+
def sold_year(years):
|
| 357 |
+
"""The divested site reports up to and including the year before this one."""
|
| 358 |
+
return years[-2]
|
| 359 |
+
|
| 360 |
+
# ---------------------------------------------------------------- data quality
|
| 361 |
+
def gen_quality(seed, d):
|
| 362 |
+
r = rng_for(ENV + "/data-quality", seed, d)
|
| 363 |
+
org, year = r.choice(ORGS), r.randint(2019, 2024)
|
| 364 |
+
n = {1: 3, 2: 5, 3: 6}[d]
|
| 365 |
+
factor = round(r.uniform(0.08, 0.45), 3)
|
| 366 |
+
months = ["%d-%02d" % (year, m) for m in range(1, 13)]
|
| 367 |
+
while True:
|
| 368 |
+
meters = ["M%02d" % i for i in sorted(r.sample(range(1, 60), n))]
|
| 369 |
+
sites = sorted(r.sample(SITES, 2 if d < 3 else 3))
|
| 370 |
+
site_of = dict((m, sites[i] if i < len(sites) else r.choice(sites)) for i, m in enumerate(meters))
|
| 371 |
+
gaps = dict((m, []) for m in meters)
|
| 372 |
+
if d >= 2:
|
| 373 |
+
for m in r.sample(meters, 2 if d == 2 else 3):
|
| 374 |
+
first = r.randint(1, 10)
|
| 375 |
+
gaps[m] = [first] + ([r.randint(first + 2, 10)] if d == 3 and first <= 8 and r.random() < 0.5 else [])
|
| 376 |
+
rows, clean, dups, filled = [], {}, {}, {}
|
| 377 |
+
for m in meters:
|
| 378 |
+
base = r.uniform(1500, 40000)
|
| 379 |
+
vals = [int(round(base * (1 + 0.35 * abs(6.5 - k) / 5.5 * r.uniform(0.6, 1.2)) * r.uniform(0.9, 1.1))) for k in range(1, 13)]
|
| 380 |
+
present = [k for k in range(12) if k not in gaps[m]]
|
| 381 |
+
twice = r.sample(present, r.randint(0, 3))
|
| 382 |
+
dups[m] = len(twice)
|
| 383 |
+
def row(k):
|
| 384 |
+
unit = "MWh" if (d == 3 and r.random() < 0.35) else "kWh"
|
| 385 |
+
return {"meter_id": m, "site": site_of[m], "month": months[k], "consumption": "%.3f" % (vals[k] / 1000.0) if unit == "MWh" else vals[k], "unit": unit}
|
| 386 |
+
for k in present:
|
| 387 |
+
first = row(k); first["invoice_ref"] = "E%06d" % r.randint(100000, 999999)
|
| 388 |
+
rows.append(first)
|
| 389 |
+
if k in twice:
|
| 390 |
+
again = row(k) if d == 3 else dict(first)
|
| 391 |
+
again["invoice_ref"] = first["invoice_ref"]
|
| 392 |
+
rows.append(again)
|
| 393 |
+
filled[m] = dict((months[k], fill_gap(vals[k - 1], vals[k + 1])) for k in gaps[m])
|
| 394 |
+
clean[m] = [filled[m][months[k]] if k in gaps[m] else float(vals[k]) for k in range(12)]
|
| 395 |
+
by_month = sorted(((sum(clean[m][k] for m in meters), months[k]) for k in range(12)), reverse=True)
|
| 396 |
+
if sum(dups.values()) < 2 or by_month[0][0] - by_month[1][0] < 0.02 * by_month[0][0]: continue
|
| 397 |
+
break
|
| 398 |
+
r.shuffle(rows)
|
| 399 |
+
checks = []
|
| 400 |
+
for m in meters: checks += [c_num("meters.%s.annual_kwh" % m, sum(clean[m]), 1), c_int("meters.%s.duplicate_rows" % m, dups[m])]
|
| 401 |
+
total = sum(sum(clean[m]) for m in meters)
|
| 402 |
+
checks += [c_int("duplicate_rows_removed", sum(dups.values())), c_num("total_kwh", total, 1), c_num("total_t_co2e", total * factor / 1000.0, 2, weight=2)]
|
| 403 |
+
rules = ["A meter should have exactly one row per month. Where a meter has more than one row for the same month, the later rows are duplicates loaded twice: "
|
| 404 |
+
"they always carry the same consumption as the first%s. Keep one row and drop the rest." % (" once both are in the same unit" if d == 3 else "")]
|
| 405 |
+
more = ""
|
| 406 |
+
if d >= 2:
|
| 407 |
+
rules.append("Where a meter has no row for a month, fill it with the mean of that meter's consumption in the month before and the month after. "
|
| 408 |
+
"A missing month always has both neighbours present, and it is never January or December.")
|
| 409 |
+
for m in meters:
|
| 410 |
+
for mo, v in sorted(filled[m].items()): checks.append(c_num("filled.%s.%s" % (m, mo), v, 1))
|
| 411 |
+
checks.append(c_set("meters_with_gap", [m for m in meters if gaps[m]], weight=2))
|
| 412 |
+
more += ("\n- `filled`: an object keyed by meter id, only for meters that had a missing month. Each value is an object keyed by the missing month (`YYYY-MM`) "
|
| 413 |
+
"giving the filled consumption in kWh, 1 decimal.\n- `meters_with_gap`: list of the meter ids that had at least one missing month (any order).")
|
| 414 |
+
if d == 3:
|
| 415 |
+
rules.insert(0, "The `consumption` column mixes units: each row is in kWh or in MWh as its `unit` says. Convert everything to kWh first (1 MWh = 1000 kWh).")
|
| 416 |
+
by_site = dict((s, sum(sum(clean[m]) for m in meters if site_of[m] == s) * factor / 1000.0) for s in sites)
|
| 417 |
+
checks += [c_num("by_site_t_co2e.%s" % s, by_site[s], 2) for s in sites] + [c_str("peak_month", by_month[0][1])]
|
| 418 |
+
more += ("\n- `by_site_t_co2e`: an object keyed by site, tonnes CO2e from the cleaned consumption of that site's meters, 2 decimals."
|
| 419 |
+
"\n- `peak_month`: the month (`YYYY-MM`) with the highest cleaned consumption summed over all meters.")
|
| 420 |
+
rules.append("Emissions = cleaned consumption in kWh x the electricity emission factor, converted from kg to tonnes (1 tonne = 1000 kg).")
|
| 421 |
+
rfile = "# Data rules for the %d electricity return\n\n- Electricity emission factor: %.3f kg CO2e per kWh (use this value).\n\n%s\n" % (year, factor, "\n".join("%d. %s" % (i + 1, x) for i, x in enumerate(rules)))
|
| 422 |
+
inst = """# Emissions inventory: cleaning the meter data
|
| 423 |
+
|
| 424 |
+
`meter_readings.csv` is the %d monthly electricity consumption export for the meters of %s (a synthetic organisation). It was assembled from several uploads and needs cleaning before it can be used. `data_rules.md` gives the cleaning rules and the emission factor.
|
| 425 |
+
|
| 426 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 427 |
+
|
| 428 |
+
- `meters`: an object keyed by meter id, each with
|
| 429 |
+
- `annual_kwh`: the meter's consumption for the twelve months after cleaning, in kWh, 1 decimal.
|
| 430 |
+
- `duplicate_rows`: how many of its rows you dropped as duplicates, as an integer (0 if none).
|
| 431 |
+
- `duplicate_rows_removed`: the number of duplicate rows dropped over all meters, as an integer.
|
| 432 |
+
- `total_kwh`: cleaned consumption of all meters, in kWh, 1 decimal.
|
| 433 |
+
- `total_t_co2e`: emissions from `total_kwh`, in tonnes CO2e, 2 decimals.%s
|
| 434 |
+
|
| 435 |
+
Do not round intermediate values. Numbers are accepted within one unit of the last decimal place asked for.
|
| 436 |
+
""" % (year, org, more)
|
| 437 |
+
return Task(ENV, "data-quality", seed, d, "Cleaning meter data for %d meters" % n, inst,
|
| 438 |
+
{"meter_readings.csv": to_csv(rows, ["meter_id", "site", "month", "consumption", "unit", "invoice_ref"]), "data_rules.md": rfile}, checks, {"meters": n})
|
| 439 |
+
|
| 440 |
+
FAMILIES = {"activity-data": gen_activity, "multi-gas": gen_multigas, "time-series": gen_series, "data-quality": gen_quality}
|
| 441 |
+
|
| 442 |
+
def generate(seed, difficulty, family=None):
|
| 443 |
+
fam = family or sorted(FAMILIES)[seed % len(FAMILIES)]
|
| 444 |
+
return FAMILIES[fam](seed, difficulty)
|
envs/emissions_inventory/oracle.py
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Reference solution for Emissions Inventory. Works only from the files in the current directory."""
|
| 3 |
+
import csv, json, os, re
|
| 4 |
+
|
| 5 |
+
def rows(name):
|
| 6 |
+
with open(name, newline="") as f: return list(csv.DictReader(f))
|
| 7 |
+
|
| 8 |
+
def text(name):
|
| 9 |
+
with open(name) as f: return f.read()
|
| 10 |
+
|
| 11 |
+
def activity():
|
| 12 |
+
year = re.search(r"Reporting year:\s*(\d{4})", text("inventory_boundary.md")).group(1)
|
| 13 |
+
factors = dict((r["source"], r) for r in rows("emission_factors.csv"))
|
| 14 |
+
conv = rows("unit_conversions.csv")
|
| 15 |
+
recs = rows("activity_data.csv")
|
| 16 |
+
by_source, by_scope, by_site, outside = {}, {"scope_1": 0.0, "scope_2": 0.0, "scope_3": 0.0}, {}, 0.0
|
| 17 |
+
for r in recs:
|
| 18 |
+
if r["invoice_date"][:4] != year: continue
|
| 19 |
+
f = factors[r["source"]]
|
| 20 |
+
q = float(r["quantity"])
|
| 21 |
+
if r["unit"] != f["unit"]:
|
| 22 |
+
hit = [c for c in conv if c["from_unit"] == r["unit"] and c["to_unit"] == f["unit"] and (c["applies_to"] == "all" or r["source"] in c["applies_to"].split(";"))]
|
| 23 |
+
assert len(hit) == 1, (r, hit)
|
| 24 |
+
q *= float(hit[0]["multiply_by"])
|
| 25 |
+
e = q * float(f["factor_kg_co2e_per_unit"]) / 1000.0
|
| 26 |
+
by_source[r["source"]] = by_source.get(r["source"], 0.0) + e
|
| 27 |
+
if f["scope"] in ("1", "2", "3"):
|
| 28 |
+
by_scope["scope_" + f["scope"]] += e
|
| 29 |
+
by_site[r["site"]] = by_site.get(r["site"], 0.0) + e
|
| 30 |
+
else: outside += e
|
| 31 |
+
total = sum(by_scope.values())
|
| 32 |
+
in_scope = [s for s in by_source if factors[s]["scope"] in ("1", "2", "3")]
|
| 33 |
+
r2 = lambda d_: dict((k, round(v, 2)) for k, v in d_.items())
|
| 34 |
+
return {"by_source": r2(by_source), "by_scope": r2(by_scope), "by_site": r2(by_site), "total_t_co2e": round(total, 2), "outside_scopes_t_co2e": round(outside, 2),
|
| 35 |
+
"scope_share_percent": dict((k, round(100 * v / total, 1)) for k, v in by_scope.items()), "largest_source": max(in_scope, key=lambda s: by_source[s])}
|
| 36 |
+
|
| 37 |
+
def multigas():
|
| 38 |
+
gwp = {}
|
| 39 |
+
for line in text("gwp_values.md").splitlines():
|
| 40 |
+
cells = [c.strip() for c in line.strip().strip("|").split("|")]
|
| 41 |
+
if line.strip().startswith("|") and len(cells) == 2 and re.match(r"^[0-9.]+$", cells[1]): gwp[cells[0]] = float(cells[1])
|
| 42 |
+
factors = dict((r["category"], r) for r in rows("gas_factors.csv"))
|
| 43 |
+
to_unit = {("m3", "litre"): 1000.0, ("kg", "tonne"): 0.001}
|
| 44 |
+
ans = {"sources": {}}
|
| 45 |
+
tot = {"co2_t": 0.0, "ch4_t_co2e": 0.0, "n2o_t_co2e": 0.0}
|
| 46 |
+
full = {}
|
| 47 |
+
for r in rows("sources.csv"):
|
| 48 |
+
f = factors[r["category"]]
|
| 49 |
+
amount = float(r["amount"]) * (1.0 if r["unit"] == f["unit"] else to_unit[(r["unit"], f["unit"])])
|
| 50 |
+
co2 = amount * float(f["co2_kg_per_unit"]) / 1000.0
|
| 51 |
+
ch4 = amount * float(f["ch4_g_per_unit"]) / 1000.0
|
| 52 |
+
n2o = amount * float(f["n2o_g_per_unit"]) / 1000.0
|
| 53 |
+
e = co2 * gwp["CO2"] + ch4 * gwp["CH4"] / 1000.0 + n2o * gwp["N2O"] / 1000.0
|
| 54 |
+
ans["sources"][r["source_id"]] = {"co2_t": round(co2, 2), "ch4_kg": round(ch4, 2), "n2o_kg": round(n2o, 2), "co2e_t": round(e, 2)}
|
| 55 |
+
full[r["source_id"]] = e
|
| 56 |
+
tot["co2_t"] += co2; tot["ch4_t_co2e"] += ch4 * gwp["CH4"] / 1000.0; tot["n2o_t_co2e"] += n2o * gwp["N2O"] / 1000.0
|
| 57 |
+
hfc = 0.0
|
| 58 |
+
if os.path.exists("refrigerant_log.csv"):
|
| 59 |
+
for r in rows("refrigerant_log.csv"): hfc += float(r["topped_up_kg"]) * gwp[r["refrigerant"]] / 1000.0
|
| 60 |
+
grand = sum(tot.values()) + hfc
|
| 61 |
+
ans["totals"] = dict((k, round(v, 2)) for k, v in tot.items())
|
| 62 |
+
ans["totals"]["co2e_t"] = round(grand, 2)
|
| 63 |
+
ans.update(refrigerants_t_co2e=round(hfc, 3), non_co2_share_percent=round(100 * (grand - tot["co2_t"]) / grand, 1), largest_source=max(full, key=lambda s: full[s]))
|
| 64 |
+
return ans
|
| 65 |
+
|
| 66 |
+
def series():
|
| 67 |
+
target = text("target.md")
|
| 68 |
+
base = int(re.search(r"Base year:\s*(\d{4})", target).group(1))
|
| 69 |
+
target_year = int(re.search(r"Target year:\s*(\d{4})", target).group(1))
|
| 70 |
+
cut = float(re.search(r"([0-9.]+)\s*% below", target).group(1))
|
| 71 |
+
totals, output = {}, {}
|
| 72 |
+
if os.path.exists("annual_emissions.csv"):
|
| 73 |
+
for r in rows("annual_emissions.csv"):
|
| 74 |
+
totals[int(r["year"])] = float(r["scope_1_t"]) + float(r["scope_2_t"]) + float(r["scope_3_t"])
|
| 75 |
+
output[int(r["year"])] = float(r["output"])
|
| 76 |
+
else:
|
| 77 |
+
ledger, out = rows("emissions_ledger.csv"), rows("output.csv")
|
| 78 |
+
sold = re.search(r"Divested site:\s*(\w+)", target)
|
| 79 |
+
still = set(r["site"] for r in ledger) - set([sold.group(1)] if sold else [])
|
| 80 |
+
for r in ledger:
|
| 81 |
+
if r["site"] not in still: continue
|
| 82 |
+
y = int(r["year"])
|
| 83 |
+
totals[y] = totals.get(y, 0.0) + float(r["amount"]) / (1000.0 if r["unit"] == "kg" else 1.0)
|
| 84 |
+
for r in out:
|
| 85 |
+
if "site" in r and r["site"] not in still: continue
|
| 86 |
+
output[int(r["year"])] = output.get(int(r["year"]), 0.0) + float(r["output"])
|
| 87 |
+
years = sorted(totals)
|
| 88 |
+
latest = years[-1]
|
| 89 |
+
ans = {"years": {}}
|
| 90 |
+
for i, y in enumerate(years):
|
| 91 |
+
o = {"total_t_co2e": round(totals[y], 1), "intensity_kg_per_unit": round(totals[y] * 1000.0 / output[y], 1)}
|
| 92 |
+
if y != base:
|
| 93 |
+
o["change_vs_previous_percent"] = round((totals[y] - totals[years[i - 1]]) / totals[years[i - 1]] * 100, 1)
|
| 94 |
+
o["change_vs_base_percent"] = round((totals[y] - totals[base]) / totals[base] * 100, 1)
|
| 95 |
+
ans["years"][str(y)] = o
|
| 96 |
+
goal = totals[base] * (1 - cut / 100.0)
|
| 97 |
+
left = target_year - latest
|
| 98 |
+
path = totals[base] - (totals[base] - goal) * (latest - base) / float(target_year - base)
|
| 99 |
+
ans.update(target_t_co2e=round(goal, 1), required_annual_reduction_t=round((totals[latest] - goal) / left, 1), linear_path_latest_t=round(path, 1),
|
| 100 |
+
on_track=totals[latest] <= path, required_annual_reduction_percent=round((1 - (goal / totals[latest]) ** (1.0 / left)) * 100, 2))
|
| 101 |
+
return ans
|
| 102 |
+
|
| 103 |
+
def quality():
|
| 104 |
+
factor = float(re.search(r"emission factor:\s*([0-9.]+)", text("data_rules.md")).group(1))
|
| 105 |
+
seen, dups, site = {}, {}, {}
|
| 106 |
+
for r in rows("meter_readings.csv"):
|
| 107 |
+
m = r["meter_id"]
|
| 108 |
+
site[m] = r["site"]; seen.setdefault(m, {}); dups.setdefault(m, 0)
|
| 109 |
+
kwh = float(r["consumption"]) * (1000.0 if r["unit"] == "MWh" else 1.0)
|
| 110 |
+
if r["month"] in seen[m]:
|
| 111 |
+
assert abs(seen[m][r["month"]] - kwh) < 1e-6
|
| 112 |
+
dups[m] += 1
|
| 113 |
+
else: seen[m][r["month"]] = kwh
|
| 114 |
+
year = sorted(next(iter(seen.values())))[0][:4]
|
| 115 |
+
months = ["%s-%02d" % (year, k) for k in range(1, 13)]
|
| 116 |
+
ans = {"meters": {}, "filled": {}, "meters_with_gap": []}
|
| 117 |
+
month_total, site_total, total = dict((mo, 0.0) for mo in months), {}, 0.0
|
| 118 |
+
for m, have in seen.items():
|
| 119 |
+
filled = {}
|
| 120 |
+
for i, mo in enumerate(months):
|
| 121 |
+
if mo not in have: filled[mo] = (have[months[i - 1]] + have[months[i + 1]]) / 2.0
|
| 122 |
+
if filled:
|
| 123 |
+
ans["filled"][m] = dict((mo, round(v, 1)) for mo, v in filled.items()); ans["meters_with_gap"].append(m)
|
| 124 |
+
have = dict(have); have.update(filled)
|
| 125 |
+
annual = sum(have.values())
|
| 126 |
+
ans["meters"][m] = {"annual_kwh": round(annual, 1), "duplicate_rows": dups[m]}
|
| 127 |
+
for mo in months: month_total[mo] += have[mo]
|
| 128 |
+
site_total[site[m]] = site_total.get(site[m], 0.0) + annual
|
| 129 |
+
total += annual
|
| 130 |
+
ans.update(duplicate_rows_removed=sum(dups.values()), total_kwh=round(total, 1), total_t_co2e=round(total * factor / 1000.0, 2),
|
| 131 |
+
by_site_t_co2e=dict((s, round(v * factor / 1000.0, 2)) for s, v in site_total.items()), peak_month=max(months, key=lambda mo: month_total[mo]))
|
| 132 |
+
return ans
|
| 133 |
+
|
| 134 |
+
if os.path.exists("activity_data.csv"): answer = activity()
|
| 135 |
+
elif os.path.exists("gwp_values.md"): answer = multigas()
|
| 136 |
+
elif os.path.exists("target.md"): answer = series()
|
| 137 |
+
else: answer = quality()
|
| 138 |
+
with open("answer.json", "w") as f: json.dump(answer, f, indent=1)
|
envs/exposure_assessment/__init__.py
ADDED
|
File without changes
|
envs/exposure_assessment/env.toml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
name = "exposure-assessment"
|
| 2 |
+
title = "Exposure Assessment"
|
| 3 |
+
isced = "1022"
|
| 4 |
+
summary = "Do an occupational hygienist's sums from workplace records: noise dose, airborne chemical averages, hand-arm vibration and injury rates against given limits."
|
| 5 |
+
task_type = "exposure calculation"
|
| 6 |
+
good_for = ["Logarithmic and root-sum-square arithmetic on logs", "Filtering records by a written definition", "Comparing results with supplied limit values"]
|
| 7 |
+
families = ["noise", "chemicals", "vibration", "incidents"]
|
envs/exposure_assessment/gen.py
ADDED
|
@@ -0,0 +1,685 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Exposure Assessment (ISCED-F 1022 Occupational health and safety).
|
| 2 |
+
|
| 3 |
+
Four task families, all from synthetic workplace records:
|
| 4 |
+
noise daily personal noise exposure L_EX,8h from a task diary, weekly exposure, extra time before a limit
|
| 5 |
+
chemicals 8-hour time-weighted averages from air samples, ppm <-> mg/m3, exposure index, additive mixture index
|
| 6 |
+
vibration daily hand-arm vibration exposure A(8) for several tools, time for each tool alone to reach a value
|
| 7 |
+
incidents lost-time injury frequency rate and severity rate from an incident log and an hours-worked table
|
| 8 |
+
|
| 9 |
+
Methods (the formulas are also written out in every task, so nothing rests on recall):
|
| 10 |
+
L_EX,8h = 10 log10((1/8) sum t_i 10^(L_i/10)), t in hours: ISO 9612:2009 / ISO 1999; also Directive 2003/10/EC.
|
| 11 |
+
Weekly exposure = 10 log10((1/5) sum over the days worked of 10^(L_EX,8h/10)): ISO 1999 normalisation to a
|
| 12 |
+
nominal 5-day week, as used in Directive 2003/10/EC Art. 3(3) and UK HSE guidance L108.
|
| 13 |
+
8-hour TWA = sum(C_i t_i) / 480 min: standard occupational hygiene practice (e.g. UK HSE EH40, "Calculation of
|
| 14 |
+
exposure with regard to the specified reference periods").
|
| 15 |
+
mg/m3 = ppm x M / 24.45 (molar volume of an ideal gas at 25 deg C and 101.3 kPa): NIOSH / ACGIH convention.
|
| 16 |
+
Additive mixture index = sum(C_i / OEL_i) for substances with similar effects: ACGIH TLV mixture formula, EH40.
|
| 17 |
+
A(8) = sqrt(sum a_i^2 t_i / 8 h), time to a value = 8 h x (value / a)^2, vibration total value
|
| 18 |
+
a_hv = sqrt(ax^2 + ay^2 + az^2): ISO 5349-1:2001 and ISO 5349-2; also Directive 2002/44/EC.
|
| 19 |
+
Frequency rate = injuries x K / hours worked, severity rate = days lost x K / hours worked: ILO resolution on
|
| 20 |
+
statistics of occupational injuries (16th ICLS, 1998); K is stated in each task.
|
| 21 |
+
|
| 22 |
+
Every action value, limit value and occupational exposure limit is supplied in the task as "use these values".
|
| 23 |
+
They are exercise values and are not presented as any country's law. Molar masses are standard values and are
|
| 24 |
+
supplied in the task table as well.
|
| 25 |
+
"""
|
| 26 |
+
import math
|
| 27 |
+
from practice.core import Task, rng_for, to_csv, c_int, c_num, c_str, c_set, clear_of
|
| 28 |
+
|
| 29 |
+
ENV = "exposure-assessment"
|
| 30 |
+
NOTE = "Use these values. They are set for this exercise and are not presented as any country's legal limits."
|
| 31 |
+
TOL = "Numbers are accepted within one unit of the last decimal place asked for."
|
| 32 |
+
|
| 33 |
+
def hhmm(m): return "%02d:%02d" % (m // 60, m % 60)
|
| 34 |
+
|
| 35 |
+
# ---------------------------------------------------------------- noise
|
| 36 |
+
def lex8h(parts):
|
| 37 |
+
"""Daily personal noise exposure in dB(A). parts: (hours, level in dB(A)) per task."""
|
| 38 |
+
return 10 * math.log10(sum(t * 10 ** (L / 10.0) for t, L in parts) / 8.0)
|
| 39 |
+
|
| 40 |
+
def lex_week(dailies):
|
| 41 |
+
"""Weekly exposure from the L_EX,8h of each day worked, normalised to five 8-hour days."""
|
| 42 |
+
return 10 * math.log10(sum(10 ** (L / 10.0) for L in dailies) / 5.0)
|
| 43 |
+
|
| 44 |
+
def extra_hours(parts, level, limit):
|
| 45 |
+
"""Hours that can be added at `level` before L_EX,8h reaches `limit`; 0 if it is already there."""
|
| 46 |
+
room = 8.0 * 10 ** (limit / 10.0) - sum(t * 10 ** (L / 10.0) for t, L in parts)
|
| 47 |
+
return max(0.0, room / 10 ** (level / 10.0))
|
| 48 |
+
|
| 49 |
+
def noise_band(L, lower, upper, limit):
|
| 50 |
+
return "over_limit" if L > limit else "upper_action" if L >= upper else "lower_action" if L >= lower else "below_lower_action"
|
| 51 |
+
|
| 52 |
+
NOISE_TASKS = [("angle grinding", 96, 102), ("pneumatic chiselling", 99, 105), ("circular saw", 94, 99), ("sand blasting", 100, 106),
|
| 53 |
+
("press brake", 88, 93), ("compressor room checks", 90, 95),
|
| 54 |
+
("welding", 84, 90), ("forklift driving", 81, 86), ("packing line", 79, 85), ("assembly bench", 74, 81),
|
| 55 |
+
("stores and dispatch", 68, 76), ("office and paperwork", 56, 65)]
|
| 56 |
+
DAYS = ["Mon", "Tue", "Wed", "Thu", "Fri"]
|
| 57 |
+
|
| 58 |
+
def noise_values_doc(lower, upper, limit):
|
| 59 |
+
return """# Noise exposure values for this assessment
|
| 60 |
+
|
| 61 |
+
%s
|
| 62 |
+
|
| 63 |
+
| Value | dB(A) |
|
| 64 |
+
|---|---|
|
| 65 |
+
| Lower action value | %d |
|
| 66 |
+
| Upper action value | %d |
|
| 67 |
+
| Limit value | %d |
|
| 68 |
+
|
| 69 |
+
## Bands
|
| 70 |
+
|
| 71 |
+
- `below_lower_action`: the exposure is below the lower action value.
|
| 72 |
+
- `lower_action`: at or above the lower action value and below the upper action value.
|
| 73 |
+
- `upper_action`: at or above the upper action value and not above the limit value.
|
| 74 |
+
- `over_limit`: above the limit value.
|
| 75 |
+
""" % (NOTE, lower, upper, limit)
|
| 76 |
+
|
| 77 |
+
def _noise_jobs(r, levels):
|
| 78 |
+
"""One day's jobs as (task, minutes, level); `levels` fixes the level per task, or None to draw one per job."""
|
| 79 |
+
while True:
|
| 80 |
+
k = r.randint(3, 4)
|
| 81 |
+
nl = min(k - 1, r.choice([0, 0, 1, 1, 2]))
|
| 82 |
+
picks = r.sample(NOISE_TASKS[:6], nl) + r.sample(NOISE_TASKS[6:], k - nl)
|
| 83 |
+
r.shuffle(picks)
|
| 84 |
+
jobs = []
|
| 85 |
+
for name, lo, hi in picks:
|
| 86 |
+
lv = levels[name] if levels else round(r.uniform(lo, hi), 1)
|
| 87 |
+
mins = r.choice([5, 10, 15, 20, 30] if lv >= 95 else [15, 30, 45, 60, 90] if lv >= 88 else [45, 60, 90, 120, 150, 180, 240])
|
| 88 |
+
jobs.append((name, mins, lv))
|
| 89 |
+
if sum(j[1] for j in jobs) <= 540: return jobs
|
| 90 |
+
|
| 91 |
+
def _clock(r, jobs):
|
| 92 |
+
"""Lay the jobs out through a shift; returns (task, start, end) with short unlisted gaps between them."""
|
| 93 |
+
t = 360 + r.choice([0, 30, 60, 90]); out = []
|
| 94 |
+
for name, mins, _ in jobs:
|
| 95 |
+
t += r.choice([0, 0, 5, 10, 15, 30])
|
| 96 |
+
out.append((name, hhmm(t), hhmm(t + mins))); t += mins
|
| 97 |
+
return out
|
| 98 |
+
|
| 99 |
+
def gen_noise(seed, d):
|
| 100 |
+
r = rng_for(ENV + "/noise", seed, d)
|
| 101 |
+
lower, upper, limit = r.choice([(80, 85, 87), (80, 85, 90), (77, 82, 85)])
|
| 102 |
+
thr = [lower, upper, limit]
|
| 103 |
+
n = {1: 3, 2: 5, 3: 4}[d]
|
| 104 |
+
wids = ["W%02d" % i for i in sorted(r.sample(range(1, 60), n))]
|
| 105 |
+
levels = None
|
| 106 |
+
if d >= 2: levels = dict((name, round(r.uniform(lo, hi), 1)) for name, lo, hi in NOISE_TASKS)
|
| 107 |
+
rows, checks, planned, res = [], [], [], {}
|
| 108 |
+
for w in wids:
|
| 109 |
+
if d == 1:
|
| 110 |
+
while True:
|
| 111 |
+
jobs = _noise_jobs(r, None)
|
| 112 |
+
L = lex8h([(m / 60.0, lv) for _, m, lv in jobs])
|
| 113 |
+
if clear_of(L, thr, 0.3): break
|
| 114 |
+
for name, m, lv in jobs: rows.append({"worker_id": w, "task": name, "duration_min": m, "laeq_db": lv})
|
| 115 |
+
res[w] = L
|
| 116 |
+
checks.append(c_num("workers.%s.lex8h_db" % w, L, 1))
|
| 117 |
+
elif d == 2:
|
| 118 |
+
cands = sorted(name for name in levels if levels[name] >= limit + 2)
|
| 119 |
+
while True:
|
| 120 |
+
jobs = _noise_jobs(r, levels)
|
| 121 |
+
parts = [(m / 60.0, lv) for _, m, lv in jobs]
|
| 122 |
+
L = lex8h(parts)
|
| 123 |
+
if not clear_of(L, thr, 0.3): continue
|
| 124 |
+
pt = r.choice(cands)
|
| 125 |
+
mins = extra_hours(parts, levels[pt], limit) * 60.0
|
| 126 |
+
if L > limit: extra = 0
|
| 127 |
+
elif mins > 300 or not 0.05 <= mins % 1 <= 0.95: continue
|
| 128 |
+
else: extra = int(mins)
|
| 129 |
+
break
|
| 130 |
+
for name, s, e in _clock(r, jobs): rows.append({"worker_id": w, "task": name, "start": s, "end": e})
|
| 131 |
+
planned.append({"worker_id": w, "planned_task": pt})
|
| 132 |
+
res[w] = L
|
| 133 |
+
checks += [c_num("workers.%s.lex8h_db" % w, L, 1), c_int("workers.%s.extra_minutes" % w, extra)]
|
| 134 |
+
else:
|
| 135 |
+
while True:
|
| 136 |
+
days = sorted(r.sample(range(5), r.randint(3, 5)))
|
| 137 |
+
per_day = [(DAYS[i], _noise_jobs(r, levels)) for i in days]
|
| 138 |
+
daily = [lex8h([(m / 60.0, lv) for _, m, lv in jobs]) for _, jobs in per_day]
|
| 139 |
+
L = lex_week(daily)
|
| 140 |
+
top = sorted(daily, reverse=True)
|
| 141 |
+
if clear_of(L, thr, 0.3) and top[0] - top[1] >= 0.3: break
|
| 142 |
+
for (day, jobs), Ld in zip(per_day, daily):
|
| 143 |
+
for name, s, e in _clock(r, jobs): rows.append({"worker_id": w, "day": day, "task": name, "start": s, "end": e})
|
| 144 |
+
checks.append(c_num("workers.%s.daily_lex8h_db.%s" % (w, day), Ld, 1))
|
| 145 |
+
res[w] = L
|
| 146 |
+
checks += [c_num("workers.%s.weekly_lex_db" % w, L, 1),
|
| 147 |
+
c_str("workers.%s.loudest_day" % w, per_day[daily.index(max(daily))][0])]
|
| 148 |
+
checks.append(c_str("workers.%s.band" % w, noise_band(res[w], lower, upper, limit)))
|
| 149 |
+
checks.append(c_set("at_or_above_upper_action", sorted(w for w in wids if res[w] >= upper), weight=2))
|
| 150 |
+
r.shuffle(rows)
|
| 151 |
+
files = {"exposure_values.md": noise_values_doc(lower, upper, limit)}
|
| 152 |
+
formula = """ L_EX,8h = 10 * log10( (1/8) * sum( t_i * 10^(L_i/10) ) )
|
| 153 |
+
|
| 154 |
+
with t_i the time spent on task i in hours and L_i the A-weighted equivalent level of that task in dB(A). Time that is not in the diary contributes nothing."""
|
| 155 |
+
if d == 1:
|
| 156 |
+
files["noise_diary.csv"] = to_csv(rows, ["worker_id", "task", "duration_min", "laeq_db"])
|
| 157 |
+
intro = "`noise_diary.csv` is the task diary for one working day: the tasks each worker did, the minutes spent on each and the level measured for that task (`laeq_db`, in dB(A))."
|
| 158 |
+
keys = [" - `lex8h_db`: the daily personal noise exposure L_EX,8h in dB(A), 1 decimal.",
|
| 159 |
+
" - `band`: the band of that exposure, one of the four names in `exposure_values.md`."]
|
| 160 |
+
basis = "L_EX,8h"
|
| 161 |
+
else:
|
| 162 |
+
lv_rows = [{"task": name, "laeq_db": levels[name], "lcpeak_db": round(levels[name] + r.uniform(14, 26), 1),
|
| 163 |
+
"measured_by": r.choice(["sound level meter", "dosimeter"])} for name, _, _ in NOISE_TASKS]
|
| 164 |
+
r.shuffle(lv_rows)
|
| 165 |
+
files["task_levels.csv"] = to_csv(lv_rows, ["task", "laeq_db", "lcpeak_db", "measured_by"])
|
| 166 |
+
if d == 2:
|
| 167 |
+
files["noise_diary.csv"] = to_csv(rows, ["worker_id", "task", "start", "end"])
|
| 168 |
+
files["planned_work.csv"] = to_csv(planned, ["worker_id", "planned_task"])
|
| 169 |
+
intro = ("`noise_diary.csv` is the task diary for one working day, with a start and end time (24-hour clock) for each task. "
|
| 170 |
+
"`task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed). "
|
| 171 |
+
"`planned_work.csv` names, for each worker, one task the supervisor would like to add after the work in the diary.")
|
| 172 |
+
keys = [" - `lex8h_db`: the daily personal noise exposure L_EX,8h from the diary, in dB(A), 1 decimal.",
|
| 173 |
+
" - `band`: the band of that exposure, one of the four names in `exposure_values.md`.",
|
| 174 |
+
" - `extra_minutes`: the largest whole number of minutes of the planned task that can be added to the diary with L_EX,8h staying at or below the limit value. "
|
| 175 |
+
"Work out the exact time at which L_EX,8h would equal the limit value and round it down to whole minutes. Give 0 if the diary alone is already above the limit value."]
|
| 176 |
+
basis = "L_EX,8h"
|
| 177 |
+
else:
|
| 178 |
+
files["noise_diary.csv"] = to_csv(rows, ["worker_id", "day", "task", "start", "end"])
|
| 179 |
+
intro = ("`noise_diary.csv` is the task diary for one working week, with a start and end time (24-hour clock) for each task. Workers do not all work the same days. "
|
| 180 |
+
"`task_levels.csv` gives the level measured for each task (`laeq_db`, in dB(A); the peak level `lcpeak_db` is not needed).")
|
| 181 |
+
keys = [" - `daily_lex8h_db`: an object keyed by day (`Mon` to `Fri`, only the days that worker worked) giving L_EX,8h for that day in dB(A), 1 decimal.",
|
| 182 |
+
" - `weekly_lex_db`: the weekly noise exposure in dB(A), 1 decimal.",
|
| 183 |
+
" - `loudest_day`: the day with the highest L_EX,8h.",
|
| 184 |
+
" - `band`: the band of the weekly exposure, one of the four names in `exposure_values.md`."]
|
| 185 |
+
formula += """
|
| 186 |
+
|
| 187 |
+
The weekly exposure is normalised to five 8-hour days whatever the number of days worked:
|
| 188 |
+
|
| 189 |
+
L_EX,w = 10 * log10( (1/5) * sum over the days worked of 10^(L_EX,8h/10) )"""
|
| 190 |
+
basis = "weekly exposure"
|
| 191 |
+
inst = """# Noise exposure assessment
|
| 192 |
+
|
| 193 |
+
%s `exposure_values.md` gives the action and limit values to use and the band names.
|
| 194 |
+
|
| 195 |
+
%s the daily personal noise exposure is
|
| 196 |
+
|
| 197 |
+
%s
|
| 198 |
+
|
| 199 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 200 |
+
|
| 201 |
+
- `workers`: an object keyed by worker id, each with
|
| 202 |
+
%s
|
| 203 |
+
- `at_or_above_upper_action`: list of the worker ids whose %s is at or above the upper action value, including any above the limit value (any order; an empty list if none).
|
| 204 |
+
|
| 205 |
+
%s
|
| 206 |
+
""" % (intro, "For each worker and each day worked" if d == 3 else "For each worker", formula, "\n".join(keys), basis, TOL)
|
| 207 |
+
return Task(ENV, "noise", seed, d, "Noise exposure for %d workers" % n, inst, files, checks, {"workers": n})
|
| 208 |
+
|
| 209 |
+
# ---------------------------------------------------------------- airborne chemicals
|
| 210 |
+
MOLAR_VOLUME = 24.45 # litres per mole at 25 deg C and 101.3 kPa
|
| 211 |
+
|
| 212 |
+
def ppm_to_mg(ppm, molar_mass): return ppm * molar_mass / MOLAR_VOLUME
|
| 213 |
+
def mg_to_ppm(mg, molar_mass): return mg * MOLAR_VOLUME / molar_mass
|
| 214 |
+
|
| 215 |
+
def twa8(samples, shift_min=480, unsampled="zero"):
|
| 216 |
+
"""8-hour time-weighted average. samples: (minutes, concentration).
|
| 217 |
+
unsampled 'zero': time outside the samples counts as no exposure.
|
| 218 |
+
unsampled 'as_sampled': the whole shift is taken to be at the time-weighted mean of the sampled periods."""
|
| 219 |
+
ct = sum(t * c for t, c in samples)
|
| 220 |
+
if unsampled == "zero": return ct / 480.0
|
| 221 |
+
return ct / float(sum(t for t, _ in samples)) * shift_min / 480.0
|
| 222 |
+
|
| 223 |
+
def mixture_index(pairs):
|
| 224 |
+
"""Additive index for substances with similar effects. pairs: (concentration, limit) in the same unit."""
|
| 225 |
+
return sum(c / float(oel) for c, oel in pairs)
|
| 226 |
+
|
| 227 |
+
# name, molar mass (g/mol), exercise limit options (mg/m3), effect group
|
| 228 |
+
SUBSTANCES = [("toluene", 92.14, (150, 190), "narcotic"), ("xylene", 106.17, (200, 220), "narcotic"),
|
| 229 |
+
("acetone", 58.08, (600, 1200), "narcotic"), ("butanone", 72.11, (300, 600), "narcotic"),
|
| 230 |
+
("styrene", 104.15, (85, 100), "narcotic"), ("ethyl_acetate", 88.11, (500, 730), "narcotic"),
|
| 231 |
+
("ammonia", 17.03, (14, 18), "irritant"), ("acetic_acid", 60.05, (25, 30), "irritant"),
|
| 232 |
+
("formic_acid", 46.03, (9, 12), "irritant"), ("hydrogen_chloride", 36.46, (8, 10), "irritant")]
|
| 233 |
+
JOBS = ["spray painter", "degreasing operator", "laminator", "print finisher", "tank cleaner", "adhesive mixer", "laboratory technician", "coating line operator"]
|
| 234 |
+
|
| 235 |
+
def _draw_samples(r, target, oel, shift, unsampled):
|
| 236 |
+
"""Personal samples (minutes, mg/m3) whose 8-hour TWA is near `target` (mg/m3)."""
|
| 237 |
+
while True:
|
| 238 |
+
durs = [r.choice([45, 60, 75, 90, 105, 120, 150]) for _ in range(r.randint(2, 4))]
|
| 239 |
+
if 150 <= sum(durs) <= min(shift, 480): break
|
| 240 |
+
base = target * 480.0 / (sum(durs) if unsampled == "zero" else shift)
|
| 241 |
+
dec = 1 if oel >= 50 else 2
|
| 242 |
+
return [(t, max(round(base * r.uniform(0.6, 1.4), dec), 10 ** -dec)) for t in durs]
|
| 243 |
+
|
| 244 |
+
def gen_chemicals(seed, d):
|
| 245 |
+
r = rng_for(ENV + "/chemicals", seed, d)
|
| 246 |
+
n = {1: 3, 2: 5, 3: 4}[d]
|
| 247 |
+
wids = ["W%02d" % i for i in sorted(r.sample(range(1, 60), n))]
|
| 248 |
+
table = {}
|
| 249 |
+
for name, M, opts, grp in SUBSTANCES:
|
| 250 |
+
oel = float(r.choice(opts)); unit = "mg/m3"; shown = oel
|
| 251 |
+
if d == 3 and r.random() < 0.5: # some limits are tabled in ppm
|
| 252 |
+
shown = mg_to_ppm(oel, M)
|
| 253 |
+
shown = float(round(shown)) if shown >= 10 else round(shown, 1)
|
| 254 |
+
unit = "ppm"; oel = ppm_to_mg(shown, M)
|
| 255 |
+
table[name] = {"M": M, "oel_mg": oel, "shown": shown, "unit": unit, "group": grp}
|
| 256 |
+
rows, wrows, checks, over = [], [], [], []
|
| 257 |
+
for w in wids:
|
| 258 |
+
shift = 480 if d == 1 else r.choice([420, 450, 480, 510, 540, 600])
|
| 259 |
+
uns = "zero" if d == 1 else r.choice(["zero", "as_sampled"])
|
| 260 |
+
while True:
|
| 261 |
+
if d < 3: subs = [r.choice(SUBSTANCES)[0]]
|
| 262 |
+
else:
|
| 263 |
+
grp = r.choice(["narcotic", "irritant"])
|
| 264 |
+
same = sorted(s[0] for s in SUBSTANCES if s[3] == grp); other = sorted(s[0] for s in SUBSTANCES if s[3] != grp)
|
| 265 |
+
subs = r.sample(same, 2) + (r.sample(other, 1) if r.random() < 0.6 else [])
|
| 266 |
+
mine, out, groups = [], {}, {}
|
| 267 |
+
for i, s in enumerate(subs):
|
| 268 |
+
t = table[s]
|
| 269 |
+
if d < 3: idx = r.choice([r.uniform(0.2, 0.6), r.uniform(0.7, 0.93), r.uniform(1.08, 1.8)])
|
| 270 |
+
else: idx = r.uniform(0.15, 0.8) if i < 2 else r.uniform(0.2, 1.5)
|
| 271 |
+
smp = []
|
| 272 |
+
for mins, c in _draw_samples(r, idx * t["oel_mg"], t["oel_mg"], shift, uns):
|
| 273 |
+
if d >= 2 and r.random() < 0.5: # a direct-reading instrument reports ppm
|
| 274 |
+
v = round(mg_to_ppm(c, t["M"]), 2)
|
| 275 |
+
smp.append((mins, v, "ppm", ppm_to_mg(v, t["M"])))
|
| 276 |
+
else: smp.append((mins, c, "mg/m3", c))
|
| 277 |
+
twa = twa8([(m, mg) for m, _, _, mg in smp], shift, uns)
|
| 278 |
+
out[s] = (twa, twa / t["oel_mg"])
|
| 279 |
+
groups.setdefault(t["group"], []).append((twa, t["oel_mg"]))
|
| 280 |
+
mine.append((s, smp))
|
| 281 |
+
gidx = dict((g, mixture_index(p)) for g, p in groups.items())
|
| 282 |
+
if all(abs(v - 1) >= 0.05 for v in gidx.values()) and all(abs(v[1] - 1) >= 0.05 for v in out.values()): break
|
| 283 |
+
for s, smp in mine:
|
| 284 |
+
t = table[s]
|
| 285 |
+
for mins, v, unit, _ in smp:
|
| 286 |
+
rows.append({"worker_id": w, "substance": s, "sample_type": "personal", "duration_min": mins, "concentration": v, "unit": unit})
|
| 287 |
+
if d >= 2: # static (area) samples and field blanks must be left out
|
| 288 |
+
for _ in range(r.randint(0, 2)):
|
| 289 |
+
rows.append({"worker_id": w, "substance": s, "sample_type": "static", "duration_min": r.choice([60, 120, 180, 240]),
|
| 290 |
+
"concentration": round(t["oel_mg"] * r.uniform(0.2, 2.5), 1), "unit": "mg/m3"})
|
| 291 |
+
if r.random() < 0.5:
|
| 292 |
+
rows.append({"worker_id": w, "substance": s, "sample_type": "blank", "duration_min": 0, "concentration": 0.0, "unit": "mg/m3"})
|
| 293 |
+
wrows.append({"worker_id": w, "job": r.choice(JOBS), "shift_min": shift, "unsampled_time": uns})
|
| 294 |
+
if d < 3:
|
| 295 |
+
s = subs[0]
|
| 296 |
+
checks.append(c_num("workers.%s.twa_mg_m3" % w, out[s][0], 2))
|
| 297 |
+
if d == 2: checks.append(c_num("workers.%s.twa_ppm" % w, mg_to_ppm(out[s][0], table[s]["M"]), 2))
|
| 298 |
+
checks.append(c_num("workers.%s.exposure_index" % w, out[s][1], 2))
|
| 299 |
+
else:
|
| 300 |
+
for s in sorted(out):
|
| 301 |
+
checks += [c_num("workers.%s.substances.%s.twa_mg_m3" % (w, s), out[s][0], 2),
|
| 302 |
+
c_num("workers.%s.substances.%s.exposure_index" % (w, s), out[s][1], 2)]
|
| 303 |
+
for g in sorted(gidx): checks.append(c_num("workers.%s.group_index.%s" % (w, g), gidx[g], 2))
|
| 304 |
+
if max(gidx.values()) > 1: over.append(w)
|
| 305 |
+
checks.append(c_set("over_limit", over, weight=2))
|
| 306 |
+
r.shuffle(rows)
|
| 307 |
+
for i, row in enumerate(rows): row["sample_id"] = "S%03d" % (i + 1)
|
| 308 |
+
trows = [{"substance": s, "molar_mass_g_per_mol": table[s]["M"], "oel_8h": table[s]["shown"], "oel_unit": table[s]["unit"],
|
| 309 |
+
"effect_group": table[s]["group"]} for s in table]
|
| 310 |
+
r.shuffle(trows)
|
| 311 |
+
files = {"oel_table.csv": to_csv(trows, ["substance", "molar_mass_g_per_mol", "oel_8h", "oel_unit", "effect_group"])}
|
| 312 |
+
limits = ("`oel_table.csv` gives, for each substance, its molar mass and the 8-hour occupational exposure limit to use in this exercise. "
|
| 313 |
+
"Use these values; they are not presented as any country's legal limits. The table lists more substances than were sampled.")
|
| 314 |
+
conv = " mg/m3 = ppm * M / 24.45 (M is the molar mass in g/mol)"
|
| 315 |
+
if d == 1:
|
| 316 |
+
files["samples.csv"] = to_csv([dict(x, concentration_mg_m3=x["concentration"]) for x in rows],
|
| 317 |
+
["sample_id", "worker_id", "substance", "duration_min", "concentration_mg_m3"])
|
| 318 |
+
intro = "`samples.csv` holds the personal air samples taken on three workers during one 8-hour shift: the minutes each sample ran and the concentration it found, in mg/m3. Each worker was sampled for one substance."
|
| 319 |
+
method = """The 8-hour time-weighted average (TWA) is
|
| 320 |
+
|
| 321 |
+
TWA = sum( C_i * t_i ) / 480
|
| 322 |
+
|
| 323 |
+
with C_i the concentration of sample i and t_i its duration in minutes. Time that was not sampled counts as zero exposure."""
|
| 324 |
+
keys = [" - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.",
|
| 325 |
+
" - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals."]
|
| 326 |
+
last = "- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none)."
|
| 327 |
+
else:
|
| 328 |
+
files["samples.csv"] = to_csv(rows, ["sample_id", "worker_id", "substance", "sample_type", "duration_min", "concentration", "unit"])
|
| 329 |
+
files["workers.csv"] = to_csv(wrows, ["worker_id", "job", "shift_min", "unsampled_time"])
|
| 330 |
+
intro = ("`samples.csv` holds the air samples from one survey day and `workers.csv` gives each worker's shift length and how to treat the time that was not sampled. "
|
| 331 |
+
"Use only the rows with `sample_type` `personal`: static (area) samples and field blanks are not part of a worker's exposure. "
|
| 332 |
+
"Some concentrations are in ppm and some in mg/m3 (see `unit`). Convert with\n\n" + conv)
|
| 333 |
+
method = """The 8-hour time-weighted average (TWA) always uses 480 minutes as the reference period, whatever the shift length. With C_i the concentration of personal sample i in mg/m3 and t_i its duration in minutes:
|
| 334 |
+
|
| 335 |
+
- `unsampled_time` = `zero`: time outside the samples counts as zero exposure, so TWA = sum( C_i * t_i ) / 480.
|
| 336 |
+
- `unsampled_time` = `as_sampled`: the whole shift is taken to be at the time-weighted mean of the sampled periods, so TWA = ( sum( C_i * t_i ) / sum( t_i ) ) * shift_min / 480."""
|
| 337 |
+
if d == 2:
|
| 338 |
+
keys = [" - `twa_mg_m3`: the 8-hour TWA in mg/m3, 2 decimals.",
|
| 339 |
+
" - `twa_ppm`: the same TWA expressed in ppm, 2 decimals.",
|
| 340 |
+
" - `exposure_index`: the TWA divided by the limit for that substance, 2 decimals."]
|
| 341 |
+
last = "- `over_limit`: list of the worker ids whose exposure index is above 1 (any order; an empty list if none)."
|
| 342 |
+
intro = intro.replace("from one survey day", "from one survey day (each worker was sampled for one substance)")
|
| 343 |
+
else:
|
| 344 |
+
limits += " Some limits are tabled in ppm and some in mg/m3 (see `oel_unit`); convert the ppm ones to mg/m3 with the same formula."
|
| 345 |
+
method += """
|
| 346 |
+
|
| 347 |
+
Each worker was sampled for two or three substances; work out a TWA for each. Substances in the same `effect_group` act together, so for each worker and each effect group add up the exposure indices of that worker's substances in the group (the additive mixture index, sum of C_i / OEL_i). A group with one substance has that substance's index."""
|
| 348 |
+
keys = [" - `substances`: an object keyed by substance name, each with `twa_mg_m3` (the 8-hour TWA in mg/m3, 2 decimals) and `exposure_index` (the TWA divided by the limit in mg/m3, 2 decimals).",
|
| 349 |
+
" - `group_index`: an object keyed by effect group (only the groups that worker has a substance in) giving the additive mixture index, 2 decimals."]
|
| 350 |
+
last = "- `over_limit`: list of the worker ids with at least one group index above 1 (any order; an empty list if none)."
|
| 351 |
+
inst = """# Airborne chemical exposure
|
| 352 |
+
|
| 353 |
+
%s
|
| 354 |
+
|
| 355 |
+
%s
|
| 356 |
+
|
| 357 |
+
%s
|
| 358 |
+
|
| 359 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 360 |
+
|
| 361 |
+
- `workers`: an object keyed by worker id, each with
|
| 362 |
+
%s
|
| 363 |
+
%s
|
| 364 |
+
|
| 365 |
+
%s
|
| 366 |
+
""" % (intro, limits, method, "\n".join(keys), last, TOL)
|
| 367 |
+
return Task(ENV, "chemicals", seed, d, "Airborne exposure for %d workers" % n, inst, files, checks, {"workers": n})
|
| 368 |
+
|
| 369 |
+
# ---------------------------------------------------------------- hand-arm vibration
|
| 370 |
+
def a8(parts):
|
| 371 |
+
"""Daily vibration exposure A(8) in m/s2. parts: (magnitude in m/s2, exposure time in hours) per tool."""
|
| 372 |
+
return math.sqrt(sum(a * a * t for a, t in parts) / 8.0)
|
| 373 |
+
|
| 374 |
+
def minutes_to(a, value):
|
| 375 |
+
"""Minutes of use of one tool with magnitude `a` for A(8) to reach `value`."""
|
| 376 |
+
return 480.0 * (value / float(a)) ** 2
|
| 377 |
+
|
| 378 |
+
def total_value(ax, ay, az):
|
| 379 |
+
"""Vibration total value from the three frequency-weighted axis values."""
|
| 380 |
+
return math.sqrt(ax * ax + ay * ay + az * az)
|
| 381 |
+
|
| 382 |
+
def vib_band(A, action, limit):
|
| 383 |
+
return "over_limit" if A > limit else "action_to_limit" if A >= action else "below_action"
|
| 384 |
+
|
| 385 |
+
TOOLS = [("angle grinder", 4, 8), ("hammer drill", 8, 14), ("impact wrench", 5, 9), ("chipping hammer", 10, 18), ("orbital sander", 3, 6),
|
| 386 |
+
("reciprocating saw", 6, 12), ("needle scaler", 8, 14), ("chainsaw", 4, 7), ("plate compactor", 5, 10), ("brush cutter", 3, 5),
|
| 387 |
+
("nut runner", 2, 4), ("die grinder", 3, 6)]
|
| 388 |
+
|
| 389 |
+
def vib_values_doc(action, limit):
|
| 390 |
+
return """# Hand-arm vibration values for this assessment
|
| 391 |
+
|
| 392 |
+
%s
|
| 393 |
+
|
| 394 |
+
| Value | m/s2 |
|
| 395 |
+
|---|---|
|
| 396 |
+
| Exposure action value | %.1f |
|
| 397 |
+
| Exposure limit value | %.1f |
|
| 398 |
+
|
| 399 |
+
Both are daily exposures A(8).
|
| 400 |
+
|
| 401 |
+
## Bands
|
| 402 |
+
|
| 403 |
+
- `below_action`: A(8) is below the exposure action value.
|
| 404 |
+
- `action_to_limit`: A(8) is at or above the exposure action value and not above the exposure limit value.
|
| 405 |
+
- `over_limit`: A(8) is above the exposure limit value.
|
| 406 |
+
""" % (NOTE, action, limit)
|
| 407 |
+
|
| 408 |
+
def _use_minutes(r, a):
|
| 409 |
+
base = r.choice([5, 10, 15, 20, 30, 40] if a >= 10 else [10, 20, 30, 45, 60, 90] if a >= 5 else [20, 30, 60, 90, 120, 180])
|
| 410 |
+
return max(5, int(round(base * r.choice([0.4, 0.7, 1.0, 1.0, 1.5]) / 5.0)) * 5)
|
| 411 |
+
|
| 412 |
+
def gen_vibration(seed, d):
|
| 413 |
+
r = rng_for(ENV + "/vibration", seed, d)
|
| 414 |
+
action, limit = r.choice([(2.5, 5.0), (2.5, 5.0), (2.0, 4.0)])
|
| 415 |
+
n = {1: 4, 2: 5, 3: 5}[d]
|
| 416 |
+
oids = ["OP%02d" % i for i in sorted(r.sample(range(1, 50), n))]
|
| 417 |
+
rows, checks, res = [], [], {}
|
| 418 |
+
tools, trows = {}, []
|
| 419 |
+
if d >= 2:
|
| 420 |
+
picks = r.sample(TOOLS, 7)
|
| 421 |
+
for i, (name, lo, hi) in enumerate(picks):
|
| 422 |
+
tid = "T%02d" % (i + 1)
|
| 423 |
+
row = {"tool_id": tid, "description": name, "last_tested": "%d-%02d" % (r.choice([2022, 2023]), r.randint(1, 12))}
|
| 424 |
+
if d == 2:
|
| 425 |
+
a = round(r.uniform(lo, hi), 1); row["vibration_m_s2"] = a
|
| 426 |
+
else:
|
| 427 |
+
w = [r.uniform(0.3, 1.0) for _ in range(3)]; norm = math.sqrt(sum(x * x for x in w)); tgt = r.uniform(lo, hi)
|
| 428 |
+
ax, ay, az = [round(tgt * x / norm, 2) for x in w]
|
| 429 |
+
row.update(ax_m_s2=ax, ay_m_s2=ay, az_m_s2=az); a = total_value(ax, ay, az)
|
| 430 |
+
tools[tid] = a; trows.append(row)
|
| 431 |
+
for o in oids:
|
| 432 |
+
while True:
|
| 433 |
+
if d == 1:
|
| 434 |
+
use = [(name, round(r.uniform(lo, hi), 1)) for name, lo, hi in r.sample(TOOLS, r.randint(2, 3))]
|
| 435 |
+
use = [(name, a, _use_minutes(r, a) * 60, None) for name, a in use]
|
| 436 |
+
else:
|
| 437 |
+
use = []
|
| 438 |
+
for tid in r.sample(sorted(tools), r.randint(2, 3)):
|
| 439 |
+
log, secs = [], 0
|
| 440 |
+
for _ in range(r.randint(1, 3)):
|
| 441 |
+
per = r.randint(5, 90)
|
| 442 |
+
ops = max(2, int(round(_use_minutes(r, tools[tid]) * 30.0 / per)))
|
| 443 |
+
log.append((ops, per)); secs += ops * per
|
| 444 |
+
use.append((tid, tools[tid], secs, log))
|
| 445 |
+
A = a8([(a, s / 3600.0) for _, a, s, _ in use])
|
| 446 |
+
part = sorted((a * a * s for _, a, s, _ in use), reverse=True)
|
| 447 |
+
if clear_of(A, [action, limit], 0.08) and (d < 3 or part[0] >= 1.15 * part[1]): break
|
| 448 |
+
res[o] = A
|
| 449 |
+
checks += [c_num("operators.%s.a8_m_s2" % o, A, 2), c_str("operators.%s.band" % o, vib_band(A, action, limit))]
|
| 450 |
+
if d == 3: checks.append(c_str("operators.%s.dominant_tool" % o, max(use, key=lambda u: u[1] * u[1] * u[2])[0]))
|
| 451 |
+
for name, a, secs, log in use:
|
| 452 |
+
if d == 1: rows.append({"operator_id": o, "tool": name, "vibration_m_s2": a, "trigger_time_min": secs // 60})
|
| 453 |
+
else:
|
| 454 |
+
for ops, per in log:
|
| 455 |
+
rows.append({"operator_id": o, "tool_id": name, "job_ref": "J%04d" % r.randint(1000, 9999), "operations": ops, "seconds_per_operation": per})
|
| 456 |
+
for tid in sorted(tools):
|
| 457 |
+
checks.append(c_num("tools.%s.minutes_to_action" % tid, minutes_to(tools[tid], action), 1))
|
| 458 |
+
if d == 3: checks.append(c_num("tools.%s.minutes_to_limit" % tid, minutes_to(tools[tid], limit), 1))
|
| 459 |
+
checks.append(c_set("at_or_above_action", sorted(o for o in oids if res[o] >= action), weight=2))
|
| 460 |
+
r.shuffle(rows)
|
| 461 |
+
files = {"vibration_values.md": vib_values_doc(action, limit)}
|
| 462 |
+
formula = """ A(8) = sqrt( sum( a_i^2 * t_i ) / 8 )
|
| 463 |
+
|
| 464 |
+
with a_i the vibration magnitude of tool i in m/s2 and t_i the time the operator's hands were exposed to it, in hours."""
|
| 465 |
+
okeys = [" - `a8_m_s2`: the daily exposure A(8) in m/s2, 2 decimals.",
|
| 466 |
+
" - `band`: one of the three band names in `vibration_values.md`."]
|
| 467 |
+
tkeys = ""
|
| 468 |
+
if d == 1:
|
| 469 |
+
files["tool_use.csv"] = to_csv(rows, ["operator_id", "tool", "vibration_m_s2", "trigger_time_min"])
|
| 470 |
+
intro = "`tool_use.csv` lists the vibrating tools each operator used today, the vibration magnitude measured at the handle (`vibration_m_s2`) and the trigger time in minutes."
|
| 471 |
+
else:
|
| 472 |
+
files["tool_use.csv"] = to_csv(rows, ["operator_id", "tool_id", "job_ref", "operations", "seconds_per_operation"])
|
| 473 |
+
intro = ("`tool_use.csv` is today's tool log. Each row is a batch of identical operations with one tool: the exposure time of the row is `operations` times `seconds_per_operation`. "
|
| 474 |
+
"An operator may have several rows for the same tool; add their times together.")
|
| 475 |
+
tcalc = """For each tool in `tools.csv` (whether or not it was used today), also work out how long the tool could be used on its own before A(8) reaches a given value:
|
| 476 |
+
|
| 477 |
+
time in minutes = 480 * ( value / a )^2
|
| 478 |
+
|
| 479 |
+
The result may be longer than a working day; report it as calculated."""
|
| 480 |
+
if d == 2:
|
| 481 |
+
files["tools.csv"] = to_csv(trows, ["tool_id", "description", "vibration_m_s2", "last_tested"])
|
| 482 |
+
intro += " `tools.csv` gives the vibration magnitude of each tool (`vibration_m_s2`)."
|
| 483 |
+
tkeys = "\n- `tools`: an object keyed by tool id, each with `minutes_to_action`: the minutes of use of that tool alone at which A(8) equals the exposure action value, 1 decimal."
|
| 484 |
+
else:
|
| 485 |
+
files["tools.csv"] = to_csv(trows, ["tool_id", "description", "ax_m_s2", "ay_m_s2", "az_m_s2", "last_tested"])
|
| 486 |
+
intro += (" `tools.csv` gives each tool's frequency-weighted acceleration on three axes. The magnitude to use for a tool is the vibration total value\n\n"
|
| 487 |
+
" a = sqrt( ax^2 + ay^2 + az^2 )\n\nDo not round it before using it.")
|
| 488 |
+
okeys.append(" - `dominant_tool`: the tool id that contributes most to this operator's exposure, that is the one with the largest a_i^2 * t_i.")
|
| 489 |
+
tkeys = ("\n- `tools`: an object keyed by tool id, each with `minutes_to_action` and `minutes_to_limit`: the minutes of use of that tool alone at which A(8) equals the "
|
| 490 |
+
"exposure action value and the exposure limit value, 1 decimal each.")
|
| 491 |
+
formula += "\n\n" + tcalc
|
| 492 |
+
inst = """# Hand-arm vibration assessment
|
| 493 |
+
|
| 494 |
+
%s `vibration_values.md` gives the exposure action and limit values to use and the band names.
|
| 495 |
+
|
| 496 |
+
For each operator the daily vibration exposure is
|
| 497 |
+
|
| 498 |
+
%s
|
| 499 |
+
|
| 500 |
+
Write `answer.json` in this folder, a JSON object with:
|
| 501 |
+
|
| 502 |
+
- `operators`: an object keyed by operator id, each with
|
| 503 |
+
%s%s
|
| 504 |
+
- `at_or_above_action`: list of the operator ids whose A(8) is at or above the exposure action value, including any above the limit value (any order; an empty list if none).
|
| 505 |
+
|
| 506 |
+
%s
|
| 507 |
+
""" % (intro, formula, "\n".join(okeys), tkeys, TOL)
|
| 508 |
+
return Task(ENV, "vibration", seed, d, "Hand-arm vibration for %d operators" % n, inst, files, checks, {"operators": n})
|
| 509 |
+
|
| 510 |
+
# ---------------------------------------------------------------- incident statistics
|
| 511 |
+
def frequency_rate(n, hours, per):
|
| 512 |
+
"""Lost-time injuries per `per` hours worked."""
|
| 513 |
+
return n * float(per) / hours
|
| 514 |
+
|
| 515 |
+
def severity_rate(days, hours, per):
|
| 516 |
+
"""Days lost per `per` hours worked."""
|
| 517 |
+
return days * float(per) / hours
|
| 518 |
+
|
| 519 |
+
def is_lti(row):
|
| 520 |
+
"""The stated definition: an injury to an employee, work-related, with at least one day lost."""
|
| 521 |
+
return (row["type"] == "injury" and row.get("person_type", "employee") == "employee"
|
| 522 |
+
and row.get("work_related", "yes") == "yes" and row["days_lost"] >= 1)
|
| 523 |
+
|
| 524 |
+
DEPTS = ["Fabrication", "Warehouse", "Assembly", "Maintenance", "Logistics", "Finishing"]
|
| 525 |
+
INJ = ["cut to hand from sheet metal", "slipped on wet floor", "strain while lifting a crate", "struck by falling part", "foot crushed by pallet truck",
|
| 526 |
+
"burn from hot surface", "fall from step ladder", "eye injury from swarf", "finger trapped in guard", "twisted ankle on stairs"]
|
| 527 |
+
OTHER = {"near miss": ["load slipped from forklift, nobody hit", "unguarded edge reported", "pallet fell from racking, area empty", "spill found on walkway"],
|
| 528 |
+
"property damage": ["forklift struck racking upright", "roller door damaged by vehicle", "pipework hit by reach truck"],
|
| 529 |
+
"ill health": ["dermatitis from cutting fluid", "work-related upper limb disorder", "noise-induced hearing loss claim"]}
|
| 530 |
+
RATE_SETS = [(1000000, 1000, 3), (200000, 200000, 2), (1000000, 1000000, 2)]
|
| 531 |
+
|
| 532 |
+
def commas(n): return "{:,}".format(n)
|
| 533 |
+
|
| 534 |
+
def gen_incidents(seed, d):
|
| 535 |
+
r = rng_for(ENV + "/incidents", seed, d)
|
| 536 |
+
year = r.choice([2021, 2022, 2023, 2024])
|
| 537 |
+
years = [year - 1, year] if d == 3 else [year]
|
| 538 |
+
depts = sorted(r.sample(DEPTS, {1: 1, 2: 3, 3: 4}[d]))
|
| 539 |
+
per_f, per_s, sdec = r.choice(RATE_SETS)
|
| 540 |
+
cap = r.choice([150, 180, 200]) if d == 3 else None
|
| 541 |
+
while True:
|
| 542 |
+
log, hrows = [], []
|
| 543 |
+
hours = dict(((y, dp), 0) for y in years for dp in depts)
|
| 544 |
+
for y in years:
|
| 545 |
+
for dp in depts:
|
| 546 |
+
base = r.randint(180, 320) * 100 if d == 1 else r.randint(60, 380) * 100
|
| 547 |
+
for m in range(1, 13):
|
| 548 |
+
h = int(base * r.uniform(0.85, 1.12))
|
| 549 |
+
hours[(y, dp)] += h
|
| 550 |
+
row = {"month": "%d-%02d" % (y, m), "department": dp, "hours": h}
|
| 551 |
+
if d == 3: row["workforce"] = "employees"
|
| 552 |
+
hrows.append(row)
|
| 553 |
+
if d == 3 and dp == depts[0]: # contractor hours are tabled too and must be left out
|
| 554 |
+
hrows.append({"month": "%d-%02d" % (y, m), "department": dp, "hours": int(base * r.uniform(0.1, 0.3)), "workforce": "contractors"})
|
| 555 |
+
def add(y, dp, typ, days, person="employee", work="yes"):
|
| 556 |
+
desc = r.choice(INJ) if typ == "injury" else r.choice(OTHER[typ])
|
| 557 |
+
if work == "no": desc = r.choice(["road accident on the way to work", "sports injury at the weekend", "fall on the way home"])
|
| 558 |
+
treat = "none" if typ in ("near miss", "property damage") else r.choice(["medical treatment", "hospital"]) if days else r.choice(["first aid", "medical treatment"])
|
| 559 |
+
log.append({"date": "%d-%02d-%02d" % (y, r.randint(1, 12), r.randint(1, 28)), "department": dp, "type": typ, "person_type": person,
|
| 560 |
+
"work_related": work, "treatment": treat, "days_lost": days, "description": desc})
|
| 561 |
+
for y in years:
|
| 562 |
+
for dp in depts:
|
| 563 |
+
for _ in range(r.randint(2, 5) if d == 1 else r.randint(0, 4)): add(y, dp, "injury", r.choice([1, 2, 3, 4, 5, 7, 8, 10, 12, 14, 18, 21, 25, 30, 38, 45, 60]))
|
| 564 |
+
for _ in range(r.randint(3, 6) if d == 1 else r.randint(1, 3)): add(y, dp, "injury", 0)
|
| 565 |
+
for _ in range(r.randint(2, 5) if d == 1 else r.randint(0, 2)): add(y, dp, r.choice(["near miss", "near miss", "property damage"]), 0)
|
| 566 |
+
if d >= 2:
|
| 567 |
+
for _ in range(r.randint(0, 2)): add(y, dp, "injury", r.choice([0, 2, 5, 9, 16, 30]), person=r.choice(["contractor", "contractor", "visitor"]))
|
| 568 |
+
if r.random() < 0.5: add(y, dp, "injury", r.choice([3, 6, 11, 20]), work="no")
|
| 569 |
+
if r.random() < 0.5: add(y, dp, "ill health", r.choice([0, 4, 15, 40]))
|
| 570 |
+
if d == 3: add(y, r.choice(depts), "injury", cap + r.randint(10, 150)) # one long absence above the cap
|
| 571 |
+
log.sort(key=lambda x: x["date"])
|
| 572 |
+
first = r.randint(100, 800)
|
| 573 |
+
for i, row in enumerate(log): row["incident_id"] = "INC-%04d" % (first + i)
|
| 574 |
+
stats = {}
|
| 575 |
+
for y in years:
|
| 576 |
+
for dp in depts + ["*"]:
|
| 577 |
+
ltis = [x for x in log if is_lti(x) and x["date"].startswith(str(y)) and (dp == "*" or x["department"] == dp)]
|
| 578 |
+
h = sum(hours[(y, q)] for q in depts) if dp == "*" else hours[(y, dp)]
|
| 579 |
+
days = sum(min(x["days_lost"], cap) if cap else x["days_lost"] for x in ltis)
|
| 580 |
+
stats[(y, dp)] = {"n": len(ltis), "days": days, "hours": h, "f": frequency_rate(len(ltis), h, per_f), "s": severity_rate(days, h, per_s),
|
| 581 |
+
"ids": [x["incident_id"] for x in ltis]}
|
| 582 |
+
if any(stats[(y, "*")]["n"] < 2 for y in years): continue
|
| 583 |
+
target = None
|
| 584 |
+
if d >= 2:
|
| 585 |
+
fs = [stats[(year, dp)]["f"] for dp in depts]
|
| 586 |
+
opts = [t * per_f / 1000000.0 for t in (3, 4, 5, 6, 8, 10, 12, 15, 20, 25, 30)]
|
| 587 |
+
opts = [t for t in opts if all(abs(f - t) >= 0.08 * t for f in fs)]
|
| 588 |
+
mixed = [t for t in opts if min(fs) < t < max(fs)]
|
| 589 |
+
if not opts: continue
|
| 590 |
+
target = r.choice(mixed or opts)
|
| 591 |
+
if d == 3 and abs(stats[(year, "*")]["f"] - stats[(year - 1, "*")]["f"]) < 0.05: continue
|
| 592 |
+
break
|
| 593 |
+
checks = []
|
| 594 |
+
def block(path, s, full=True):
|
| 595 |
+
pre = path + "." if path else ""
|
| 596 |
+
out = [c_int(pre + "lti_count", s["n"])]
|
| 597 |
+
if full: out += [c_int(pre + "days_lost", s["days"]), c_int(pre + "hours_worked", s["hours"])]
|
| 598 |
+
return out + [c_num(pre + "ltifr", s["f"], 2), c_num(pre + "severity_rate", s["s"], sdec)]
|
| 599 |
+
cur = stats[(year, "*")]
|
| 600 |
+
if d == 1:
|
| 601 |
+
checks += block("", cur)
|
| 602 |
+
else:
|
| 603 |
+
for dp in depts: checks += block("departments.%s" % dp, stats[(year, dp)])
|
| 604 |
+
if d == 2: checks += block("site", cur)
|
| 605 |
+
else:
|
| 606 |
+
for y in years: checks += block("site.%d" % y, stats[(y, "*")], full=False)
|
| 607 |
+
checks.append(c_num("ltifr_change", cur["f"] - stats[(year - 1, "*")]["f"], 2))
|
| 608 |
+
checks.append(c_set("above_target", sorted(dp for dp in depts if stats[(year, dp)]["f"] > target), weight=2))
|
| 609 |
+
checks.append(c_set("lti_ids", cur["ids"], weight=2))
|
| 610 |
+
# reference file -------------------------------------------------------
|
| 611 |
+
conds = ["- `type` is `injury` (near misses, property damage and ill health cases are not injuries);", "- `days_lost` is 1 or more;"]
|
| 612 |
+
if d >= 2:
|
| 613 |
+
conds += ["- `person_type` is `employee` (the hours table covers the company's own employees, so contractors and visitors are left out);",
|
| 614 |
+
"- `work_related` is `yes` (commuting and other incidents outside work are left out)."]
|
| 615 |
+
else: conds[-1] = conds[-1][:-1] + "."
|
| 616 |
+
days_txt = "Days lost are counted for lost-time injuries only."
|
| 617 |
+
if cap: days_txt += " The days lost for any single lost-time injury are capped at %d days: a longer absence counts as %d." % (cap, cap)
|
| 618 |
+
hours_txt = "Hours worked are the hours in `hours_worked.csv` for the period and unit in question."
|
| 619 |
+
if d == 3: hours_txt += " Use only the rows with `workforce` = `employees`."
|
| 620 |
+
defs = """# Incident statistics: definitions for this report
|
| 621 |
+
|
| 622 |
+
Use these definitions and values. They are set for this exercise.
|
| 623 |
+
|
| 624 |
+
## Lost-time injury (LTI)
|
| 625 |
+
|
| 626 |
+
An incident in the log counts as a lost-time injury only if all of these hold:
|
| 627 |
+
|
| 628 |
+
%s
|
| 629 |
+
|
| 630 |
+
## Days lost
|
| 631 |
+
|
| 632 |
+
%s
|
| 633 |
+
|
| 634 |
+
## Hours worked
|
| 635 |
+
|
| 636 |
+
%s
|
| 637 |
+
|
| 638 |
+
## Rates
|
| 639 |
+
|
| 640 |
+
- Frequency rate (LTIFR) = number of LTIs x %s / hours worked
|
| 641 |
+
- Severity rate = days lost x %s / hours worked
|
| 642 |
+
""" % ("\n".join(conds), days_txt, hours_txt, commas(per_f), commas(per_s))
|
| 643 |
+
if target is not None:
|
| 644 |
+
defs += "\n## Target\n\nA department is above target when its LTIFR is higher than %s.\n" % ("%.1f" % target)
|
| 645 |
+
files = {"definitions.md": defs}
|
| 646 |
+
rate_keys = ("`lti_count` (integer), `days_lost` (integer, total days lost through LTIs%s), `hours_worked` (integer), `ltifr` (2 decimals) and `severity_rate` (%d decimals)"
|
| 647 |
+
% (", after the cap" if cap else "", sdec))
|
| 648 |
+
if d == 1:
|
| 649 |
+
files["incident_log.csv"] = to_csv(log, ["incident_id", "date", "type", "treatment", "days_lost", "description"])
|
| 650 |
+
files["hours_worked.csv"] = to_csv(hrows, ["month", "hours"])
|
| 651 |
+
body = ("`incident_log.csv` is one site's incident log for %d and `hours_worked.csv` gives the hours worked each month. `definitions.md` says what counts as a lost-time injury and how the rates are defined.\n\n"
|
| 652 |
+
"Work out the site's figures for the year.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n"
|
| 653 |
+
"- `lti_count`: the number of lost-time injuries, an integer.\n- `days_lost`: the total days lost through those injuries, an integer.\n"
|
| 654 |
+
"- `hours_worked`: the total hours worked in the year, an integer.\n- `ltifr`: the frequency rate, 2 decimals.\n- `severity_rate`: the severity rate, %d decimals.\n"
|
| 655 |
+
"- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).") % (year, sdec)
|
| 656 |
+
elif d == 2:
|
| 657 |
+
files["incident_log.csv"] = to_csv(log, ["incident_id", "date", "department", "type", "person_type", "work_related", "treatment", "days_lost", "description"])
|
| 658 |
+
files["hours_worked.csv"] = to_csv(hrows, ["month", "department", "hours"])
|
| 659 |
+
body = ("`incident_log.csv` is a site's incident log for %d and `hours_worked.csv` gives the hours worked by each department's employees each month. "
|
| 660 |
+
"`definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is.\n\n"
|
| 661 |
+
"Work out the figures for each department and for the site as a whole.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n"
|
| 662 |
+
"- `departments`: an object keyed by department name, each with %s.\n"
|
| 663 |
+
"- `site`: the same five keys for all departments together.\n"
|
| 664 |
+
"- `above_target`: list of the departments whose LTIFR is above the target (any order; an empty list if none).\n"
|
| 665 |
+
"- `lti_ids`: list of the incident ids counted as lost-time injuries (any order).") % (year, rate_keys)
|
| 666 |
+
else:
|
| 667 |
+
files["incident_log.csv"] = to_csv(log, ["incident_id", "date", "department", "type", "person_type", "work_related", "treatment", "days_lost", "description"])
|
| 668 |
+
files["hours_worked.csv"] = to_csv(hrows, ["month", "department", "workforce", "hours"])
|
| 669 |
+
body = ("`incident_log.csv` is a site's incident log for %d and %d and `hours_worked.csv` gives the hours worked in each department each month. "
|
| 670 |
+
"`definitions.md` says what counts as a lost-time injury, how the rates are defined and what the target is. An incident belongs to the year of its `date`.\n\n"
|
| 671 |
+
"Work out the figures for each department for %d, and for the site as a whole for both years.\n\nWrite `answer.json` in this folder, a JSON object with:\n\n"
|
| 672 |
+
"- `departments`: an object keyed by department name, each with %s, all for %d.\n"
|
| 673 |
+
"- `site`: an object keyed by year (`\"%d\"` and `\"%d\"`), each with `lti_count`, `ltifr` and `severity_rate` for all departments together in that year.\n"
|
| 674 |
+
"- `ltifr_change`: the site LTIFR for %d minus the site LTIFR for %d, 2 decimals (negative if the rate fell). Use unrounded rates for the subtraction.\n"
|
| 675 |
+
"- `above_target`: list of the departments whose %d LTIFR is above the target (any order; an empty list if none).\n"
|
| 676 |
+
"- `lti_ids`: list of the incident ids counted as lost-time injuries in %d (any order).") % (
|
| 677 |
+
year - 1, year, year, rate_keys, year, year - 1, year, year, year - 1, year, year)
|
| 678 |
+
inst = "# Incident statistics\n\n" + body + "\n\n" + TOL + "\n"
|
| 679 |
+
return Task(ENV, "incidents", seed, d, "Injury rates for %d" % year, inst, files, checks, {"departments": len(depts)})
|
| 680 |
+
|
| 681 |
+
FAMILIES = {"noise": gen_noise, "chemicals": gen_chemicals, "vibration": gen_vibration, "incidents": gen_incidents}
|
| 682 |
+
|
| 683 |
+
def generate(seed, difficulty, family=None):
|
| 684 |
+
fam = family or sorted(FAMILIES)[seed % len(FAMILIES)]
|
| 685 |
+
return FAMILIES[fam](seed, difficulty)
|
envs/exposure_assessment/oracle.py
ADDED
|
@@ -0,0 +1,177 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""Reference solution for Exposure Assessment. Works only from the files in the current directory."""
|
| 3 |
+
import csv, json, os, re
|
| 4 |
+
from math import log10, sqrt, floor
|
| 5 |
+
|
| 6 |
+
def rows(name):
|
| 7 |
+
with open(name, newline="") as f: return list(csv.DictReader(f))
|
| 8 |
+
|
| 9 |
+
def text(name):
|
| 10 |
+
with open(name) as f: return f.read()
|
| 11 |
+
|
| 12 |
+
def table_value(doc, label):
|
| 13 |
+
"""The number in the second column of the Markdown table row that starts with `label`."""
|
| 14 |
+
m = re.search(r"\|\s*" + re.escape(label) + r"\s*\|\s*([0-9.]+)\s*\|", doc)
|
| 15 |
+
return float(m.group(1))
|
| 16 |
+
|
| 17 |
+
def minutes(clock):
|
| 18 |
+
h, m = clock.split(":")
|
| 19 |
+
return int(h) * 60 + int(m)
|
| 20 |
+
|
| 21 |
+
# ---------------------------------------------------------------- noise
|
| 22 |
+
def noise():
|
| 23 |
+
doc = text("exposure_values.md")
|
| 24 |
+
lower, upper, limit = [table_value(doc, k) for k in ("Lower action value", "Upper action value", "Limit value")]
|
| 25 |
+
diary = rows("noise_diary.csv")
|
| 26 |
+
level = {}
|
| 27 |
+
if os.path.exists("task_levels.csv"):
|
| 28 |
+
for r in rows("task_levels.csv"): level[r["task"]] = float(r["laeq_db"])
|
| 29 |
+
energy = {} # worker -> day -> sum of hours x 10^(L/10)
|
| 30 |
+
for r in diary:
|
| 31 |
+
if "duration_min" in r: hrs = float(r["duration_min"]) / 60
|
| 32 |
+
else: hrs = (minutes(r["end"]) - minutes(r["start"])) / 60
|
| 33 |
+
L = float(r["laeq_db"]) if "laeq_db" in r else level[r["task"]]
|
| 34 |
+
day = r.get("day", "day")
|
| 35 |
+
energy.setdefault(r["worker_id"], {}).setdefault(day, 0.0)
|
| 36 |
+
energy[r["worker_id"]][day] += hrs * 10 ** (L / 10)
|
| 37 |
+
def band(x):
|
| 38 |
+
if x > limit: return "over_limit"
|
| 39 |
+
if x >= upper: return "upper_action"
|
| 40 |
+
if x >= lower: return "lower_action"
|
| 41 |
+
return "below_lower_action"
|
| 42 |
+
weekly = "day" in diary[0]
|
| 43 |
+
planned = {}
|
| 44 |
+
if os.path.exists("planned_work.csv"):
|
| 45 |
+
for r in rows("planned_work.csv"): planned[r["worker_id"]] = r["planned_task"]
|
| 46 |
+
ans = {"workers": {}, "at_or_above_upper_action": []}
|
| 47 |
+
for w, days in energy.items():
|
| 48 |
+
daily = {d: 10 * log10(e / 8) for d, e in days.items()}
|
| 49 |
+
if weekly:
|
| 50 |
+
value = 10 * log10(sum(10 ** (x / 10) for x in daily.values()) / 5)
|
| 51 |
+
loudest = sorted(daily, key=lambda d: daily[d])[-1]
|
| 52 |
+
out = {"daily_lex8h_db": {d: round(x, 1) for d, x in daily.items()}, "weekly_lex_db": round(value, 1), "loudest_day": loudest}
|
| 53 |
+
else:
|
| 54 |
+
value = daily["day"]
|
| 55 |
+
out = {"lex8h_db": round(value, 1)}
|
| 56 |
+
if w in planned:
|
| 57 |
+
allowed = 8 * 10 ** (limit / 10) # energy budget at the limit value
|
| 58 |
+
spare = allowed - days["day"]
|
| 59 |
+
out["extra_minutes"] = int(floor(spare / 10 ** (level[planned[w]] / 10) * 60)) if spare > 0 else 0
|
| 60 |
+
out["band"] = band(value)
|
| 61 |
+
ans["workers"][w] = out
|
| 62 |
+
if value >= upper: ans["at_or_above_upper_action"].append(w)
|
| 63 |
+
return ans
|
| 64 |
+
|
| 65 |
+
# ---------------------------------------------------------------- chemicals
|
| 66 |
+
def chemicals():
|
| 67 |
+
oel, mass, group = {}, {}, {}
|
| 68 |
+
for r in rows("oel_table.csv"):
|
| 69 |
+
m = float(r["molar_mass_g_per_mol"]); v = float(r["oel_8h"])
|
| 70 |
+
if r["oel_unit"] == "ppm": v = v * m / 24.45
|
| 71 |
+
oel[r["substance"]] = v; mass[r["substance"]] = m; group[r["substance"]] = r["effect_group"]
|
| 72 |
+
info = {}
|
| 73 |
+
if os.path.exists("workers.csv"):
|
| 74 |
+
for r in rows("workers.csv"): info[r["worker_id"]] = (float(r["shift_min"]), r["unsampled_time"])
|
| 75 |
+
acc = {} # (worker, substance) -> [sum C x t, sum t]
|
| 76 |
+
for r in rows("samples.csv"):
|
| 77 |
+
if r.get("sample_type", "personal") != "personal": continue
|
| 78 |
+
s = r["substance"]
|
| 79 |
+
if "concentration_mg_m3" in r: c = float(r["concentration_mg_m3"])
|
| 80 |
+
else:
|
| 81 |
+
c = float(r["concentration"])
|
| 82 |
+
if r["unit"] == "ppm": c = c * mass[s] / 24.45
|
| 83 |
+
a = acc.setdefault((r["worker_id"], s), [0.0, 0.0])
|
| 84 |
+
a[0] += c * float(r["duration_min"]); a[1] += float(r["duration_min"])
|
| 85 |
+
per_worker = {}
|
| 86 |
+
for (w, s), (ct, t) in acc.items():
|
| 87 |
+
shift, rule = info.get(w, (480.0, "zero"))
|
| 88 |
+
twa = ct / 480 if rule == "zero" else ct / t * shift / 480
|
| 89 |
+
per_worker.setdefault(w, {})[s] = twa
|
| 90 |
+
multi = any(len(v) > 1 for v in per_worker.values())
|
| 91 |
+
ans = {"workers": {}, "over_limit": []}
|
| 92 |
+
for w, subs in per_worker.items():
|
| 93 |
+
if multi:
|
| 94 |
+
gi = {}
|
| 95 |
+
for s, twa in subs.items(): gi[group[s]] = gi.get(group[s], 0.0) + twa / oel[s]
|
| 96 |
+
ans["workers"][w] = {"substances": {s: {"twa_mg_m3": round(twa, 2), "exposure_index": round(twa / oel[s], 2)} for s, twa in subs.items()},
|
| 97 |
+
"group_index": {g: round(v, 2) for g, v in gi.items()}}
|
| 98 |
+
worst = max(gi.values())
|
| 99 |
+
else:
|
| 100 |
+
(s, twa), = subs.items()
|
| 101 |
+
ans["workers"][w] = {"twa_mg_m3": round(twa, 2), "twa_ppm": round(twa * 24.45 / mass[s], 2), "exposure_index": round(twa / oel[s], 2)}
|
| 102 |
+
worst = twa / oel[s]
|
| 103 |
+
if worst > 1: ans["over_limit"].append(w)
|
| 104 |
+
return ans
|
| 105 |
+
|
| 106 |
+
# ---------------------------------------------------------------- vibration
|
| 107 |
+
def vibration():
|
| 108 |
+
doc = text("vibration_values.md")
|
| 109 |
+
action, limit = table_value(doc, "Exposure action value"), table_value(doc, "Exposure limit value")
|
| 110 |
+
mag = {}
|
| 111 |
+
if os.path.exists("tools.csv"):
|
| 112 |
+
for r in rows("tools.csv"):
|
| 113 |
+
if "vibration_m_s2" in r: mag[r["tool_id"]] = float(r["vibration_m_s2"])
|
| 114 |
+
else: mag[r["tool_id"]] = sqrt(float(r["ax_m_s2"]) ** 2 + float(r["ay_m_s2"]) ** 2 + float(r["az_m_s2"]) ** 2)
|
| 115 |
+
dose = {} # operator -> tool -> a^2 x hours
|
| 116 |
+
for r in rows("tool_use.csv"):
|
| 117 |
+
if "tool" in r: key, a, hrs = r["tool"], float(r["vibration_m_s2"]), float(r["trigger_time_min"]) / 60
|
| 118 |
+
else: key, a, hrs = r["tool_id"], mag[r["tool_id"]], float(r["operations"]) * float(r["seconds_per_operation"]) / 3600
|
| 119 |
+
d = dose.setdefault(r["operator_id"], {})
|
| 120 |
+
d[key] = d.get(key, 0.0) + a * a * hrs
|
| 121 |
+
ans = {"operators": {}, "at_or_above_action": []}
|
| 122 |
+
for o, d in dose.items():
|
| 123 |
+
A = sqrt(sum(d.values()) / 8)
|
| 124 |
+
out = {"a8_m_s2": round(A, 2), "band": "over_limit" if A > limit else "action_to_limit" if A >= action else "below_action"}
|
| 125 |
+
if mag: out["dominant_tool"] = sorted(d, key=lambda k: d[k])[-1]
|
| 126 |
+
ans["operators"][o] = out
|
| 127 |
+
if A >= action: ans["at_or_above_action"].append(o)
|
| 128 |
+
if mag:
|
| 129 |
+
ans["tools"] = {t: {"minutes_to_action": round(480 * (action / a) ** 2, 1), "minutes_to_limit": round(480 * (limit / a) ** 2, 1)} for t, a in mag.items()}
|
| 130 |
+
return ans
|
| 131 |
+
|
| 132 |
+
# ---------------------------------------------------------------- incidents
|
| 133 |
+
def incidents():
|
| 134 |
+
doc = text("definitions.md")
|
| 135 |
+
def factor(label):
|
| 136 |
+
m = re.search(re.escape(label) + r".*? x ([0-9,]+) / hours worked", doc)
|
| 137 |
+
return int(m.group(1).replace(",", ""))
|
| 138 |
+
per_f, per_s = factor("Frequency rate"), factor("Severity rate")
|
| 139 |
+
m = re.search(r"capped at (\d+) days", doc); cap = int(m.group(1)) if m else None
|
| 140 |
+
m = re.search(r"LTIFR is higher than ([0-9.]+?)\.?\s*$", doc, re.M); target = float(m.group(1)) if m else None
|
| 141 |
+
log, hrs = rows("incident_log.csv"), rows("hours_worked.csv")
|
| 142 |
+
years = sorted(set(r["month"][:4] for r in hrs))
|
| 143 |
+
year = years[-1]
|
| 144 |
+
hours = {}
|
| 145 |
+
for r in hrs:
|
| 146 |
+
if r.get("workforce", "employees") != "employees": continue
|
| 147 |
+
k = (r["month"][:4], r.get("department", "site"))
|
| 148 |
+
hours[k] = hours.get(k, 0) + int(r["hours"])
|
| 149 |
+
ltis = [r for r in log if r["type"] == "injury" and int(r["days_lost"]) >= 1
|
| 150 |
+
and r.get("person_type", "employee") == "employee" and r.get("work_related", "yes") == "yes"]
|
| 151 |
+
def figures(y, dept=None):
|
| 152 |
+
mine = [r for r in ltis if r["date"][:4] == y and (dept is None or r["department"] == dept)]
|
| 153 |
+
days = sum(min(int(r["days_lost"]), cap) if cap else int(r["days_lost"]) for r in mine)
|
| 154 |
+
h = sum(v for (yy, dd), v in hours.items() if yy == y and (dept is None or dd == dept))
|
| 155 |
+
return {"lti_count": len(mine), "days_lost": days, "hours_worked": h, "ltifr": len(mine) * per_f / h, "severity_rate": days * per_s / h}
|
| 156 |
+
def tidy(f):
|
| 157 |
+
g = dict(f); g["ltifr"] = round(f["ltifr"], 2); g["severity_rate"] = round(f["severity_rate"], 4); return g
|
| 158 |
+
ids = [r["incident_id"] for r in ltis if r["date"][:4] == year]
|
| 159 |
+
if "department" not in hrs[0]:
|
| 160 |
+
ans = tidy(figures(year)); ans["lti_ids"] = ids
|
| 161 |
+
return ans
|
| 162 |
+
depts = sorted(set(r["department"] for r in hrs))
|
| 163 |
+
per_dept = {d: figures(year, d) for d in depts}
|
| 164 |
+
ans = {"departments": {d: tidy(f) for d, f in per_dept.items()}, "lti_ids": ids,
|
| 165 |
+
"above_target": [d for d in depts if per_dept[d]["ltifr"] > target]}
|
| 166 |
+
if len(years) == 1: ans["site"] = tidy(figures(year))
|
| 167 |
+
else:
|
| 168 |
+
site = {y: figures(y) for y in years}
|
| 169 |
+
ans["site"] = {y: tidy(f) for y, f in site.items()}
|
| 170 |
+
ans["ltifr_change"] = round(site[year]["ltifr"] - site[years[0]]["ltifr"], 2)
|
| 171 |
+
return ans
|
| 172 |
+
|
| 173 |
+
if os.path.exists("noise_diary.csv"): answer = noise()
|
| 174 |
+
elif os.path.exists("samples.csv"): answer = chemicals()
|
| 175 |
+
elif os.path.exists("tool_use.csv"): answer = vibration()
|
| 176 |
+
else: answer = incidents()
|
| 177 |
+
with open("answer.json", "w") as f: json.dump(answer, f, indent=1)
|
envs/harris_matrix/__init__.py
ADDED
|
File without changes
|