Notation clarification on length of strings.

86 Views Asked by At

I am a student who only recently started learning about regular expressions and automatas.

My question involves the following notation: 2|σ| a = |σ| b
I have read that |σ| a is read as the number of a's in sigma, but I am lost when we equate that to |σ| b.

Does the expression mean "There are 2 B's for every A" or "There are 2 A's for every B"?

1

There are 1 best solutions below

0
On BEST ANSWER

The standard notation would be $2|\sigma|_a = |\sigma|_b$. Given a word $\sigma$ and a letter $a$, $|\sigma|_a$ denotes the number of occurrences of $a$ in $\sigma$. For instance, if you take the example suggested by Hagen von Eitzen, $\sigma = babbcbbaba$, then you have $|\sigma|_a = 3$ and $|\sigma|_b = 6$, and thus $2|\sigma|_a = |\sigma|_b$.