Jagadeesh from SkilledMonster posted a nice collection of programming puzzle websites.

I mentioned another collection earlier here.

Advertisements

Posted by Ed on November 22, 2012

Jagadeesh from SkilledMonster posted a nice collection of programming puzzle websites.

I mentioned another collection earlier here.

Advertisements

Posted in computer science | Tagged: improve, programming, puzzles, skills | Leave a Comment »

Posted by Ed on November 22, 2012

If you want to improve your programming skills, I highly recommend Topcoder. Unlike projecteuler which is heavy on number theory Topcoder focuses on algorithm design. In the live competitions you are given three problems that you can try to solve within a time limit. There are two divisions. *Division 2* is for beginners whereas *Division 1* is for those with a higher ranking.

Here are some nice tutorials on how to get started:

Getting Started on Topcoder

TopCoder Quickstart Tutorial

You do not have to participate in the competitions. You can also just use the archive to practice:

– Go to the problem archive.

– Click on *Div2 Success Rate*. This will sort the problems from easy to hard. You can then start working on the problems where the difficulty gradually increases.

– After compiling, testing and submitting your solution don’t forget to run the system test. For this, click on *Practice Options -> Run System Test*.

– Browse through other people’s solution and learn new tricks. This is a nice feature on Topcoder.

After some practice you should compete in one of the live competitions. First, it is very exciting and fun. Second, you learn to write correct code fast. Third, you read other people’s code during the challenge phase.

By the way, Mark Zuckerberg also has a profile on topcoder.

Posted in computer science | Tagged: introduction, programming, topcoder, tutorial | 1 Comment »

Posted by Ed on November 20, 2012

In this blog post we will derive a formula for the interior angle of an n-sided regular polygon. We will examine how depends on n. This allows us to draw the regular polygon.

**Regular polygons**

A regular polygon is a figure whose sides have the same length (equilateral) and whose interior angles are equal (equiangular). Let’s draw one with 3 sides. We can easily construct it if we know the *interior angle* . For the triangle it is = 60°.

Let’s do the same for a square, for which the interior angle is = 90°.

Now, can we do the same for a pentagon (5 sides)? What about a 13 sided regular polygon?

Obviously, we could if we knew how to choose . Before you continue reading you may want to ponder how to determine the internal angle. So, spoilers ahead.

We have two equations.

(1)

(2)

We solve (2) for : (3)

Plug (3) into (1): (4)

Multiply (4) by n: (5)

Substract 2*180° on both sides: (6)

Divide by n: (7)

This is the interior angle for an n-sided regular polygon.

**Problems**

1) Show that the formula is correct for the triangle and the square.

2) What is the interior angle for the pentagon?

3) What is the sum of all interior angles in a 7-sided regular polygon?

4) What is the sum of all interior angles in an n-sided regular polygon?

5) What happens with the interior angle if you make n bigger and bigger?

**Answers**

1) Before we derived the formula we already knew that the interior angles are 60° and 90° respectively for the triangle and square. Let’s check if the formula gives us these values.

For the triangle we set n=3 and get .

For the square we set n=4 and get .

2) For the pentagon we set n=4 and get .

3) and 4) The sum of all interior angles in an n-sided regular polygon is . For a 7-sided regular polygon we set n=7 and get .

5) If we make n bigger and bigger, the value for approaches 180°. We can express this with the limit:

Posted in mathematics | Tagged: derivation, geometry, interior angle, regular polygon | Leave a Comment »

Posted by Ed on November 9, 2012

Recently, I’ve been reading the Wallstreet Journal. I particularly enjoy reading the section on life, health and work at the end. Here are two articles that I like:

Some Don’t Live to Earn, but Earn to Live By RHEA WESSEL

Self-Help for Skeptics By ELIZABETH BERNSTEIN

Posted in Education | Tagged: wallstreet journal | Leave a Comment »

Posted by Ed on November 8, 2012

CodingBat offers some nice problems to test your programming skills in Java and Python. They are particularly suited for beginners. Some harder problems deal with recursion.

Posted in computer science | Tagged: coding, java, practice, Python | Leave a Comment »