Friday 16 June 2017

What Types of Math Do Computer Programmers Use?

Computer programming touches almost every aspect of our lives. Software applications for our computers is commonly thought of when computer programming is mentioned. However, programming of embedded devices can be found in cars, cell phones, video games, appliances and door locks. Computer applications are available for education, entertainment and work that use different types of mathematics.

Basic Programming Math

Binary math is at the core of how any computer operates. Binary is used to represent each number in the computer. Reading and simple mathematical operations with binary are critical for low-level programming of hardware. Understanding how to work with hexadecimal number system is required for many programming functions such as setting the color of an object. Standard arithmetic is used in many functions of programming. Addition, subtraction, multiplication, and division is used in almost every program written. Algebra is used to solve simple problems that many computer programmers will encounter.

Advanced Programming Math

Obtaining a computer science degree requires completing many math classes. These include college algebra, statistics, calculus I and calculus II. These classes are applied in two different ways for computer programming. The most obvious are using the math taught to solve complex equations. The less obvious is the skills learned to master advanced math is similar to the skills required to build complex applications. These skills include logic and following complicated step-by-step processes.

Application-Specific Math

The application for the program being created will often dictate the specific type of math techniques required. Linear algebra is often used for transformation of matrices. Matrix transformation is found in both 2D and 3D modeling as seen in the computer-aided design and photo editing software. Differential equations can be found in software to simulate traffic or health conditions. Statistics is used in many computer programming applications including polling systems, reports, and card games.

Thursday 15 June 2017

Stunning Examples Of Mathematics In Nature

Are you one of those people who thought you’d never need math after leaving school? Well, whether you like it or not, there’s math everywhere around you. Here are just a few incredible examples of mathematics in the natural world.

The Number 1

Long considered important by mathematicians, this number turns up again and again in the natural universe. Snails have one shell, oak trees have one trunk, the earth has one moon, and members of the species Sphyraena have bodies composed of exactly one fish. Amazing!

 Tall Tree


Never thought trees had anything to do with math? Well, a tall tree is an incredible example of height, one of the essential units of mathematical measurement.

Cow Udders


This one’s mind-blowing. All cows have exactly four symmetrically arranged udders so that all the members of the Beatles can drink from them at the same time.

Sticks


If you can find a good stick that isn’t too gnarly and doesn’t bow too much, it basically looks just like a minus sign.

Oceans And Lakes


 Ready for something even more unbelievable? Oceans and lakes are both made of water. Think the math ends there? They also are both homes to fish. Incredible!

Math and Nature

Mathematics is everywhere in this universe. We seldom note it. We enjoy nature and are not interested in going deep about what mathematical idea is in it. Here are very few properties of mathematics that are depicted in nature.

SYMMETRY

Symmetry is everywhere you look in nature. 

Symmetry is when a figure has two sides that are mirror images of one another. It would then be possible to draw a line through a picture of the object and along either side the image would look exactly the same. This line would be called a line of symmetry. 

There are two kinds of symmetry. 


One is bilateral symmetry in which an object has two sides that are mirror images of each other. 
The human body would be an excellent example of a living being that has bilateral symmetry. 


Few more pictures in nature showing bilateral symmetry.





The other kind of symmetry is radial symmetry. This is where there is a center point and numerous lines of symmetry could be drawn. 

The most obvious geometric example would be a circle.
Few more pictures in nature showing radial symmetry.



SHAPES

Geometry is the branch of mathematics that describes shapes.

Sphere:

A sphere is a perfectly round geometrical object in three-dimensional space, such as the shape of a round ball. 

The shape of the Earth is very close to that of an oblate spheroid, a sphere flattened along the axis from pole to pole such that there is a bulge around the equator.

Hexagons:

Hexagons are six-sided polygons, closed, 2-dimensional, many-sided figures with straight edges.

  
For a beehive, close packing is important to maximize the use of space. Hexagons fit most closely together without any gaps; so hexagonal wax cells are what bees create to store their eggs and larvae. 

Cones:

A cone is a three-dimensional geometric shape that tapers smoothly from a flat, usually circular base to a point called the apex or vertex.

Volcanoes form cones, the steepness, and height of which depends on the runniness (viscosity) of the lava. Fast, runny lava forms flatter cones; thick, viscous lava forms steep-sided cones.



Still, a lot of things exists in nature. According to me, Mathematics is a pattern of nature. And many more things will be shared in future.

Saturday 10 June 2017

Thursday 8 June 2017

Algorithms that dominate our world !


Now if you have studied algorithms the first thing that could come to your mind while reading the article is “Does the author know what an algorithm is?” or maybe “Facebook news feed is an algorithm?” because if Facebook news feed is an algorithm then you could eventually classify almost everything as an algorithm. So I’m going to try to explain in this post what an algorithm is and which are the real 10 (or maybe more ) algorithms that rule our world.

What is an algorithm?

Informally, an algorithm is any well-defined computational procedure that takes
some value, or set of values, as input and produces some value, or set of values, as
output. An algorithm is thus a sequence of computational steps that transform the
input into the output
Source: Thomas H. Cormen, Chales E. Leiserson (2009), Introduction to Algorithms 3rd edition.
In simple terms, it is possible to say that an algorithm is a sequence of steps which allow solving a certain task ( Yes, not just computers use algorithms, humans also use them). Now, an algorithm should have three important characteristics to be considered valid:
  1. It should be finite: If your algorithm never ends trying to solve the problem it was designed to solve then it is useless
  2. It should have well-defined instructions: Each step of the algorithm has to be precisely defined; the instructions should be unambiguously specified for each case.
  3. It should be effective: The algorithm should solve the problem it was designed to solve. And it should be possible to demonstrate that the algorithm converges with just a paper and pencil.
Also, it is important to point out that algorithms are not just used in Computing Sciences but are a mathematical entity. In fact, the first recorded mathematical algorithms that we have date from 1600 BC — Babylonians develop earliest known algorithms for factorization and finding square roots. So here we have the first problem with the post mentioned before, it treats algorithms as computing entities, but if you take the formal meaning of the word the real top 10 algorithms that rule the world can be found in a book of arithmetic (addition, subtraction, product, etc).
But let's take computing algorithms as our definition of an algorithm in this post, so the question remains: Which are the 10 algorithms that rule the world? Here I’ve put together a little list, in no particular order.

1. Merge Sort, Quick Sort and Heap Sort




What is the best algorithm to sort elements? It depends on what you need, and that’s why I put the three more frequently used sort algorithms in the same place; maybe you have a preference for one, but all of them are equally important.
The Merge Sort algorithm is by far one of the most important algorithms that we have today. It is a comparison-based sorting algorithm that uses the divide-and-conquer approach to solving a problem that once was an O(n^2). It was invented by the mathematician John von Neumann in 1945.
A quick sort is a different approach to the sorting problem, it can use in-place partition algorithms and is a divide and conquer algorithm as well. The problem with this algorithm is that is not a stable sort but is really efficient for sorting RAM-based arrays.
Finally, Heap Sort algorithm uses a priority queue that reduces the search time in the data. This algorithm is also an in-place algorithm and is not a stable sort.
These algorithms are a big improvement over other approaches previously used like bubble sort, in fact, it is thanks to them that today we have Data mining, artificial intelligence, link analysis and most of the computing tools in the world including the web.

2. Fourier Transform and Fast Fourier Transform



Our entire digital world uses these simple but really powerful algorithms, which transform signals from their time domain into their frequency domain and vice versa. In fact, you are seeing this post thanks to these algorithms.
The internet, your WiFi, smartphone, phone, computer, router, satellites, almost everything that has a computer inside uses these algorithms in one way or another to function. You can’t get a degree in electronics, computing or telecommunications without studying these important algorithms.

3. Dijkstra’s algorithm






It is not crazy to say that the internet wouldn't work as efficiently as it does if it wasn't because of this algorithm. This graph search algorithm is used in different applications where the problem can be modeled as a graph and you have to find the shortest path between two nodes.
Today, even when we have better solutions to the problem of finding the shortest path, Dijkstra’s algorithm is still used in systems that require stability.

4. RSA algorithm


The internet wouldn't be as important as it is today if it wasn't for cryptography and cybersecurity. You can think “Sure, security in the era of NSA and other intelligence agencies” or “You have to be really naive to think you are safe on the Internet”; but, people need to feel that they are secure in order to spend their money. After all, you wouldn't input your credit card number on a web service if you know it is not secure.
And from the field of cryptography, there is an algorithm that remains one of the most important in the world: the RSA algorithm. Developed by the founders of the company RSA, this algorithm made cryptography available to everybody in the world and helped to shape how cryptography works today. The RSA algorithm is a solution to a simple but complex problem: how to share public keys between independent platforms and final users, in order to allow cryptography (I would argue that it hasn’t been completely solved, I think we need more work in this direction).

5. Secure Hash Algorithm


This isn't exactly an algorithm but a family of cryptographic hash functions developed by the NIST in the USA. But this family of algorithms is fundamental for the functioning of the World. From your app store, your email, your antivirus, to your browser, etc , all of them use these algorithms (in reality the hash that results from them) to determine if you have downloaded what you wanted or if you have been the victim of a man in the middle attack or maybe a phishing attack.

6. Integer factorization


This is a mathematical algorithm that is heavily used in the computing field. Without this algorithm, cryptography would be much more unsafe. The algorithm is a series of steps used to get the prime factorization of a composite number into smaller non-trivial divisors. This is considered an FNP problem, which is an extension of the class NP making the problem really hard to solve.
Many cryptographic protocols are based on the difficulty of factoring large composite integers or a related problem—for example, the RSA problem. An algorithm that efficiently factors an arbitrary integer would render RSA-based public-key cryptography insecure.
The birth of quantum computing is making it easier to solve this problem, opening a completely new field that uses properties of the quantum world to make systems safe.

7. Link Analysis



In the era of internet, the analysis of relationships between different entities is crucial. From search engines and social networks to marketing analysis tools, everybody is trying to find the real structure of the Internet through time.
Link analysis is arguably one of the algorithms with the most myths and confusion in the general public. The problem is that there are different ways to make link analysis and there are also characteristics that make each algorithm a little different (which allows to patent the algorithms) but in their bases they are similar.
The idea behind link analysis is simple, you can represent a graph in a Matrix form making it an eigenvalue problem. These eigenvalues can give you a really good approach to the structure of the graph and the relative importance of each node. The algorithm was developed in 1976 by Gabriel Pinski and Francis Narin.
Who uses this algorithm? Google in its Page Rank, Facebook when it shows you your news feed (this is the reason why Facebook news feed is not an algorithm but the result of one), Google+ and Facebook friend suggestion, LinkedIn suggestions for jobs and contacts, Netflix and Hulu for movies, YouTube for videos, etc. Each one has a different objective and different parameters, but the math behind each remains the same.
Finally, I’d like to say that even though it seems like Google was the first company to work with this type of algorithms, in 1996 (two years before Google) a little search engine called “RankDex”, founded by Robin Li, was already using this idea for page ranking. Finally, Massimo Marchiori, the founder of “HyperSearch”, used an algorithm of page rank based on the relations between single pages. (The two founders are mentioned in the patents of Google).

8. Proportional Integral Derivative Algorithm



Have you ever used an airplane, an automobile, a satellite service or a cell phone network? Have you ever been in a factory or seen a robot? If so, then you have seen this algorithm in action.
Basically, this algorithm uses a control loop feedback mechanism to minimize the error between the desired output signal and the real output signal. It is used wherever you need signal processing or you need an electronic system controlling a mechanical, hydraulic or thermal system using automation.
You could say that without this algorithm our modern civilization wouldn't exist.

9. Data compression algorithms


It is difficult to decide which is the most important compression algorithm because, depending on the application, the algorithm used can vary from zipping to mp3 and from JPEG to MPEG-2. But there is something that everybody knows that these algorithms are really important in almost all the structures.
Where could you find them, besides the obvious zipped document? This web page used data compression to be downloaded into your computer, in video games, videos, music, data storage, cloud computing, databases, etc. You could say that everything uses data compression algorithms; they help make systems cheaper and more efficient.

10. Random Number Generation





Today we don’t have a “true” random number generator, but we have some pseudo-random number generators that are sufficient. These are used in a large number of applications, from interlink connection, cryptography, secure hash algorithm, video games, artificial intelligence, optimization, to initial conditions for problems, finances, etc.

Finally, I just want to add that this list should be taken as an opinion, not a comprehensive list because there are some algorithms in fields like Machine Learning, Matrix multiplication, categorization, etc, which are important in our world and are not mentioned here.