Skip to main content

Discrete Veerapat

Python Package มาตรฐาน PEP 517/621 สำหรับการคำนวณคณิตศาสตร์ดีสครีต (Discrete Mathematics) รวมโมดูล Counting และ Number Theory

การใช้งาน

import DiscreteVRP as dv

# 1. Counting Module

# แฟกทอเรียล (Factorial)
print(dv.factorial(5))                          # Output: 120

# การเรียงสับเปลี่ยน (Permutation: P(n, k))
print(dv.permutation(5, 2))                     # Output: 20

# การจัดหมู่ (Combination: C(n, k))
print(dv.combination(5, 2))                     # Output: 10

# การกระจายทวินาม (Binomial Expansion)
print(dv.binomial_expansion(3))                 # Output: x^3 + 3x^2y + 3xy^2 + y^3

# Stars and Bars (แจกของ n ชิ้น ให้ k กล่อง โดยคนหนึ่งอาจได้ 0 ชิ้น)
print(dv.stars_and_bars(5, 3))                  # Output: 21

# Stars and Bars (แจกของ n ชิ้น ให้ k กล่อง โดยทุกคนต้องได้อย่างน้อย 1 ชิ้น)
print(dv.stars_and_bars_at_least_one(5, 3))     # Output: 6

# ฟังก์ชัน Floor (ปัดเศษลง)
print(dv.floor_function(3.7))                   # Output: 3

# ฟังก์ชัน Ceiling (ปัดเศษขึ้น)
print(dv.ceiling_function(3.2))                 # Output: 4

# หลักการรวมเข้า-ตัดออก สำหรับ 2 เซต (Inclusion-Exclusion Principle: 2 Sets)
print(dv.inclusion_exclusion_2(10, 15, 3))      # Output: 22

# หลักการรวมเข้า-ตัดออก สำหรับ 3 เซต (Inclusion-Exclusion Principle: 3 Sets)
print(dv.inclusion_exclusion_3(10, 15, 12, 3, 2, 4, 1)) # Output: 29

# หลักการรังนกพิราบ (Pigeonhole Principle)
print(dv.pigeonhole_principle(10, 3))           # Output: At least 1 hole has 4 pigeons


# 2. Number Theory Module

# ตรวจสอบจำนวนคู่ (Even Number)
print(dv.is_even(4))                            # Output: True

# ตรวจสอบจำนวนคี่ (Odd Number)
print(dv.is_odd(7))                             # Output: True

# ตรวจสอบจำนวนเฉพาะ (Prime Number)
print(dv.is_prime(29))                          # Output: True

# ตรวจสอบจำนวนประกอบ (Composite Number)
print(dv.is_composite(10))                      # Output: True

# Division Algorithm: a = qb + r
print(dv.division_algorithm(70, 15))            # Output: 70 = 4(15) + 10

# ตัวหารร่วมมาก (Greatest Common Divisor - GCD)
print(dv.gcd(48, 18))                           # Output: 6

# ตรวจสอบจำนวนเฉพาะร่วม (Relatively Prime)
print(dv.is_relatively_prime(15, 28))           # Output: True

# แสดงขั้นตอนการหา ห.ร.ม. แบบยูคลิด (Euclidean Algorithm Steps)
dv.euclidean_algorithm_steps(2569, 2026)
# Output:
# 2569 = 1(2026) + 543
# 2026 = 3(543) + 397
# 543 = 1(397) + 146
# 397 = 2(146) + 105
# 146 = 1(105) + 41
# 105 = 2(41) + 23
# 41 = 1(23) + 18
# 23 = 1(18) + 5
# 18 = 3(5) + 3
# 5 = 1(3) + 2
# 3 = 1(2) + 1
# 2 = 2(1) + 0

Metadata

Release files for DiscreteVRP 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for DiscreteVRP 0.1.1
File Size Uploaded
discretevrp-0.1.1.tar.gz 4.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for DiscreteVRP 0.1.1
File Interpreter ABI Platform
discretevrp-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 7.8 kB

Release files / discretevrp-0.1.1.tar.gz

Download URL discretevrp-0.1.1.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
b5f5bde44590aab2453e7d72582ee474cbf60aa0b4af687f8a195f01bc7e2d75
BLAKE2b-256 checksum
How to use checksums
3b688e40908fc5402ddc2c40e4f249217b5a8d27fd1575c38f0d90b151c9cc5a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / discretevrp-0.1.1-py3-none-any.whl

Download URL discretevrp-0.1.1-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9f7cadf253a1cbfcf39e98610513682eb2de3e3a5b19a6c630318b3b50b2eacb
BLAKE2b-256 checksum
How to use checksums
fae4b03d1f61371d97c1eec039b571eb2981fbc56e404a22e23a8c78924de479
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release history Release notifications | RSS feed

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

This release

0.1.1 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page