Archives

All Posts

Everything I’ve written on pythonandr.com, newest first — ten years of the maths, worked in code.

  • Magic 5-gon Ring — Project Euler (Problem 68)

    Yet another exciting math problem that requires an algorithmic approach to arrive at a quick solution! There is a pen-paper approach to it too, but this post assumes we’re more interested in discussing the programming angle. First, the problem: Working…

  • Maximum Path Sum — Dynamic Programming Algorithm

    I came across this problem recently that required solving for the maximum-sum path in a triangle array. To copy the above triangle array: As can be seen, there are 15 levels to this tree (including the top most node). Therefore,…

  • Collatz Conjecture — What You Need to Know

    Like many of my previous posts, this post too has something to do with a Project Euler problem. Here’s a sketch of the Colatz Conjecture. The following iterative sequence is defined for the set of positive integers: n → n/2…

  • Large sum — Project Euler (Problem 13)

    This isn’t much of a problem really, but since I’m posting solutions to all the Project Euler problems I solve, I’ve been OCD’d into posting this one too. Besides, it illustrates the simplifying power of Python as a language? Anyway……

  • Highly Divisible Triangular Number — Project Euler (Problem 12)

    All ∑n numbers are Triangle Numbers. They’re called so, because they can be represented in the form of a triangular grid of points where the first row contains a single element and each subsequent row contains one more element than…

  • Consecutive Prime Sum — Project Euler (Problem 50)

    Many problems in Project Euler relate to working with primes. I use primesieve-python to help solve such problems. It consists of Python bindings for the primesieve C++ library. Generates primes orders of magnitude faster than any pure Python code. Features:…

  • Largest Product in a Grid — Project Euler (Problem 11)

    I started solving Project Euler problems this month. Check out the Project Euler tab of this blog for a list of the problems I’ve solved (with solutions) till date. Here’s a problem you might find interesting: Here’s my solution using…

  • MOOC Review: Introduction to Computer Science and Programming Using Python (6.00.1x)

    I enrolled in Introduction to Computer Science and Programming Using Python with the primary objective of learning to code using Python. This course, as the name suggests, is more than just about Python. It uses Python as a tool to teach…

  • Which Programming Languages Get Used Most At Hackathons?

    For a quick peek into the list: The Top 10 Languages At Devpost’s Hackathons: HTML/CSS (see note below) JavaScript Python Java C/C++ PHP Objective-C C# Swift JSON (which isn’t … really a programming language, but is on their list for…

  • R — The Big Mover in IEEE Spectrum’s 2015 Rankings for Top 10 Programming Languages

    The column on the left is the 2015 ranking; the column on the right is the 2014 ranking for comparison: source: The 2015 Top Ten Programming Languages The thing to note is that the top 5 languages haven’t budged from…

  • Object Oriented Programing with Python – Particle Diffusion Simulation

    I’m a newbie to the programming world. I first started programming in Python in May this year, a month after I started this blog, so I still haven’t learnt enough to contribute to economics as is the stated goal of…

  • Skillset Necessary for Data Science

    I came across this truly amazing visualization of what it takes to foray into data science by @kzawadz via twitter MarketingDistillery.com

  • Which Programming Language Should I Learn First? [Infographic]

    Here’s a pretty interesting flow chart to determine which programming language would suit you: Which Programming Language Should I Learn First? [Infographic]. or Click here for the PDF

  • Number of Inversions in an Unsorted Array: Python Code

    This is my solution to the first programming assignment of Tim Roughgarden’s course on Algorithms  that was due 12:30 PM IST today. Here’s the question quoted as it is: Programming Question-1 Download the text file here. (Right click and save…

  • Introducing cricketr! : An R package to analyze performances of cricketers

    Wicked! Or must I say ‘howzzat!?’ Giga thoughts … Yet all experience is an arch wherethro’ Gleams that untravell’d world whose margin fades For ever and forever when I move. How dull it is to pause, to make an end,…