Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
increasing subsequences of 1:N

Subject: increasing subsequences of 1:N

From: David Epstein

Date: 16 Apr, 2012 21:50:09

Message: 1 of 3

Given positive integers d<N, how do I obtain a list of all strictly increasing subsequences of 1:N of length exactly d? Or equivalently you could give me an (N choose d) x d matrix, with each row strictly increasing. N and d are not too large---should be a quick computation.

Thanks for any help.

Subject: increasing subsequences of 1:N

From: Matt J

Date: 16 Apr, 2012 22:12:09

Message: 2 of 3

"David Epstein" <David.Epstein.spam@remove.warwick.ac.uk> wrote in message <jmi46h$6g3$1@newscl01ah.mathworks.com>...
> Given positive integers d<N, how do I obtain a list of all strictly increasing subsequences of 1:N of length exactly d? Or equivalently you could give me an (N choose d) x d matrix, with each row strictly increasing. N and d are not too large---should be a quick computation.
===============

nchoosek(1:N,d)

Subject: increasing subsequences of 1:N

From: Bruno Luong

Date: 16 Apr, 2012 22:15:09

Message: 3 of 3

"David Epstein" <David.Epstein.spam@remove.warwick.ac.uk> wrote in message <jmi46h$6g3$1@newscl01ah.mathworks.com>...
> Given positive integers d<N, how do I obtain a list of all strictly increasing subsequences of 1:N of length exactly d?

help nchoosek

Bruno

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us