Article of the week

Bash recursion examples - part 1

Bash recursion examples - part 1

15 Jan 2017 16:58:45


Some recursive Maths functions written in BASH.


Read full article »

Recent articles

Number of unique paths in square lattice

14 Feb 2020 21:45:36

Number of unique paths in square lattice

Suppose that you have a square (N x N) grid and want to determine number of unique paths, which will take you from the top left corner in the grid to the bottom right one of if. You are allowed to move by one point at at time, and to the right or to the bottom only. For example, ...

Read more »

Week day number falling on a month day

14 Feb 2020 01:51:58

Week day number falling on a month day

Suppose, that you were born on Monday, January 1, and want to know how many Mondays happened to fall on the same day of any month of the year over, lets say, the last 100 years. It is a silly problem, but also one which points to some problems and inaccuracies ensuing from ...

Read more »

Walking pyramid graph paths in PHP

12 Feb 2020 19:53:09

Walking pyramid graph paths in PHP

This article is a follow-up to my text about turning a pyramid like structure into a graph (which looks a lot like a tree, but isn't one), finding all the paths in the graph and collecting all the values held by vertices in each path of it. In the first article I stopped at ...

Read more »

Converting pyramid to graph in PHP

11 Feb 2020 20:28:38

Converting pyramid to graph in PHP

Suppose you have a structure like one shown below, lets call it pyramid, and are asked to find all the paths from top to bottom in it, and perhaps also to do something with values of nodes in each path, add them or find their product etc. . How do you achieve these things? In ...

Read more »