Project Euler and the Key to Learn any Skill

It’s been a week since I started the challenge. For the last 2 days, a website called Project Euler is keeping me busy. Using the tools I acquired in starting lectures I tried to solve some of the problems on Project Euler.  I was able to solve problem number 1,2,5,6,7,8,9,10. I noticed that the major part of learning occurs by solving actual problems rather that passively watching the lectures. I realized that I’m still not comfortable with using arrays, strings, pointers and memory allocation. The concept of loops and conditions is much clearer now.

#This month’s sub-goal is to read and learn more about arrays, memory allocation, pointers and strings.

Along with the challenge I’m also reading a book called “Mastery” by Robert Greene. According to the book the process of skill acquisition occurs in the following way:-

It is essential that you begin with one skill that you can master, and that serves as a foundation for acquiring others. You must avoid at all cost the idea that you can manage learning several skills at a time. You need to develop your powers of concentration, and understand that trying to multitask will be the death of the process.

The initial stages of learning a skill invariably involve tedium. Yet rather than avoiding this inevitable tedium, you must accept and embrace it. The pain and boredom we experience in the initial stage of learning a skill toughens our minds, much like physical exercise. Too many people believe that everything must be pleasurable in life, which makes them constantly search for distractions and short-circuits the learning process. The pain is a kind of challenge your mind presents—will you learn how to focus and move past the boredom, or like a child will you succumb to the need for immediate pleasure and distraction? Much as with physical exercise, you can even get a kind of perverse pleasure out of this pain, knowing the benefits it will bring you. In any event, you must meet any boredom head-on and not try to avoid or repress it. Throughout your life you will encounter tedious situations, and you must cultivate the ability to handle them with discipline.

In practicing a skill in the initial stages, something happens neurologically to the brain that is important for you to understand. When you start something new, a large number of neurons in the frontal cortex (the higher, more conscious command area of the brain) are recruited and become active, helping you in the learning process. The brain has to deal with a large amount of new information, and this would be stressful and overwhelming if only a limited part of the brain were used to handle it. The frontal cortex even expands in size in this initial phase, as we focus hard on the task. But once something is repeated often enough, it becomes hardwired and automatic, and the neural pathways for this skill are delegated to other parts of the brain, farther down the cortex. Those neurons in the frontal cortex that we needed in the initial stages are now freed up to help in learning something else, and the area goes back to its normal size.

This process of hardwiring cannot occur if you are constantly distracted, moving from one task to another. In such a case, the neural pathways dedicated to this skill never get established; what you learn is too tenuous to remain rooted in the brain. It is better to dedicate two or three hours of intense focus to a skill than to spend eight hours of diffused concentration on it. You want to be as immediately present to what you are doing as possible. Once an action becomes automatic, you now have the mental space to observe yourself as you practice. You must use this distance to take note of your weaknesses or flaws that need correction—to analyze yourself. It helps also to gain as much feedback as possible from others, to have standards against which you can measure your progress so that you are aware of how far you have to go.

People who do not practice and learn new skills never gain a proper sense of proportion or self-criticism. They think they can achieve anything without effort and have little contact with reality. Trying something over and over again grounds you in reality, making you deeply aware of your inadequacies and of what you can accomplish with more work and effort. If you take this far enough, you will naturally enter the cycle of accelerated returns: As you learn and gain skills you can begin to vary what you do, finding nuances that you can develop in the work, so that it becomes more interesting. As elements become more automatic your mind is not exhausted by the effort and you can practice harder, which in turn brings greater skill and more pleasure. You can look for challenges, new areas to conquer, keeping your interest at a high level. As the cycle accelerates, you can reach a point where your mind is totally absorbed in the practice, entering a kind of flow in which everything else is blocked out. You become one with the tool or instrument or thing you are studying. Your skill is not something that can be put into words; it is embedded in your body and nervous system—it becomes tacit knowledge. Learning any kind of skill deeply prepares you for mastery. The sensation of flow and of being a part of the instrument is a precursor to the great pleasures that mastery can bring.

In essence, when you practice and develop any skill you transform yourself in the process. You reveal to yourself new capabilities that were previously latent, that are exposed as you progress. You develop emotionally. Your sense of pleasure becomes redefined. What offers immediate pleasure comes to seem like a distraction, an empty entertainment to help pass the time. Real pleasure comes from overcoming challenges, feeling confidence in your abilities, gaining fluency in skills, and experiencing the power this brings. You develop patience. Boredom no longer signals the need for distraction, but rather the need for new challenges to conquer.

Although it might seem that the time necessary to master the requisite skills and attain a level of expertise would depend on the field and your own talent level, those who have researched the subject repeatedly come up with the number of 10,000 hours. This seems to be the amount of quality practice time that is needed for someone to reach a high level of skill and it applies to composers, chess players, writers, and athletes, among others. This number has an almost magical or mystical resonance to it. It means that so much practice time—no matter the person or the field—leads to a qualitative change in the human brain. The mind has learned to organize and structure large amounts of information. With all of this tacit knowledge, it can now become creative and playful with it. Although the number of hours might seem high, it generally adds up to seven to ten years of sustained, solid practice—roughly the period of a traditional apprenticeship. In other words, concentrated practice over time cannot fail but produce results.

As I proceed with CS50x the concepts which are troubling me right now will become more clear. I’d be able to solve more problems on Project Euler.  The algorithms which I develop right now takes too much memory and time. Some programs took almost 10-15 mins to compile. I’ve got to make them more efficient in the coming weeks.

This is CS50x!

It’s been 3 days since I started the Programming Challenge. Things have been going pretty well. I’ve been using two resources right now :-

1) Harvard University’s CS50x – Introduction to the intellectual enterprises of computer science and the art of programming. This course teaches students how to think algorithmically and solve problems efficiently. Topics include abstraction, algorithms, data structures, encapsulation, resource management, security, software engineering, and web development. Languages include C, PHP, and JavaScript plus SQL, CSS, and HTML. Problem sets inspired by real-world domains of biology, cryptography, finance, forensics, and gaming. Designed for concentrators and non-concentrators alike, with or without prior programming experience.

“Demanding, but definitely doable. Social, but educational. A focused topic, but broadly applicable skills. CS50 is the quintessential Harvard course” – Edx Course info

Since I’ve already seen the starting lectures last semester, all I did was tried to recall everything I learned previously. The course’s professor David Malan starts this course from the very basics and promises to build complex applications towards the courses’s end. I’ve finished till week 2 of the course. Following topics have been covered so far :-

Introduction. Bits. Binary. ASCII. Programming. Algorithms. Statements. Boolean expressions. Conditions. Loops. Variables. Threads. Events C. Source code. Compilers. Object code. Functions. Comments. Standard output. Arithmetic operators. Precedence. Local variables. Types. Casting. Standard input. Libraries. Boolean expressions, continued. Conditions, continued. Loops, continued Functions, continued. Global variables. Parameters. Return values. Stack. Frames. Scope. Arrays. Strings. Command-line arguments. Cryptography

2) Head First C – Head first books are some of the most useful resources available in the market right now.  The most awesome part is that they make learning fun. With colorful images, conversational style, humor and interesting projects it really makes the book alive. How does the book help in sticking up what you have learnt?. The trick is to get your brain to see the new material you’re learning as Really Important. Crucial to your well-being. As important as a tiger. Otherwise, you’re in for a constant battle, with your brain doing its best to keep the new content from sticking.

So just how DO you get your brain to treat programming like it was a hungry tiger?

There’s the slow, tedious way, or the faster, more effective way. The slow way is about sheer repetition. You obviously know that you are able to learn and remember even the dullest of topics if you keep pounding the same thing into your brain. With enough repetition, your brain says, “This doesn’t feel important to him, but he keeps looking at the same thing over and over and over, so I suppose it must be.”  The faster way is to do anything that increases brain activity, especially different types of brain activity. A conversational style helps because people tend to pay more attention when they perceive that they’re in a conversation, since they’re expected to follow along and hold up their end. The amazing thing is, your brain doesn’t necessarily care that the “conversation”  is between you and a book! On the other hand, if the writing style is formal and dry, your brain perceives it the same way you experience being lectured to while sitting in a roomful of passive attendees. No need to stay awake.

Till now I’ve finished two chapters of Head First C. The second chapter included the concepts of memory and pointers. Which is a little harder to grasp for a newbie. I’ll have to re-read it again today in order to completely understand it.

This is it!.  Learning pace will be slow at the start. Since it is an entirely new domain, things will take some time to settle down. I’ll get bored. I’ll get frustrated. I’ll procrastinate. But the trick is to continue learning and practicing without giving up. This too shall pass!

P.S – My next post will be about a book which I’m reading along with the challenge. It’s called “Mastery: The Keys to Success and Long-Term Fulfillment” by Robert Greene. See you soon! 

The Programming Challenge

“You’ve too many interests, you’ll never become an expert in one thing. You’ll get bored from the job, switch sectors and will eventually leave the company. You might be the jack of all trades but you’ll never become a master of one”

Said the senior HR guy of a Big Business Analytics firm when he kicked me out of the final round of hiring process. I was devastated. Not because I didn’t get the job but because I started having doubts about my own capabilities. Was that person correct? Do I shuffle too much from one task to another? Do I get distracted easily? Do I posses less focus and concentration?. It isn’t only about one person. I’ve been kicked out by 3 HR persons over the course of placement season with each and every guy giving almost the same reason. If that is the case, something is terribly wrong…

There are two ways to deal with criticism :-

1) Dwell on the past. Accept that you are a loser. Some people cannot change. And one of them is you. 

2) Do something about the situation. Have control over things rather than simply watching things happen to you. Instead of sitting and worrying, do something, anything.

I’d go with the second option. I’ll take this criticism as a challenge. Over the next few months, I’m going to learn the entire 4-year curriculum for computer science, without the help of college. Rather than going for actual classes, I’ve decided to learn everything on my own using online resources. This challenge is inspired from the original Scott H Young’s MIT Challenge who finished the MIT’s entire 4 year CS curriculum in one year.

Q) Why computer science? 

Computers have always fascinated me. The moment I saw the first computer when I was a teenager, I knew I wanted to program them. But with the turn of events, I didn’t get a preferred CS branch in college and ended up doing Electrical Engineering. Apart from that, Machine learning, Data and Business analytics, cloud computing, artificial intelligence are some of the hottest fields. Most devices will be automated by 2020 and without the knowledge of computers it would be difficult to survive in the job market. 

Q) What is your prior programming experience?

When I was still in my freshman year I did a fair bit of programming, mostly creating small programs using C. I didn’t do it very well. I think I’ll call myself a noob.

Q) What courses are you planning to take? 

Unlike Scott Young I’ll not be taking actual college courses. Rather I’ll divide my learning into several modules. I’ll first start with Harvard University’s CS50x. It’s an introduction to the entire computer science field. Syllabus of the course includes :-

1) C programming language

2) Intro to HTML/CSS

3) Intro to  PHP, Javascript

4) Intro to DBMS, SQL, Ajax, Security

Once I’m done with that I’d go deeper into each and every discipline. Focusing on Web development, Object oriented programming, Database management system individually. I hope to complete CS50 by the end of May.

         Goal #1

“Complete Harvard University’s CS50 in 3 months”

Q) What is the end goal? What do you hope to achieve from this blog?

It takes 10,000 hours to be an expert at something. If I dedicated 3 hours everyday to this challenge, I’ll spend 7*3 = 21 hours every week. Or close to around 1065 hours in 1 year. Having a blog will help me in 2 ways :-

1) It’ll make me accountable to my progress so that I wouldn’t procrastinate

2) I’ll have a written record of my progress so that others can follow.

I’ll be posting concepts, programs, codes and my progress on this blog regularly.

Q) How much time and effort are you willing to put in this challenge? What would be your daily schedule?

I’ll dedicate 3 hours everyday for the next few months. They’ll be divided into 1 hour chunks with a short break between each of them. The time table will be :-

5-6pm – Watch a lecture (Passive learning)

7-10pm (With a break in between) – Practice problems, visit forums and read books ( Active learning)

Now sometimes I can get distracted with something coming up in between. Like going out with a friend or to a party may be. I’ll make sure I change the schedule that day so that I won’t fall behind.

Enough said, Let’s do some programming 🙂

Image