简体   繁体   中英

String length after kleen's closure in finite-autometa theory

Note: Not sure if this is the correct site for this question. I found other finite-autometa theory questions here, so posting here.

Suppose a language is defined over two letters

L1 = { aa , b }

We take Kleen closure over it:

S1 = aab
S2 = aaaabb

Now my question is simple, what is the string length of these two strings S1 and S2?

According to my understanding since string length can only be determined by the number of character it uses and since 'aa' is a single character so string lengths for both strings should be:

S1 = 2 characters or string of length 2
S2 = 4 characters or string of length 4

According to my teacher string length for each string is

S1 = 3 characters
S2 = 6 characters

You are confusing two different concepts: languages/strings and alphabets/symbols.

Languages are sets of strings. Alphabets are (nonempty finite) sets of symbols. Strings are (typically finite) sequences of symbols.

You say L1 is defined over two letters, but then write L1 = {aa, b}. So you could mean two things:

  1. L1 is a set of strings over the alphabet {aa, b} where aa and b are understood to be symbols.
  2. L1 is a language of two strings aa and b, where a and b are understood to be symbols of an implied alphabet.

Under the first interpretation, S1 and S2 have lengths 2 and 4 characters, respectively. Under the second interpretation, S1 and S2 have lengths 3 and 6 characters, respectively. Crucially, the meaning of * (Kleene star) is overloaded:

  1. E*, where E is an alphabet, is the set of all strings over the symbols in the alphabet.
  2. L*, where L is a language, is the set of all strings formed by concatenating strings in L with each other.

Often, when it does not cause confusion, alphabets can be treated as being essentially the same as (finite, nonempty) languages of strings of length one.

HOWEVER, they are not the same thing, and dropping that distinction has confused you (and lots of other people)… so it may be a simplification of dubious value.

The length of a string is the number of characters in the string including spaces. For example:

length of "cat" is 3

length of "" is 0

length of "cat " is 4

Notice that spaces count in the length, but the double quotes do not.

In this case "aa" is considered 1 character instead of 2.

S2 is 4 characters long as "aa" is considered 1 character

For more details you can refer to this link:

https://bilalamjad.net/automata-alphabets-and-strings/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM