Graphing Calc Class

Screen Shot of Graphing Calc

In my calculus BC class, we had the option of taking time out of class to go work on building a calculator that can graph original functions and their derivatives. The entire process would have taken a lot less time if I didn’t have to write my own parser on converting a string to an equation, but nonetheless, it was worth the whole work because I was able to overcome a very difficult challenge in my short computer science career.

The Parser converted infix notation, the one that we are typically used to, to postfix notation and then solved the entire thing. Infix notation is where all the operators are in between the operands, and the equation uses parenthesis to define its orders of operation. In postfix notation, the operands are both next to each other and the operator comes after the two variables that it operates on. Depending on the position of the operator, it is easy to determine how the order of operations works in the system.

To set up the graphics program, I used the open source Stanford ACM graphics library. For me, it facilitated the process because I had been using it for most of the summer, and it made the entire process much smoother for me. I had to create a backdrop and draw my own axes, and then create a separate panel on the side where the user can input the function and set the left and right bounds (the screen will always remain a square). Then I let the user define their choice of color using an RGB style.

Plotting the points took an entire algorithm to shift the points onto the screen, but eventually after trial and error, it came out well. I used multiple classes that each handled different aspects of the process, and I was able to completely graph both the first and second derivative by taking very small intervals and finding the slope of each curve.

There still are a few bugs that I need to work out. First, each general function, such as sin(x+2) has its own way of solving within the parenthesis. Instead, the function could simply be recursive and return a numerical value within the function and then solve the function of the number. Next, the algorithm doesn’t continue after the function runs a first time.

There are also ways to make the calculator more aesthetically appealing. However, this is a great first step towards building useful applications in computer science for years to come. And to keep up with the theme, I now am continuing working on my two projects from Carnegie Mellon.

Project Proposal Background

Facebook and Twitter have been using and posting advertisements on their websites for a long time. However, as more and more people have been ignoring their advertisements, Facebook released data linking to its API and allowing researchers for different companies to privately access different posts and walls of people. Facebook allows companies to now tailor specific advertisements to people based on the interests perceived by the company. However, with more than a billion Facebook users, companies can’t fund analysts to look through each person’s wall and determine which product they’d be most interested in. There must be an Algorithm used for this type of project, and I intend to find the algorithm or a similar one.

Algorithms Conference

For me, one of the most interesting parts of computer science is the study of Algorithms. It seems to be the building block of all programs, and I want to delve into the world of Algorithms. I want to go to the Random Approx Conference in Berkeley, which is going to take place on the 21st of August! That’s the day before my birthday!

http://www.conference-service.com/conferences/us/algorithms.html

http://cui.unige.ch/tcs/random-approx/2013/index.php