Game with Doritos

In a bag of Doritos, there are 2020 tortilla chips--1010 of which are BBQ flavored and the other 1010 are Nacho Cheese flavored. On the n th n^\text{th} second,

  • Anqi takes a chip from the bag, labels it n n , and places it on a plate. (She won't be able to tell which flavor the chip is until it's out of the bag.)
  • She can then decide to eat two (and only two) chips from the plate subject to the condition that they must be the same flavor. When she eats 2 chips labelled x x and y y , she gets x y | x - y | jellies.
  • Alternatively, she can wait for a more opportune time to eat the chips. (But she can only eat two chips each second, so don't wait too long.)

Anqi does this for a total of 2020 seconds. What is the minimum number of jellies Anqi is guaranteed to get?


The answer is 510050.

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.

1 solution

We split each flavor of chips into two halves, the 505 lowest numbers of the flavor and the 505 highest numbers of the flavor. Let the lower halves of each flavour be combined into a group called A , and the higher halves be combined into a group called B .

For each flavor, the ideal situation would be to eat 1 from each of A and B every time, so that all the x belong to B and all the y belong to A , thus maximizing the jellies for the flavor. We claim Anqi can always achieve this ideal situation.

Since each time Anqi eats she is able to each 2 chips, she only needs 1010 seconds to eat all the chips. Thus she can just wait till the 1011th second to start eating. At the 1011th second there are 1011 chips. By pigeonhole principle, we can find 506 chips on the plate with the same flavour. By pigeonhole principle again, those 506 chips consist of at least one element of A and B . Thus Anqi can choose to eat one from each half on the 1011th second.

Now assume Anqi is able to eat one chip from each half all the way until the (1010+n) t h ^{th} second. She would have eaten 2n chips, leaving (1010 - n) chips behind in the plate. Since the 2n chips are split equally amongst A and B , there are a total of (1010 - n) chips in each half left to be eaten. On the next second, one more chip is added to the plate, thus making the number of chips on the plate (1011 - n). Since there are only at most (1010 - n) chips in each of A and B , by pigeonhole principle there is at least 1 chip in each half. The only way for Anqi to not be able to choose 1 chip from each half is for all the elements of A on the plate to be nacho and all the elements of B on the plate to be BBQ (or vice versa). Let the number of nacho chips on the plate be k . WLOG, all k chips belong to A . Then the number of BBQ chips on the plate is m where k + m = 1011 - n . Additionally, all m BBQ chips belong to B . Since the number of nacho/BBQ chips in each of A and B are the same (505 - p where 2p is the number of nacho/BBQ chips eaten so far), the number of BBQ chips in A is at least m. Thus the size of A is at least k + m = 1011 - n > 1010 - n , a contradiction. Thus, Anqi is able to pick 2 chips of the same flavour such that one chip belongs to each of A and B . By induction, Anqi is always able to achieve the ideal situation.

Now, it is time to minimize her jellies. Since x belongs to B and y belongs to A , If we were to pair the k t h ^{th} smallest nacho/BBQ chip in A with the k t h ^{th} smallest nacho/BBQ chip in B we realize that every such pairing has a difference of at least 505. Since the order of x and y do not matter for the sake of the answer (since we just need \sum (x - y) = \sum x - \sum y ) the minimum guaranteed jellies is 505 × \times 1010 = 510050 \boxed{510050} .

We can easily construct the minimum by letting all the BBQ be 1 to 1010 and all the nachos be 1011 to 2020.

0 pending reports

×

Problem Loading...

Note Loading...

Set Loading...