Sunday, March 25, 2012

Understanding fractions

I had always been puzzled about fractions right from my childhood days. Why should we take LCM? Why does the method taught in school yields the correct answer? and questions like that. I happened to meet a class 9 student at  a temple. During my conversation i asked him about the math syllabus 8th, 9th etc. He talked about LCM HCF GCD and many more. When i asked him what a LCM actually is, he started showing me the method to calculate LCM. But what is an LCM actually? His teacher had not taught that or like most students he did not care about it. After this i went back and started thinking about fractions. So here is what i got.

question 1) why cant we simply add 1/2 + 1/4 while we can do 1/2 + 1/2 or any other fraction addition with common denominator?
ans: Suppose you ve a cake, then 1/2 means dividing it into 2 "equal" parts and taking 1 part out of it.
Similarly 1/4 means dividing the cake in 4 equal part and taking 1 part out of those 4. So obviously we cant simply(easily) add the two "unequal" parts.

ans) LCM gives us the common denominator that we want. How? well, least common multiple means the smallest number which is multiple of given numbers. Eg. LCM of 2 and 3 is 6 coz the first no. which is common in the tables of 2 and 3 is 6.
now, let us add two fractions. 1/2 + 1/4 = 1/2 * (2/2) + 1/4 * (1/1) = 3/4.  [Notice the 2/2 and 1/1, they are masked in the school method which we are taught]. why they are used? we want to take the fractions to a common base keeping the ratio same. So multiply and divide by the number which will take that fraction to the common base form.

Hope this was intuitive!

Friday, March 9, 2012

The answer to the puzzle!

Sorry for the delay in posting the answer to the question i had asked in my prev post. Since almost no one has attempted it here it is........The 99th line is true while all others are false....


Suppose all hundred lines are true.. Then hundred th line should also be true. But 100th line says that exactly 100 lines out of 100 are false and this should be true coz we have assumed it it is true.
But this gives rise to a contradiction..
Thus all 100 cant be true some are false.. and 100th line cant be true..Thus 100th statement is false..

Now the 99th line can either be true or false..Suppose 99th line is false then there is no true line at all..but the 100th line is already proved false..so 99th line must be true..If this was confusing please spare some time and think..U will get the logic!!

Sunday, February 26, 2012

An Interesting Logic Puzzle

It has been a long time since i posted any math puzzles..here is one which i managed to solve yesterday,

"the nth  statement in a list of 100 statements is "Exactly n of the statements in this list are false"
a) What conclusions can you draw from these statements?
b) Answer part (a) if the nth statement is "atleast n of the statements in this list are false"
c)Answer part (b) assuming that the list contains 99 statements.

For those of you who are finding it hard to understand the problem statement, here is an elaboration.
It simply means that there are 100 statements written down somewhere. Part (a) means that :-
1st line - "exactly 1 of the statements in this list are false"
2nd line- " exactly 2 of the statements in this list are false"
.
.
.
99th line- "exactly 99 of the statements in this list are false"
100th line- "exactly 100 of the statements in this list are false"

similarly for the other two parts..only the statement now changes..I ll give the answer tonight..till then the readers can try to think over!! all the best

Monday, January 23, 2012

My annual pilgrimage to Sonda!

Sonda (near Sirsi) is one of my favourite pilgrimage spots, simply because of the scenery and silence. It had been a year since i had been there, making me ever more desperate to visit this beautiful place again. Thus i decided to go to Sonda the very day our vacations were declared ie Dec 10th. But again, there was exam duty and all other mundane responsibilities to finish off and patience finally bore fruit on 24th of Dec. when i finally managed to proceed to Sonda. I wanted to keep my luggage minimal and thus with two small bags and few books i left home at around 10:30.. While walking out of my house towards the bus stop, wind blew from behind. It was pleasant and i (being a firm believer in omens) knew that this pilgrimage was going to be a very good one.. I missed a bus to court cirlcle by a few minutes and decided to wait for few more minutes for another one.. During this "waiting time" an old man enquired about me and when i responded he began to talk about many many things. Old people generally want someone to hear them..This old guy had found me, i thought. I stood there for about 10min. With no signs of a bus coming, i decided to take an auto to court circle. Sitting besided the auto driver was pretty nostalgic. The driver had managed to fill the auto with 6 people.. Getting down at court circle and hurriedly negotiating the traffic at chennamma circle i finally managed to reach Hubli Old Bus Stand..


The stink of evaporating urine and almost every wall painted in red, thanks to the constant spitting of ghutka are the distinguishing of out Bus Stand. I stood at Platform No 7( wondering where was THE PLATFORM). Soon a bus to sirsi and i alighted it. The journey had begun. I had committed a few mistakes the first time i had been to Sonda. Although i had got myself involved in many religious activities i had spent considerable amount of time gossiping with others. This time i wanted to stay silent and stay away from making new friends. I had spent about an hour recollecting as  many religious rules as i could..

The bus stopped at Tadas village.. I opened a book from my bag and started reading.. But the silence was not to last long enough.. A woman got into the bus with her crying child. That scene was common enough for me..But when the bus left the child started screaming loudly.. All the passengers were irritated by the screams of that child.. We had thought that the mother would console the child.. But she was simply ignoring her child as if it were sleeping on her lap..All the passengers complained to the conductor and the poor man went to the woman and asked to shut the child's mouth.. The woman, on the other hand, replied that the child wanted an ice candy and she had not bought one.. So it was crying like that.. She then asked the conductor to console the child!! On hearing the conductor's consolation, the child started screaming even more! I was right behind that woman and was now losing my patience. I wanted to slap that child and the mother.. But somehow managed to control myself.. We all had to bear that child for another 2 hours and that woman finally got down with her child near sirsi!! About an hour later i got down at sirsi old bus stand..

Friday, December 2, 2011

Some numpy notes

here are some numpy notes..
#create a numpy array

a = array([1,2,4])

#make this a column vector
a = a.reshape(len(a),1)

#append a new column vector to it
a = concatenate((a,a),axis=1)

#the append function is not working for me..so i will stick to concatenate

now let me give  a simple program to read a file of real numbers, compute the average of each row and write a new file with this columns of averages appended..
You need the scitools package and numpy installed to execute this

#program to read a file containing real numbers and sum the rows and take average. add the average as a new column and save
import sys
from numpy import *

try:
    infile = sys.argv[1]
    outfile = sys.argv[2]
except:
    print "lafda aiti tamma"

import scitools.filetable as ft
#x = []
#y = []
fin = open(infile, 'r')
fout = open(outfile, 'w')

#now read the x,y pairs from command line
#if len(sys.argv) % 2 != 0:
#    print "must enter even no of digits"
#    exit

#for i in range(2,len(sys.argv[2:])): #leave out the first two elements of sys.argv ie program name and output file
#    y.append(float(sys.argv[i])) if (i%2) else x.append(float(sys.argv[i]))

#x = array(x)
#y = array(y)

#read the table from the file and store as a matrix
table = ft.read(fin)

num_rows = table.shape[0]
num_columns = table.shape[1]
avg_col = []


for i in range(num_rows):
    avg_col.append(mean(table[i]))
      

avg_col = array(avg_col)
print table.shape
print avg_col.shape
avg_col = avg_col.reshape(len(avg_col),1)
table = concatenate((table,avg_col),axis=1)
ft.write(fout,table)






















Monday, August 9, 2010

BSNL broadband connection in ubuntu 10.04

i had to go through a lot of sites to get this working..so i ve decided to document what has worked for me..
first we need to add DNS server addresses to /etc/resolv.conf..to get the addresses iused ipconfig -a in windows.this is what the file looks like
nameserver 218.248.245.1
nameserver 218.248.255.141

then cd to /etc/ppp/peers
edit the file named profile and add your username(broadband username) and phone no..

# There should be a matching entry with the password in /etc/ppp/pap-secrets
# and/or /etc/ppp/chap-secrets.
user "guruvyasa"<------username here

# MUST CHANGE: replace ******** with the phone number of your provider.
# The /etc/chatscripts/pap chat script may be modified to change the
# modem initialization string.
connect "/usr/sbin/chat -v -f /etc/chatscripts/pap -T 173333" <-------your phone no. will be same for entire area

with this done, open new terminal and type

sudo pppoeconf
it will ask for username and password rest all dont worry..
switch off modem and switch on again.
type sudo poff -a to close connection
sudo pon dsl-provider
to connect to internet

there are some problems with vi editor which comes pre-installed with ubuntu..so use gedit to edit files initially..it also doesnt allow cd to these directories..so we need to change permissions using chmod command..
enjoy

Wednesday, August 4, 2010

nachiketa(continued)

Nachiketa (continued)...
now,..what made nachiketa ask his father that kind of a question??
the upanishad says.."dakshinasu neeyamaanasu SHRADDHA aavivesha"..seeing his father giving away those cows, there was a sudden surge of SHRADDHA in him..so what is shraddha??
this word is derived from SHRAT dhatu which means truth..SHRAT ASYAAM DHEEYATA ITI SHRADDHA..ie a firm belief that this is true or we can say CONVICTION..so this is what makes us achieve something in life..coz unless we have a firm belief that something is true and good to us we cannot put in efforts to own it..thats why krishna says, SHRADDHAAVAN LABHATE JYNANAM , TATPARAHA SAMYATENDRIYAHA..ie this shraddha results in a person gaining knowledge..and we can see this in nachiketa's story..interesting the SHRADDHA that ought to be in his father, had cropped up in him..from this we need to learn that although we may not be having lots of devotion in doing good deeds, but still we have to do those, coz there may be a NACHIKETA in the people observing us, who will learn from our deeds and grow up to become a role-model for others..