All about flooble | fun stuff | Get a free chatterbox | Free JavaScript | Avatars    
perplexus dot info

Home > Numbers
Up and up (Posted on 2010-05-04) Difficulty: 4 of 5
What is the number of non-decreasing sequences of (n+1) integers from 0 to n?

Example: f(2)=10 i.e. (000,001, 002, 011, 012, 022,111,112,122,222))

No Solution Yet Submitted by Ady TZIDON    
Rating: 4.0000 (1 votes)

Comments: ( Back to comment list | You must be logged in to post comments.)
Solution solution Comment 2 of 2 |

A given non-decreasing sequence can be represented by a sequence of I's and U's, where I represents the placement of an integer and U represents going up by 1 unit in value as the current value to be placed at any given I. Any U's that occur before the first I increase the value of the first integer. If the last integer is lower than n, then the remaining U's occur after the last I.

Thus there are n U's to take the values from 0 to n, and n+1 I's as there are n+1 integers.  The number of such sequences of U's and I's is C(2n+1,n). In the sample case, where n=2, this is C(5,2) = 10, and the correspondence of the two types of sequence is shown:

000 IIIUU
001 IIUIU
002 IIUUI
011 IUIIU
012 IUIUI
022 IUUII
111 UIIIU
112 UIIUI
122 UIUUI
222 UUIII

  Posted by Charlie on 2010-05-04 17:32:31
Please log in:
Login:
Password:
Remember me:
Sign up! | Forgot password


Search:
Search body:
Forums (0)
Newest Problems
Random Problem
FAQ | About This Site
Site Statistics
New Comments (0)
Unsolved Problems
Top Rated Problems
This month's top
Most Commented On

Chatterbox:
Copyright © 2002 - 2024 by Animus Pactum Consulting. All rights reserved. Privacy Information