Category Archives: Math

Small Python Challenge No. 3 – Random Selection

This time I’ll give two related problems, both not too hard. Lets warm up with the first: You have a mapping between items and probabilities. You need to choose each item with its probability. For example, consider the items [‘good’, … Continue reading

Posted in Challenges, Math, Programming, Python | Tagged , , , , , | 12 Comments

Interesting links – 4

http://ivory.idyll.org/articles/advanced-swc/ “Intermediate and Advanced Software Carpentry in Python” is an excellent reading by Titus Brown. If you feel you’re good with Python but want to improve it, or if you are an experienced programmer that wants to get better, this … Continue reading

Posted in Compilation, Math, Programming, Python | Tagged , , , , | Leave a comment

Fractals in 10 minutes no. 3 – The Dragon

When first I looked through the pages of the book “Hacker’s Delight”, I found myself looking at the chapter about bases. There I learned a very curious fact – with the digits of 0,1 and the base of -2, you … Continue reading

Posted in Fractals, Math, Programming, Python | Tagged , , , , | 3 Comments

Using zpint in Cryptography Homework

Originally, I wrote zpint to help me with my algebric structures homework. For those not familiar with it, it allows you to do computations modulo p the same way you do for ints. Not surprisingly, I found myself using it … Continue reading

Posted in Cryptography, Math, Programming, Python | Tagged , , | Leave a comment

Fibonacci meals

Lately I’ve been reminded of the existence of Fibonacci meals. For a long time, I despised those, but now that I’m preparing my own food most of the time, I’m aiming for them, to save time cooking. A Fibonacci meal … Continue reading

Posted in Humour, Math, Personal | Leave a comment

Elegant Line Clipping Algorithm

I actually wrote about that a long time ago, in the wiki that once was algorithm.co.il. Since the wiki is long gone, and I figured this is a very elegant algorithm, I decided I should write about it. First, some … Continue reading

Posted in Algorithms, Geometry, Graphics, Math, Programming, Python | Tagged , , , | Leave a comment

Python module usage statistics – Cont.

Well, very embarrassingly for me, turns out I had a bug in my original post and code. As per Doug’s suggestion, I tried running the script I wrote on the standard library, and got results I didn’t quite believe. So … Continue reading

Posted in Math, Programming, Python | Tagged , , , | 3 Comments

Python module usage statistics

IMPORTANT UPDATE: The code I used to create these statistics had some bugs. The fixed statistics are available here. After reading Doug Hellman’s post about python stdlib modules he needs the documentation to, I commented there that I need the … Continue reading

Posted in Math, Programming, Python | Tagged , , , | 5 Comments

Pagerank recommends movies

So how was your Yom Kippur? After Yom Kippur ended, I sat down to write something that was nagging me for quite some time. I wanted to see what pagerank had to say about movies. I’ve always liked to picture … Continue reading

Posted in Algorithms, computer science, Math, Programming, Python | Tagged , , , | 1 Comment

A new fold on the origami page: Qua Qua Egg

In Israel, we have a fold we call ‘qua-qua-de-la-oma” or for short, “qua-qua”. I believe in english it is called a ‘color changer’, but I’m not sure of that. In any case, this fold yields a 3D shape similar to … Continue reading

Posted in Math, Origami | Tagged , , | Leave a comment