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

  • Context: MHB 
  • Thread starter Thread starter Amad27
  • Start date Start date
  • Tags Tags
    String
Click For Summary
SUMMARY

The recursive definition for the set K, which consists of strings of 1s and 2s with the number of 1s congruent to 3 modulo 4, is established as follows: K = {ε, 2} ∪ {2, 111, x}K. This definition allows for the inclusion of strings that can be empty, contain no 1s, or have 1s that satisfy the condition of being equivalent to 3 mod 4. Additionally, if a string s is in K, then both 2s and the pattern 12*12*12*1s are also included in K, confirming the recursive nature of the set.

PREREQUISITES
  • Understanding of modular arithmetic, specifically congruences
  • Familiarity with recursive definitions in formal language theory
  • Basic knowledge of string manipulation and pattern recognition
  • Experience with combinatorial structures in computer science
NEXT STEPS
  • Research "modular arithmetic in formal languages" to deepen understanding of congruences in strings
  • Study "recursive definitions in automata theory" for broader applications
  • Explore "combinatorial enumeration of strings" to analyze string patterns
  • Learn about "context-free grammars" to relate recursive definitions to grammar structures
USEFUL FOR

This discussion is beneficial for computer scientists, mathematicians, and anyone interested in formal language theory, particularly those working with recursive structures and modular arithmetic in strings.

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.
 

Similar threads

  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 66 ·
3
Replies
66
Views
7K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 75 ·
3
Replies
75
Views
7K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 17 ·
Replies
17
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K