Category Archives: Week 11

Thinking algorithmically

There is no doubt how powerful computers can be, and now days we can’t really imagine our lives without using computers at school, at home, at our jobs.

For me, everything started when I decided to study computer science as my undergraduate degree. I didn’t really have experience in programming and coding, but I was very interested to really understand how computers work and understand what can be accomplished using them.

I always loved puzzles as a kid, and to me, programming felt the same way. It was fascinating to see how organized my thinking became, and how you can break down any kind of problem into smaller tasks.

Learning how to code is exactly like learning a new language, where you have to learn the grammar, study the rules in order to fluently learn the language, and as they say, the more practice you have with it, the easier it gets.

The fascinating realization for me was when you study different programming languages, you understand the differences between them, and you choose which language can be more efficient when working on different applications and software.

IEEE ranking sheet of top programming languages of 2017, according to their popularity

From all the languages, I really like Python.  Python can be used for internet development, for scientific and numeric computing, for GUIs and other software applications, and because it offers so many libraries that you can import in your code, usually is the most popular and most used language.

For my undergraduate thesis, I used Python to do a sentiment analysis on Michelle Obama’s speeches from different years, to understand the connotation of each speech, and then I showed the results using different visualization graph, also using by importing python’s library in my code.

Here is part of the code from my final project:

To explain a little bit what is happening with the code, I have  a list of speeches ( 8 speeches from 2008-2016), and after I do a sentiment analysis, I also look for 5 particular traits on each speech (openness, conscientiousness, extraversion, agreeableness, and emotional range).

After the analysis is complete, I show the results using graphs as visuals.

As Jeannette Wing explained in her video, learning how to code and program, can really help with computational thinking.

Computer Science helps you with how to find solutions to different problems we face, and not just homework assignments. Thinking “algorithmically” about the world, helps you to tackle the problem fundamentally, by breaking it down in it’s easiest parts, studying it and find better solutions to the possible errors, just like running a program in the console.

And what is really interesting to me is the fact that now days, we can combine the power of computing and programming with any other discipline and the options and opportunities on what can be achieved are limitless. From social sciences, to humanities, to fine arts, to engineering, science and technology we can expand our curiosity and knowledge, and we can help in designing efficient solutions to make our tasks easier.

Resources:

Evans, David Introduction to Computing: Explorations in Language, Logic, and Machines. Oct. 2011 edition. CreateSpace Independent Publishing Platform; Creative Commons Open Access: http://computingbook.org/.

Irvine, Martin An Introduction to Computational Concepts

Wing, Jeannette Computational Thinking

Think about what you want, not what’s allowed

The two major takeaways from the readings and other materials this week is the common ground that computational thinking shared with mathematical thinking and engineering thinking, but more importantly, as they do share many of the patterns and visions, they somehow developed their own characteristics on top of the factors they took from each other.

 

For the intersections between computational thinking and mathematical thinking, it’s easy to understand that since mathematics serves as the foundation of the computational thinking, there would be a major indication and representation of mathematical way of thinking in computational thinking, but the one identical difference is that “when we execute our solutions on a machine or as human we are constrained by the physics of the machine – we can’t represent or reason about all the integers because we are only representing a finite number of them in our machine.”

 

As for the distinction between computational thinking and engineering, thinking is that when we are dealing with computational thinking, we are talking about building a program – in which you are building a system, you would be engineering an artifact, so it’s reasonable for you to borrow from all the discipline of engineering. But as we – the human are the ones to define the system, there’s one thing, in particular, we could manipulate – the software. In software, you could do anything you could build virtual worlds that define the laws of nature or laws of physics because it’s a virtual world, you could invent your rules. This means you are not constrained by the physical world.

 

The way I take this is to think beyond the tangible layer of the computer. The hardware is getting fancier every day – faster processor, bigger memory, but that’s not the core of computational thinking – not even close. We should think in the way that: what the hardware we have in hand would allow us to do, but what we need and what we want to do, and try to make the hardware to incorporate that.

 

 

Python and Symbols

When I first looked at Python, I could recall many math curricula I have taken. In my opinion, Computation is a way to manipulate logic based on mathematical rules and symbols. However, most mathematical problems have only one solution and outcome each, but as for computation, multiple solutions can be given to one simple problem based on how you articulate the logic flow. That’s the most intriguing and confusing matter for me to understand computation: although the process of solving a math problem constrict your undertakings and ushers you to find the only true answer to it, the process of computation, which is based on math concepts and methodology, does not limit your approach to resolving a problem.

Also, I’m interested in if different coding language can be applied to solve the same problem. I noticed that JavaScript and Python have some same functions such as printing a string; given that any code language is a symbol system constructed on a set of rules, it can be possible that the same problem can be addressed and resolved by different coding languages as long as the algorithm underlying all solutions are viable. However, my limited knowledge of computation circumscribes to explore further on the possibility of solving the same problem using different coding languages.

I am also captured by the idea of computation as the manipulation of symbol systems. For me, insofar the course has proceded, I have acknowledged that everything has meaning, certainly including computation, but I still want to figure out a way to interpret the meaning behind computation. I hope to be equipped with the methodology to extract the meaning behind any meaning system and reexamine them with semiology.

Reference:

Jeannette Wing, “Computational Thinking.” Communications of the ACM 49, no. 3 (March 2006): 33–35.

Intro Ideas for Computing and Programming Language

From the changing history of definitions on the term of computation and computers, I can see a development on the understanding of computing. Human applies computing to different but associating fields taking it as different roles. To me the most amazing thing in computer science is that idea to convert human mind to 1 and 0, on and off. Such idea leads me to the understanding that computing system becomes “the extension of man”, more to say, the extension of human mind.The programming language as a medium enables such kind of extension

“ If programming is the act of teaching a computer to have a conversation with a user, it would be most useful to first teach the computer how to speak.”

For long time, as programming has always been a subject in the school, in the programming class,  I feel like that students (human) are being taught to have a conversation with a computer. In this way, human are somehow standing in a passive position. However this first sentence at the very beginning of the Python Codecademy Program seems to be so different. We are not trying to adapt to the computer, but make the computer to adapt human language. It shows an idea about how we as human consider our relationship with computer and what actually does computing mean to us.

As I have never know about the language of Python before, with really few basic knowledge about C++ and Java, I was amazed by how “human” the Python language is. To explain what does “human” mean here in a non-profession way, I would like to applying how much I can understand when reading these lines without any Python backgrounds. To understand Python better, I talked with several friends who are doing programming jobs.  As I am not an expert in neither Java, C++ nor Python, from my perspective, Python is more like to be designed for human, here I mean that it is more readable and understandable to human. While the C++ is more  like to be designed for machines. The comparisons between programming languages are always hot topics in the field. Except for the personal preferences, actually different programming language do have some different characteristic that lead them to be the best choice in some situation.

For example, Java is a mainstream choice in the development of not only applications in Android and IOS system but also video games, desktop UI and some softwares. While Python is often used in the WordPress pug-in or web design. Python with its human language characteristics is easier to start with but Java with its flourish details gains better extendibility. Working on WordPress for 506 this semester, I manage to gain a incomplete sense that WordPress lead by Python has the similar characteristics of “being human”. This seems to sow that the characters of programming language might be reflected on the production, or to say system it is working in.

References

  1. Denning, P. J. (2010). Great principles of computing. American Scientist.Evans, D. (2009).
  2. https://www.codecademy.com/tracks/python

Programming Language & Computational Thinking

Due to the inefficiency, obscurity, and complexity of natural languages people use in daily lives, people develop computation which is “the outcome of centuries of cumulative human symbolic thoughts for representing abstract patterns and processes”. Nowadays, we have programming languages for computers to understand easily and clearly, such as Python, JavaScript, and C++. Some of these languages are closer to machine language, such as assembly language, and some get closer to natural languages, such as Python.

Someone might regard that Python is more superior than assembly language and misunderstand that programming language itself is computational thinking. However, programming language, like natural language, is a system of symbols and meanings instead of thoughts. Hence, using natural-like language for coding is not an important direction. The purpose of a programming language is to solve a problem, to interpret an ambiguous and realistic question, so the most significant part of a programming language is how to realize it.

When humans are thinking a problem, the image emerges in their minds are complete and abstract. For instance, to fix the problem of a malfunctioned laptop, people who know nothing about programming might figure out its evident symptoms, such as the black screen or uncontrollable mouse unconsciously. But experts in it at least go through three steps: abstraction, automation, and analysis.

Thinking at multiple levels of abstraction plays a vital role in computational thinking which translates a specific problem into a series of representants. Basically, abstraction is to use symbols to represent meanings and build a theoretical model to handle a practical task. When I was learning Python in WomenCode group in Georgetown University, before we started to code formally, the first step the tutor required us to do is to draw a flow chart which assisted us to separate a specific task into a few steps. I think it is always the most crucial part to do this work because it practices people’s capabilities to think like a computer, abstracting the real task out of a vague description of the problem, establishing a set of procedures step by step to solve it and enact your idea. This process is also called Pseudocode. It is not exactly coding, but for humans to understand. Moreover, there could be various ways to complete one task, such as using if/else or while loop. Despite many feasible ways, we need to figure out which one is the most efficient and direct.

Therefore, programming language itself is not the panacea to entangle a problem but is a system of symbols to represent meanings and describe the whole problem. I have learned basic Java, Python, HTML, and CSS in CCT, which was unimaginable for me before because I had the stereotype that programming languages are for those who major in computer science. But now I realize that everyone needs to have a fundamental command of coding because of its underlying logic and ways of thinking.

Just as Douglas Adams said, “A computer terminal … is an interface where the mind and body can connect with the universe and move bits of it about”. Computers, or even higher level of artificial intelligence, are the extension of humans. They enable humans to build more connections with the truth and knowledge of the universe.

Reference:

  1. Evans, D. (2011). Introduction to Computing: Explorations in Language, Logic, and Machines.
  2. Hillis, W.D. (1999). The Pattern on The Stone: The Simple Ideas That Make Computers Work
  3. Wing, J. (2006). Computational Thinking. Communications of the ACM 49(3). pp. 33-35
  4. Irvine, M. (2018). Introductory video.
  5. Irvine, M. (2018). An introduction to Computational concepts.

Python and Computational Thinking

I am learning Python in one of Professor LeMasters’ classes. I think Python is very practical and useful compared to other computing language and it is easier as well because it is close to linguistic language. In fact, that can be explained by computational thinking, too.

According to Jeannette Wing, computational thinking involves solving problems, designing systems and understanding human behavior. Also, computational thinking is using heuristic reasoning to discover a solution. It is planning, learning and scheduling in the presence of uncertainty. Every time before I use Python, the first thing I need to do is like a computer – what problems do I need to solve? Then I could figure out each instruction step by step. The relations between step need to be logical and by sequence so that the computer can understand and solve the problem.

I once used Python to analyze the comments count and score of the TOP 25 movies in one website. My instructions can be seen as computational thinking. A computer is a machine that can accept input, execute a mechanical procedure and produce output. And that what python does. First, I need to import the input and the relevant instructions begin with import. Then is the execution of the mechanical procedure. Here that’s one of python’s wisdom. If I make some mistakes, Python can point it out immediately and tell you where you make the mistakes. If you keep the mistakes, Python won’t let you go until you give it the true mechanical procedure which it can understand. When you want the output, just type print and the computer begins to produce output.

By using Python, I can get to understand computational thinking better and it makes me think in a more logical way and unconsciously imitate how computers work. First is conceptualizing. Whenever I meet a problem, it’s more logical to think at multiple levels of abstraction and think of computational concepts and ideas we use to approach and solve problems. Then is the process to solve problems. After using computational thinking, it’s important to complement and combine mathematical and engineering. Take Python as an example. Python is not just math or engineering. However, it must combine both of the two subjects. We use the engineering thought to figure out the logics and instructions to deal with mathematic problems. Like the case I used above, I combined mathematical and engineering to make the chart with python. Besides, computational thinking is using abstraction and decomposition when attacking a large complex task or designing a large complex system. It is a separation of concerns. This is similar to my example as well. During the input of my instructions, I am dividing the big problem into step by step and solve them step by step as well. After a series of instructions, the problem has been solved and the chart has formed in the end.

Reference

  1. Denning, P. J. (2010). Great principles of computing. American Scientist.Evans, D. (2009).
  2. Introduction to Computing Explorations in Language, Logic, and Machines.
  3. Wing, J. M. (2006). Computational thinking. Communications of the ACM49(3), 33-35.

 

Computational thinking and countless possibilities of implementation– Wency

Computational thinking and countless possibilities of implementation– Wency

It might not be a bad idea to start the discussion with an example we’ve learnt this week. We want to obtain a word which could be determined by everyone that have seen our need. We want to make it neat with all the characters in this word to be lower case. We also want to do something with the word, we want to replace the first character onto the end of the word and add some other self-defined characters onto the end of the new word.

Now it seems that we have a clear need with clarified task already. To accomplish the task, we need to break it down into several procedures with the help of our nature language:

  1. Define a string variable and assign a value to it
  2. Define a variable and assign the user input on it.
  3. If the length of user input is more than zero and the all the characters in the user input are alphabets, conduct the task below
    • convert all the characters within the word into lower case
    • define a variable and assign the first character in the word onto it
    • add the first character and the value of the string variable defined in the first step onto the variable
    • cut the first character of the new variable from it
  4. If the length of the user input equals to zero, then output empty.

The above steps, i.e., initiate a need, define the task, analyze the task and break down into several logic steps or logic functions. It’s human nature to break accomplish a complex task step by step each of which is relying on a specific function relatively independent from the other parts, and interestingly, we are sometimes unaware of that. The way human beings solve problems, thus, is a way of computational thinking, which, as Wing mentioned in his work, is a way that humans, not computers, think. Within just a few steps we are thus able to conceptualize the large chunk of task into multiple level of abstraction (Wing, 2006, p.35).

At this level, however, our computational thinking is better to be ascribed onto a mathematical level, to connect our daily lives tasks with computer, we need further transformation. As is mentioned by Evans, there are several inevitable problems with nature language including complexity, ambiguity, irregularity, uneconomic and limited means of abstraction (Evans, 2011, p36). Therefore, just as human society has its own grammar of nature language, there is a set of syntax that we need to follow to interact with computers (Irvine, 2018, p.7). Speaking of this example, we are using the syntax of Python to transfer our nature language into the first level of computer understandable language. We implement the Boolean logic thinking, abstraction of different variables into the code stored in script.py, the interpreter later converts the language into binary values, i.e., 0s and 1s which could be manipulate by machines (Evans, 2011, p38).

Since 0s and 1s, basically speaking, stand for two states which represent the concept of digitalization where analog values are divided into several regions based on standards or boundaries, to merely implement two states physically, we can use a ton of different physical devices such as the fluid computer, the jacquard loom, etc., however, since the speed of electricity equals to the speed of light (i.e., 3*10^8 m/s), and since the electricity only need to travel nanometers between transistors, the two states of switch, i.e., ON and OFF, could happen millions of times within one second which makes the information processing much faster, therefore, using electricity to implement the binary operation is a more popular way in modern computation. By combining transistors into logic gates including AND, OR, NOT, XOR and combine the logic gates into more complicated modules including logic arithmetic units such as adder, comparer, etc., and those modules such as memory, control unit, arithmetic logic unit, etc., thus are combined together and interact with each other under control to work efficiently (Irvine, 2018, p.5). we are therefore utilizing instruction to perform several tasks based on the binary sequence (Hillis, 1999, p.20-27). At this point, back to Wings conclusion of the characteristic of computational thinking, it is easier to understand the concept that computational thinking complements and combines mathematical and engineering thinking (Wing, 2006, p.35). Computation, thus, although understood by many several scientists as mathematical thinking, is physically limited and measures the power of a computing machine includes how much information and how fast it can process (Evans, 2011, p.3).

Of course, the example I provided above is just one case in our daily lives. In fact, as Evans mentioned, we can use sequences of bits to represent many kinds of data including Numbers, Discrete Values, Text, Rich data (e.g.: picture is divided into discrete squares known as pixels) and there is a limitation in terms of frequency that human beings can distinguish, whatever that could break down into smaller chunks and procedures in daily lives and illustrated as logical steps could therefore be transferred into the machine understandable language, interpreted into binary sequence and thus implemented by electricity and transistors (Evans, 2011, p.11).

To look back on each step that we use to accomplish a complicated task, therefore, it’s not difficult for us to recognize how much symbolic meanings and representation are assigned by us onto each level of the task and how we implement such symbolic representation to enable our interaction with computers. We are offloading and distributing human agency and cognition into software not only because we are able to manipulate computers and enabling its automatic information processing, but we are also at the same time thinking computationally with abstraction, recursion, modulization ourselves through every single task we confront in our lives. We are in a digital-analog continuum for implementing many kinds of design concepts software designed for automating symbol process, computation is the outcome of cumulative human symbolic thoughts for representing abstract patterns and process, it performs metafunction which, not merely represent meanings, can also be used to perform actions on other symbols (Irvine, 2018).

References:

  1. Evans, D. (2011). Introduction to Computing: Explorations in Language, Logic, and Machines.
  2. Hillis, W.D. (1999). The Pattern on The Stone: The Simple Ideas That Make Computers Work.
  3. Irvine, M. (2018). Introductory video.
  4. Irvine, M. (2018). An introduction to Computational concepts.
  5. Wing, J. (2006). Computational Thinking. Communications of the ACM 49(3). pp. 33-35