Archive for the ‘Today I want to be’ Category

Where’s the Math in Computer Science?

Today’s guest blogger is Kenrick Mock, Associate Professor of Computer Science from the University of Alaska Anchorage. Kenrick writes a blog called Teaching, Technology, and Learning.

As a computer science instructor sometimes a student will ask me why math is required for a CS degree. At the University if Alaska Anchorage we require Calc I, Calc II, and discrete math for all of our Bachelor of Science CS majors. I think one of the reasons for this question is that there really isn’t much direct math content in the introductory CS courses aside from the occasional algebraic equation and an understanding of exponents and logarithms for the data structures course. Nevertheless, I think one of the misconceptions that students have is they equate computer programming with computer science. It is possible to be an excellent programmer with only basic math skills (one example is the Information Systems degree) but computer science is more concerned with the science behind the construction of hardware and software systems. This scientific foundation is based on mathematics. With this in mind, I’ve outlined below several ways that math is important to a budding computer scientist as he or she works their way through a CS degree.

1. Mathematical Maturity and Problem Solving
College Algebra is prerequisite for our CS1 course although we only have a little bit of direct algebra content. However, college algebra is important to develop the maturity to solve programming problems. A big part of programming (and computer science) is not the construction of code but the process of problem solving. For example, one of the problems I give in my CS1 class is to write a program that can solve the problem below,where each letter can be a digit from 0-9 and no two letters can have the same value.

Solving this problem requires more than just understanding what a loop does and how to write if-then-else statements. The student must know how to break this problem up into appropriate algorithmic steps so that a program can be written to solve each step. This type of problem solving is similar to algebraic word problems given in math classes, and some CS education researchers have suggested that students that struggle with planning and problem solving in math also struggle in CS classes. More directly related to programming, many programming languages are based on functions, a concept similar to mathematical functions. Similarly, the concept of variables and variable manipulation is also closely related to mathematical variables.

2. Computer Hardware and Low-Level Software
An understanding of Boolean algebra and various number systems (base 2, 8, 16) is critical to represent and manipulate data. Computer instructions and data are represented in binary and it is common to map values between binary, decimal, and hexadecimal. Boolean logic is necessary to understand how basic circuits (e.g. AND, OR, NAND gates) operate. Such low-level detail is often hidden by software abstractions in today’s programming languages, so it is possible to be an excellent programmer with minimal knowledge of the underlying hardware and software. However, these topics are a part of the computer science curriculum.
3. Design and Analysis of Algorithms
A programmer quickly learns that there many ways to write a program that solve the same problem. The most obvious solution is not always the most efficient. For example, sorting a list of N items using the Selection Sort algorithm requires a number of steps proportional to N2 but if the Heapsort algorithm is used then the number of steps required is proportional to N*Log2(N). This is referred to as the runtime of the algorithm. With a large list of items the difference is significant; Heapsort will run much faster. While an understanding of exponents and logarithms is all that is necessary to get the big picture, determining the runtime requires an understanding of recursion and the ability to solve summations. Here’s a sample summation that describes the runtime of one algorithm:

Solving this summation indicates that the algorithm requires a runtime proportional to n steps.
4. Computer Theory
The computer science theory course describes what is possible to compute and is closely related to discrete mathematics. Topics include finite state automata (commonly used to model the “intelligence” behind computer players in games), grammars (used to describe programming languages), and Turing machines (analogous in power to a modern computer). These tools are all mathematical in nature and often rely on inductive proofs. For example, the concept of NP-Completeness allows computer scientists to determine how “hard” a problem may be which has implications on the efficiency of possible solutions. One of my favorite examples involving grammars is the Lindenmayer System which can be visualized as a plant-like structure:

5. Elective Specializations
Various upper-division elective courses also include mathematical content. For example, in an artificial intelligence course involving neural networks (used for a variety of machine learning tasks), the output of the network is typically computed using a sigmoidal activation function, which is loosely based upon the behavior of neurons in actual brains. The function to perform the actual learning in the network is derived from taking the derivate of the error function – hopefully you still remember your calculus! Other techniques in artificial intelligence also rely heavily upon statistics.
Another example is computer networking. Data across a network is split into packets and routed from the source to destination. The routing is based on graph theory, a sub-discipline of mathematics.
The subject of a program may also require some math. This scientific research project ( modeled the behavior of killer whales using models based on logistic curves, probability, and non-linear differential equations.
6. Computer Graphics
Lastly, perhaps one of the best examples of math in computer science is the generation of computer graphics. Computer games are a great example. Here is a screenshot from World of Warcraft:

How is the world drawn? How can a program tell if a projectile hits a player? How can a program determine what is visible and what is not? The solutions to all of these questions are based on math, in particular, principles of geometry and linear algebra. For example, objects in real-time 3D graphics games are typically decomposed into thousands of polygons, usually triangles. These triangles are positioned, rotated, and scaled on the screen to conform to the particular 3D scene. So if you want to become a 3D game programmer, you will need to learn some advanced mathematics.
7. Conclusion
Although math may not appear to be necessary for introductory computer science classes, it is still necessary for logical thinking and problem solving. As a student progresses to more advanced computer science classes the math prerequisite becomes more apparent, especially when covering topics involving the science behind computing as opposed to programming.



Possibly Related Posts:


Today I want to be a Chemist (3)

As I was watching videos on YouTube about the Large Hadron Collider, this series of videos called The Periodic Table of Videos caught my attention. I am sharing the video of Antimony with you (Antimony is the name of my avatar in Second Life) here:

What would the math equivalent of the periodic table be? We have sets of numbers, theorems, functions, and rules, but what interesting, unifying element (note the pun) could you build a set of videos around?

Possibly Related Posts:


Today I want to be a phyicist

Just to use this video on the first day of class!

Possibly Related Posts:


Today I want to be a Biologist (II)

If only to use this quirky video on Protein Syntheses from the 70s, complete with interpretive dancing, music, poetry, and poofs of smoke!

Of course, if you never read the original “Today I want to be a biologist…” that video is stunning, find it here.

Possibly Related Posts:


Today I want to be an Astronomer…

What’s the likelihood of stumbling across two kickin’ applications on astronomy in one day? Apparently, pretty good.

The first application I saw was released on TED Talks this week – a program called Worldwide Telescope – and an application by Microsoft (if you can believe that). The application must run on the same software platform as Photosynth (Seadragon). Worldwide Telescope will eventually be housed on the Internet at (not much there to see yet).

The second application is called Google Sky (launched today). This application has the advantage of being “live” right now. So you can go play immediately, zooming and panning through the sky in the same way you navitage in Google Maps.

If you haven’t seen Photosynth yet (previewed to a stunned audience last at TED last year), it’s an amazing application of trigonomety, the Internet, and computing power (view the TED Talk on Photosynth here and go to the Photosynth website here where you can try out a “preview” of Photosynth).

Apparently, I now have a feature series (like Technology Reviews) called “Today I want to be a …” (I figure four blog posts by the same title is a series). The previous posts in the series are:

I know that Pi-Day is tomorrow, and I should be excited to be celebrating a math holiday, but honestly I feel a little down. Where are the cool “explorer-style” applications for mathematics? Is the TI N-Spire supposed to do it for me when I’m comparing it to stuff like this? This is exactly the kind of feeling that led me to get three degrees as an undergraduate (math, chemistry, and biology … thanks for asking). Math, even with the cool applications that we have available to us today, is simply not as engaging at the lower levels as the sciences. I doubt very much that students go to Wolfram Demonstrations to “explore” concepts. Nobody logs in to MyMathLab, WebAssign or WebWorks just to “play” with the mathematics they are learning.

  • Maybe Wolfram can create an interactive galaxy of Wolfram Demonstrations (similar to Jonathan Harris’ Universe), where the “constellations” are mapped out through similar topics connecting the WDs or a TED-style interface for browsing? Only let’s just make all the demos “live” and not hidden behind a download and player.
  • Maybe Apple can make a touch screen calculator capable of graphing in COLOR with easy zoom and pan options at the touch of a finger and functionality for exploration where every option isn’t buried under a series of 5 menus (hey – if they can put EA’s game Spore on that phone, it’s certainly not out of reach).
  • Maybe the monotony of algebra and precalculus can be absorbed by an online virtual world where students learn through puzzles and concept-oriented games (sorry DimensionM – I’ve played you, and you’re just not ready for the College crowd – too much game, not enough content).
  • Maybe math teachers should act as roving content instructors – showing up at science, business, and computer classes to conduct “just in time” math teaching and working with other instructors to seamlessly integrate content into the rest of the curriculum.

I don’t know what the answer is, but I’m tired of longing for the great educational tools available in other fields. If we all push together, maybe by NEXT pi day, I’ll have something more exciting than pi to be excited about! All together now … let’s push our way into the 21st century with the power of Web 2.0.

Possibly Related Posts:


Today I want to be a Chemist (2)

Anything that illicits me saying, out loud, “NO WAY!!!” is, in my opinion, worth posting here. And today is that day for chemistry. You may recall that I do occasionally deviate into cool chem and cool bio posts.

Without further adieu… here is a chemistry video from second life that can build a 3-D molecular model from the InChIKey code.

The video is by Hiro Sheridan. His site, containing flickr photos are worth a look as they show the Chemistry SN island in 2nd Life … complete with a presentation stage including deck chairs, wouldn’t this be a nice way to attend math talks… hmm… maybe if I am granted a sabbatical I’ll get to work on a Math island – on second thought, maybe MAA, AMS, or AMATYC will do it for us. Any takers?

I particularly liked the photos of the chemist with goggles (goggles up or goggles down?)

I hope Hiro doesn’t mind my reposting of gifs of a few of these images, as I am sending you to his flickr site too to view the whole set (there is more than one page).

This week I just desperately feel like I NEED MORE TIME!!! I will never catch up with technology … does anyone else feel this way? Are we even remotely training/encouraging faculty in higher ed to “deal” with this new online/Web 2.0 environment? Do the majority of faculty (and students) even realize this stuff is out there? It’s like we’re in a science fiction world but the majority of the population doesn’t know it yet.

Possibly Related Posts:


Today I want to be a Chemist…

Okay, okay, I know… this is a blog for math and technology. But occasionally I have to stray just a little. I do have a degree in Chemistry too… so I am allowed!

This is totally the coolest interactive periodic table website I have ever seen! And it was created with Mathematica (believe it or not).

Surely you could use the data provided with each element for some kind of math problem? Or you could show your students the appropriate chemical element if it shows up in a word problem.

P.S. I found this site on the Wolfram Blog… which you might want to check out yourself!

Possibly Related Posts:


Today I want to be a Biologist…

Wait… technically I am a biologist (at least by one degree)…

Follow this link to watch the movie and read about the collaboration between Harvard University and XVIVO that created the movie.

Interested in seeing more? Poke around the XVIVO websiteand you’ll see more of their biology animations. (Click on Animation)

Also, if you suddenly find that you want to understand some of the biology that you see in the video, watch the segment on ABC News about parts of the movie.

Possibly Related Posts: