AGENT SKILL

combinatorics-and-discrete-math

Solve combinatorics and discrete math problems: counting principles, permutations, combinations, pigeonhole, inclusion-exclusion, recurrences, generating functions, partitions, Catalan numbers, Ramsey theory, recurrence relations, algorithms for counting. Includes script. Use for counting, enumeration, and recurrence problems.

License 许可
MIT
最近更新
2026-10-17
Stars
★ 8
Forks
1

01 前言 Front Matter

name
combinatorics-and-discrete-math
description
Solve combinatorics and discrete math problems: counting principles, permutations, combinations, pigeonhole, inclusion-exclusion, recurrences, generating functions, partitions, Catalan numbers, Ramsey theory, recurrence relations, algorithms for counting. Includes script. Use for counting, enumeration, and recurrence problems.

02 资源文件 2

03 SKILL.md 正文

Combinatorics & Discrete Mathematics

Counting

  • Rule of sum/product; permutations P(n,k) = n!/(n-k)!; combinations C(n,k); circular arrangements (n-1)!; multiset coefficients C(n+k-1, k).
  • Binomial identities: Pascal C(n,k) = C(n-1,k-1) + C(n-1,k); sum C(n,k) = 2^n; Vandermonde; hockey stick; combinatorial proofs by double counting and bijections.
  • Inclusion-exclusion; derangements D_n = n! sum_{k} (-1)^k/k!; surjections via Stirling numbers S(n,k) (set partitions), Bell numbers; integer partitions p(n) (Euler's pentagonal recurrence).
  • Special sequences: Catalan C_n = C(2n,n)/(n+1) (parenthesizations, Dyck paths, binary trees), Fibonacci (F_n = F_{n-1} + F_{n-2}), Stirling numbers of the first kind, Eulerian numbers.
  • Burnside / Polya enumeration for counting up to symmetry.

Extremal & existence

  • Pigeonhole: n+1 objects in n boxes; Erdos-Szekeres; Dirichlet approximation.
  • Ramsey: R(3,3) = 6, R(4,4) = 18. Probabilistic method: show existence by showing positive probability. Extremal graph theory: Turan's theorem; Sperner; Dilworth; Hall's marriage theorem.
  • Invariants and monovariants for process problems; coloring arguments; the pigeonhole of the parity.

Recurrences & generating functions

  • Linear recurrence with constant coefficients: characteristic roots -> closed form (Binet for Fibonacci).
  • Ordinary generating function G(x) = sum a_n x^n; exponential generating function for labeled structures; partial fractions to extract coefficients; Lagrange inversion; transfer-matrix method; asymptotics via singularity analysis.
  • Master theorem for divide-and-conquer T(n) = aT(n/b) + f(n).

Discrete structures

Sets, relations, equivalence classes, partial orders and lattices, Boolean algebra, functions (injective/surjective/bijective), cardinality (countable vs uncountable, Cantor diagonal).

Method

Model as sequences/sets; decide ordered vs unordered, repetition allowed or not; count complement if easier; verify small cases by brute force with scripts/combinatorics.py.

04 同仓库更多 Skills

hamzabellouch
hamzabellouch/agent-skills

security-audit

Comprehensive security guidance, source code audit, vulnerability assessment, and penetration test review for codebases, APIs, microservices, CLI tools, libraries, and LLM-backed applications. Triggers on requests to audit a codebase, conduct security reviews, find vulnerabilities or flaws, pen-test source code, or when the user asks in Arabic (فحص أمني، تدقيق الكود أمنياً، مراجعة الثغرات، فحص أمان المشروع). Supports Guidance mode (focused review) and Full Audit mode (deterministic 6-phase harness).

★ 8
hamzabellouch
hamzabellouch/agent-skills

malware-analysis-reversing

Production malware analysis workflows, reverse engineering methodologies, isolated sandbox triage, static/dynamic binary analysis, memory forensics, and YARA detection rule authoring.

★ 8
hamzabellouch
hamzabellouch/agent-skills

application-security-pentesting

Production Application Security (AppSec) standards, OWASP Top 10 vulnerability remediation, SAST/DAST pipeline integration, secure code review, threat modeling, and defensive security posture.

★ 8
hamzabellouch
hamzabellouch/agent-skills

oauth2-oidc-security-flows

Implement enterprise OAuth 2.1 and OpenID Connect (OIDC) authorization code flow with Proof Key for Code Exchange (PKCE), state and nonce verification, refresh token rotation, token revocation, and centralized IdP federation (Keycloak, Auth0, Okta). Trigger when building secure authentication, single sign-on (SSO), or third-party delegated authorization.

★ 8
hamzabellouch
hamzabellouch/agent-skills

jwt-session-management-hardening

Harden JWT-based authentication and session lifecycles using asymmetric signing (RS256/EdDSA), JWKS rotation, strict claims validation, Redis-backed sliding window sessions, revocation lists, and secure HttpOnly cookie storage. Trigger when implementing token validation, session revocation, or hardening API authentication.

★ 8
hamzabellouch
hamzabellouch/agent-skills

soc2-compliance-automation

Best practices for implementing SOC 2 Type II compliance controls, continuous evidence collection, infrastructure policy-as-code, and automated security monitoring. Use when automating Trust Services Criteria (Security, Availability, Confidentiality, Processing Integrity, Privacy), audit logging, IAM least privilege, or CI/CD security gates.

★ 8