Panini stickers follow up

Written on 30 January 2014, 11:23pm

Tagged with: , , ,

The previous post about Panini stickers got into some mathematical formulas. However, the 2 main conclusions were referring to the duplicates probability and distinct probability. That was the mathematical approach to the problem.
Below – the geeky one 🙂

1. Duplicates probability

In a Panini pack of 17 stickers (out of 192 possible stickers), there are 50% chances to have a duplicate.

The geeky way:
– generate a random array of ‘n’ integers in the range [1,192]
– calculate how many duplicates has the array
– repeat this a number of times to get a reliable view.

Results (PHP code at the end of the post):

Number of stickers - Probability of duplicate
10 - 20.47% 
11 - 25.8% 
12 - 31.2% 
13 - 37.13% 
14 - 40.6% 
15 - 45.47% 
16 - 47% 
17 - 53.4%
18 - 58.4% 
19 - 63.27% 
20 - 66.53% 
21 - 69.87% 
22 - 74.53% 
23 - 76.53% 
24 - 80.27% 
25 - 82.33% 
26 - 85.47% 
27 - 86.27% 
28 - 87.87% 
29 - 89.93% 
30 - 91.67% 
31 - 93.73% 
32 - 94.4% 
33 - 94.87% 
34 - 96.07% 
35 - 96.53% 
36 - 97.13% 
37 - 97.47% 
38 - 97.6% 
39 - 98% 
40 - 98.33% 

(more…)

Visual sorting algorithms

Written on 19 November 2013, 11:31am

Tagged with: ,

The guys behind AlgoRythmics found a brilliant way of showing how the sorting algorithms work: they used popular Romanian and Hungarian dance!
Have a look below how the bubble sort was done:

For more dancing watch their YouTube page: they also ‘implemented’ quick sort, insert sort, merge sort and shell sort. You can also play with their sorting tools on their website until you are sure you understood how these sorting algorithms work.
PS – hear and see also the sound of 15 sorting algorithms
(more…)

Geek joke

Written on 17 June 2013, 09:04am

Tagged with: , ,

I’m usually posting these on Twitter, but this one is too good 🙂
objects

Java Guy: “OK guys. Any idea how to make women more interested in us?”

C++: More exceptions?
Python: New methods?
ANSI-C: Stop treating them like objects?

— via Google+