Skip to main content
Data Science Wizardry Blog by Attila Vajda

Permutations, combinations, variations

Cold, foggy, beautiful winter morning #

Mail orders permutations

As many orders can be represented with long and short lines, as many numbers can be represented with the same digits of binary numbers.

5 bars

10010

11111

My hand with all fingers open, and binary values written on the fingers, it adds to 31:

My hand with all fingers open, and binary values written on the fingers, it adds to 31

I am trying to speak to our cat about Python development, because I remembered the advice from the Front End Masters Bootcamp to do so.

Psychedelic postage stamp from 1974

What does the part in the denominator mean? Do the numbers in the denominator always represent repeating elements? To find the representation of Zip codes with a 20 letter alphabet, I tried working backwards from setting the variations at 20, and got the ratio 6!/4!*3, or 6!/(4*3*2)(4*3*2)(4*3*2). I became curious about the meaning of (4*3*2).

This is what I mean, discussing analogies with a computer agent is very cool, and it can be used with understanding partial differential equations, machine learning concepts, or any old thing 👏:

Analogies of Mixtral computer agent of factorials

Ah, so 4! is four groups, and 3*4! is three times 4 groups, of factori 🐠. "I love it! ❤️"

Are factorial fractals? What are fractorials?

The whimsical description of fractorial

Three times four groups of three groups of two groups of one.

Code puzzles #

alpha = 7
grocery_list = {'apple': alpha, 'banana': alpha, 'orange': alpha}
alpha = 8
print(grocery_list['apple'])

I know this! 🤓

numbers = list(range(1, 6))
numbers[1::2] = [-1, -2]
print(numbers[-1])
Click me! My guess is 5, because range(1, 6) is [1,2,3,4,5], then we change the element with index `1` to `-1` and `3` to `-2`. Then we print the last element, which is `5`
wafflesyrup, flamingos, moonrocket = dict((item, hash(item)*79 + 86) for item in ['zebracrossing', 'parrotfeather', 'octopusgarden'])
print(wafflesyrup)
Click me! I don't know what `hash(item)*79 + 86` is. >>> hash('a') -4097877494882150676 >>> hash('zebracrossing')*79+86 481847513324174709720

Jacobs, H. R. (1994). Mathematics - Human Endeavor (Revised Edition). W. H. Freeman and Company.

Mayer, C., Rieger, L., & Chan, A. (2020). "Coffee Break Python - Mastery Workout: 99 Tricky Python Puzzles to Push You to Programming Mastery.".