Importance of Math Concepts in Computer Programming
|
Herat University Computer science Faculty |
|
Lecturer: Teacher Faqiry |
Abstract
- A computer programmer uses math concepts every day in order to solve real-world problems. Developing a mathematical understanding of data organization, number sequencing and logic is essential in order to acquire good programming skills. Machines do not directly understand words. Computer programmers essentially communicate with robots, PCs and other technical equipment by using numbers.
Contents
2. Data Structures, Grids and Storage: 4
3. Counting and looping techniques. 6
7.2 Advanced Programming Math: 10
7.5 Application-specific Math: 10
8. A final word on computer programming math. 11
Table of figures
Figure 1: mathematic used every where you see. 3
Figure 2: binary digit is the core storage values of computers. 4
Figure 3: loops needed when to execute a code several times. 6
Figure 4: computer is combined of several related parts. 7
Figure 5: math is theoretical foundation of computer science. 9
Figure 6 : we trust on computers because of math. 11
1. Introduction
· Suppose a person owned an ice cream shop that saw hundreds of customers daily. The owner decides that it is important to know what the most popular flavors of ice cream are on a monthly basis to ensure that there is enough inventory in stock. A simple computer program that stores the orders can be created, and it will keep track of the demand on each of the different ice cream flavors. This will require a programmer to give storage and counting instructions to a computer based on customers' ice cream orders. Even in the simplest example, the programmer must tell the computer to count each ice cream order and keep track of how many times chocolate was ordered versus vanilla.
Now suppose the owner wants to find out how many combinations of flavors are possible. What if someone orders a combination of vanilla, chocolate and mint chocolate chip, for example? Permutations and combinations are other mathematical concepts that a programmer may need to understand to answer a real-world question.
Figure 1: mathematic used everywhere you see
2. Data Structures, Grids and Storage:
- Computer storage of ice cream flavors, or any other information for that matter, requires an understanding of the mathematical concepts of data structures and databases (essentially a big grid of information with rows and columns). For example, there will be many important pieces of information that need to be stored in a database for every ice cream order. An order number, order price, amount ordered, ice cream flavor and amount available in stock may be just a few. A data structure is a group of related bits of information collected together that can be used to update a row in the ice cream database every time an order is placed.
Figure 2: binary digit is the core storage values of computers
Manipulating data in a storage grid will require a computer programmer to use math, also. Once an order for vanilla ice cream is made, for instance, the amount of that flavor available in stock must be adjusted in the database by first finding the correct storage location of vanilla ice cream (perhaps row number 2, column number 5) and then doing a mathematical subtraction.
(Liang, 2013)
3. Counting and looping techniques
Often in computer programming, instructions will need to be repeated several times to accomplish a task. This is when looping techniques are used. Looping requires an understanding of math. Suppose a programmer is asked to create an online educational test. It could be a school science test for fifth-grade students, as an example. In the test, a student answers 20 science questions and then the program stops and a score is provided. How will the program known to keep giving questions, and how will it know how many questions have been answered correctly? This type of computer program will require a loop in order to keep track of the number of correct answers. If an incorrect answer is given, the program will not increment the count of correct answers. Counting the number of right answers in a loop requires math computation.
Also, in order for the computer to read the answers to questions, it will require a loop. How will the computer know how long the answers are? They could be a couple of words or a paragraph. Looping will be required to read these strings of characters. Counting, adding, subtracting and possibly even multiplying numbers may be important. (webmaster, 1990)
Figure 3: loops needed when to execute a code several times
4. Combinator
All computer programs do some form of counting as a small part of a task. Counting a hundred items does not take a long time, even without a computer. However, some computers may have to count a billion items or more. If the counting is not done efficiently, it may take days for a program to finish a report when it should take only minutes. For example, the counting winning lottery numbers of all lottery tickets should involve stopping a ticket count when the minimum number of correct numbers cannot be reached on that particular ticket. When the lottery numbers on each ticket are presorted, the count can be very quick with a divide and conquer strategy. The branch of mathematics called combinatorics gives students the theory needed to code counting programs that include the short cuts that will reduce the run time of the program.
Figure 4: computer is combined of several related parts
5. Algorithms
After a count has been completed, a task to do something with the actual number from the count is needed. The number of steps needed to complete a task should be minimized so the computer can return a result faster for a large number of tasks. Again, if a task needs to be done only 20 times, it will not take long even for the slowest computer. However, if the task needs to be done a billion times, an inefficient algorithm with too many steps could take days instead of hours to be completed, even on a million-dollar computer. For example, there are many ways to sort a list of unsorted numbers from lowest to highest, but some algorithms take too many steps, which could cause the program to run much longer than necessary. Learning the mathematics behind algorithms allows students to create efficient steps in their programs. (schmidt, 2008)
6. Automata theory
Problems in computers are much bigger than just counting and algorithms. Automata theory studies problems that have a finite or infinite number of potential outcomes of varying probability. For example, computers trying to understand the meaning of word with more than one definition would need to analyze the entire sentence or even a paragraph. After all the counting and algorithms on the sentence or paragraph are done, rules to determine the correct definition are needed. The creation of these rules is part of automata theory. Probabilities are assigned to each definition depending on the results of the algorithm portion for the paragraph. Ideally, the probabilities are just 100 percent and 0 percent, but many real-world problems are complicated with no certain outcome. Computer compiler design, parsing and artificial intelligence make heavy use of automata theory. (engineering, 1963).
Figure 5: math is theoretical foundation of computer science
7. Programming Math
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
7.1 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 is 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. (salman, 2012)
7.2 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 is 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.
7.5 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 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.
7.6 Significance
Mathematical operations at higher levels, including mathematical modeling, involves using computers in testing the operations and the system theories. The more involved computer technology gets, the more deep mathematics are required. Often computer companies seek out math majors.
7.5 Features:
Mathematicians use computers to test predictions and models and to analyze data. They use computers with mathematics to create new algorithms. Mathematicians also use computers to work in fields such as cryptography--code breaking and making--and in biotech research
8. A final word on computer programming math
Whatever a computer does, it is always using mathematics. Whether a user is downloading and storing family pictures or playing a video game, computers will be using math to perform its required tasks. And the computer programmer is the one who will tell the computer how to collect and use the data that it receives and sends.
Figure 6: we trust on computers because of math
9. Conclusion
Every computer programmer uses math to do operations on variables, to generate charts, to draw graph and uses formulas to count the percentages or simply if you see in computer programming all of them is operations, logic and algorithms so mathematic is the main and core component of programming as an example you cannot code any program for a bank with mathematic operation..
And finally if you look deeper computer technology is nothing but binary digits or zeros and ones.
Bibliography
engineering, m. u. (1963, 6 12). Automata Theory: Advanced Concepts in Information Processing Systems. machigan, machigan , united states of america: machigan university of engineering. Retrieved from fazil.rasekhoonblog.com: http://fazil.rasekhoonblog.com/show/192290/
Liang, Y. D. (2013). Introduction to java programming (Vol. ninth edition). San Francisco, united states of america: Armstrong Atlantic State University.
schmidt, v. (2008). the algorithm of success. united states: valerie schmidt.
webmaster, p. t. (1990). Looping Techniques. Retrieved from http://docs.python.org/: http://docs.python.org/2/tutorial/datastructures.html#looping-techniques
