• 2 Posts
  • 93 Comments
Joined 1 year ago
cake
Cake day: October 19th, 2023

help-circle



  • You got downvoted here but you’re absolutely right. It’s easy to prove that the set of strings with prime length is not a regular language using the pumping lemma for regular languages. And in typical StackExchange fashion, someone’s already done it.

    Here’s their proof.

    Claim 1: The language consisting of the character 1 repeated a prime number of times is not regular.

    A further argument to justify your claim—

    Claim 2: If the language described in Claim 1 is not regular, then the language consisting of the character 1 repeated a composite number of times is not regular.

    Proof: Suppose the language described in Claim 2 is regular if the language described in Claim 1 is not. Then there must exist a finite-state automaton A that recognises it. If we create a new finite-state automaton B which (1) checks whether the string has length 1 and rejects it, and (2) then passes the string to automaton A and rejects when automaton A accepts and accepts when automaton A rejects, then we can see that automaton B accepts the set of all strings of non-composite length that are not of length 1, i.e. the set of all strings of prime length. But since the language consisting of all strings of prime length is non-regular, there cannot exist such an automaton. Therefore, the assumption that the language described in Claim 2 being regular is false.


















  • NateNate60@lemmy.worldOPtomemes@lemmy.worldHope you like socialism
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    3 months ago

    At the risk of starting another argument, I have heard it described thusly—

    Suppose you have some number of apples and some number of people who want the apples.

    • Capitalism is where one person owns all the apples and everyone has to work for them to get an apple.
    • Socialism is where the apples are distributed evenly to all the people who want them.
    • Communism is where unlimited apples fall out of the sky and everyone can have as many as they need.

    Now, this quote was originally used by capitalists to mock communism, but I think it’s really not a bad analogy. Think about it: Star Trek, another beloved Lemmy staple, takes place in a communist society. Everyone works whatever job they want contributing to society and in return, everyone gets whatever they need provided for by the state. It’s not truly post scarcity, since human greed always outstrips any finite amount of resources. But there is no distinction of rich or poor in Star Trek. People are judged by their intelligence, skill, and merit, and rewarded proportionally. At the same time, there is no concept of money, mostly (except when the plot needs it). What good is money when all your necessities are taken care of? All but your wildest desires can be conjured up at a snap of your fingers, and all the state asks in return is that you do what you can to contribute. It is a mutually beneficial relationship that most people have learned to be content with. That, my friends, is an ideal depiction of communism.