Sunday, March 19, 2017

Building robots with dynamic walking abilities

It’s often thought that Computer Science is only related to personal computers and learning how to code. However, computer science is a broader field than that. Computer science plays a key role in all our lives. From security, to algorithms, to networks etc. Computer science, even extends its effect to our future through the study of robotics, artificial intelligence and motion planning. I, personally, am passionate about motion planning and robotics.
To begin with, let me start by explaining the theoretical side of designing a robotics system that’s bounded by a set of variables. The process is based on trajectory optimization and randomized motion planning. Theoretically, we should be able to solve any complex systems using that process. However, in reality complex systems don’t behave as nicely and trajectory optimization doesn’t work as it's hoped.
Complex systems are the ones that involve limited control authority and non-linear, making them tough to discretize well. So, simple dynamic programming methods such as evaluating variables with a couple of equations and proofs fail to deal with the robustness of a system. It also can’t deal with the large discretization errors that are difficult to bound.
What’s the alternative?
The alternative starts from our experience with robust control on motion planning. For instance, fighter jets managed to manipulate linear systems for great results in stability. Furthermore, the lecturer argues that we could benefit from that experience, and build on it to deal with multidimensional systems.
Many approaches try to address multidimensional systems. Main approach, and the one the lecturer argues for, is based on lyapunov function.
Lyapunov function based approach
Lyapunov functions behave as better methods for calculating functions with complex uncertainties. Instead of trying to tackle complex systems with just differential equations. Since, lyapunov functions are based on the generalization of energy and finding a positive scalar function to relate the variables to. To illustrate all of that, let's think of a really simple machine, the pendulum. We can't just usea physical equation for the motion because it won’t be able to account for the uncertainty nicely. So, we could  use lyapunov function to picture the graph of the pendulum’s motion. Then we look for the fixed points and the recurring patterns for a more accurate local analysis.
What made lyapunov functions more appealing approach nowadays is how simple it has become to find one using bilinear optimization.
The Lyapunov-function approach in practice
Lyapunov functions are not alternative for mathematical equations in our system. The whole idea behind lyapunov functions is to make the equations simpler to understand, and to reduce the effect of the uncertainty. Furthermore, lyapunov function approach is applied in practice using funnels with calculated values for the differentiating variables, and with motion the properties of the funnels are edited accordingly.
The lyapunov approach still requires a lot of planning and is still difficult to implement for runtime constraints. That being said, the lyapunov approach was able to combine the combinatorial complexity from motion planning to the dynamic complexity from lyapunov, which eased dealing with complex real-life systems, and enabled practical feedback design.

Lastly, Lyapunov approach also paved the way for many new ideas to be tried out such as rational polynomial approximation and many more to come.
  

Friday, November 25, 2016

Algorithmic efficiency

The efficiency of a computer user algorithm  is a topic of obvious practical importance .In computer scicne , there's always multiple ways to do any simple question and they will all work without any compile errors, if they're coded correctly.However,it's also Important to consider how efficient each way is interms of performance and productivity.

Algorithmic efficiency in computer scicne is defended by Wikipedia as the properties of an algorithm which relate to the amount of computational resources used by the algorithm.
So as the definition suggest , algorithmic efficiency is looking at the software in terms of how it's using all the resources available.Is it using all the memory for nothing ? Is it doing processes that are extra load ? 




Algorithmic efficiency relationships
 
By answering all these questions,a developer will be able to produce the most efficient algorithm that should have the feature of being:
General: An algorithm that works with more than one similar problem so it's not only limited to solving only one.
Concise: An algorithm that doesn't repeat itself without any reason or a one that uses every method for a reason. 
Expandable: An algorithm that can be improved up on and updated throughout time so it should be understandable for other developers too.

Algorithmic efficiency is something that has been introduced into computer science since the it's early days and it has been with it since then because it's such an essential element for developing a useful and efficient program 

References:
1-https://en.m.wikipedia.org/wiki/Algorithmic_efficiency
2-https://apelbaum.files.wordpress.com/2011/10/yaacovapelbaumbigoplot.jpg

Friday, November 18, 2016

Trees

This might sound like it's an article not related to computer science,but in computer science trees refer to an advanced data structure concept that's very useful for ordered collections and the way we represent them in coding.

What's a tree ?

Wikipedia defines a tree as a widely used abstract type(ADT) can be defined recursively (locally) as a collection of nodes (starting at a root node), where each node is a data structure consisting of a value, together with a list of references to nodes (the "children"), with the constraints that no reference is duplicated, and none points to the root.

What are some properties of a theoretical tree?

Much similar to plants, data structures trees have some properties that specify them.Some of these properties are:
1-Height :the length of its longest path or the deepest depth 
2-Depth:the length of its root path
3-Path length:the sum of the depths of all nodes
4-Width:the size of the largest level 

How's that connected to programming ? What's a binary tree?

It's an ordered tree in which every internal node has two distinguished subtrees.
Binary trees are more important than general trees or unordered trees because they have a pattern that works with the machine language(0s and 1s),so that's what makes a binary tree one of the most widely used internal data structures in computing 



Some applications of binary trees ?

1-Binary search trees :a binary tree in which for each key in the tree, all the keys in its left subtree are less than it and all the keys in its rights subtrees are greater than it.
2-Fibonacci tress:built on the same structure of the Fibonacci numbers that we took earlier in the semester 

3-AVL trees :a binary search tree that maintains its balance by forcing the two subtrees at any node to have nearly the same height.This is done by rotating subtrees whenever an imbalance occurs through an algorithm

References:
1-https://en.wikipedia.org/wiki/Tree_(data_structure)
2-https://upload.wikimedia.org/wikipedia/commons/thumb/f/f7/Binary_tree.svg/220px-Binary_tree.svg.png
3-https://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/pix/binaryTree.bmp
4-https://upload.wikimedia.org/wikipedia/commons/thumb/e/ea/Fibonacci_Tree_5.svg/372px-Fibonacci_Tree_5.svg.png
5-https://www.cs.auckland.ac.nz/software/AlgAnim/fig/AVL1a.gif







Friday, November 11, 2016

Computer graphics in Object Oriented Programming

In the last couple of weeks, we've been talking about the idea of object oriented programming and how it eases applying major ideas that could be impossible to do without organizing the idea into separate objects that interact together.One of these applications is computer graphics.

What's computer graphics ?

In general ,Computer graphics is the science and art of communicating visually via a computer’s display and its interaction devices. Computer graphics is an explosive and complex field ,with rapid advances in both theory and practice ,so instead of changing the whole API an alternative is implementing a highly adaptable organization built on objects by creating separate files for every function needed.

Why would we combine computer graphics and object oriented programming ?

Combining saturated graphics with object oriented programming is essential  allows programmers to conveniently construct interactive displays and it's object oriented programming interface (API) allows these structure to be easily reused and extended,thus allowing more flexibility to model application-specific graphics, which allows non-expert programmers to create creative apps without having to build the whole code on their own.

Are there any things that we have to keep in mind while using computer graphics ?


Of course,for a computer scientist to manipulate object oriented programming to use extensive graphics, he/she has to make sure to be careful to most of the details like resolution, transition,pixels,file types, coordinate system , booleans ,transition and vertex because without taking these into consideration, it will end up to be a big mess.

Lastly , a great example go computer graphics in object oriented programming is StdDraw which we have been using since the second weekend maybe the 1000 lines it had seemed scary back then and still confusing till now, it doesn't matter anyways because we only have to know how to implement it.
A product of StdDraw
References:
1-http://www.cs.cornell.edu/courses/cs4620/2010fa/Competition/img/1/8.jpg
2-http://www.cis.upenn.edu/~cis110/14su/hw/hw03/gallery/juschang-4.png

Monday, October 31, 2016

where computer science and biology meet...

It's thought that biology and computer science don't have anything in common, but that's entirely a false accusation because surprisingly computer science benefited from biology you can check my previous blog about DNA computing for more details about that. Moreover, biology wouldn't reach the stage it did today without computer science since now we've already figured out what every gene does! This strong connection resulted in the creation of many interdisciplinary fields, one of which is computational biology.

What's computational biology? 

In general, Computational biology is the application of computers and computational techniques to biological data. It's definition is extended to cover a wide range of applications from data basing of fundamental datasets such as protein and DNA sequences, and even laboratory processes, to sophisticated analyses such as the modeling of protein structures and cellular networks. Areas related to that include Neuroinformatics and Medical informatics too which are the areas of modeling nervous systems and medical data sets  

What's needed for computational biology?

Data structures: This is one of the most essential parts because without organizing the data you collect in a uniform way you won't end up with any patterns to work with in the first place and it would be all just a huge packs of data that aren't useful enough. For example, when collecting DNA sequences, we have to make sure the samples won't be mixed up when inputted and it will be all organized, and the machine should be able to find out what part of our data look similar to each other? 
Data processing & Machine learning: The next step would be to use the patterns collected and make sense out of them, so an example would be connecting the animals that have symmetric features and labeling them according to that. 

Is computational biology the only field that connects the dots between computer science and Biology?

No, there are many other fields that require this connection, like bioengineering, computational evolutionary biology and there will be many more in the future quoting what Bill Gates said "Biology is a sister science "I think a lot of the breakthroughs will be made by people who were trained in biology and computer science,"

Is biology the only one that cries for computer science attention ?

It's not only biology out of the sciences that thrives for computer science attention, Physics, Chemistry, Math and even the social sciences benefit from computing too, and there's always an inverse relationship for that because without Math, and Physics there won't be even computers so we need these connections to power up our devices every day but can we evolve out computational methods to live on itself? and if we can what could we get out of that? These are important questions that the leading computer scientists have to think about each and every day!

Picture References :
1-http://previews.123rf.com/images/radiantskies/radiantskies1212/radiantskies121203363/17021260-Abstract-word-cloud-for-Computational-biology-with-related-tags-and-terms-Stock-Photo.jpg
2-http://dhmri.org/assets/PageImage-Bioinformatics.jpg