aboutsummaryrefslogtreecommitdiff
path: root/challenge-108/duncan-c-white/README
blob: 5b35941c97afc4120794f2a8ea867a1709950c52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Task 1: "Locate Memory

Write a script to declare a variable or constant and print it's location in
the memory.
"

My notes: umm, does this just mean "use \ and %p", or something more subtle?


Task 2: "Bell Numbers

Write a script to display top 10 Bell Numbers. Please refer to

https://en.wikipedia.org/wiki/Bell_number

for more informations.

Example:

B0: 1 as you can only have one partition of zero element set

B1: 1 as you can only have one partition of one element set {a}.

B2: 2

   {a}{b}
   {a,b}

B3: 5

   {a}{b}{c}
   {a,b}{c}
   {a}{b,c}
   {a,c}{b}
   {a,b,c}

B4: 15

   {a}{b}{c}{d}
   {a,b,c,d}
   {a,b}{c,d}
   {a,c}{b,d}
   {a,d}{b,c}
   {a,b}{c}{d}
   {a,c}{b}{d}
   {a,d}{b}{c}
   {b,c}{a}{d}
   {b,d}{a}{c}
   {c,d}{a}{b}
   {a}{b,c,d}
   {b}{a,c,d}
   {c}{a,b,d}
   {d}{a,b,c}
"

My notes: Bell's triangle has a simple algorithm; let's use that!