Community

Try our innovative online adaptive learning system, Alcumus.
Over 1100 problems and 60+ video lessons. FREE!
Login Register Memberlist Search AoPS Blogs Contests Galleries Forum Index
The time now is Sun Dec 06, 2009 10:29 pm
All times are UTC - 8
View posts since last visit
View unanswered posts
subsequence of a string
Moderators: High School Olympiad Moderators, darij grinberg, freemind, Megus, N.T.TUAN, orl, pbornsztein
Post new topic   Reply to topic View previous topicView next topic
7 Posts • Page 1 of 1
Author Message
alpar
P versus NP
P versus NP

Offline
Joined: 25 Jan 2008
Posts: 21

To rate posts you must be logged in
#1
subsequence of a string
subsequence of a string

We have a string with n characters.How many subsequences can i produce with this string?

is this a permutation?

PostPosted: Wed Nov 04, 2009 9:27 am  Back to top 
  ProfilePM
mavropnevma
Yang-Mills Theory
Yang-Mills Theory


Offline
Joined: 27 Jun 2009
Posts: 688
Location: Bucharest
CanadaRomania

To rate posts you must be logged in
#2
For one thing, this is not a Calculus question, but Combinatorics.
For seconds, it is not a permutation, for sure.

Let the sequence be (x_k)_{k=1,2,\ldots,n}. If by subsequence you mean (as you should) a sequence (x_{k_m})_{m=1,2,\ldots,s}, then there are as many subsequences as non-empty parts of \{1,2,\ldots,n\}, hence 2^n - 1. If you mean subsequences made by consecutive elements, there are n+(n-1)+\cdots+2+1 = \frac {1} {2} n(n+1).
_________________
Listen to REMBETIKA for decoding the handle.

PostPosted: Wed Nov 04, 2009 10:12 am  Back to top 
  ProfilePM
alpar
P versus NP
P versus NP

Offline
Joined: 25 Jan 2008
Posts: 21

To rate posts you must be logged in
#3
mavropnevma wrote:
For one thing, this is not a Calculus question, but Combinatorics.


Sorry Embarassed , i was also looking something about calculus and i confused
(someone move my topic)

By subsequence i mean: A subsequence arises from a sequence after removing one or more characters

PostPosted: Wed Nov 04, 2009 10:19 am  Back to top 
  ProfilePM
mavropnevma
Yang-Mills Theory
Yang-Mills Theory


Offline
Joined: 27 Jun 2009
Posts: 688
Location: Bucharest
CanadaRomania

To rate posts you must be logged in
#4
Then it's 2^n - 2 (we should not count the empty subsequence, nor the full sequence).
_________________
Listen to REMBETIKA for decoding the handle.

PostPosted: Wed Nov 04, 2009 10:29 am  Back to top 
  ProfilePM
alpar
P versus NP
P versus NP

Offline
Joined: 25 Jan 2008
Posts: 21

To rate posts you must be logged in
#5
mavropnevma wrote:
Then it's 2^n - 2 (we should not count the empty subsequence, nor the full sequence).

yes but why?
thanks!

PostPosted: Wed Nov 04, 2009 11:06 am  Back to top 
  ProfilePM
mavropnevma
Yang-Mills Theory
Yang-Mills Theory


Offline
Joined: 27 Jun 2009
Posts: 688
Location: Bucharest
CanadaRomania

To rate posts you must be logged in
#6
Quote:
... there are as many subsequences as non-empty parts of \{1,2,\ldots,n\}, hence 2^n - 1 ...

... with the added proviso we must also ignore the full part, hence 2^n - 2.

The indices of the terms in a subsequence can be any such part of \{1,2,\ldots,n\}.
_________________
Listen to REMBETIKA for decoding the handle.

PostPosted: Wed Nov 04, 2009 11:13 am  Back to top 
  ProfilePM
alpar
P versus NP
P versus NP

Offline
Joined: 25 Jan 2008
Posts: 21

To rate posts you must be logged in
#7
why not count the empty subsequence?
if we remove all characters we have the null sequence

PostPosted: Sat Nov 07, 2009 11:59 am  Back to top 
  ProfilePM
Display posts from previous:   Sort by:   
7 Posts • Page 1 of 1
Post new topic   Reply to topic View previous topicView next topic
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
You cannot post calendar events in this forum


© Copyright 2008 AoPS Incorporated. All Rights Reserved. • FoundationPrivacyContact Us