Showing posts with label Maths. Show all posts
Showing posts with label Maths. Show all posts

01 May 2014

Odd Perfect Number

A perfect number is a positive integer, the sum of whose factors(except the number itself) add upto the number.
Example: 28 = 14 + 7 + 4 + 2 + 1

There are about 48 known perfect numbers at the time of writing this article.But none of them are odd. Computers have checked upto $10^{300}$ but could never find one. So I tried my luck disproving their existence.I had a little experience proving this (pefect squares have odd number of factors). But rather than disproving their existence I ended up finding constraints on their existence.

Let $x$ be a odd perfect number.
Then $x$ can be denoted as $x = p^a.q^b.r^c ..….$ where $p, q, r.....$ are prime factors.


Theorem 1: One and only one of the prime factors have an odd power i.e. only one of $a, b, c....$ is odd and all others are even.
Proof: 
All the combination of factors of $x$ can be denoted by varying the powers of the prime factors.
The sum of all the factors of $x$ can then be written as
$s = (p^0 + p^1 + p^2 + ....p^a)(q^0 + ..... q^b)(r^0 + ...… r^c).....$

30 March 2014

The Three Point Conjecture

Don't get too excited about the title. It's simply a puzzle(The three utilities puzzle).
There are three houses and three factories(water,gas,electricity) in a city block.Each house should be supplied with water,gas and electricity.The supply lines should not overlap each other.Draw the connections.
In short there are 2 sets of three points.Each point in Set-1 should be connected to every point in Set-2 without the lines overlapping.

Seems easy enough.But there's a catch, no matter how you try, you won't be able to make one last connection.You don't want to know how much time I spend on it and was convinced of its impossibility.

Now one last challenge remained - the proof.
The difficult part about the proof was that I've got no idea where to begin or which path to follow.Proving something like this was entirely new. It disturbed me day and night. It's amazing how desperation could make you do things that you thought you couldn't. And this fine morning something strange struck me.


29 December 2013

Prime Factorial

While doing some random computing I accidently found out something.
(2!+1)/3=1
(3!+1)/4=Fraction
(4!+1)/5=5
(5!+1)/6=Fraction
(6!+1)/7=103
Only when the denominator is a prime the quotient will be an integer.
Let n be prime
Then ((n-1)!+1)/n will be an integer.
I computed it to really large numbers and seemed to hold.
Don't yet know if its generally true.

Update: This theorem is called Wilson's Thoerem.

21 December 2013

[C++][Project] Calculator + Automatic Syntax Checking + Complex Analysis


This is my first ever C++ coding project.The main motivation behind it was a Casio scientific calculator I once owned and I had a hard time figuring out the syntax.

I have only 2 year experience studying Borland C++ in school.So please don't go too technical in comments. This is a genuine piece of work and no code has been borrowed from anywhere.I am open to suggestions and you are free to use the code in any way you please.


Overview:

This is a scientific calculator with support for complex analysis.(support calculations and functions of complex numbers)
It automatically check for syntax errors.You can only enter valid syntax.
The program is written entirely using basic input and output manipulation techniques and inbuilt math functions.Thus it has limitations when it comes to precision and possible logical workarounds are implemented wherever possible.

Changelog:

V4.5
+Rewrote in GCC compiler

V4.4
+Very tiny Bugfix

V4.3
+Very tiny bugfix

V4.2
+Removed Gamma function for computing factorial.
+Bugfix: Inverse Cos.
+Error handling: 0th root.

V4.1
+Fixed approximation bug in complex power function.
+Changed the way evaluation code handle 'i' and '-'.

V4.0
+Optimised evaluation technique(Functions are evaluated first).
+Minor Tweaks in Syntax checking.
+Optimised code converting string to long double.
+Bugfix in complex log function.
+Bugfix: i^x bug.
+Tweak: Precise ambiguity.
+Cleaned up the code.

V3.7
+Temporary bugfix for i^x bug.

V3.6
+Complex Math By GenX introduced.
+Support for complex functions.
+Redid evaluation code.

V3.5
+Added support for complex numbers.
+ -,+,*,/ operations on complex numbers supported.
+Tweaks in syntax checking
+Tweaks in evaluation

V3.2
+Redid a major part of the program to remove bugs.
+ √ function added

V3.1
+Added support for inverse functions.
+Tweaks in syntax checking.
+Tweaks in evaluation.

V3.0
+Added support for functions: cos, sin, tan, log .....
+Tweaks in syntax checking.
+Tweaks in evaluation.

V2.9
+Bugfix: Backspace handling in syntax checking.

V2.8
+Added Help
+Syntax checking calls help after a number of invalid entries.

V2.7
+Added nCr , nPr and factorial operations.
+Tweaks in syntax checking.
+Tweaks in evaluation.

V2.6
+Compiled as independent program.
+Bugfix in syntax checking.

V2.5 and earlier
+The program was part of X Shell a dos like command prompt written in C++.
+Supports only +,-,/,*,(,) operators.

23 November 2013

Only Perfect Squares Have Odd Number Of Factors

One day I came across a brain teaser,

There are 100 rooms in a hostel numbered 1,2...100.At first the hostel warden opens every room.Then he closes every 2nd room i.e. 2,4,6...100.In the next round he goes to every 3rd room 3,6,..99, if the room is already open he closes it and open closed rooms.This goes on and after the 100th round how many rooms will be open??

To solve this I tried using many methods.One of the methods was to find the number with odd number of factors. If the number had odd number of factors, it will stay opened after all the rounds been complete. Let's say 26. Factors are 1,2,13,26. It'll be opened in round 1, round 2, round 13 and round 26. After that it'll remain untouched. Now let's say a number $n$ has odd number of factors, then it'll remain open after $n$th round.

I tried other combinatorial methods.But all these seemed too long to yield an answer in a reasonable amount of time.After an hour or two one of my friends gave an answer 10.On asking how he arrived at the solution he said he tried upto 10 rounds and only the perfect squares 1, 4 & 9 remained open.

Frankly, I didn't like his answer.It was like mere guess work. And it was not yet conclusive. So the question was do all perfect squares actually have odd number of factors, do other numbers have odd number of factors as well?On factorizing random numbers only perfect squares seemed to have this property.

So we can vaguely say all perfect squares and only perfect squares have odd number of factors.
But I was never a fan of uncertainty, and the fact seemed too elementary to present itself in the form of a proof. After burning tons of glucose in my brain, the proof seemed pretty silly......

Counting Partitions Of a Set

Then I was studying at 11th std when we were being introduced to 'Sets' my maths tutor at P.C.Thomas Classes told me that there was no 'real' formula for finding the number of partitions for a set of $x$ elements.But then I came across the Bell number which gave the number of partitions as a recurrence series.
But still I was not satisfied, Bell number was not really a formula and there was no explanation why it represent the number of partitions.

Nearly  a year passed by, I learned many new things which included functions. Suddenly I had a insight that Surjective funtions beared a close relationship with set partitions.

Finally I arrived a the summation formula:

Where $x$ is the number of elements in the set.

Proof:
A function $f:X->Y$ is said to be surjective if every element of $Y$ is a image of some element of $X$ .
($x$ & $y$ are respectively the number of elements in $X$ & $Y$).$\left ( x\geq y \right )$

17 November 2013

Summing Dice Throws

What is the probability of getting a particular sum after a dice is thrown n times??

During the 1st terminal exam(class 12), I came across a problem in probability wherein a die is thrown twice and finding the probability that the sum obtained is 6. Well the solution was arrived at by finding out the sample space(I actually hate that method, just computation no logic). So naturally a question arose, what if the die is thrown n times........

It preoccupied me the whole evening.Finally I got a formula for finding the number of ways in which a sum can be obtained.
Let the sum of the outcomes be s=(n + 6k + x)
Where, 
n=>number of throws
k=>arbitrary constant
ϵ {0,1,2,3,4,5}

Then number of ways the sum can be obtained is given by:


Using this formula you can easily find the probability..

This formula can also be extended to a die with 'f' faces
s=(n+fk+x)
Where, 
n=>number of throws
k=>arbitrary constant
ϵ {0,1,2,3,...,f-1}
No. of ways = $\sum_{i=0}^{k}(-1)^i.\binom{n}{i}.\binom{n+(k-i)f+y-1}{(k-i)f+y}$


Uh.Oh Forgot one important thing.