The Gateway to Computer Science Excellence
0 votes
128 views

Image may contain: text

in Combinatory by Boss (48.8k points) | 128 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 Answer

+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.

by Boss (11.8k points)

Related questions

0 votes
0 answers
1
asked Dec 25, 2018 in Compiler Design by Sanjay Sharma Boss (48.8k points) | 67 views
+2 votes
1 answer
3
asked Dec 25, 2018 in Compiler Design by Sanjay Sharma Boss (48.8k points) | 67 views
0 votes
2 answers
4
asked Dec 25, 2018 in Probability by Sanjay Sharma Boss (48.8k points) | 111 views
Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
50,648 questions
56,422 answers
195,196 comments
99,860 users