• 𝓔𝓶𝓶𝓲𝓮@lemm.ee
    link
    fedilink
    arrow-up
    44
    ·
    edit-2
    3 months ago

    Let us substitute: ( - x, ) - y
    Thus ()() becomes xyxy
    ())( becomes xyyx
    Now clearly it can be seen, even while high, that the second one is and the first isn’t

  • TriflingToad@lemmy.world
    link
    fedilink
    arrow-up
    27
    ·
    3 months ago

    for those too lazy to google,
    palindrome /păl′ĭn-drōm″/ noun A word, verse, or sentence, that is the same when read backward or forward. “madam; Hannah; or Lewd did I live, & evil I did dwel.”

    () () backwards is )( )(
    () )( backwards is () )(

  • Kaelygon@lemmy.world
    link
    fedilink
    arrow-up
    21
    ·
    edit-2
    3 months ago

    this took me a while but after converting to ascii in hex I get it

    “())(” = 40 41 41 40

    “()()” = 40 41 40 41

    As long your strings aren’t null terminated

    • pingveno@lemmy.world
      link
      fedilink
      English
      arrow-up
      11
      ·
      3 months ago

      As long your strings aren’t null terminated

      What kind of monstrous bug prone language would do that?

  • CanadaPlus@lemmy.sdf.org
    link
    fedilink
    arrow-up
    14
    ·
    edit-2
    3 months ago

    Calm down, everyone. Brackets form a tree structure, and can be represented by a free magma, while strings with concatenation are equivalent to a free monoid. You’re essentially asking for the two respective common involutory operations to be connected by this map, just because they’re involutory, which put that way is a wild guess at best. In fact, reversing this string produces something outside the range of the map entirely, which is injective and so can’t be surjective for combinatorical reasons.

    … Yeah I might be the only person that finds that useful.

    • AFaithfulNihilist@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      3 months ago

      I’m just going to assume those 4 dollar words are real and you aren’t just misspelling normal words to fuck with us.

      Non surjective free magma? What about the doblastic amortized basalt?

      • CanadaPlus@lemmy.sdf.org
        link
        fedilink
        arrow-up
        3
        ·
        edit-2
        3 months ago

        I was saying unipotent at first instead of involutory, which was actually the wrong jargon because of the context, but I’ve fixed that now. Yes, they’re all real.

        A glossary:

        Involution

        Surjective

        Injective

        Free magma

        Free monoid

        Map, although in this context I could probably have just said function. I go with map by default when thinking bidirectionally.

        I think most people here will know combinatorics, the study of the different possible configurations of something. The number of n-length strings with two possible characters is 2n, as coders should all know, and the number of trees turns out to be Catalan numbers, many of which have prime factors other than 2. This is an injective map from n node trees to 2n character strings, so it’s possible, but you’ll (almost?) never get a perfect match, so by the pigeonhole principle it can’t be surjective.

        I’m wondering now if Catalan numbers are O(n!). The equation has a lot of n! but it also has a certain smell like it might depend on big or little o.

        Edit: D’oh, they must grow no faster than 22n; I just wrote that. So, exponential.