Skip to main content

Topic: "Mogussort" Author: "구FS"

Mogussort



Error: Could not load image source.

😤😩😩💦💦💦

1. 📮Mogussort

World's (📮)SUSSIEST sorting algorithm

2. 📮Lore📮

Error: Could not load image source.

sussy

Your normal and boring sorting algorithms are just too fast? You want to introduce some sussy code to your programs?
Then you have come to the right place.

Inspired by the fantastic Csussus version and certified 📮extra sussy📮 by the original author!

3. Installation

You can install 📮Mogussort📮 from PyPi with pip install Mogussort.

4. 📮How it works📮

There are 2 (two, 2📮) lists, crew_in and crew_out.

  • crew_in contains all crewmates at the start of the game.
  • crew_out is empty.

The algorithm will vote out one random crewmate and put it in crew_out That crewmate is then removed from crew_in. Then, it checks if crew_out is correctly sorted (ascending).

If it is correnct, it will continue to vote and populate crew_out.

If the crewmates are not in the right order an 📮Impostor📮 (sus, baka) has been spotted. This means that the game is lost, and crew_out will be cleared, and crew_in will be reset to the original form.

The algorithm will stop once all crewmates are in the right order.

5. 📮Performance📮

Error: Could not load image source.

The 📮mogussort solves all of your sorting problems with an incredible, luck based runtime. You might ask "how fast is it exactly?".

Well, having $c$ crew mates the probability $p$ of sorting voting correctly in $1$ attempts to sort emergency meeting is:

$$ \begin{align} p&=\frac{1}{c} \cdot \frac{1}{c-1} \cdot \frac{1}{c-2} \cdot ... \cdot \frac{1}{1} \ &=\frac{1}{c!} \end{align} $$

That means the probability to fail in $1$ emergency meeting is:

$$ \begin{align} 1-p=1- \frac{1}{c!} \end{align} $$

If we make $n$ emergency meetings, the chance $P$ of $1$ success is:

$$ \begin{align} P&=1-(1-p)^{n} \ &=1-(1- \frac{1}{c!})^{n} \end{align} $$

So, how many meetings do we need until we have a chance of $P$ to have them sorted correctly once?

$$ \begin{align} P &= 1-(1- \frac{1}{c!})^{n}\ (1- \frac{1}{c!})^{n} &= 1-P \ n &= \text{log}_{1- \frac{1}{c!}}(1-P) \ n &= \frac{\text{lg}(1-P)}{\text{lg}(1- \frac{1}{c!})} \end{align} $$

So if we manage $m$ meetings per second, mogussort will finish with a probability $P$ within time $t_{P}$:

$$ \begin{align} t_{P} &= \frac{n}{m} \ &= \frac{\text{lg}(1-P)}{\text{lg}(1- \frac{1}{c!})} \cdot \frac{1}{m} \end{align} $$

Let's assume we manage $m=60 \text{k} \frac{\text{meeting}}{\text{s}}$ , which is a value I roughly get on my computer (Intel Core i7-8550U). Then mogussort will finish with a probability $P$ of $0,50$ and $0,95$ within:

Crew Mates $c$ Time $t_{0,50}$ Time $t_{0,50}$ Time $t_{0,95}$ Time $t_{0,95}$
$2$ $16,67 \text{µs}$ $72,03 \text{µs}$
$3$ $63,36 \text{µs}$ $273,9 \text{µs}$
$4$ $271,4 \text{µs}$ $1,173 \text{ms}$
$5$ $1,381 \text{ms}$ $5,966 \text{ms}$
$6$ $8,312 \text{ms}$ $35,92 \text{ms}$
$7$ $58,22 \text{ms}$ $251,6 \text{ms}$
$8$ $465,8 \text{ms}$ $2,013 \text{s}$
$9$ $4,192 \text{s}$ $18,12 \text{s}$
$10$ $41,92 \text{s}$ $181,2 \text{s}$ $(3,0 \text{min})$
$11$ $461,1 \text{s}$ $(7,7 \text{min})$ $1,993 \text{ks}$ $(33 \text{min})$
$12$ $5,534 \text{ks}$ $(1,5 \text{h})$ $23,92 \text{ks}$ $(6,6 \text{h})$
$13$ $71,94 \text{ks}$ $(20 \text{h})$ $310,9 \text{ks}$ $(3,6 \text{d})$
$14$ $1,007 \text{Ms}$ $(12 \text{d})$ $4,353 \text{Ms}$ $(50 \text{d})$
$15$ $15,11 \text{Ms}$ $(170 \text{d})$ $65,29 \text{Ms}$ $(2,1 \text{a})$
$16$ $242,0 \text{Ms}$ $(7,7 \text{a})$ $1,046 \text{Gs}$ $(33 \text{a})$
$17$ $4,162 \text{Gs}$ $(132 \text{a})$ $17,99 \text{Gs}$ $(570 \text{a})$
$18$ $104,1 \text{Gs}$ $(3.297 \text{a})$ $449,7 \text{Gs}$ $(14.251 \text{a})$

This even means you might be able to play a game of Among Us while you wait for the algorithm to finish (now isn't that fantastic?).

6. 📮Sus📮

⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⣀⣀⣐⡀⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄⠄
⠄⠄⢠⠄⣠⣶⣿⣿⣿⠿⠿⣛⣂⣀⣀⡒⠶⣶⣤⣤⣬⣀⡀⠄⢀⠄⠄⠄⠄⠄⠄⠄
⠄⠄⢀⣾⣿⣿⣿⡟⢡⢾⣿⣿⣿⣿⣿⣿⣶⣌⠻⣿⣿⣿⣿⣷⣦⣄⡀⠄⠄⠄⠄⠄
⠄⠄⣈⣉⡛⣿⣿⣿⡌⢇⢻⣿⣿⣿⣿⣿⠿⠛⣡⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠄⠄⠄
⠄⠺⠟⣉⣴⡿⠛⣩⣾⣎⠳⠿⠛⣋⣩⣴⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠄⠄
⠄⠄⠄⠘⢋⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄
⠄⠄⢀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠄
⠄⠄⠄⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⣀
⠄⠄⠄⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠘⠛
⠄⠄⠄⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠋⣀⣀⣠⣤
⠄⠄⣀⣀⡙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⢛⣩⠤⠾⠄⠛⠋⠉⢉
⠄⠺⠿⠛⠛⠃⠄⠉⠙⠛⠛⠻⠿⠿⠿⠟⠛⠛⠛⠉⠁⠄⠄⣀⣀⣠⣤⣠⣴⣶⣼⣿
⠀⠀⠀⡯⡯⡾⠝⠘⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢊⠘⡮⣣⠪⠢⡑⡌ 
⠀⠀⠟⠝⠈⠀⠀⠀⠡⠀⠠⢈⠠⢐⢠⢂⢔⣐⢄⡂⢔⠀⡁⢉⠸⢨⢑⠕⡌
⠀⠀⡀⠁⠀⠀⠀⡀⢂⠡⠈⡔⣕⢮⣳⢯⣿⣻⣟⣯⣯⢷⣫⣆⡂⠀⠀⢐⠑⡌ 
⢀⠠⠐⠈⠀⢀⢂⠢⡂⠕⡁⣝⢮⣳⢽⡽⣾⣻⣿⣯⡯⣟⣞⢾⢜⢆⠀⡀⠀⠪
⣬⠂⠀⠀⢀⢂⢪⠨⢂⠥⣺⡪⣗⢗⣽⢽⡯⣿⣽⣷⢿⡽⡾⡽⣝⢎⠀⠀⠀⢡ 
⣿⠀⠀⠀⢂⠢⢂⢥⢱⡹⣪⢞⡵⣻⡪⡯⡯⣟⡾⣿⣻⡽⣯⡻⣪⠧⠑⠀⠁⢐
⣿⠀⠀⠀⠢⢑⠠⠑⠕⡝⡎⡗⡝⡎⣞⢽⡹⣕⢯⢻⠹⡹⢚⠝⡷⡽⡨⠀⠀⢔ 
⣿⡯⠀⢈⠈⢄⠂⠂⠐⠀⠌⠠⢑⠱⡱⡱⡑⢔⠁⠀⡀⠐⠐⠐⡡⡹⣪⠀⠀⢘
⣿⣽⠀⡀⡊⠀⠐⠨⠈⡁⠂⢈⠠⡱⡽⣷⡑⠁⠠⠑⠀⢉⢇⣤⢘⣪⢽⠀⢌⢎
⣿⢾⠀⢌⠌⠀⡁⠢⠂⠐⡀⠀⢀⢳⢽⣽⡺⣨⢄⣑⢉⢃⢭⡲⣕⡭⣹⠠⢐⢗
⣿⡗⠀⠢⠡⡱⡸⣔⢵⢱⢸⠈⠀⡪⣳⣳⢹⢜⡵⣱⢱⡱⣳⡹⣵⣻⢔⢅⢬⡷
⣷⡇⡂⠡⡑⢕⢕⠕⡑⠡⢂⢊⢐⢕⡝⡮⡧⡳⣝⢴⡐⣁⠃⡫⡒⣕⢏⡮⣷⡟
⣷⣻⣅⠑⢌⠢⠁⢐⠠⠑⡐⠐⠌⡪⠮⡫⠪⡪⡪⣺⢸⠰⠡⠠⠐⢱⠨⡪⡪⡰ 
⣯⢷⣟⣇⡂⡂⡌⡀⠀⠁⡂⠅⠂⠀⡑⡄⢇⠇⢝⡨⡠⡁⢐⠠⢀⢪⡐⡜⡪⡊
⣿⢽⡾⢹⡄⠕⡅⢇⠂⠑⣴⡬⣬⣬⣆⢮⣦⣷⣵⣷⡗⢃⢮⠱⡸⢰⢱⢸⢨⢌ 
⣯⢯⣟⠸⣳⡅⠜⠔⡌⡐⠈⠻⠟⣿⢿⣿⣿⠿⡻⣃⠢⣱⡳⡱⡩⢢⠣⡃⠢⠁
⡯⣟⣞⡇⡿⣽⡪⡘⡰⠨⢐⢀⠢⢢⢄⢤⣰⠼⡾⢕⢕⡵⣝⠎⢌⢪⠪⡘⡌
⡯⣳⠯⠚⢊⠡⡂⢂⠨⠊⠔⡑⠬⡸⣘⢬⢪⣪⡺⡼⣕⢯⢞⢕⢝⠎⢻⢼⣀
⠁⡂⠔⡁⡢⠣⢀⠢⠀⠅⠱⡐⡱⡘⡔⡕⡕⣲⡹⣎⡮⡏⡑⢜⢼⡱⢩⣗⣯⣟ 

7. Language

Error: Could not load image source.

pysus

Made in py📮sus📮 to improve performance in comparison to the original Csussus version.

Metadata

Release files for mogussort 1.0.3

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

Source distribution (sdist)

Source distribution for mogussort 1.0.3
File Size Uploaded Provenance Actions
mogussort-1.0.3.tar.gz 4.9 kB Without provenance Details for mogussort-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mogussort 1.0.3
File Interpreter ABI Platform Actions
mogussort-1.0.3-py3-none-any.whl Python 3 none any Details for mogussort-1.0.3-py3-none-any.whl

Total release size: 10.5 kB

Release files / mogussort-1.0.3.tar.gz

Download URL mogussort-1.0.3.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f43ac4c60806f7f2a3d52e27430c574c8b174159037e21fa875a163475f4204e
BLAKE2b-256 checksum
How to use checksums
498b107b9f2aec3f29a2e8d176fb81c2037ccf6f16be01f6065ae03cc9c5ae3d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / mogussort-1.0.3-py3-none-any.whl

Download URL mogussort-1.0.3-py3-none-any.whl
Size 5.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c74f758d915f7c2143898f25fa866b16c9be915cd1398540d2e7136d1d6dc70e
BLAKE2b-256 checksum
How to use checksums
fd65984d9e73fcb09faf7b8921e61c2bf6ada617f8df9c720049183a9f1ac538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/4.0.2 CPython/3.11.5

Security for mogussort 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files No provenance

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