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
# 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| discretevrp-0.1.3.tar.gz | 4.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| discretevrp-0.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.9 kB
Release files / discretevrp-0.1.3.tar.gz
| Download URL | discretevrp-0.1.3.tar.gz |
|---|---|
| Size | 4.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f67dcf1268ac0b4f9b43f6f210ca7f7704d44e8d9e286b1487235d47708471ad
|
|
BLAKE2b-256 checksum How to use checksums |
ccfb89a24b757e361fe9aa03637f2c7c5da62367b1d96fc10cf7ee8bc9a0ee7b
|
| 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.3-py3-none-any.whl
| Download URL | discretevrp-0.1.3-py3-none-any.whl |
|---|---|
| Size | 5.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
12b4e0e14ba2d7eddffad30494bfa503889da4e52ab7dfa7d0f354468fe6c1d3
|
|
BLAKE2b-256 checksum How to use checksums |
20ddd369d05b63707d74a24976402cc72f3cb5182b01ee3604daa1f84e63d4dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|