mathguard
यह क्या करती है
यह टूल जटिल कंप्यूटेशनल समस्याओं को हल करने के लिए उन्नत गणितीय तरीके चुनने में मदद करता है, खासकर जब बहुत ज़्यादा डेटा हो। यह पारंपरिक तरीकों के मुकाबले ज़्यादा असरदार विकल्प सुझाता है, भले ही इसके लिए थोड़ी सी गलती की गुंजाइश माननी पड़े।
कब इस्तेमाल करें
- ✓जब आपके पास लाखों डेटा पॉइंट हों और आपको जल्दी से मिलते-जुलते आइटम ढूंढने हों।
- ✓जब सिग्नल या इमेज प्रोसेस करनी हो और तेज़ कैलकुलेशन चाहिए।
- ✓जब आम एल्गोरिदम पहले से तेज़ हों, फिर भी आपको और बेहतर हल चाहिए और थोड़ी गलती सह सकते हों।
Skill का लिंक
https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/mathguard/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मुझे 10 मिलियन इमेज के डेटासेट में डुप्लीकेट ढूंढने हैं, लेकिन कुछ false positives चल सकते हैं। मैं कौन सी गणितीय तकनीक इस्तेमाल कर सकता हूँ?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह समस्या की तुलना उन ज्ञात गणितीय तकनीकों से करता है जो बड़े डेटा के लिए ज़्यादा असरदार हैं। यह जाँचता है कि सटीक हल ज़रूरी है या किसी ज्ञात गलती की सीमा वाला अनुमान (approximation) चल सकता है।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
mathguard — Math-Heavy Optimization for AI Code
lemmaly makes you pick the right classical algorithm. mathguard kicks in when the classical algorithm is already optimal but mathematics gives a better bound — usually by accepting bounded approximation, exploiting structure, or moving to a smarter algebraic space.
The model knows these techniques. It almost never proposes them spontaneously. mathguard fixes that.
Violating the letter of these rules is violating the spirit of the skill. A Bloom filter where the caller assumed exact answers is a production incident, not an optimization.
When to Use This Skill
Use mathguard when:
- Working with large-scale data (
n ≥ 10⁶): similarity search, deduplication, top-K / heavy-hitters, streaming analytics, cardinality estimation, embeddings, recommender systems. - Doing signal/image processing, polynomial or big-integer arithmetic, convolution, graph distance, computational geometry, randomized algorithms.
- The classical O(n log n) is already the floor and you need an asymptotic win (Bloom filter, HyperLogLog, Count-Min Sketch, MinHash/LSH, FFT/NTT, Johnson-Lindenstrauss projection, sweep line, kd-tree/BVH, fast exponentiation, monoid parallel reduction, amortized potential method).
- Loaded after
lemmalyhas confirmed the classical answer is not enough.
Do not use mathguard when:
- The caller needs exact answers (auth, billing, dedup-for-correctness, primary keys).
nis small (n < 10⁴) and the path is not hot.- The bottleneck is I/O, not CPU/memory.
The Iron Law
NO APPROXIMATE STRUCTURE WITHOUT WRITTEN ε/δ AND EXPLICIT CALLER ACCEPTANCE
Probabilistic data structures (Bloom, HyperLogLog, Count-Min, MinHash/LSH, t-digest), randomized projections (JL), and lossy transforms (floating FFT) all change the answer's meaning. Before proposing one:
- Write the error parameter the caller will see (false-positive rate, relative error, distortion bound).
- Identify the caller and state, in one sentence, that they tolerate this kind of wrong answer.
- If you cannot identify the caller, or they need exact (auth checks, billing, dedup keys, deduplication for correctness, anything that flows into a primary key), DO NOT propose the approximate structure. Keep classical, or escalate to a sharded/streaming exact design.
This rule has saved more incidents than any other in this skill. Do not soften it.
Non-negotiable rules
Declare exact vs approximate up front. Before suggesting a math-level technique, state:
mode: exactormode: approximate- If approximate: the error parameter (ε, δ, false-positive rate) and a sentence on whether the caller can tolerate it.
- If the caller needs exact and there is no exact win, say so and stop — do not silently degrade to approximate.
Cite the technique by name. Never describe a probabilistic or numerical trick in vague terms. Name it:
Bloom filter,HyperLogLog,Count-Min Sketch,MinHash + LSH,Johnson–Lindenstrauss projection,FFT,NTT,fast exponentiation,Karatsuba,Strassen,sweep line,kd-tree,BVH,union-find with path compression,Floyd's cycle detection,Boyer-Moore majority,reservoir sampling,Knuth shuffle,Aho-Corasick,suffix automaton,segment tree with lazy propagation,Fenwick tree,monoid scan / parallel prefix. A named technique is auditable; "a smart approximation" is not.State the trade you are making. Every math-level optimization buys something at a cost. In one line:
- Buys:
space,time,wall-clock,parallelism. - Costs:
accuracy ε=?,code complexity,dependency,non-determinism,numerical stability. - If the cost is invisible to the caller, write "callers see no change".
- Buys:
Justify the asymptotic win. Do not propose a math technique without a one-line bound argument:
- "HyperLogLog: count uniques in O(log log n) bits at standard error 1.04/√m."
- "FFT: polynomial multiplication O(n log n) vs schoolbook O(n²)."
- "JL projection: preserves pairwise distances within (1±ε) using O(log n / ε²) dimensions."
- "Sweep line: rectangle overlap from O(n²) pair checks to O(n log n) events." No bound, no proposal.
Forbid math cargo-culting. Do not introduce these techniques when:
- n is small enough that a linear scan finishes in microseconds (n < ~10⁴ unless it is a hot path).
…
अक्सर पूछे जाने वाले सवाल
'approximation with known error' का क्या मतलब है?
इसका मतलब है कि जवाब 100% सटीक नहीं हो सकता, लेकिन गलती छोटी और अनुमानित होती है (जैसे 1% संभावना कि जवाब गलत हो)। इससे कैलकुलेशन काफी तेज़ हो जाते हैं।
इस टूल का इस्तेमाल कब नहीं करना चाहिए?
इसे तब इस्तेमाल न करें जब सटीकता सबसे ज़रूरी हो (जैसे वित्तीय लेन-देन में), या जब डेटा बहुत कम हो (10,000 आइटम से कम), जहाँ सरल तरीके पहले से ठीक काम करते हैं।
यह कौन सी तकनीकें सुझा सकता है?
समस्या के आधार पर यह Bloom Filters, HyperLogLog, Count-Min Sketch, MinHash, Fast Fourier Transform (FFT) जैसी तकनीकें सुझा सकता है।
जानकारी
लेखक का मूल विवरण
Math-heavy escalation for n >= 10^6 — Bloom, HyperLogLog, Count-Min, MinHash/LSH, FFT, JL projection, sweep line. Use when classical O(n log n) is the floor and approximate or math wins.
लोकप्रियता
- GitHub स्टार
- 48k
- रैंकिंग में स्थान
- #5180
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
00-andruia-consultant
48kआपके एजेंट को AI प्रोजेक्ट शुरू करने या उन्हें बेहतर बनाने में मदद करता है। यह code का विश्लेषण करता है, tools सुझाता है और स्पेनिश भाषा में action plan बनाता है।
007
48kआपका एजेंट security audit और threat modeling करता है। यह प्रोजेक्ट को हमलों और कमजोरियों से बचाने में काम आता है।
10-andruia-skill-smith
48kआपके एजेंट को AI tools बनाने या उन्हें बेहतर करने में मदद करता है। यह तय करता है कि tools कैसे काम करेंगे, documentation लिखता है और structure की जांच करता है।
20-andruia-niche-intelligence
48kआपका एजेंट किसी खास industry का summary बनाता है। भरोसेमंद स्रोतों की मदद से यह प्रोजेक्ट का संदर्भ, नियम, इस्तेमाल के तरीके और जोखिम समझने में मदद करता है।
मिलती-जुलती skills
pytorch-patterns
280kआपके एजेंट को machine learning models के लिए PyTorch इस्तेमाल करने में मदद करता है। कुशल model training के best practices लागू करता है और नतीजों को दोहराने लायक रखता है।
evm-token-decimals
280kयह आपके एजेंट को अलग-अलग blockchain networks पर decimal numbers की गलतियों से बचने में मदद करता है। यह transactions और calculations में token values सही रखने का ध्यान रखता है।
ito-inference
280kआपके एजेंट को AI models की उपलब्धता जाँचने देता है। यह compute request को तैयार model service से जोड़ता है।