The Gateway to Computer Science Excellence
0 votes
144 views

Image may contain: text

in Combinatory by Boss (49.4k points) | 144 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 (13.4k points)

Related questions

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,833 questions
57,740 answers
199,468 comments
108,010 users