How many points, segments, triangles and quadrilaterals?

A couple of weeks ago I saw a simple problem in Facebook or Twitter. It was about how many triangles there are were in a picture. I started solving the problem with pen and pencil.

I think the original problem looked like this. The question was how many triangles you see in the picture.

I tried to think different methods how to solve the problem and of course how to generalize it. Finally, I decided to draw it with GeoGebra, so I could play with the problem more easily.

Now that I have played with the problem some time, I understood that you should also count how many intersection points, segments and quadrilaterals there are in the picture when you add more lines to it. And what about pentagons, hexagons, … when we add more horizontal lines?

To generalize it more I made a GeoGebra app with a slider n to add horizontal lines.. 

So, the question is. How many intersection points there are when the slider value is n in my app?

How many triangles and quadrilaterals?

What is easier for you, to make a simple function or recursive rule.

What about pentagons, heptagons…? You also have to decide if you allow the segments to be on the same line.

Is AHIJ a quadrilateral in this problem?


For people who like to play with GeoGebra, I will show how I produced the app with using list and zip commans and some vector maths. The app does not solve the problem, but maybe it helps you how get the function or the recursive formulas for the problem.

First I created three points A, B and C and a slider n with integer values..

Then I created the point lists to segment AB, AC and BC with commands:

l1 = Sequence(A + nn Vector(A, B) / n, nn, 1, n – 1)

l2 = Sequence(A + nn Vector(A, C) / n, nn, 1, n – 1)

l3 = Sequence(B + nn Vector(B, C) / (n + 1), nn, 1, n)

With Zip command it is easy to join the points

Zip(Segment(AA, BB), AA, l1, BB, l2)

Zip(Segment(A, CC), CC, l3)

You can find the final app in GeoGebra Materials at

IGCI 2021 talk on Using GeoGebra for Statistic

I am really honored to be invited to this conference. It is always very inspirational to work with teachers from different countries. I think we teachers around the world are very same kind of people. We love our subject, we love the kids, students and we want to help them to get a better life.

Conference website

Youtube video from the conference. My part starts about 56 min before the end.

Google Slides

Player data pdf from FIFA

World cup player ggb-file

Mikko’s probability simulations GeoGebra Book

The High School Seniors Prom at HYL

On Thursday the 12th graders (3rd graders in high school) left the school. The day is called in Finnish “penkinpainajaiset or penkkarit”. So, the 11th graders became the oldest students at our school. Last months they have been practicing old traditional dances like mazurka, cicapo, polonaise, viennese walz, tango, fireman’s dance, …  for the Senior Prom, “vanhojen tanssit” in Finnish. In some high schools the ball is on Thursday evening but in our school, it is on Friday evening. In our school we also have a tradition that on Thursday some seniors visit elder people at a local nursing home.

On Friday, during the school day, the seniors dance for the other pupils in our school. It is also a dress rehearsal for the official evening ball.  In the evening, families and relatives gather to school to see the spectacular prom. 10th graders work for their senior students in the café and they also clean the ball room after the show.

After the prom we will have a sport holiday for a week.

All the photos from the school day

My collegue Vesa Lahtinen shot a video of their own dance.

Vanhojen tanssit in Wikipedia