224 views

| 224 views
+1
n(n+1)/2 + 1 ( 1 for epsilon)

=> (10 * 11)/2 + 1

=> 56

option 3.
0
Is it correct way finding no of substring
0
this formula applies only when all the symbols are different. Otherwise you have to do it using combinations.

+1 vote

a d e f b g h n m p ;  N=10 (all distinct)

Substring of length $0\rightarrow\;$1(i.e. null string)

Substrings of length $1\rightarrow\;N$

Substrings of length $2\rightarrow\;N-1$

Substrings of length $3\rightarrow\;N-2$

Substrings of length $N-1\rightarrow\;2$

Substrings of length $N\rightarrow\;1$

Total no. of substrings $=1+N+(N-1)+(N-2)+\cdots+2+1$

$=1+\frac{N(N+1)}{2}$

Here N=10, so total substrings = 1+55 = 56.