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


Friday, October 28, 2016

Data Structure

You've probably heard about this topic many times, because let's face it it's an essential field in computing but what does it actually mean ? Why is it so important ? Why can't we have our date represented in computers the same way we represent it in our human lives ?

Data structures is a particular way of organizing data in a computer so that it can be used efficiently. Data structures can implement one or more particular abstract data types (ADT), which specify the operations that can be performed on a data structure and the computational complexity of those operations. 

What are some data structures ?

A- Simple data structures which include: 
   1- Arrays( [] ):a systematic arrangement of similar objects, usually in rows and columns.

B -Compound data structures which include:

     A- Linear : In linear data structures, values are arranged in linear fashion.          Examples of linear data structures include:          1-Queue: a collection in which the entities in the collection are kept in order and the    principal (or only) operations on the collection are the addition of entities ,and removal of entities.        2-Linked list: is a linear collection of data elements, called nodes, each pointing to the next node by means of a pointer
        3-Stack: an abstract data type that serves as a collection of elements.

    B-Non-linear:in linear data structures, values are arranged not arranged in order         1-Tree: it simulates a hierarchical tree structure, with a root value and subtrees of children with a parent node, represented as a set of linked nodes.         2-Graph:is an abstract data type that is meant to implement the undirected graph and directed graph concepts from mathematics.

Why is it essential for computers to have a different structure for data values and types ?

Data structure is a particular way of storing and organizing information in a computer so that it can be retrieved and used most productively. Different kinds of data structures are meant for different kinds of applications, and some are highly specialized to specific tasks.Without,data structures computers wouldn't be able to do anything,because search engines like Google,or intelligent assistants like Siri wouldn't be able to organize data and sort them in an efficient way that would allow the computers to do all the computing needed.

References:
1-http://www.tutorsonnet.com/images/datastructures.jpg
2-http://scanftree.com/Data_Structure/pic.png




Friday, October 21, 2016

Principles of Software engineering

Let me me first start with the question of "What's software engineering ? "Software engineering is the application of engineering to the design,development,implementation, testing and maintenance of software.
Software engineering often does involve writing code, but this is only one stage in the process. True software engineering has a well-articulated life cycle.

What are the main principles in software engineering ?

  1.  Separation of Concerns: the process of breaking a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors.
  2.  Modularity:  a software design technique that emphasizes separating the functionality of a program into independent, interchangeable modules, such that each contains everything necessary to execute only one aspect of the desired functionality.For instance, using libraries and multiple static methods 
  3. Abstraction: is a technique for arranging complexity of computer systems. It works by establishing a level of complexity on which a person interacts with the system, suppressing the more complex details below the current level.
  4. Consistency: specifies a contract between programmer and system, wherein the system guarantees that if the programmer follows the rules, memory will be consistent and the results of memory operations will be predictable.
  5. Incremental Development:is a method of software development where the product is designed, implemented and tested incrementally (a little more is added each time) until the product is finished. It involves both development and maintenance.
  6. Anticipation of Change: Software, even when it is developed and commissioned for production, undergoes changes. When there are changes, additional costs will be incurred. A design goal in software development is to ensure cost is kept to a minimum. One approach is to anticipate where changes are likely to occur and make provisions for the changes during the design stage.

How's software engineering important in our lives ?

Well,without software engineering there will be lack of methodical planning,systemical planning,desing in our codes and more important than that is that our  code won't be ever tested so nothing will work as efficient as we want it to be.For example, below is a screenshot of a code that should function well because it's written correctly.However,it doesn't because it lacks the main principles of software engineering 

References:
1-https://d1wvhegsi0wquf.cloudfront.net/media/uploads/2016/08/03/softwarwee.jpg
2-http://3.bp.blogspot.com/ qW_1AuSbq60/UVRGncteqdI/AAAAAAAAAVo/yWlWCh8Bypk/s1600/software_engineering.png





Friday, October 14, 2016

What's an operating system ?

We deal with operating systems everyday on our phones, laptops,wearables,and even cars, but how does it really work and how can a company code an operating system ?
I will assure you that it's a long process that requires a lot of thinking, and visualizing interactions and how would people feel about it,becuase let's face it none of us would want to go back to Windows 1.0 or the classic Mac OS since they're so hard to deal with and it would take us hours just to write a word document on such an operating system.Oh wait ! you can't even do that because Microsoft office is such a hard program for an OS like the Mac OS X 1

What's an operating system ?

An operating system is the most important software that runs on a computer. It manages the computer's memory and processes, as well as all of its software and hardware. It also allows you to communicate with the computer without knowing how to speak the computer's language. Without an operating system, a computer is useless.

What does it do ? And how does it do it ?

An operating system communicates with the various parts of your computer. It sends information to and from your computer hardware and the desired application or action in order to carry out the tasks you request. The following pieces of equipment are in contact with your operating system:
  • Keyboard
  • Monitor
  • Printer
  • Mouse
  • Disk drive
Your OS receives commands from you through some of these devices and then delivers it to the correct places to process your request.
Operating systems perform the following tasks:
  • Recognize mouse click requests
  • Register keyboard commands
  • Deliver visual content
  • Connect to printers, ports, drives, etc.
  • Organize content
For the part of how does it do all of that, it's related to the engineering of computers they all have BIOS(Basic Input/Output System ) that are connected to the motherboards and every time we turn on our smart devices the bios takes the command and gives the lead to the OS 

References:
1-http://zdnet3.cbsistatic.com/hub/i/r/2015/07/23/db9b07b8-1bd3-4451-9365-7bd336f4d7dd/resize/1170x878/6a5511eafc6e9a454add33945466f8ed/cmwindows1-0jul15a.jpg
2-http://netdna.webdesignerdepot.com/uploads/2009/03/mac-os-1.gif

Friday, October 7, 2016

Speech recognition

With the fast evolution of intelligent personal assistants like Siri and google now ,it's important to know how programs are now capable of understanding what we tell them. 

Speech recognition vs voice recognition 

Speech recognition is the ability of a machine or program to identify words and phrases in spoken language and convert them to a machine-readable format. 
The terms "speech recognition" and "voice recognition" are sometimes used interchangeably. However, the two terms mean different things. Speech recognition is used to identify words in spoken language. Voice recognition is a biometric technology used to identify a particular individual's voice.

How does it work ?


Speech recognition is one of the most complex areas of computer science—and partly because it's interdisciplinary: it involves a mixture of extremely complex linguistics, mathematics, and computing itself
Broadly speaking, there are four different approaches a computer can take if it wants to turn spoken sounds into written words:
  1. Simple pattern matching (where each spoken word is recognized in its entirety—the way you instantly recognize a tree or a table without consciously analyzing what you're looking at)(It's like the scanner in java )
  2. Pattern and feature analysis (where each word is broken into bits and recognized from key features, such as the vowels it contains)(It's like how we use the arrays)
  3. Language modeling and statistical analysis (in which a knowledge of grammar and the probability of certain words or sounds following on from one another is used to speed up recognition and improve accuracy)
  4. Artificial neural networks (brain-like computer models that can reliably recognize patterns, such as word sounds, after exhaustive training)

Why is it so important ?

Because it's making our lives so much easier because now you can just ask your personal assistant on your phone or laptop to look up a meaning or play a song or even do a complex mathematical equation which spares us some time and effort, and trust me you're going to  want to chat with your personal assistant because nowadays they can be sassy, funny,and nice.


References:
1-http://www.and-bmod.com/wp-content/uploads/2015/01/Windows-Speech-Recognition-2-Featured.jpg
2-http://copia.com.au/wp-content/themes/copia/images/medicalspeech.png



Friday, September 30, 2016

Real reality, virtual reality and the master mix

I know that title freaks you out because who used the phrase real reality but due to the many advances in computer vision i believe that it's time to change our view from a broad one to a more detailed one.
As the phrases suggest,real reality is the one that we live in and we were bounded by it until the early 2000s when computer scientists thought about virtual reality and how to manipulate lenses to attract the human mind.


What does virtual reality mean in computer science ?

 Virtual reality is the term used to describe a three-dimensional, computer generated environment which can be explored and interacted with by a person. That person becomes part of this virtual world or is immersed within this environment and whilst there, is able to manipulate objects or perform a series of actions.

How does Virtual reality  work ?

Tricking your brain 

VR works as the brain uses systems including proprioception (the sense of where limbs are in space) and how the eyes orientate to the scene when the head moves. Also, place cells in the hippocampus have been shown to be the centre for self-location, which is used by the brain when assessing where the body is in space.
Ultimately, the brain has to believe the concept of presence, which is based on the brain’s past experience of what it feels like to walk down a street, for instance, and how this compares to the virtual street portrayed in the VR environment. The brain compares these past experiences with the CG environment and decides how real it actually is. Also, when virtual limbs are created in the virtual world, the brain is surprisingly willing to merge the fake with the real. Indeed, in one test VR users pulled their arms away from a virtual fire.

Pros and cons:

Pros:

1-Provides a safe way to build skills in challenging or risky tasks
2-Offers real-time feedback
3-FUNNNN!

Cons:

1-Blurs the boundaries between ourselves and the outside world.
2-Invades privacy.



With that said computer scientists wanted all the pros and less of the cons that's why they thought about more interactive and creative way which is a mixed reality(the master mix) that allows a person to live in both world at the same time.Building 3D objects, living millions of experiences we already enjoy in our real lives and creating new methods of how to capture our memories so that they would immortal.And,No,that's not a dream. Microsoft has been the leader in mixed reality which is something you could find in Microsoft holoLens  

References:
1-https://elearningindustry.com/wp-content/uploads/2015/10/Virtual-Reality.png
2-https://blackbearsolutions.nl/wp-content/uploads/2016/02/VR-w855h425@2x.jpg
3-https://cdn0.vox-cdn.com/thumbor/aotdquRv2ZmMp1l-NTU_HrHcQtA=/cdn0.vox-cdn.com/uploads/chorus_asset/file/3327268/a67d3d33-e1e5-4cf7-bf3d-dbe1befc8d8c.0.jpg