All posts by aurojit

Programing Thingamajig

Ishan, Abhay, Mukul, and I are planning on holding some sort of an algorithmic programing workshop day-after-tomorrow, that is on the 27th from 1:30 – 3:30 PM, somewhere inside of school (one would hope), and hopefully if you come around to the eGurucool lab on that day someone would tell you where to find us.

We plan on covering basic recursion, some amount of dynamic programing, and introductory graph theory, or some subset of those topics, depending on how much time we have on our hands, and as far as I know we would probably not be doing anything which would require you to prefer one particular language over another, however a basic understanding of itteration (that’s basically a suave way of saying that you should know about loops, though I use that as an example, know some amount of programing, you should have gone beyond hello world programs in at least one language), and such things would be helpful.

I know this is really short notice, and hence it would be really great if people spread the word around, and while I know there are a billion reasons why people would want us to shift the date around, however due to prior commitments it is unlikely that all of us would be able to make it to school on any other day, so we would really like to do this on Wednsday.

I hope to see some of you around on Wednesday, and I would really appreciate it if people spread the word around.

Aurojit/The Mascot

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)

Ze Panda, ….

Hi

Zis is Ze Panda/Aurojit/Panda/ze fat guy who bored u at Exun-Ellite/ze fat guy who sat near ze mac/ze reallllllly fat guy/ze guy who’s half crazy/ze guy who is oh so domineering. Umm well Karan’s finally acting on one of my older suggestions (I had actually written abt this sometime back ). Now ze unfortunate fact of life is zat most of my views r already there on my blog at thepanda.org (where else, huh!!!)…. So u shud read me there….

Ze Panda