Three Pieces

For one I am incapable of making 5 pieces, and well I can’t classify the three that I have, ergo these shall be forever be three pieces… Now as for these questions, at a minimum I expect Rungta, Azgez, and “the dormant female programmer in 12th/11th” (taken from somewhere on this blog, probably) to solve these, though if neone else does it, well & good… If neone outside of Exun gets all three done, then well while I can’t promise ur inclusion into the club (alumnus, can’t really do that), however I can wud recommend that u be taken in, and well my recommendation wud probably work. For lack of time, and effort I haven’t put the problems into a more succinct form, so ur gonna have to work around that. So there that gets the preliminaries out of the way.

Now for three simple rules

  1. Contrary to popular belief, I do not have access to a grid or a super-computing facility, so make sure ur code can run in sane amts of time.
  2. Some of these questions r solvable by a single mathematical equation, some by recursion. Now I am not a fan of simulations, so if u get the these done without simulating the actual process, then well u get more points in my book, not all that useful, but well u never know…
  3. In code u submit to me, umm pls don’t use a void main(), since as of 6 or 7 years ago, ANSI regulations state that void main() is not a valid main funtion, use int main() instead, and return a value of 1.

The Questions

  1. Throughout this question, the term line and ray are supposed to take on their usual mathematical meanings, which is to say that a line extends infinitely in an infinite two dimensional plane, and a ray starts of at a particular point, but directional extends unto infinity. The question assumes that ur working on an infinite 2d plain. Now the question itself is pretty simple, so there r two parts to it. a) Given n (n>2) lines, what is the maximum number of regions u can divide ur 2d plain into? b) Now instead of lines if we used two rays at an angle, in a sort of V formation, what is the maximum number of regions with n (n>1) Vs then?
  2. There’s a room with n walls (2<n<10), shaped like a regular n sided polygon, with a mirror on each wall. The first wall contains a light source, for which you have a given x coordinate and the angle between the light beam and the wall (horizontal angle, the light beam is so arranged that the beam itself lies on a plane parallel to the floor of the room), and given the x coordinate extents (two coords each) of each mirror, predict the number of reflections that take place before the beam is absorbed. Assume that walls themselves are perfect absorbers of light, as is the light source. Also predict the number of times the rays intersect….
  3. A lil bit of military strategy. Umm well let’s have this as a story. Ur in one of those essentially violent central African countries, a part of a rather underfunded UNPKF, and the only possibility of survival rests in understanding rebel attack strategies. Now the rebel army follows some very peculiar rules, for one they always conduct battles with 12 units, and all battles last for 16 hrs. The rebel army is strictly hierarchal, so much so that on the pain of death, each subordinate wud do whatever his superior’s unit did and relay his superior’s commands to his subordinates immidiately. Unfortunately the rebel army relies on an extremely slow, though highly successful means of communication, and each message takes an hour to relay, which is to say that each subordinate does what his superior did an hour ago. Now given that 1 represents attack, and 0 represents retreat, and given an hour by hour analysis of rebel movements, ur program shud figure out the hierarchy of the rebel army. Every commander has a minimum of two subordinates.

    For instance if the movements read something like:

    1 2 3 4 5 6 7 8 9 0 1 2

    1 0 1 1 1 0 0 1 1 0 0 1

    0 1 1 1 0 1 1 1 1 1 1 1

    1 0 0 1 1 0 1 0 1 1 1 1

    1 1 0 1 1 1 0 1 1 1 1 0

    0 1 1 0 0 1 0 1 0 0 0 0

    0 0 1 0 0 0 1 0 0 0 0 1

    1 0 0 1 1 0 1 0 1 1 1 1

    1 1 1 1 1 1 0 1 1 1 1 0

    0 1 1 0 0 1 1 1 0 0 0 1

    1 0 0 1 1 0 1 0 1 1 1 1

    1 1 0 1 1 1 0 1 1 1 1 0

    0 1 0 0 0 1 0 1 0 0 0 0

    0 0 1 0 0 0 0 0 0 0 0 0

    0 0 0 0 0 0 1 0 0 0 0 1

    1 0 0 1 1 0 0 0 1 1 1 0

    0 1 1 0 0 1 0 1 0 0 0 0

    then u shud eventually find the following hierarchy

    Unit 3 commands Units 7 & 12

    Unit 7 commands Units 1, 4 & 5

    Unit 5 commands Units 2, 6 & 8

    Unit 12 commands units 9, 10 & 11

Neways best of luck doing these, mail me the solutions at [email protected], and well I’ll test them and get back to u….

Ze Panda

(The Mascot)

Leave a Reply

Your email address will not be published. Required fields are marked *