All my bags are packed, I'm ready to go

A subset S S of { 1 , 2 , , n } \{1,2,\ldots,n\} is said to be packed if whenever i , j S i, j \in S the number i + j 2 \left\lfloor \frac{i+j}{2} \right\rfloor is also in S . S. Determine how many subsets of { 1 , 2 , , 25 } \{1,2,\ldots, 25\} are packed.

Details and assumptions

i i and j j need not be distinct. If i = j i= j is in the set, then clearly so is i + j 2 \left\lfloor \frac{i+j}{2} \right\rfloor .

The sets S S and the empty set clearly satisfy the conditions of the question, and should be included in your count.


The answer is 326.

This section requires Javascript.
You are seeing this because something didn't load right. We suggest you, (a) try refreshing the page, (b) enabling javascript if it is disabled on your browser and, finally, (c) loading the non-javascript version of this page . We're sorry about the hassle.

10 solutions

Ricky Escobar
May 20, 2014

First, we will show that a packed subset is simply a subset containing only consecutive integers, which we will do by contradiction. Assume that there exists a subset S S of { 1 , 2 , . . . , 25 } \{1,2,...,25\} , which contains nonconsecutive integers. Then there exist i i and j = i + k j=i+k , for k 2 k \geq 2 , for which none of the integers between i i and j j (noninclusive) exist in S S , i.e., there does not exist c c such that i < c < j i<c<j . However, if i i and j j are in S S , then so is c = i + j 2 = i + i + k 2 = 2 i + k 2 = i + k 2 = j k 2 c=\lfloor \frac{i+j}{2} \rfloor=\lfloor \frac{i+i+k}{2} \rfloor=\lfloor \frac{2i+k}{2} \rfloor=\lfloor i+ \frac{k}{2} \rfloor=\lfloor j - \frac{k}{2} \rfloor . Because k 2 k \geq 2 , c = 2 i + k 2 c=\lfloor \frac{2i+k}{2} \rfloor is greater than i i , and c = j k 2 c=\lfloor j - \frac{k}{2} \rfloor is less than j j . This implies that i < c < j i<c<j , which contradicts our assumption that there does not exist such c c , therefore our assumption is false, and all packed subsets contain only consecutive integers.

If S = 0 |S|=0 , i.e., S = S=\emptyset . The empty set trivially satisfies the conditions for a packed subset,

If S = 1 |S|=1 (i.e., S S has one element), then there are clearly 25 25 packed subsets { 1 } , { 2 } , . . . , { 25 } \{1\}, \{2\},..., \{25\} .

If S 2 | S | \geq 2 , we can simply choose the first and last of the consecutive integers. Hence, there are ( 25 2 ) { 25 \choose 2 } subsets.

So in total, there are 1 + 25 + 300 = 326 1 + 25 + 300 = 326 subsets.

While it is easy to recognize that the only packed subsets must consist of consecutive integers, many students had great difficulty proving this statement. For example, even if you show that there is an (infinite) chain of integers satisfying i a 1 a 2 a n j i \leq a_1 \leq a_2 \ldots \leq a_n \leq j , it does not mean that the integers a k a_k must take on all values from i i to j j .

Calvin Lin Staff - 7 years ago
Erick Wong
May 20, 2014

This problem becomes very straightforward once we see that a non-empty set S S is packed iff it is a contiguous interval [ a , b ] [a,b] . It is clear that each such interval is packed since i i + j 2 j i \le \lfloor \frac{i+j}{2} \rfloor \le j for any integers i j i \le j .

Conversely, a non-empty set S S which is not contiguous contains some gap of size d > 1 d>1 , meaning it contains a a and a + d a+d but nothing in between. Such a set cannot be packed because it would have to contain 2 a + d 2 = a + d 2 \lfloor \frac{2a+d}{2} \rfloor = a + \lfloor \frac{d}{2} \rfloor , which is strictly greater than a a (since d 2 d\ge 2 ) and strictly less than a + d a+d (since d > 0 d > 0 ).

It remains to count the number of intervals in { 1 , , 25 } \{1,\ldots,25\} . It is easy to count intervals with at least 2 elements: there are ( 25 2 ) = 300 \binom{25}{2} = 300 ways to choose distinct starting and ending elements. Now we just need to include the 25 singletons and 1 empty set, for a total of 326.

Shaun Ault
May 20, 2014

First observe that the empty set and all singleton sets { 1 } , { 2 } , , { 25 } \{1\}, \{2\}, \ldots, \{25\} , for a total of 26 so far. Next we characterize all packed subsets that have two or more elements.

Claim: For a packed set S S' , if a , b S a, b \in S' , then all integers between a a and b b are in S S' .

Proof: Induct on the size of the gap b a b - a . If b a = 1 b - a = 1 , there are no integers between a a and b b . If b a = 2 b - a = 2 , then a + b 2 = a + 1 \lfloor \frac{a+b}{2} \rfloor = a+1 , the midpoint between a a and b b . Assume now for some n 2 n \geq 2 , that the claim is true for all pairs c , d S c, d \in S' with d c n d - c \leq n . Let a , b S a, b \in S' such that b a = n + 1 b - a = n+1 . Let m = i + j 2 m = \lfloor \frac{i+j}{2} \rfloor . Clearly a < m < b a < m < b , which implies both m a n m - a \leq n and b m n b - m \leq n . By inductive hypothesis, there are no gaps between a a and m m , nor between m m and b b .

All that remains is to count the sets of at least two elements. It suffices to know the first and last elements, which we count using the binomial coefficient, ( 25 2 ) = 300 \binom{25}{2} = 300 .

This brings our total to 326, the number of packed subsets of S S .

Calvin Lin Staff
May 13, 2014

The condition stated above tells us that for any two non-consecutive numbers in S S , there is a number between them also in S . S. This means that the numbers in S S must be a consecutive set. There are ( k 2 ) \binom{k}{2} ways to choose a consecutive subset of numbers from 1 , 2 , k 1,2,\ldots k of size at least 2. There are an additional k k ways to choose a single element subset. The empty set also satisfies this property. Thus, in total there are ( k 0 ) + ( k 1 ) + ( k 2 ) \binom{k}{0} + \binom{k}{1} + \binom{k}{2} packed subsets. When k = 25 k = 25 , this gives 1 + 25 + 300 = 326 1 + 25 + 300 = 326 packed subsets.

Tushar Gupta
Jan 6, 2015

condition satisfies only subsets having consecutive integers, proof:- A subset can't exist s.t. it has elements at distance d, s.t. d >1, if d > 1 then there also exist an element in between a , a + d in subset. since d > lb(d/2) >0 if d >1 and an integer. this contradicts the assumption. that two elements can exist in subset at distance d.

Kristan Liza
May 20, 2014

For the subset of S to be packed ,it must contain n consecutive integers.

There are 25 subsets of S where n is 1. There are 24 subsets of S where n is 2. There are 23 subsets of S where n is 3. . . . There is 1 subset of S where n is 25.

The total number of subsets where n is 1, 2, 3, \ldots 25 is

25+24+23+ \ldots +1 = 325

but we still need to consider the empty subset of S since it also satisfies the condition of being packed vacuously, so the total number of subsets of S that are packed is 326.

Dionys Nipomici
May 20, 2014

we will show that if a,b∈S then all interval [a;b]∈S, let b-a=k then ⌊(a+a+k)/2⌋=a+⌊k/2⌋∈S.Now a, a+⌊k/2⌋∈S then ⌊(a+a+⌊k/2⌋)/2⌋=a+⌊k/4⌋∈S.And going on like this we get a+⌊k/2^n⌋∈S and for n that satisfy inequality 2^(n+1)>k>=2^n this number ⌊k/2^n⌋=1, and we get a+1∈S.We have if a,b∈S then a+1,b∈S.Doing the same but for numbers a+1 and b ∈S we get a+2,b∈S.By induction we have all interval [a;b]∈S. Now calculate how many consecutive intervals we have 1interval 25 consecutive,2 intervals 24 consecutive,3 intervals 23 consecutive,.... 23 intervals 3 consecutive, 24 intervals 2 consecutive, 25 intervals 1 consecutive, and 1 emty set so the sum is 1+2+3+4...+24+25+1=25*26/2+1=326

Abhishek Sinha
May 20, 2014

To begin with, note that the empty set Φ \Phi is packed. Now assume a subset U S U \subset S is non-empty. Then it must have some maximum element j j and minimum element i i . Now if the subset U U is packed , it implies that the number m = i + j 2 m=\lfloor \frac{i+j}{2}\rfloor is also in U U and i m j i\leq m \leq j . Similarly the numbers m 1 = i + m 2 m_1=\lfloor \frac{i+m}{2}\rfloor and m 2 = m + j 2 m_2=\lfloor \frac{m+j}{2}\rfloor and i m 1 m m 2 j i\leq m_1 \leq m \leq m_2 \leq j . We can continue the above construction for finitely many times and an easy contradiction argument shows that, indeed, all integers k k s.t. i k j i \leq k \leq j belongs to the subset U U . Now it is an easy task to determine how many such subsets we can choose from S S . For a fixed integer j j s.t. 1 j n 1\leq j \leq n , any i i in the range 1 i j 1\leq i \leq j gives us a valid packed subset. Thus there are j = 1 n j = n ( n + 1 ) 2 = 325 \sum_{j=1}^{n} j = \frac{n(n+1)}{2} = 325 such subsets. Hence total number of packed subsets is 326 326 including the empty set.

We first notice that if the subset is ordered from least element to greatest element and there are nonconsecutive numbers right next to each other than we reach a contradiction to the given statement. Since if we have two elements i and j then the greatest integer less than or equal to (i+j) is also in the set we can say lets choose i and j to be two consecutive elements of the least to greatest ordering of some subset of the given set with i<j. If j doesnt equal i+1 then i< floor of (i+j)< j which implies there is an element k in between them which contradicts the assumption that they were consecutive elements of the subset ordered least to greatest. So now we know that any subset that satisfies this constraint is some set of consecutive integers. Now we see that the set can have 0,1,2,3,4,5,....25 elements. If there is 1 element then there are 25 options if there are 2 consecutive elements there are 24 ways to choose them and in general if there are k elements 0<k<26 then there are 26-k subsets of k consecutive elements that can be chosen. So the number of none empty subsets that satisfy this is 1+2+3+4+....+25=(25)(26)/2=325. And then one can not forget to add the empty set case ending up with a total of 326 possible subsets.

Qizhen Lim
May 20, 2014

Considering the number of element(s) in each subset, we will have 26 cases from 0 element to 25 elements in a subset.

For the 0 element and 25 elements it is clear that there is only 1 such subset of {1,2,...,25}. These two sets are also packed.

For the case of 1 element, there are 25 such subsets. {1},{2},...,{25}

For the other cases, the elements in each subset must be consecutive.

Take the case of 3 elements in a subset for illustration. For a subset of 3 elements, the elements {1,2,3} fulfill the packed condition. floor(1+2)=1; floor(1+3)=2; floor(2+3)=2

We are unable to skip any number (i.e. the subsets {1,2,4}, {1,3,4} include skipped numbers 3 and 2 respectively) as this would result in the subset not fulfilling the packed condition. We should understand that considering two non-consecutive numbers such as 3 and 5, the floor of the average of the numbers would be a number between them and not either of them. Hence, every subset that fulfills the packed condition will have only consecutive numbers.

After realising that the subsets must have only consecutive numbers, we find a pattern in the number of such subsets.

For subset(s) with 0 element, there is 1 such subset. For subset(s) with 1 element, there are 25 such subsets. For subset(s) with 2 elements, there are 24 such subset ({1,2},{2,3},{3,4},...{24,25}) For subset(s) with 3 elements, there are 23 such subsets. ({1,2,3},{2,3,4},...{23,24,25})

This goes on till subsets with 25 elements, of which there is only 1 such subset.

Hence, the total number of packed subsets of {1,2,3,...,25} is the sum of all integers from 1 to 25 and 1 again(for the case of 0 element).

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...