Tuesday, September 30, 2008

Assignment 1 and the symmetric pattern

For assignment 1, problem 2, i noticed something fishy... Something playing around with my mind..

I could sense a pattern going on but couldn't trace it down. The problem is that we are given 2 meals, L and S. A suitable cycle for the meals in which the meal for the next day differs by exactly one would be: {}, {S}, [L,S}, {L},

So when we add a new meal and manually compute the set, we get this:

{}, {S}, [L,S}, {L}, {L,P}, [L,S,P}, {S,P}, {P} which is correct.

But I noticed something interesting. Starting from the first element {}, lets make a copy of this list. If we take the region after the last element and before the "," [i.e: {}, {S}, [L,S}, {L} (THIS REGION HERE) ,] and use it as a vertical symmetry axis, we can rotate the list by 180 degrees and we would obtain an image of our original list.




Then if we add the new meal 'P' in each set in our newly rotated list, we get this:
{}, {S}, [L,S}, {L}, {L,P}, [L,S,P}, {S,P}, {P}

And this corresponds to what we would get by manually verifying it:
{}, {S}, [L,S}, {L}, {L,P}, [L,S,P}, {S,P}, {P}

So, could there be a pattern? Lets check by adding a new meal 'Q'. We repeat the same stesp. Lets create an imaginary vertical symmetry axis at the point labelled 'here': ...{P} (HERE) ,

Lets make a copy of the list and rotate it. We would get this:
{}, {S}, {L,S}, {L}, {L,P}, {L,S,P}, {S,P}, {P} ( Symmetry Axis here) , {P}, {S,P}, {L,S,P}, {L,P}, {L}, {L,S}, {S}, {}

So if we add the new meal 'Q' in each set of our newly rotated list, we would get:
{}, {S}, {L,S}, {L}, {L,P}, {L,S,P}, {S,P}, {P}, {P,Q}, {S,P,Q}, {L,S,P,Q}, {L,P,Q}, {L,Q}, {L,S,Q}, {S,Q}, {Q}

And if we verify manually, we would get the same! So there exists a pattern to solve this question! In a programming language, we can achieve this by copying the list, reversing the elements, add the new element in each array, appending the modified copy to our original list and voila!

Maybe the law of supersymmetry in physics (which states that for any object, there exists its symmetric twin somewhere else in the universe) could explain this but this technique works for any length of the list!

Now we can also observe that the length of the list is equal to 2 ^ (number of meals)
Inductively we can prove that when new meal is added, the length of the new list of meals is double that of the original list.

n>2

We need to rpove P(n) => P(n+1)

<=> 2^(n+1) = 2^n x 2^1
<=> P(n) x 2 # Which means P(n) was actually 2^n

So inductively we can show that the length of the new list is double the size of the original list.

Hope it helped!

2 comments:

Crom, the Destroyer said...

Nice picture. How did you make it?

Danny Heap said...

I think your technique works. The main point isn't the size of the schedule, since this is a direct result of a set of n elements having 2^n different subsets. The main point is that you achieve the pattern of adjacent menus differing by exactly one meal.