A subset S of { 1 , 2 , … , n } is said to be packed if whenever i , j ∈ S the number ⌊ 2 i + j ⌋ is also in S . Determine how many subsets of { 1 , 2 , … , 2 5 } are packed.
Details and assumptions
i and j need not be distinct. If i = j is in the set, then clearly so is ⌊ 2 i + j ⌋ .
The sets S and the empty set clearly satisfy the conditions of the question, and should be included in your count.
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.
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 , it does not mean that the integers a k must take on all values from i to j .
This problem becomes very straightforward once we see that a non-empty set S is packed iff it is a contiguous interval [ a , b ] . It is clear that each such interval is packed since i ≤ ⌊ 2 i + j ⌋ ≤ j for any integers i ≤ j .
Conversely, a non-empty set S which is not contiguous contains some gap of size d > 1 , meaning it contains a and a + d but nothing in between. Such a set cannot be packed because it would have to contain ⌊ 2 2 a + d ⌋ = a + ⌊ 2 d ⌋ , which is strictly greater than a (since d ≥ 2 ) and strictly less than a + d (since d > 0 ).
It remains to count the number of intervals in { 1 , … , 2 5 } . It is easy to count intervals with at least 2 elements: there are ( 2 2 5 ) = 3 0 0 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.
First observe that the empty set and all singleton sets { 1 } , { 2 } , … , { 2 5 } , 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 ′ , if a , b ∈ S ′ , then all integers between a and b are in S ′ .
Proof: Induct on the size of the gap b − a . If b − a = 1 , there are no integers between a and b . If b − a = 2 , then ⌊ 2 a + b ⌋ = a + 1 , the midpoint between a and b . Assume now for some n ≥ 2 , that the claim is true for all pairs c , d ∈ S ′ with d − c ≤ n . Let a , b ∈ S ′ such that b − a = n + 1 . Let m = ⌊ 2 i + j ⌋ . Clearly a < m < b , which implies both m − a ≤ n and b − m ≤ n . By inductive hypothesis, there are no gaps between a and m , nor between m and 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, ( 2 2 5 ) = 3 0 0 .
This brings our total to 326, the number of packed subsets of S .
The condition stated above tells us that for any two non-consecutive numbers in S , there is a number between them also in S . This means that the numbers in S must be a consecutive set. There are ( 2 k ) ways to choose a consecutive subset of numbers from 1 , 2 , … k of size at least 2. There are an additional k ways to choose a single element subset. The empty set also satisfies this property. Thus, in total there are ( 0 k ) + ( 1 k ) + ( 2 k ) packed subsets. When k = 2 5 , this gives 1 + 2 5 + 3 0 0 = 3 2 6 packed subsets.
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.
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, … 25 is
25+24+23+ … +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.
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
To begin with, note that the empty set Φ is packed. Now assume a subset U ⊂ S is non-empty. Then it must have some maximum element j and minimum element i . Now if the subset U is packed , it implies that the number m = ⌊ 2 i + j ⌋ is also in U and i ≤ m ≤ j . Similarly the numbers m 1 = ⌊ 2 i + m ⌋ and m 2 = ⌊ 2 m + j ⌋ and i ≤ m 1 ≤ m ≤ m 2 ≤ j . We can continue the above construction for finitely many times and an easy contradiction argument shows that, indeed, all integers k s.t. i ≤ k ≤ j belongs to the subset U . Now it is an easy task to determine how many such subsets we can choose from S . For a fixed integer j s.t. 1 ≤ j ≤ n , any i in the range 1 ≤ i ≤ j gives us a valid packed subset. Thus there are ∑ j = 1 n j = 2 n ( n + 1 ) = 3 2 5 such subsets. Hence total number of packed subsets is 3 2 6 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.
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).
Problem Loading...
Note Loading...
Set Loading...
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 of { 1 , 2 , . . . , 2 5 } , which contains nonconsecutive integers. Then there exist i and j = i + k , for k ≥ 2 , for which none of the integers between i and j (noninclusive) exist in S , i.e., there does not exist c such that i < c < j . However, if i and j are in S , then so is c = ⌊ 2 i + j ⌋ = ⌊ 2 i + i + k ⌋ = ⌊ 2 2 i + k ⌋ = ⌊ i + 2 k ⌋ = ⌊ j − 2 k ⌋ . Because k ≥ 2 , c = ⌊ 2 2 i + k ⌋ is greater than i , and c = ⌊ j − 2 k ⌋ is less than j . This implies that i < c < j , which contradicts our assumption that there does not exist such c , therefore our assumption is false, and all packed subsets contain only consecutive integers.
If ∣ S ∣ = 0 , i.e., S = ∅ . The empty set trivially satisfies the conditions for a packed subset,
If ∣ S ∣ = 1 (i.e., S has one element), then there are clearly 2 5 packed subsets { 1 } , { 2 } , . . . , { 2 5 } .
If ∣ S ∣ ≥ 2 , we can simply choose the first and last of the consecutive integers. Hence, there are ( 2 2 5 ) subsets.
So in total, there are 1 + 2 5 + 3 0 0 = 3 2 6 subsets.