Bit Strings: Recursive Definition

  • Thread starter Thread starter sta|ker
  • Start date Start date
  • Tags Tags
    Definition
Click For Summary
SUMMARY

The discussion focuses on the recursive definition of the set of bit strings represented as \{ 0^{r} 1^{s} 0^{r} \| r, s \in N \}. The initial attempt at a solution proposed a basis of λ and a recursive step involving the string ω. However, the correct recursive definition was clarified to include a basis of 0 1^{n} 0 and a recursive step stating that if w is in A, then 0 w 0 is also in A. This adjustment ensures that the number of 0's remains equal while allowing for varying numbers of 1's.

PREREQUISITES
  • Understanding of recursive definitions in formal languages
  • Familiarity with the notation of natural numbers (N)
  • Basic knowledge of string manipulation and construction
  • Concept of formal grammars and their components
NEXT STEPS
  • Study formal language theory and recursive functions
  • Explore the concept of context-free grammars and their applications
  • Learn about the Chomsky hierarchy and its relevance to string definitions
  • Investigate examples of recursive definitions in computer science
USEFUL FOR

This discussion is beneficial for computer science students, particularly those studying formal languages, automata theory, and recursion. It is also useful for educators and anyone interested in the theoretical foundations of computer science.

sta|ker
Messages
12
Reaction score
0

Homework Statement


Give a recursive definition for the set
of bit strings \{ 0^{r} 1^{s} 0^{r} \| r, s \in N \}. Note the number of 0’s must be equal, but the
number of 1’s may be different from the number of 0’s.

Homework Equations


N/A

The Attempt at a Solution


I believe this is:
Basis: \lambda \in A
Recursive Step: If \omega \in A, then 0 \omega 1 \omega 0 \in A

I just want to verify if this is correct or not.

Thanks!
 
Physics news on Phys.org
If \omega = 010 then you just claimed that 001010100 is in A.
 
Office_Shredder said:
If \omega = 010 then you just claimed that 001010100 is in A.

Ohh, I think I see. w represents the initial value, which would basically make everything I put wrong. What about the following:

Basis: 0 1^{n} 0 \in A , n \in N
Recursive Step: if w \in A, then 0 w 0 \in A

Because, this would give: A = \{ 010, 00100, 001100, ... \}
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
7
Views
2K
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K