in Combinatory retagged by
5,061 views
8 votes
8 votes
in Combinatory retagged by
5.1k views

1 Answer

15 votes
15 votes
Best answer
Subwords means letters must be consecutive as in the word. Since, the given word has 13 letters we can have

13 subwords of 1 letter

12 subwords of 2 letters

11 subwords of 3 letters

....
1 subword of 13 letters

So, total number of subwords = 13 + 12 + ... + 1 = 13 * 7 = 91

No two consecutive letters are repeating in the given word. But there are 3 A's, and 2 I's. So, 3 subwords of length 1 are counted extra. So, total number of distinct subwords = 91 - 3 = 88.
selected by

16 Comments

Thanks got the meaning.
2
2

how you find 12 subwords of 2 letters

11 subwords of 3 letters   by manually u found or any logic behind this ?

kindly explain 

0
0
For a $n$ letter word, we get $n$ subwords of 1 letter, $n-1$ of 2 letters etc. For example consider "abcd". One letter subwords
a  b  c  d

Two letter subwords

ab  bc  cd.

As we increase the length of the subwords, number of subwords decrease by 1.
4
4

Hi @Arjun sir , pardon my ignorance , I have one doubt here .

3 subwords of length 1 are counted extra

But , in the same way , 2 I's are also extra , right ? So , should we not deduct them as well ?

Thanks in advance.

0
0
3 A's and 2 I's- so totally 5 single letter words of which only 2 are distinct. So, we deduct 3 from the count.
3
3
okk , thank you @Arjun sir :)
1
1
When the word AIA will be formed then there will be a possibility of taking any 2 A's as well....should'nt that be subtracted too???? Pls explain
0
0
Sir please explain you subtracted 1 length string ,counted 3A as 1 and 2I as 1

But there is also 2length string AA which is two times why you dont subtract it

Then answer will be 88-1=87

Or he take 0 length string then answer will be 13(13+1)/2+1 =92and then he subtracted 4 which is 88

@arjun sir
0
0
We are considering subwords - so letters must be consecutive. In the given word "AA" never comes as a subword.
2
2
I skipped it. THANKS
0
0

@gatecse

Why are we not considering EMPTY string?

1
1
they are asking  distinct subwords, so 1 word subword will be 10 only.
0
0
why have u multiplied 7 ?
0
0

@Jyotsana Bharti

$ n(n+1)/2 = (13*14)/2 $

 

0
0
{n(n-1)/2 }+ x (distinct character)

is it work always?
0
0
can some one tell me why is this approach of mine wrong … GIVEN  the 13 letter word we have 14 spaces between then .. we could choose any of the 2 spaces out of the 14 spaces and thus there would be 14 Choose 2 [ 14 C 2 ] sub words .. is my approach over counting some of the combinations ….. can any one explain .. … . .. . . . … . . . .
0
0
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