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

  • MHB
  • Thread starter Amad27
  • Start date
  • Tags
    String
In summary, the set $K$ can be defined recursively as the empty string or a string with any amount of $2$s, plus a string starting with 1 and with exactly three 1's, plus a string with exactly four 1's added to any string in $K$.
  • #1
Amad27
412
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
  • #2
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.
 

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

What is a recursive string equation?

A recursive string equation is a mathematical equation that involves repeating a string of characters or symbols within the equation itself. This repetition can occur multiple times, creating a recursive pattern.

How is a recursive string equation different from a regular equation?

A regular equation follows a fixed pattern or formula and does not involve repetition. A recursive string equation, on the other hand, involves repeating a string within the equation, making it more complex and potentially harder to solve.

What are some real-world applications of recursive string equations?

Recursive string equations are commonly used in computer programming and data structures, as well as in linguistics and natural language processing. They can also be used to solve problems in mathematics, such as finding the number of possible combinations or permutations.

How do you solve a recursive string equation?

The process of solving a recursive string equation involves breaking down the equation into simpler, more manageable parts, and then substituting the repeated string with a variable. This variable can then be solved for using algebraic methods.

Are there any limitations to using recursive string equations?

Recursive string equations can become very complex and difficult to solve, especially when the recursion occurs multiple times within the equation. They also require a strong understanding of algebra and mathematical concepts to solve effectively.

Similar threads

Replies
10
Views
2K
Replies
16
Views
3K
Replies
1
Views
2K
Replies
75
Views
5K
Replies
17
Views
3K
Replies
8
Views
2K
Replies
5
Views
2K
Back
Top