Datasets:
Download code/math_code_002_solution.py from efe-T/bilingual-math-code-verification-v1: direct link, hf CLI and curl.
- Browser
- Download file 336 Bytes
-
https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_002_solution.py
- Command line
-
hf download hf://datasets/efe-T/bilingual-math-code-verification-v1/code/math_code_002_solution.py
-
curl -L -o math_code_002_solution.py https://huggingface.co/datasets/efe-T/bilingual-math-code-verification-v1/resolve/main/code/math_code_002_solution.py
336 Bytes
| from fractions import Fraction | |
| p_b = 1 - Fraction(4, 7) * Fraction(3, 6) | |
| p_a_and_b = Fraction(4, 7) * Fraction(3, 6) | |
| answer = p_a_and_b / p_b | |
| assert 0 <= answer <= 1 | |
| result = {"conditional_probability": str(answer), "eligible_pairs": 30, "favourable_pairs": 12} | |
| import json | |
| print(json.dumps(result, ensure_ascii=False, sort_keys=True)) | |