Overview
mathJX is an implementation of various formulas, theorems, and concepts related to mathematics a person should know or must have learned them while in school or college or university. It will be written by keeping in mind the exact proofs and conditions of the mathematical methodologies.
It will cover topics like:
- Prime Numbers
- Logarithms
- Square root, Cube root
- Sieve of Eratosthenes
- Factors and Multiples
- Even and Odd
- Face Value and Place Value
- Mensuration
- Exponentials
- Algebra
- Trigonometry
- Calculus
- Numerical Methods
- And so on……..
Tools and Technologies
- Java
- IntelliJ IDEA
- Little bit of Mathematics
Lets take an Example
Prime numbers usually you will think or say: “Prime numbers are the numbers that are only divisble by 1 and itself.”
// 2 and 3
// what could be the logic
// run a loop from 2 till number - 1
for(int i = 2; i < n; i++) {
if(n % i == 0)
return false;
}
Most probably this is wrong. Lets have a look at another code below :
if(n <= 1) {
return false;
}
if(n == 2) {
return true;
}
if(n % 2 == 0) {
return false;
}
for(int i = 3; i * i <= n; i+=2) {
if(n % i == 0) {
return false;
}
}
What happened here is we added checks :
- If the number is less than or equal to 1,
return false
, because prime numbers are positive integers that are greater than 1. - If n is equal to 2,
return true
, because 2 is the only even number that is a prime. - And then as we know all the even numbers except 2 are not prime we added a check,
% 2
, which will tell us if it is even or not, hencereturn false
. - And then we will only check the odd numbers loop will start from 3, and all non-prime numbers would atleast have one factor that will be less than or equal to the square root of n, hence i * i <= n, if found
return false
. - We can also have some thing called
Sieve of Eratosthenes
which is an effective way to find all prime numbers till a given numbern
.
Future Work Includes
- Logarithms
- Mensuration
- Trigonometry
- Calculus
- Numerical Methods/Analysis
- Probability
- Statistics
Conclusion
In my opinion, Mathematics is the base of every science. It helps us to be good at logic building, algorithms, analysis, thinking, etc. One should be good at maths if they want to become a cracked engineer/programmer/coder/developer.