Sunday, October 15, 2017

Anagramator

ANAGRAMATOR

INPUT

Dilly

Not exactly anagrams, more like different arrangements. Rearrangor.


How to Use

  • Type the text you wanna rearrange on the input box. Maximum 15 characters (recommended 7). You could use A-Z or 0-9 or any other characters that can be rendered on HTML.
  • Click the RUN button, you'll see the output. There's TXT to open the output on a new tab. For result size larger than 1,000 arrangements, it's only available on TXT.
  • To clear everything, hit CLEAR or delete all input.
  • Hit TOP to scroll to input box.
  • You could use [embiggen] link to get a wider area if you're on desktop or laptop or tablet.

Limitations

  • Because this is a "brute force" method with some "pointers", so then maximum input length is 15 characters to "soften the brutality". Recommended maximum length is 7 characters. Above 7, assuming there's no repeating character, the result size will increase significantly because of the factorial business. As you can see, pure 7! = 5,040, it's coped on browser. But then 8! = 40,320. That's heavy.
    If you have many characters, you should divide that into smaller chunks to then rearrange each of them to create a new readable word. Mwahaha.
    This is essentially how the "scrambling of the language" works. But instead of this, not this. This is the very screwy abstract of it.
  • Please omit the white space before calculating.
  • There'll be an auto abort function when (each) looping reaches the auto scaled limit. But you still can see some portion of the output (incomplete result). Usually, this'd happen for input size larger than 7 and it has no repeating character (or it has, but not that many). Because the repeating characters act as divisors. Before the process begins, this dilly "predicts" the output size, if it will be too huge, so then the auto scale is applied, thus the incomplete result, to "soften the brutality".

Fuamlor

Fuamlor is an anagram of formula. It's not form of a mule, thus fuamlor.

Take for example the total rearrangements can be made from these two words: YES and BOBBY.

Before that, factorial operator is an exclamation after (right side) the number. The operation is multiplication of the original integer, all the way descending to 1.
n! = n × (n-1) × (n-2) × (n-3) × ... × 1 (n is integer and larger than or equal to 0)

Pre-definition: 0! = 1

For instance, factorial(4)4! ➔ 4 × 3 × 2 × 1 = 24

Alright, let's go.

  • YES ➔ The set will be {E, S, Y} (must be sorted). The length is 3, and it has no repeating character.

    The fuamlor for total rearrangements is:

    Total = original_size! ÷ [Π each_occurrence!]
    *Π (uppercase pi) is math notation for product, for instance: 2 × 4 × 8 × 10 × ...

    Hence, for YES, total = 3! ÷ [1! 1! 1!] ➔ 6 ÷ 1 = 6

    Now, the fuamlor for subtotal of each member of the set.

    Let's use variable A, B, and C to shorten the fuamlor.

    Let A be original size

    B is Π each_occurrence!

    C is current character occurrence

    So then, Subtotal = A! ÷ B ÷ A × C

    Or like so, Subtotal = (A - 1)! ÷ B × C

    Therefore, each subtotal of E, Y, and S respectively:

    • E
      ➔ 3! ÷ [1! 1! 1!] ÷ 3 × 1 ➔ 6 ÷ 1 ÷ 3 × 1 = 2
      (OR) ➔ (3 - 1)! ÷ [1! 1! 1!] × 1 ➔ 2 ÷ 1 × 1 = 2
    • S
      ➔ 3! ÷ [1! 1! 1!] ÷ 3 × 1 ➔ 6 ÷ 1 ÷ 3 × 1 = 2
      (OR) ➔ (3 - 1)! ÷ [1! 1! 1!] × 1 ➔ 2 ÷ 1 × 1 = 2
    • Y
      ➔ 3! ÷ [1! 1! 1!] ÷ 3 × 1 ➔ 6 ÷ 1 ÷ 3 × 1 = 2
      (OR) ➔ (3 - 1)! ÷ [1! 1! 1!] × 1 ➔ 2 ÷ 1 × 1 = 2

    If we add them up, 2 + 2 + 2 = 6 (same as total rearrangements).

  • BOBBY ➔ The set is {B, O, Y}. The original length is 5 (not the size of the set), and it has one repeating character, B. The B repeats thrice (3). For others (O and Y), each has one occurrence.

    Total = 5! ÷ [3! 1! 1!] = 120 ÷ 6 = 20

    Each subtotal:

    • B
      ➔ 5! ÷ [3! 1! 1!] ÷ 5 × 3 ➔ 120 ÷ 6 ÷ 5 × 3 ➔ 4 × 3 = 12
      (OR) ➔ (5 - 1)! ÷ [3! 1! 1!] × 3 ➔ 24 ÷ 6 × 3 ➔ 4 × 3 = 12
    • O
      ➔ 5! ÷ [3! 1! 1!] ÷ 5 × 1 ➔ 120 ÷ 6 ÷ 5 × 1 ➔ 4 × 1 = 4
      (OR) ➔ (5 - 1)! ÷ [3! 1! 1!] × 1 ➔ 24 ÷ 6 × 1 ➔ 4 × 1 = 4
    • Y
      ➔ 5! ÷ [3! 1! 1!] ÷ 5 × 1 ➔ 120 ÷ 6 ÷ 5 × 1 ➔ 4 × 1 = 4
      (OR) ➔ (5 - 1)! ÷ [3! 1! 1!] × 1 ➔ 24 ÷ 6 × 1 ➔ 4 × 1 = 4

    The sum of each subtotal ➔ 12 + 4 + 4 = 20 (equal to total rearrangements).

The (total and subtotal) calculation can be looked from another angle and written "properly", but this is how the dilly above runs, for the output size "prediction" part.


Purpose

The dilly is useful for patterns observation and research. Or for other scribbling related. Not only for word, you could also use it for (pure or the permutation of letters and) numbers, like, numeric musical notes and just thing with something. Like, stuff. What an excellent explanation.

It can also be expanded with filters, like certain characters cannot be placed together, or they have to be some characters apart, or certain characters must be in fixed positions, etc. For that kind of expansion, the filter(s) can be placed before or after, depends on how the logic flows. But surely, there must be an input (or inputs) to dynamically set the filter(s). Or not, again, it's how you present the automation.

Lere & Woju, ANC, NBC, and Priotizaer are also related to this.