Saturday, December 14, 2013

Scientific Computing: Crowdsourcing

Computers are valuable to science because they can simulate scientific models. All computers have the potential to do this, so you don’t have to be a scientist to help science. Crowdsourcing is using the computational power of the public to solve a problem. I will be covering two projects that use crowdsourcing successfully.

There are some things computers aren’t good at, like folding proteins. So Foldit was designed as a game where you get a high score by folding proteins into as small of a space as possible. By helping the computer fold the protein, you help solve problems that contribute towards HIV/AIDS, Cancer, and Alzheimer’s research. Players have already discovered a new algorithm for folding proteins by playing this game.

Sometimes computers are good at solving the problem already, but there is too much data for a single computer system to handle. Einstein@Home uses crowdsourcing to go through data collected by gravitational wave detectors in order to look for “evidence of periodic sources (such as spinning neutron stars), which would be the gravitational equivalent of pulsars.” By downloading and running their program, you can help scientists make discoveries in gravitational physics.

All computers have the capability to do scientific computations. Using crowdsourcing, the average person can now aid science in making new discoveries.

Saturday, December 7, 2013

The Evolution of Computer Graphics

Computers help us get things done faster than ever before, but it also helps us procrastinate like never before. Video games were born on computers. Even modern consoles have computers inside them to compute what to put on the screen. We got to modern, photorealistic video games by starting with the basics. Here’s a short summary of the major technical revolutions in computer graphics:

Text Based Games
The first video games for computers were played by typing in commands to move around the environment. Even though this hardly resembles computer graphics, the machine had to figure out what pixels to light up when displaying fonts, and keep track of where you were in a virtual environment. The example on the left is Star Trek Text Game. You move around the grid and fight Klingon ships by firing torpedoes. Hardcore gamers today would call it boring, but back in the day people would play this game for hours.

2D: Platform Games
Platform games were the first to gain massive popularity. Who hasn’t heard of Mario from Mario Brothers? To play them, you control an “an avatar to jump between suspended platforms, over obstacles, or both to advance the game.” (Wikipedia) This requires the computer to process a lot of information. To make it even harder, the games were often in color. Figuring out the equations to get these games working is tough, and teams of programmers could take months to get it all done.

3D: Modern Games
This includes everything you are used to calling a video game. The computer must think in three dimensions, calculating the physics of how things move when they are hit or fall. At this stage, video games become super realistic and visually appealing. There is so much processing involved that high-end video games may require a video card that costs more than an average computer. It may even require two. But when you get in the game, it’s worth it.

Virtual Reality 3D: Oculus Rift
Any modern 3D game can be turned into a 3D image through video card driver software. It just involves rendering two frames instead of just one, and the second is taken from a slightly different point in space to emulate the spacing between our eyes. These two images are sent to an immersive virtual reality device, like an Oculus Rift, so that your entire vision is filled by a 3D video game. In the future, video games can be programmed just as they were in the past, and the viewer gets to see it in immersive 3D.

We went from text games to immersive virtual reality, and the processing power required increased exponentially. No one knows what the next technical revolution in computer graphics will be, but judging by our past, I can’t wait.

Saturday, November 30, 2013

Communications and Security

People communicate many things many different ways. But unless you are talking face to face, chances are you are using a digital device to communicate. Whether you are using a phone to call and text, or a computer to chat online, you can never be sure of your privacy when you are using electronic devices. Here are some types of communication and their threats to your security:

Safest Method: Talking Face to Face
The safest way to communicate private information is to do so without using technology, but there are still ways for others to infringe on your privacy when talking face to face. First, you must make sure the room is secure. Many places have video cameras and what you say can also be recorded relatively easily. That cell phone in your pocket might also be listening in. There is software that allows hackers to take over your phone and record audio without the your knowledge. It’s hard to know if this is happening to you, but your best bet is to take out your cell phone battery or leave it in another room.

Next Best Thing: Encrypted Messages
Cryptology offers the math to make sure that the only the intended people can decrypt private messages. Using asymmetric and symmetric encryption at the same time also allows for the keys (which are required to make sense of the encrypted message) are only known by the sender and recipient. By making sure that you use software that is TLS/SSL compatible, you can be almost certain that your privacy is safeguarded. However, communicating using technology opens the doors for another threat to your privacy. Because computers must know where to direct the messages, others can see the Meta Data that is sent with your encrypted message. Meta Data is information about the sender, recipient, and time the message was sent. Meta Data is not the actual message, but it can still say a lot about what you are communicating. Lets say you needed to leak information about illegal activities being committed at the company you work for. If you were to send an encrypted message to the press, the company you sent it from wouldn’t know what you said, but they would know that you communicated with the press. After the news story hits, they would be able to figure out that you leaked the information.

Gaining security when communicating can be very hard. Even when talking face to face with someone you must take precautions. It gets even harder to communicate privately when using a digital device.

Saturday, November 23, 2013

Artificial Intelligence: Teaching Robots to Learn

Imagine how hard it would be to write a program for a robot to walk. There are just too many factors involved to have one distinct solution that always worked. Instead, researchers have found that it is easier to treat the problem the same way humans do: through learning. Using positive reinforcement techniques, the robot only needs to be programmed how to learn, not how to do the specific task.

This poses a new problem: how do you teach a robot how to learn? It’s actually easier than you think. Because the human brain works on reinforcing neural connections, learning is as simple as doing random things and repeating what works. Psychologists call this technique positive reinforcement when talking about humans, but it can also be used to produce an artificial intelligence.

Positive reinforcement can be used for anything, even to teach a robot how to walk. Much like a baby, the robot would spend most of its time doing random things instead of walking, but as soon as it randomly takes a step without falling it would be rewarded. It may not walk immediately after. But after receiving a virtual reward for the steps it did take, it would be more likely to attempt walking in the future.

This concept is easier to demonstrate with a simpler task. Imagine you wanted to teach a robot to choose a blue square when shown several color options. The first step would be programming the robot to make use of positive reinforcement. After that, it must learn to do what you want.

Imagine a choice of four squares.
  • Yellow (25% Probability)
  • Green (25% Probability)
  • Red (25% Probability)
  • Blue (25% Probability) 

At first, much like a human who has no idea what the end goal is, the robot guesses a color (with equal probability). If it’s not blue, nothing happens and the process repeats with all options possible. No reward, no learning. But eventually (most likely in the first four random guesses) the robot will randomly choose blue.

The robot is virtually rewarded for this choice (the equivalent for humans might be a small piece of candy). At this point everything changes. The robot becomes more likely to choose blue in the future, as any human would. Now the probability for picking each color changes:
  • Yellow (22% Probability)
  • Green (22% Probability)
  • Red (22% Probability)  
  • Blue (34% Probability)
If this process went on for a while, it’s obvious that in the end the robot would learn to choose blue 100% of the time, demonstrating the success of positive reinforcement learning. This approach to programming can also be used for software, where the learning game of choosing a color, or learning how to walk, can be done virtually. That way, the computer could do thousands of simulations a second to solve the problem.

Hopefully, this article has made you think about how robots and humans learn, and how positive reinforcement can be used in programming and robotics to come up with innovative solutions for the future.

Source: Personal Knowledge

Wednesday, November 13, 2013

History of Computer Science

Computers have advanced far beyond what was thought to be possible by their inventors. Every step of the way, Computer Scientists have been focusing on different topics. To illustrate the history of Computer Science, I will focus on major revolutions in computer technology.

Punched Cards
Punched Cards are stiff pieces of paper with holes in particular areas that signal a command or instruction for the computer to do. The first computer programs were written by constructing large stacks of these punched cards to convey to the computer a series of instructions that were to be done in a certain order. Punched cards allowed computers to be given instructions that weren’t hard-wired into the computer’s architecture. The result was the birth of computer software.

Command Line
The first step towards the modern computer was the ability for computers to understand commands that were entered from the command line terminal. This marks the first time that computers became dynamic. When turned on, the computer would eventually wait for the user to type something in. Depending on the command, the computer could run a program, make a new folder, and so on. This piece of history is still part of modern day computers, and nearly everything you can do in Windows Explorer or Finder (such as making a folder, copying files, renaming files, etc.) can be done through the Windows Command Prompt or the Terminal application on OSX.

Graphical User Interface (GUI)
The first computer designed for home use was the Xerox Alto (shown on the left). Suddenly, ordinary people could control computers. Copying a file could be done with a drag-and-drop interface, instead of a long complicated command typed into a command line interface. A GUI makes computers more intuitive to use, and a mouse allows you to click on specific windows and move them around. These tasks would be almost impossible to do from a keyboard. This revolution allowed operating systems to evolve to Windows 7 and Mac OS X.

Multi-Touch Screens
Although developed long before they became popular, multi-touch screens allow for an even more natural way to interact with computers. Instead of manipulating a mouse until the cursor was in the correct location, then clicking, a simple tap on the screen became the way to control what happens on the screen. It also allowed for more than one finger to touch the screen at the same time, allowing software to be designed for multiple cursors and develop gestures. This technology allowed for the development of the Apple iPhone, iPad, and Microsoft products like Windows 8 touchscreen tablets. It also allowed Apple to create multi-touch track pads for laptops, so that three and four finger gestures can control the computer.

The history of computer science entails much more than what I focused on today. Still, I think the revolutions in technology are the most important part of the history of computer science, because it made computer scientists think in new ways. We have much to be grateful for, as our advanced modern computer experience was only made possible thanks to these revolutions in computer science.

Wednesday, November 6, 2013

File Sharing: Copyright Enforcement vs. Freedom of Information

Popular Resources for Downloading Copyrighted Material
File Sharing is necessary for collaboration, sharing ideas, and making computers dynamic. If you define file sharing as sharing information or data, it can include browsing the Internet, chatting with friends, and sharing pictures. File Sharing is essential to modern life, and most people see a computer as nearly useless when it is not connected to the Internet.

Many files can be shared without limitations, but some data is copyright protected. Because the Internet was fundamentally built to share any kind of data, you run into a problem with people sharing files they aren’t supposed to.

Copyright infringement leads to people getting proprietary data like music for free. If they had paid for it, the music industry would have collected an estimated $12.5 billion more. This leads to a $2.7 billion reduction in workers earnings and a loss of 71,060 jobs. But it doesn’t only affect music. The software industry estimates a $59 billion loss due to online piracy because 42% of all software in the world is pirated. That’s nearly 5 times what the music industry is facing!

Obviously, copyright infringement is a major problem that can lead to huge impacts on the economy. Some say that copyright laws should be rewritten to reflect modern society. Some say that file sharing should be more restricted and filtered in order to prosecute those engaging in online piracy. But if file sharing is to be restricted, just how much is enough? When do you cross the line?

It should be noted that we have the right to share data legally, without our private information being spied on.  But allowing everyone this simple right makes enforcing copyright laws too difficult to pull off.

Due to modern laws, when you store data on Google Drive or Dropbox, the company hosting your data has an obligation to remove copyrighted material upon request and give the NSA access to your data (when court ordered) so that it can be stored and analyzed for future prosecutions. Thus, our rights to freedom of information and storage of private data have been denied in the name of copyright enforcement.

BitTorrent is the most often used Peer-To-Peer file sharing program used by people sharing copyrighted works. But it has a major flaw: your IP address can be used to prove that you are downloading copyrighted material. Major film, music, and software companies have started to download their own copyrighted works in order to capture the IP address of everyone that has the file. They look up what Internet companies are associated with that IP address in order to threaten companies like Comcast with lawsuits if they continue to let it happen. Comcast then sends an email to the primary account holder saying that their account was used to download copyrighted content illegally. If the downloader is accused of illegal downloading too many times, Comcast will terminate their service (in order to avoid a lawsuit). If the downloader gets five or more notices, the proof goes to the FBI for prosecution.

It would seem that this system should discourage online piracy. But instead it has convinced those illegally downloading copyrighted material to switch Internet service providers to smaller companies that throw away these notices.

But whenever copyright enforcement solutions are implemented, the piracy community comes up with new ways to thwart detection. The biggest threat to copyright enforcement has recently been released. The creators of the BitTorrent network have released a new file sharing protocol named BitTorrent Sync. Marketed as a competitor to Dropbox, it is a distributed, encrypted, and completely undetectable way to share files and folders with others. Simply create a new, sharable folder and upload any file to it, and with a simple link anyone else can download the file securely, without anyone (including the NSA) knowing what file they are downloading. Although less popular than regular BitTorrent, BitTorrent Sync already has over one million active members. It is also built with a decentralized design so that it cannot be taken down by the government or any Internet service provider.

In the next five years, I predict an end to copyright enforcement, triggering massive changes in copyright law. Will this hurt musicians, programmers, and movie producers? I think not. The end of the copyright battle may even have positive outcomes. Software developers will be forced to innovate and update their products frequently, with patches to discourage piracy as well as new features to justify the upgrade. Film companies will have to produce movies that justify the cost of going to see it in a theatre. Musicians may even have to distribute their music for free (or low cost), while urging the listeners to donate or pay for concerts and merchandise. In the end, I think both sides win. The people get safe and private file sharing, while enjoying superior content from copyright producers that justify the cost of paying, instead of pirating, their content.

Wednesday, October 30, 2013

Data Structures: How Computers Make Sense of what they Store

A Data Structure is an object that defines how data will be stored in memory on a computer. Data Structures are made up of data types and names/labels. A data type defines what information can be stored and how data is read by the computer. The label is used to reference the data structure later in the program.

 In C++, for example, you can define your own Data Structures using the struct keyword:

struct student {
int StudentID;        <- An integer number
float GPA;             <- A number with a decimal point

(In this case, int, float, and student are all data structures because they all define how the data is stored.)

In this example, a Data Structure for a particular student is defined. There is a lot of data that is used to describe a student. The computer needs to be told how to store this information, and in what order. By defining a Data Structure you tell the computer how to parse information stored in memory into meaningful data, and you assign names to each of these to be used later. This is important because computers store data in binary, which represent numbers.

Each individual digit of binary is called a bit, and there are 8 bits in a byte. You can store one large number using 4 bytes (using int, and taking up 32 bits), or 4 small numbers (using char, taking up 8 bits each) in the same amount of space. The computer needs to know if the next 32 digits of binary are going to be used to represent one big number or four small numbers in order to determine what gets called StudentID. Without a Data Structure, the computer can’t tell what the StudentID is.

In our example above, the student ID is defined by a 4 byte integer data type, which is defined to be 32 bits that represent one large number:

00000000 10001011 00001001 10111111  =             009111999

If the computer looked at the same data expecting 4 small numbers, you would get:

00000000 10001011 00001001 10111111  =             0, 139, 9, and 191

So you see, the same data can mean completely different things based on how you read it. That’s why it’s important to define how a computer stores information and what to label it as, and that’s what Data Structures do.

Data Structures also solve a major problem with writing programs that store data about objects with multiple traits. If you needed software to store student records, what would you call each piece of data? Without data structures you could label each piece of data individually:

$student1_name = "John Done";
$student2_name = "Jane Doe";

$student1_num = 009111999;
$student2_num = 009112999;

But how would you list the names of all the students? It would be very difficult. You would have to know in advance what students to list and how many there were, then write code like:

print $student1_name, $student2_name, $student3_name, $student4_name ......

But what if you had to list the first 1000 students? Without Data Structures, you would have to write a very long and complicated program. To solve this problem, we can use one of the most simple Data Structures, an Array. Arrays are lists of objects with the same data type. Using Arrays, we could write a simple solution to output all the names using a loop, because there is only one label for the entire list:

for(int i = 0; i < 1000; i++){
    print $student_names[i];

This is a much better solution than listing 1000 different variables to output. There are more advanced Data Structures than Arrays that make storing and accessing data much faster. You can read more about them at Hopefully this simple explanation has helped you understand the problems programmers face, and how they overcome these problems using Data Structures.