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.2

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.2
File Size Uploaded
discretevrp-0.1.2.tar.gz 4.5 kB Details

Built distribution (wheel)

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

Total release size: 7.8 kB

Release files / discretevrp-0.1.2.tar.gz

Download URL discretevrp-0.1.2.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
4d3b797ab9ef2136e782fa7a6e8a89a1a13e74c61f0181d9023e3c172b800e85
BLAKE2b-256 checksum
How to use checksums
50de26ec8650fb33fd09d92963644d4a15470f585201ad57950a96e904beb748
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.2-py3-none-any.whl

Download URL discretevrp-0.1.2-py3-none-any.whl
Size 3.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
00e0de147ccc53713c36be05a1082728ecd1410bf6bce127df74f21347888621
BLAKE2b-256 checksum
How to use checksums
aec165c2269d3f9297752b7b20d9e7ff3afed0ec99a5f938248cc7a20b19c2de
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

This release

0.1.2 This release

2 release files

0.1.1

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