Skip to main content

A simple Python library for set operations (Himpunan) supporting fractions and decimals.

Project description

Himpunan - Group 1 - Discrete Mathematics

A simple Python library for performing set operations (Himpunan), supports Fraction and Decimal types, built for Discrete Mathematics learning.

📦 Installation

You can install this package from PyPI using pip:

pip install himpunan-group1-discrete-mathematics

or if you're running it locally ''' git clone https://github.com/mchlstvny/himpunan-project-discrete-mathematics.git cd himpunan-project-discrete-mathematics python setup.py install '''

🚀 Quick Start

from himpunan import Himpunan
from fractions import Fraction
from decimal import Decimal

Create sets

A = Himpunan(1, 2, Fraction(1, 2), Decimal('3.5'))
B = Himpunan(2, 3, Fraction(3, 4))

print("Himpunan A:", A)
print("Himpunan B:", B)

Supported Operations

Operator Description
A + B Union (A ∪ B)
A / B Intersection (A ∩ B)
A - B Difference (A − B)
A * B Symmetric Difference (A ⊕ B)
A ** B Cartesian Product (A × B)
A <= B Subset (⊆)
A < B Proper Subset (⊂)
A >= B Superset (⊇)
A // B Equivalent (Equal Elements)
A.Komplemen(S) Complement wrt Universal Set
A.ListKuasa() Power Set
abs(A) Number of Power Set Elements
A += x Add Element
A -= x Remove Element

Example Usage

A = Himpunan(2, 4, 5)
B = Himpunan(1, 2, 3)

print("A ∪ B =", A + B)
print("A ∩ B =", A / B)
print("A − B =", A - B)
print("A ⊕ B =", A * B)
print("A × B =", A ** B)
print("Subset (A ⊆ B):", A <= B)
print("Superset (A ⊇ B):", A >= B)
print("Equivalent (A ≡ B):", A // B)
print("Power Set of A:", A.ListKuasa())
print("Complement of A (wrt {1,2,3,4,5}):", A.Komplemen(Himpunan(1,2,3,4,5)))
print("Total subsets in A:", abs(A))

Authors

Group 1:
Keihan Pradika Muzaki (0806022410011)
Michele Stevany Venda Dati (0806022410021)
Siti Amirah Nathania Fahreza (0806022410024)
Universitas Ciputra Surabaya (Kampus Kota Makassar)

Email

kpradika@student.ciputra.ac.id
mstevany@sstudent.ciputra.ac.id
snathania03@student.ciputra.ac.id<

Github Repository

https://github.com/mchlstvny/himpunan-project-discrete-mathematics.git

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file himpunan_group1_discrete_mathematicsr-1.0.3.tar.gz.

File metadata

File hashes

Hashes for himpunan_group1_discrete_mathematicsr-1.0.3.tar.gz
Algorithm Hash digest
SHA256 47f2d3479801c8aed0ec2e5abded4f91304a212c224d05cc38d24019fc9bab14
MD5 9655aff6f3f3ebfad3085042b3a7c775
BLAKE2b-256 ae1f52a868cb075081cfbde4a43219ded194770539a6c9aabcdc798252fe41cb

See more details on using hashes here.

File details

Details for the file himpunan_group1_discrete_mathematicsr-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for himpunan_group1_discrete_mathematicsr-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ab76927c2f876e695a26cb1305d43ea317d8801878afbbbadf31860e266bd745
MD5 be3eb138bc14388c7a0175e171aa40cc
BLAKE2b-256 5c697e2c99cad6099eded8efa913ddfc9dd29d50f8048461cf3f41b83085ad76

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page