|
Download math/math-0178.jsonl from winapiadmin/tinycodinglm: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/math/math-0178.jsonl
- Command line
-
hf download hf://datasets/winapiadmin/tinycodinglm@1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/math/math-0178.jsonl
-
curl -L -o math-0178.jsonl https://huggingface.co/datasets/winapiadmin/tinycodinglm/resolve/1c6bb525d6b4b9cdb15d2a75d54734eb29bbb8cb/math/math-0178.jsonl
1.01 kB
| {"type": "session", "harness": "opencode", "id": "math-0178", "name": "Modular Arithmetic"} | |
| {"type": "message", "message": {"role": "system", "content": "You are an expert mathematician and programmer."}} | |
| {"type": "message", "message": {"role": "user", "content": "Explain modular arithmetic for competitive programming"}} | |
| {"type": "message", "message": {"role": "assistant", "content": "Modular arithmetic: a = b (mod m) means m divides (a-b).\n\nOperations: (a+b) mod m = ((a mod m)+(b mod m)) mod m. Same for sub and mult.\nDivision: a/b mod m = a * b^{-1} mod m.\n\nModular inverse: b^{-1} mod m exists iff gcd(b,m)=1. Extended Euclidean: find x,y with bx+my=1, then x=b^{-1} mod m. O(log m).\n\nFermat: if p prime, a^{p-1} = 1 (mod p), so a^{-1} = a^{p-2} (mod p). Fast exponentiation O(log p).\n\nCRT: x = a_i (mod m_i) pairwise coprime -> unique solution mod M=product(m_i).\nx = sum(a_i * M_i * M_i^{-1}) mod M, M_i = M/m_i.\n\nApplications: counting mod 10^9+7, hashing, overflow avoidance."}} | |