Wednesday, November 11, 2015

Statistcis of the 2014 General Election

The 2014 General Elections were very popular and saw the introduction of many new faces onto the political platform. Some interesting statistics from those elections and their results are shown here which might lead us to some interesting conclusions. To begin with, let us define our data set. The links used to provide data were:
With these links we had with us the election results of all candidates in the 2014 GE. Along with that we also had with us the number of criminal cases against approximately 1400 candidates.


Using DATA1 and DATA2 we create a list of candidates present in both the data sets. Thus we have ~1000 candidates. From this list we only use 3 pieces of information.
  1. Candidate name
  2. No of criminal cases against them
  3. Number of votes they got
With that we obtain some interesting figures:
  • The minimum vote anyone received was 1
  • The maximum anyone received was 758482
  • The maximum number of criminal cases was 382 against Uday Kumar SP
  • The second highest criminal count was against Sridip Bhattacharya at 57
  • Minimum number of criminal cases were 1
  • Correlation factor between criminal cases and votes was 0.032
Some things of note are:
  • The correlation is weak. Thus it is ignored. In order for it to be relevant, it must be at least greater than 0.1
  • Real criminals are still contesting for public office
For the time being the 2014 GE show nothing interesting statistically for me to discover at my level. I will consider it interesting the day the covariance crosses 0.1

Comments and similar efforts are welcome.

Thursday, November 5, 2015

Secure Distribution of Examination Question papers

During various examinations the secure distribution of Question Papers is an important aspect of the entire examination. In case the paper is compromised the entire examination must be scraped and redone. This introduces a lot of cost to the examination body.

Here we attempt to develop a mechanism to securely deliver question papers for an examination on the day of the examination. Our goals encompass:
  • Secure delivery of the document to exam centers
  • Robustness of system
  • Cost effectiveness
  • Scalability
In order to facilitate this system we will use already existing technology and infrastructure, namely Internet and mobile penetration of India. We will adopt the use of technologies such as websites, public key encryption and hashing.

Common terms used here are:
  • Host: The body/institution responsible for the conduction of the examination.
  • Exam: The examination under discussion.
  • Center: A place where candidates may take the examination. May be an institution/independent body
  • Paper: The examination question paper

The resources needed to complete this objective are:
  • A website controlled by the Host.
  • Printers at the Center
  • Proper backups for printing are necessary in case primary printers fail.
The method employed is:
  • The Host encrypts the paper using PrivateKey1.
  • The resulting document is again encrypted using PrivateKey2
  • This document is made available for download on the website that the Host controls N days prior to the examination, N being selected based on the scale of the examination.
  • Along with this PublicKey2 is made available on the website to authenticate that the downloaded document was indeed indeed generated by the Host.
  • On the day of the examination, the PublicKey1 is declared using one of the mass communication methods discussed later.
  • With PublicKey2 and PublicKey1 the Center can now read the paper.
  • The center now prints copies of the paper as per requirement.
  • It stamps each paper with it's seal/stamp/hologram to verify that this physical paper was generated at the Center.
This method has several weaknesses and strengths. Some are:
  • The points of attack on the paper are reduced to only the Website and the Center.
  • Attacks on the website require a high skill set and thus limits the number of attackers to the system.
  • With proper precautions the chances of take down are limited.
  • Proper security of the website ensures proper security of paper distribution.
  • Authentication of the paper is done through public-key cryptography
Some weaknesses are:
  • There is no way to ensure that the Center prints what is received. They may print a different paper.
  • This can be remedied with a punishment system. After the examination, the Host publishes the paper as plain text.
  • If this is found to be different from what was given to the candidate at the Center, the candidate can report it.
  • In case of a candidate reporting an institute, investigation comprising of the stamped paper with the candidate and the paper published will be undertaken by the Host.
  • If Center is found guilty, it can be blacklisted and possibly a lawsuit filed against it for breach of contract.

For mass communication, SMS, email, content on website can be used to distribute PublicKey1. This has a two fold advantage.
  • People who receive can also forward the messages to their peers.
  • Distribution is organic. False keys will be eliminated by peer review.

With such a system in place it becomes possible to distribute exam papers securely and without much risk.

Saturday, October 31, 2015

Me and my OSes

Operating systems have changed over time to reflect what the end user wants out of them. Over the years I have changed the Operating Systems I have used and they in turn have changed my perception about operating systems. This is my attempt at chronicling them.

My first computer arrived in the house in the year 2002. It was a Compaq Presario preinstalled with Windows Millennium. Those were the days...sigh. The first day we switched on the computer, we could not manage to turn it off. Since it was a new machine we thought that turning off the main power was not really a good option. We had to call a family friend who lived near by to switch off the computer.

Windows ME


Windows ME was the last OS in the 9x series of Microsoft windows. It was a good OS as far as an 8 year old me was concerned. During that time, I had no notion of what a computer was. The entire machine was a black box. A graphical interface provided some confront, something I could work with. At school all the kids had Windows XP and powerful hardware while little old me was stuck with Win ME for whom support stopped in 2003. During those days all I did on a computer was play games. CDs were exchanged between classmates and games were played. Those were the days when I had no notion of the fact that games could be transferred between PCs without CDs. This computer had about 64 MB ram and an 80 GB hard disk. The memorable games played on this machine include Age of empires, Road rash and Rage.

Family members used it from time to time. My mother at one time got one of the family friends to put a BIOS power on password. I remember my sister and me playing detective to guess the password by laying out graphite powder to figure out what mom had typed.

Since I was restricted to just the boot procedure I noticed the flashing prompt to press F12 (or at least I think so) to enter BIOS. Somehow I got into that and reset the firmware to factory settings. I have no clear recollection of how I did that. Mom said, if I can break into it I can do it again so there is no point in the password anymore. The one thing about this OS I remember was that I used to think that frequent crashes were part of the system. They were meant to happen. Now I know they do not. For a child to be tinkering with a computer, ME was a fragile environment.

Windows XP

By about 2008 this machine was too slow to take on the new games in the market. The only purpose of the computer being gaming for me. It had served family members well and was now too slow for me. In 2008 we changed the CPU of the computer. The new machine was still behind the market, 512 MB ram, 250GB HDD and windows XP. This was still too good to be true. A jump from 64 to 512 had me running circles around my father. For a child who wanted the computer for the purpose of gaming, it was a gift in gold.

The first game on that machine was again AoE, though quickly replaced by Duke Nukem. We had shifted to Gurgaon then and I had a new purpose for a computer. Music. The medium of exchange was pen drives but I still only knew about floppy disks. Things changed quickly when Visual basic was introduced to us in class 8. It was VB6 and quiet an amazing thing. It was an entirely new world for me. The best part was that I had asked my teacher if I could do this stuff on my home computer and she had said yes.

Programming was so much fun. I designed a school bell for my school which was sadly never put into practice. I had the good fortune of learning about serial ports and what not. That along with the fact that I was playing warcraft and Runescape on the computer was awesome. things went from good to awesome. I could tinker as much as I wanted and had absolutely no problems.

Then came the big blow. I managed to infect the computer badly enough that it did not start. This led to my first experience in installing an operating system. I bought another XP cd from a local store and sat down to install. There was a lot of jargon and having no computer to browse the Internet on it took me a full 3 days to complete the procedure. Things moved along slowly from there on.

Windows 7


In 2010 along came a laptop in the house. Matter of fact I am still using this machine which was a blessed HP dv4 Pavillion laptop. It came preinstalled with a 32-bit windows 7 home edition. Now this was an experience to be had. For a kid who had grown up on blocky UI and slow computing, the fast i3 processor and nice glossy look of windows 7 will never be forgotten.

Things were awesome for about 2 years. I played Assassin's Creed 1, 2, Brotherhood on the same laptop. Games like counter strike and Call of Duty were a regular feature on this machine. All this despite no Graphic Card.

I had become adept at installing XP by now since I had plenty of practice on the desktop. Every time a trial version of Kaspersky expired, I simply reinstalled the OS. I was now exposed enough to know that there is something called Linux in this world. I began installing windows 7/ubuntu/ windows XP for fun in school computers. Windows 7 definitely was the stepping stone for putting me back in the game. I was up to speed.

Ubuntu 12

During college, I decided to try out Ubuntu. I downloaded the iso and began the installation procedure. This was my first time installing something other than XP. Sure, I messed up. I ended u pre-formatting the entire drive and only Ubuntu on my laptop to boot.

This mistake cost me dearly. I was left with no game to play and no helping hand of Windows. I resigned to my fate and began to learn about Ubuntu. The command line was a new thing and thankfully I took to it like a duck to water. Everything was straightforward and clean. I liked it. Though I still missed the games.

After a while my interest in games waned and I began to explore the wonderful world of Linux and all other open source things. Like an explorer entering the dark continent, I learnt of the rich UNIX history, of the text-editor wars.

I learnt that the World Wide Web was not the Internet, and that Internet Relay Chat was still alive. I learnt new languages. I learnt to like Perl, Java, C and Python. Ok, I fell in love with Python. I learnt that though C was old, it was still of consequence. I learnt of the Linux world.
I messed up my computer quiet a few times, since with great power comes great responsibility. Around this time I started tinkering with AI and so Ubuntu supported me with it's amazing community and support.

Linux Mint

With simplicity came elegance. After a while though Anurag recommended Mint. A cleaner version of Ubuntu in my view. While Ubuntu is great for the person new to the Linux world, it is a little too much on the helping side. It is like the overprotective mother. Mint on the other hand is just right in my opinion. A bit of class and not too helpful. Plus all the niceness of Ubuntu is just a few keystrokes away.

What I particularly liked was the color scheme and the defaults in Mint. It was simply put, easy on the eyes. Mint was where I spent a lot of my learning time. This is the OS that was running on the laptop when I discovered git, python3, virtualenv, irssi and many more such gems.

After a while though, this too felt cumbersome. My progress in the linux world had stopped. There was nothing new to do. There were no new experiences to be had and no new areas to explore.

Archlinux

Along came Archlinux. One day when I still had Mint, I was chatting away on IRC and someone recommended that I go through the rute book(found here) and also that I install Linux From Scratch. As a counter to that another said that Archlinux was good from that perspective too.

The next day I was downloading Archlinux and preparing to install on my computer. The installation took 3 weeks. Turns out that Ubuntu and Mint hide away the details of how a linux box works. There was simply too much I did not know. It took me three weeks to obtain the prerequisite knowledge required to install Archlinux and to practice on virtual machines.

That said, Arhclinux is the best I have come across till date. Simplicity is the highest sophistication.

Wrapup

One still does miss the motherly touch of Ubuntu, and the bumbling clumsiness of Windows; but those are in the past. Hopefully I will try out BOSS linux next and see what it has to offer. Fingers crossed.