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.

Thursday, 20 April 2017

Algorithms ruling the world !!



Algorithms have revolutionized our world as we know it. 
Today, a lot of things come to us a lot more easily than before. We have moved forward from the age of waiting to hear our favorite song on the FM radio and recording it on a cassette. Now, we visit YouTube to play your favorite song. It miraculously recommends all your favorite songs in the auto playlist. 
When you visit IMDB’s website, it suggests the most relevant movies every time. When you Google something, you see the most relevant information on the first page. Have you ever wondered how each website knows exactly what to show you?
Algorithms.
We have advanced so much that we can create a painting that one cannot distinguish from the works of an artist who died in 1669!
We are talking about the new 3D-printed Rembrandt painting. Developers created an algorithm to collect data from portraits painted by Rembrandt. This data was then used to create a new 3D-printed painting, which took over 500 hours of rendering.

What is an algorithm?

A process or set of rules followed in calculations or other problem-solving operations, especially by a computer”. At the simplest level, it is a procedure for accomplishing a task or solving the problem. 
How algorithms shape our world every day
Algorithms are everywhere—sports, computer gaming, finance etc. Let us take a look at a few examples.

Healthcare: Algorithms help in areas where healthcare had no effective treatment. From matching appropriate organs to mining data for matching symptoms. They complement some of the most proficient doctors across the globe.



In 2013, 4500 former footballers filed lawsuits against the NFL for concussion-related injuries. This issue came into the limelight when Hall of Famer, nine-time Pro Bowler, Mike Webster and a few other players were diagnosed with Chronic Traumatic Encephalopathy (CTE). The effects of repeated blows to the head cause CTE. 
1.6 to 3.8 million sports-related concussions occur annually in the United States. To this day, there are no effective tests/scans to detect this disorder. Sanford Health studied common symptoms of the disorder and developed a concussion-evaluation algorithm, which detects the signs and symptoms of CTE. Now, because of timely treatment and precautions, the effects of concussions are prevented in more players. Until an effective test or scan is developed, algorithms are the answer to detecting CTE in time.

Sports: The sports industry today is the result of what has moved from intuition to statistics. It is a big game of algorithms from the Duckworth-Lewis method in cricket to the ranking players by using the Elo rating in the game of chess.



Algorithms also dominate the world of sports betting. So when you see weird numbers like 12/25 for ManU and 17/25 for Arsenal, you can rest assured that they are correct. The complex mathematical concept of the Poisson distribution equation is the foundation to the sports betting. This concept is used to generate numbers in sports betting.
Let’s take the example of Elihu Feustel, who makes almost a million dollars a day by betting on tennis. You would think that he would recognize Serena Williams if he passed by her on the street. However, this isn’t the case, he neither recognizes any of the famous tennis players nor does he know their playing styles etc. So, just how does he know who to bet on? He relies on a big data model that the live betting market uses. This algorithm collects data from existing (almost 2,60,000) matches. This data is then manipulated to allow users to determine which player/match they should bet on.
It seems like it’s all out of this world, right?

Gaming: It's amazing how videos and computer games have evolved over the last 2 decades. We started with DOS games, Super Mario, Pac-Man, and went on to highly-advanced games like Need for Speed, Counter-Strike, and DotA.



The games are now getting more realistic, with life-like surroundings, smarter and scarier anti-heroes. There is an increased advancement in Augmented Reality (AR) and Virtual Reality (VR) technologies. We are now developing techniques to bring in games that require player involvement at an epidemic rate. This has led to the development of algorithms that are highly complex in nature to create complex games.


There is no doubt that irrespective of the field that you choose, algorithms have a strong influence on our lives and they are changing our world.
Soon there is a possibility that algorithms will take over most of the tasks done by human beings. This could lead to the creation of mundane jobs, which algorithms cannot do, such as stocking bottles, collecting blood samples, and other work that requires physical effort.

Tuesday, 21 February 2017

How does a boat float if it's heavy? | Why does a boat float but a nail sink?



Answer 1:


This is a wonderful question! To understand why things float you have to consider two things: 1) what is pushing "up" and 2) what is pushing "down"? The "down" force is easy - this is the boat being heavy that you mention in your question. So heavy boats are getting pushed into the water with a lot of force (by gravity)! So why don't they sink?
The "up" force: If you take a plastic ball and try to push it under water it can be quite hard because even if you can't see it, you are raising the level of the entire pool by a small amount. So you are actually pushing water up which is hard to do because water is also "heavy". So here is the answer to your question: boats float because when gravity tries to pull them into the water, it also has to push a lot of water up (the amount of water that has to move to let the boat in) so even though boats are heavy, they are also very big. If you had a boat that weighed the same as one that could float, but it was the size of a pebble it would clearly sink.
This idea that the size of the boat makes it less "heavy" in water is referred to as "density". Heavy boats float because they are less heavy than the amount of water they push away when they start to sink.
I hope this helps!

Answer 2 :

The nail sinks because the density of the steel is greater than the density of the water. But ocean liners are made of steel so why do they float, and since they do float, why do they sometimes also sink?
Everyone’s heard of gravity, that mysterious force that pulls everything downward, but did you know there is also an opposing force? Buoyancy is the push to gravity’s pull. Buoyancy is the force that floats your boat. To understand buoyant force, think about what happens when you put an ice cube into your glass of water.

As the ice cube displaces, or pushes away, some of the water it causes the level in the glass to rise and your ice cube to float partially in and partially out of the water like a miniature iceberg. Like a game of tug-of-war; gravity is pulling the ice cube down and buoyant force is pushing it up. How far in or out of the water your ice cube rests depends on its density, or solidness, because that is what the pushing and pulling forces are working against.
A Greek mathematician and inventor named Archimedes noticed that when he stepped into his bathtub the water level rose. He reasoned that the weight of the water he displaced was equal to the buoyant force in the water. This is called Archimedes Principle and it applies to all fluids.
Kids find it easy to remember Archimedes and his discovery when you ask them:
Do you remember the story about the guy who shouted “Eureka!” after leaving his bath naked?
You can learn more about Archimedes by visiting Learn From Zero With Me!’s Learn about Archimedes article.
But back to the question of the hour….Why does a boat float but a nail sink?

Ocean liners are made of steel and they float because their density is less than that of the water they float in. The ability of a boat to float depends on its average density. Average density takes into account not just the weight of the steel hull but also the air trapped in it. A ship with a large volume of trapped air has a lower density than that of the water it sits in – so it floats.
When a ships hold is full of cargo it floats lower in the water because there is less trapped air making it denser. Likewise a ship empty of cargo has more trapped air so it’s less dense and it floats higher out of the surrounding water. If the ship loses enough of its capacity to hold trapped air, it sinks. Remember the story about the Titanic?
A submarine is designed to have almost the same density of the ocean water that surrounds it. In order for a submarine to sink the crew pumps water into tanks called ballast tanks. To surface the submarine forces the water out of the ballast tanks and fills them with air, lessening the density of the sub and bringing it up to the surface.
Gravity, buoyancy and density work together to determine what floats your boat, or sinks your ship.

Monday, 20 February 2017

Archimedes' Principle of Buoyancy

How do Ships Float?
How could ships weighing thousands of pounds float on water when a small coin sinks right to the bottom? The key was a discovery by a Greek mathematician and inventor named Archimedes.




Archimedes' Solves a Problem
The Greek Mathematician and inventor Archimedes lived during the 3rd century BC. According to history he was in the bath one day when he discovered the principle of buoyancy which is the reason why huge Greek ships weighing thousands of pounds could float on water. He noticed that as he lowered himself into the bath, the water displaced by his body overflowed the sides and he realised that there was a relationship between his weight and the volume of water displaced. It is said that he ran naked into the street yelling "heurEka" which is where we get our word  "eureka!" (I found it), Greek heurEka I have found, from heuriskein to find.
Archimedes was not thinking about ships at the time, he was on a mission to solve a question that was asked of him by King Hieron II of Syracuse, the home of Archimedes which was a Greek city at the time. The question that the king had asked was about his crown. Was it pure gold or partly silver? Archimedes reasoned that if the crown had any silver in it, it would take up more space than a pure gold crown of the same weight because silver is not as dense as gold. He compared the crown's volume (measured by the amount of water displaced) with the volume of equal weights of gold and then silver, he found the answer. He had to inform his king that the crown was not pure gold.
The Buoyancy Principle
Archimedes continued to do more experiments and came up with a buoyancy principle, that a ship will float when the weight of the water it displaces equals the weight of the ship and anything will float if it is shaped to displace its own weight of water before it reaches the point where it will submerge.
This is kind of a technical way of looking at it. A ship that is launched sinks into the sea until the weight of the water it displaces is equal to its own weight. As the ship is loaded, it sinks deeper, displacing more water, and so the magnitude of the buoyant force continuously matches the weight of the ship and its cargo.
The Metacenter
Archimedes figured out that the metacenter had to be determined which is a point where an imaginary vertical line (through the center of buoyancy) intersects another imaginary vertical line (through a new centre of buoyancy) created after the ship is displaced, or tilted, in the water.

The center of buoyancy in a floating ship is the point in which all the body parts exactly balance each other and make each other float. In other words, the metacenter remains directly above the center of buoyancy regardless of the tilt of the floating ship. When a ship tilts, one side displaces more water than the other side, and the center of buoyancy moves and is no longer directly under the center of gravity; but regardless of the amount of the tilt, the center of buoyancy remains directly below the metacenter. If the metacenter is above the center of gravity, buoyancy restores stability when the ship tilts. If the metacenter is below the center of gravity, the boat is unstable and capsizes.