# Numerical ratio between the length of a string and the transited states

If we have a finite automaton that accepts a string,

is there any numerical relationship that always is true like S ≥ |w| or something similar?

Where |w| the length of the string and S the number of transited states (counting multiplicities).

For example, if we have this automata and the string w = 010 :

S = 3 and |w| = 3.

In this case, S = |w|

I'm new in computer science and i was thinking there has to be a rule of that kind but I have not found explicitly in the books that I started on computational theory.

• Welcome to CS.SE! What are your thoughts? What analysis and research have you done so far? A one-sentence question usually isn't a good fit here; we want you to provide background and context (what's the motivation for the question? where did you run across this), exhaust all reasonable ways you could solve this on your own, and show us in the question what you've tried so far, what progress you've made, and where you got stuck. Also, the body of the question should be a self-contained question, and the title should be a short summary, not a full sentence. – D.W. Aug 26 '16 at 18:09
• Finally, it's not clear to me what you are asking. What do you mean by "transited during analysis"? Why do you believe there is a single numerical ratio that is correct for all possible automata? What kind of answer are you looking for? Please edit the question to address this feedback. – D.W. Aug 26 '16 at 18:10
• I also cannot figure out what is your question. – Yuval Filmus Aug 26 '16 at 18:20
• Thanks for the coments. I will try to be more clear next time and get better with my english also... – Samuel Salvatella Aug 26 '16 at 18:26
• Thanks for the edits, that helps a lot! By S, do you mean the number of different states (so if a state is visited 20 times you only count it once)? Or do you also want to count multiplicities? For instance, if one state is visited 20 times and another state is visited 30 times, should S be 20+30=50 or should it be 1+1=2? Also, have you tried working through some examples? You should try to work out the answer on your own. A good approach is to try some small examples, then make a conjecture and see if you can prove it; and see if you can find any example that violates it. – D.W. Aug 26 '16 at 18:39

The way you have defined S, we will always have $S \ge |w|$. Why? Because each time the automaton reads one symbol from $w$, it follows one transition and visits the state at the end of that transition, incrementing $S$ by one. In other words, we add one to $S$ for each symbol in $w$. Thus $S$ is at least as large to the number of symbols in $w$. (It might be larger if you follow $\epsilon$-transitions, as they don't consume any symbols in $w$ but do visit a state.)
• @SamuelSalvatella, yes, you're completely right; we can have $S >|w|$. Thank you for highlighting this. I've edited my answer accordingly -- see the edited answer. – D.W. Aug 28 '16 at 23:07