!asklemmy@lemmy.world has over 70 times as many subscribers as the other two asklemmy communities combined.
!asklemmy@lemmy.world has over 70 times as many subscribers as the other two asklemmy communities combined.
If the set of all strings of composite length is a regular language, you can use that to prove the set of all strings of prime length are also a regular language.
But it’s also easy to prove that the set of language of strings of prime length is not regular, and thus the language of strings of composite length also can’t be regular.
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.
Average Matt Parker code
“at least 2 characters repeated [at least] twice” implies the string’s length is divisible by a number greater than 1.
Yeah but it’s just so tempting… It validates so many inputs so easily…
They said—
A line with exactly 0 or 1 characters, or a line with a sequence of 1 or 3 or more characters, repeated at least twice
Note—
…or a line with a sequence of 1 or 3 or more characters, repeated at least twice
It should be—
…or a line with a sequence of 2 or more characters, repeated at least twice
The regex in the post will match “abab”. Their original description (line 2 of this comment) will not match “abab”.
It’s a line with a sequence of two or more characters repeated at least twice.
Baking soda is sodium bicarbonate. Dissolving it in water will increase its pH. I’m not sure if that works for killing bacteria.
Pretty sure humans are not the most co-operative animals alive.
Bees and ants exist, you know
Uh oh. You should not have said that. Run for cover.
I know it’s a copypasta, but I correctly differentiated GNU and Linux in my comment.
Maybe so, but children don’t always adopt the ideology of their parents. They usually do, but not always.
That doesn’t make him a socialist. He doesn’t espouse any of the core socialist beliefs there. He’s just saying he’s a “woke communist” (as described by the right), which could mean anything from a centre-left liberal to a Marxist.
Doesn’t that make you a communist?
I would say GNU is one that’s openly socialist. If Linux’s (or rather, Linus Torvald’s) philosophy is socialist, they either do a very good job of hiding the fact or there is a lot I don’t know about them.
When you assume anyone complaining about .ml and Hexbear must be a liberal
I think every time a big leftist instance gets defederated, its users leave and move towards more mainstream instances. I remember lemmy.ml used to be somewhat neutral a year or so ago (I got banned there so here I am now on lemmy.world).
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.
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.
From a formal logic perspective, your statement is true. But in real life, the more important distinction is not between “true” and “false”, but between “purposefully deceptive and ungenuine disinformation” versus “outspoken dissenting viewpoint”. And that is one that people are really bad at telling the difference between, especially if the viewpoint in particular is one that they hold very strongly.