MHB Can You Define the Recursive Equation for Strings of 1s and 2s with 3 Mod 4 1s?

  • Thread starter Thread starter Amad27
  • Start date Start date
  • Tags Tags
    String
AI Thread Summary
The discussion focuses on defining a recursive equation for the set K of strings composed of 1s and 2s, where the count of 1s is congruent to 3 modulo 4. The initial hints suggest that K includes the empty string, strings with no 1s, and those with 1s that meet the specified condition. Examples provided indicate that strings can start with 1 and contain exactly three 1s, while also allowing for the inclusion of any number of 2s. The recursive structure is explored, emphasizing that if a string s is in K, then adding 2 or specific patterns of 1s maintains membership in K. The conversation aims to clarify the recursive definition while addressing challenges in ensuring the count of 1s meets the modulo condition.
Amad27
Messages
409
Reaction score
1
If $K$ is the set of strings of 1s and 2s with the number of 1s $\equiv3\bmod4$ and with any amount of $2$s, find a recursive definition of $K$. For example, $1112112121$.

I'm in need of some hints.

The string can be empty, have no 1's or have 1's equivalent to 3 mod 4.
$$K=\{\varepsilon,2\}\cup\{2,111,x\}K$$
I'm unable to figure out how to have the number of 1s exactly $\equiv3\bmod4$.
 
Physics news on Phys.org
Hi Olok,

The strings of the form 12*12*12* are in K, aren't they?
That is, the strings that begin with 1 and that have exactly three 1's.

If s is in K, then 2s is also in K.

If s is in K, then 12*12*12*1s is also in K.
That is, we can add a string with exactly four 1's.
 
I was reading documentation about the soundness and completeness of logic formal systems. Consider the following $$\vdash_S \phi$$ where ##S## is the proof-system making part the formal system and ##\phi## is a wff (well formed formula) of the formal language. Note the blank on left of the turnstile symbol ##\vdash_S##, as far as I can tell it actually represents the empty set. So what does it mean ? I guess it actually means ##\phi## is a theorem of the formal system, i.e. there is a...

Similar threads

Back
Top