text: This is an archived post. You won't be able to vote or comment.
  
  [–] 117 points118 points  (36 children)
  
  how am I supposed to interpret this?
  
  [–][S] 62 points63 points  (33 children)
  
  The smallest circles each represent the empty set. Each circle represents a set. The circle containing only one other circle is of cardinality one, the next size up is two, etc. this whole thing is eight, while the biggest circle inside it is seven, and the circles outside the seven are zero through six, same as inside it.
  
  [–][deleted]  (7 children)
  
  [deleted]
  
  [–] 24 points25 points  (3 children)
  
  Well, "cardinality" isn't used in the definition. Without further axioms (such as foundation), cardinality isn't a convenient concept to work with.
  
  Instead, the numbers are directly defined as being the sets in question.
  
  [–][deleted]  (2 children)
  
  [deleted]
  
  [–] 3 points4 points  (1 child)
  
  I tried to read Knuth's "Surreal Numbers" and it lost me. I got some of it but went off the rails trying to map anything other than zero to any of the sets.
  
  EDIT: Looking at On Numbers and Games, it is a MUCH better treatment of the topic. Thanks for the pointer.
  
  [–] 0 points1 point  (0 children)
  
  I actually learned what surreal numbers are from this paper. I found it very well explained there.
  
  [–]Applied Math 7 points8 points  (0 children)
  
  Not as the cardinality, but as the set itself, or if you want to be fancy, the order type of that set (with elements ordered by set inclusion).
  
  n is not the union of the n–1 previous sets, but the set whose elements are the n–1 previous sets. This is an important difference.
  
  [–] 0 points1 point  (0 children)
  
  Not the union of the n-1 previous sets, but rather the set of the n-1 previous sets. There's another layer of nesting going on.
  
  [–] 2 points3 points  (13 children)
  
  Why is there a circle for zero?
  
  [–]Set Theory 19 points20 points  (8 children)
  
  As he said, the small circles represent the empty set. The smallest circle at the far left represents 0, which is the empty set.
  
  [–] 3 points4 points  (0 children)
  
  A circle containing no other circles seems like a reasonable depiction of the empty set. It's still a set, just one without anything in it.
  
  [–] 3 points4 points  (1 child)
  
  Because zero is the first natural number, at least for set theorists :)
  
  [–]Topology 2 points3 points  (0 children)
  
  And computer scientists!
  
  [–]Geometric Analysis 5 points6 points  (0 children)
  
  Each circle is a set containing the top-level circles within it. Interpreted in this way, the whole diagram is the Von Neumann representation of the integer 8.
  
  [–]Symplectic Topology 1 point2 points  (0 children)
  
  Start from the small circle at the left; this is the empty set = 0. The circle (set) containing it is 1. The circle containing 1 and another empty set is 2. And so on and so forth. In other words, the 9 circles which belong to an Hawaiian earring correspond to the numbers 0 through 8.
  
  [–] 66 points67 points  (9 children)
  
  You inspired me to write some Python code to generate svgs of these.
  
  Edit: With some tweaks, you can get other interesting layouts.
  
  Edit: Here's a version using color. Every circle that is the same color represents the same set.
  
  [–] 10 points11 points  (1 child)
  
  And your code allowed me to try it with shaded circles. Thanks
  
  [–] 13 points14 points  (0 children)
  
  Here's a render of that at about 25% mag.
  
  [–][S] 6 points7 points  (4 children)
  
  That's awesome, especially the use of cosines to find the angles in between them. I'm totally gonna use this to fix my mathematica code up.
  
  [–] 1 point2 points  (3 children)
  
  If any part is unclear, just ask.
  
  [–] 1 point2 points  (0 children)
  
  I changed the last few parts to print to a file. It is a trivial change but I think easier than having to print a buncha stuff to the screen.
  
  def printsvg(c, pos, svg):
  svg.write('<circle cx="%f" cy="%f" r="%f" fill="white" stroke="black" />' % (zoom * pos[0], zoom *  pos[1], zoom * c.radius))
  for p in c.contents:
  printsvg(p.circle, (pos[0] + p.pos[0], pos[1] + p.pos[1]),svg)
  
  zoom = 5
  c = make(10)
  
  size = zoom * c.radius * 2
  svg = open('circles.svg','w')
  svg.write('<svg xmlns="http://www.w3.org/2000/svg" width="%f" height="%f">' % (size, size))
  svg.write('</svg>')
  svg.close()
  
  
  [–] 1 point2 points  (1 child)
  
  Can you describe what you changed for the "tweaked" version? I'm trying to follow the code but I keep ending up with just junk when I try to modify any positional code.
  
  [–] 2 points3 points  (0 children)
  
  The positioning logic stands to be clarified a bit (both the way it works in the code and by explanation). nest() does the logical work of where to be placing circles, and getnestpos() does the math for actually placing a circle in a given spot.
  
  getnestpos() takes three circles (a, b, and c) and returns the location for the third so that it is "below" the first two (so they are in order clockwise). The ap/bp bit is where it gets confusing---since the Circle objects don't actually have positions (there is only one Circle for each set, even though each is referenced many times) it is the Placement object which places a Circle within another Circle. Without ap/bp, the returned position is from the perspective of a Circle containing a and b adjacent to each other left-to-right (as the first two Circles within any Circle are). Given ap/bp, the position is corrected to account for different positions of a and b. It probably should just always be the latter way, but because of the way the code evolved that's how it is.
  
  Hopefully that helps and doesn't just make it more confusing. (:
  
  [–][S] 1 point2 points  (1 child)
  
  You try using shapes other than circles for the larger sets? When I drew it by hand I used teardrop shapes for a lot of them, and just let the arrangement of the contents dictate the size and shape of the overall thing. That meant I could fit more information into less space but the boundaries got jumbled sometimes, which was where having a colour scheme became helpful.
  
  [–] 0 points1 point  (0 children)
  
  I didn't. Here's a sketch of rectangles. I'd be interested to see your hand drawing. A lot of the shapes I just tried don't pack well.
  
  [–] 87 points88 points  (33 children)
  
  the empty set
  the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  
  
  [–] 32 points33 points  (1 child)
  
  Oh, now I get it.
  
  [–]Topology 11 points12 points  (0 children)
  
  [–][deleted]  (2 children)
  
  [deleted]
  
  [–] 21 points22 points  (1 child)
  
  Dental plan.
  
  [–] 6 points7 points  (0 children)
  
  Lisa needs braces.
  
  [–]Discrete Math 2 points3 points  (1 child)
  
  #include <stdio.h>
  #define MAXLENGTH 100
  
  int argc = 0;
  int num[MAXLENGTH] = { 0 };
  char** p;
  
  void main(int n, char **p)
  {
  
  int index = (n - 1)*(n) / 2;
  if (index + n + 1 > MAXLENGTH){
  printf("%d\n%d", n, index);
  getchar();
  }
  int tempn = n;
  int i = 0;
  
  switch (tempn){
  case 0: printf("the empty set\n");
  main(n + 1, p);
  case 1: num[index] = 1;
  break;
  default:
  num[index] = 3;
  index++;
  for (i = 0; i<n - 2; i++){
  num[index] = 2;
  index++;
  }
  num[index] = 1;
  break;
  
  }
  for (i = 0; i <= index; i++){
  switch (num[i]){
  case 1: printf("the set that contains the empty set");
  break;
  case 2: printf("the set that contains ");
  break;
  case 3: printf(" and the set that contains ");
  break;
  default:
  printf("error");
  break;
  }
  }
  printf("\n");
  main(n + 1, p);
  }
  
  
  [–]Discrete Math 0 points1 point  (0 children)
  
  This isn't really correct so i fixed it for what the OP did. I made it more obtuse.
  
  #include <stdio.h>
  #define MAXLENGTH 10000
  
  int n = 0;
  int num[MAXLENGTH] = { 0 };
  char** p;
  
  void main(int argc, char **p)
  {
  n = argc - 1;
  int index = 0;
  switch (n){
  case 0:
  break;
  case 1: index = 0;
  break;
  case 2: index = 1;
  break;
  default:
  index = (2 << (n - 1)) - (2 << (n - 2)) - 1;
  }
  if (index + (2 << (n - 1)) > MAXLENGTH){
  printf("%d\n%d", n - 1, index);
  getchar();
  }
  int tempn = n;
  int i = 0;
  
  switch (tempn){
  case 0: printf("the empty set\n");
  main(n + 2, p);
  case 1: num[index] = 1;
  break;
  case 2: num[index] = 2;
  index++;
  num[index] = 1;
  break;
  default:
  for (i = 0; i < (2 << (n - 3)); i++){
  num[index] = 2;
  num[index + 1] = 1;
  index += 2;
  }
  index--;
  break;
  }
  for (i = 0; i <= index; i++){
  switch (num[i]){
  case 1: printf("the set that contains the empty set");
  break;
  case 2: printf(" and ");
  break;
  default:
  printf("error");
  break;
  }
  }
  printf("\n");
  main(n + 2, p);
  }
  
  
  [–] 2 points3 points  (2 children)
  
  Self contained Haskell reading the number to print from the command-line. :)
  
  module Main where
  
  sentence :: [String]
  sentence = "the empty set" : tstc
  : map ((tstc ++ " and ") ++) (tail sentence)
  where tstc = "the set that contains " ++ head sentence
  
  main :: IO ()
  main = do
  n <- fmap read $getLine mapM_ putStrLn$ take (max 0 (1+n)) sentence
  
  
  [–] 3 points4 points  (0 children)
  
  You made a mistake. You are generating
  
  {}
  {{}}
  {{}, {{}}}
  {{}, {{}, {{}}}}
  {{}, {{}, {{}, {{}}}}}
  
  
  which is correct for 0,1,2, but incorrect afterward. Notice your 3 is {0,2} instead of {0,1,2}.
  
  module Sets where
  import Data.List (intercalate)
  
  s = "the empty set" : map g [1..]
  g n = "(the set that contains " ++ intercalate " and " (take n s) ++ ")"
  
  printN n = mapM_ putStrLn $take (n+1) s *Sets> printN 3 the empty set (the set that contains the empty set) (the set that contains the empty set and (the set that contains the empty set)) (the set that contains the empty set and (the set that contains the empty set) and (the set that contains the empty set and (the set that contains the empty set)))  [–] 1 point2 points (0 children) That is beautiful [–] 1 point2 points (0 children) Is this right? Correct me if I'm wrong, but I thought it went more like... 0: {} ("the empty set") 1: {{}} ("the set that contains the empty set") 2: {{},{{}}} ("the set that contains the empty set and the set that contains the empty set"). etc. The final sentence is a bit tricky to parse. Here it is written parenthesized: "the set that contains (the empty set and (the set that contains the empty set))" [–] 0 points1 point (16 children) Here's my semi-recursive, semi-iterative solution. I didn't check any of the math behind it. I don't know any of the math behind it. I'm just following your pattern: public class SetItAndForgetIt { public static void main(String[] args) { for(int k=1; k<=8;k++) System.out.println(set(k)); } public static String set(int num){ if(num<=0) return ""; if(num ==1) return "the empty set"; else if(num==2) return "the set that contains " + set(1); else if(num==3) return set(2) + " and the set that contains the set that contains the empty set"; else{ String appendage = " and the set that contains the set that contains the empty set"; StringBuilder appendSet = new StringBuilder(""); int numIterations = (int)Math.pow(2,num-2)-1; for(int k=0; k<numIterations; k++) appendSet.append(appendage); return set(3) + appendSet; } } }  [–] 0 points1 point (12 children) Java? Why? [–] 20 points21 points (11 children) Because it's the environment I have set up right now. Does the job just as well as anything else! [–] 12 points13 points (10 children) Ah. That makes sense. I just thought you really liked Java if you code up math in it. [–] 6 points7 points (9 children) God forbid someone like java.... Nah, that's right, java is dicks. [–] 2 points3 points (8 children) I'd just expect it in something without boilerplate like Python or pseudocode or a functional language like Lisp or Haskell. Maybe C. [–][deleted] (7 children) [deleted] [–] 0 points1 point (6 children) I just meant for typing out an algorithm in a reddit comment. No need for #includes and all that jazz. [–][deleted] (3 children) [deleted] [–] 0 points1 point (1 child) But C does require includes [–] 0 points1 point (2 children) He did in 8 lines what you did in 25. You could at least up the ante a bit. [–] 15 points16 points (1 child) He did in n lines what I did in 25. I win for high values of n! [–] 0 points1 point (0 children) Except 8! :/ [–] 0 points1 point (0 children) F# although I'm sure there's a better way to do it. [<EntryPoint>] let main argv = let rec gen li = match li with | [] -> "{}" | hd::tl -> "{" + gen tl + "}" let rec appl li f = match li with | [] -> (f [])::[] | li -> (f li)::(appl li.Tail f) printfn "%A" (appl [1..System.Int32.Parse(argv.[0])] gen) 0  [–] -5 points-4 points (3 children) int main(void) { while (1) { printf("the set that contains the empty set and "); } }  [–]Algebra 1 point2 points (2 children) More along the lines of F(n) { Print "the set that contains the empty set and"; F(n-1); } [–] 2 points3 points (1 child) F(n) { print "the set that contains the empty set"; if n>1 print " and "; F(n-1); } [–] 2 points3 points (0 children) Technically you'd need a base case for n=0 [–] 16 points17 points (7 children) Perhaps a simpler representation might help those who haven't seen this before. ∅ is the empty set. {∅} is the set containing the empty set. {∅, {∅}} is the set containing the empty set and the set containing the empty set. {∅, {∅}, {∅, {∅}}} is the set containing the empty set, the set containing the empty set, and the set containing the empty set and the set containing the empty set. etc. In order to model the counting numbers within set theory, we let 0 = ∅ 1 = {0} etc. This is not the only way to model the counting numbers in set theory, but it's the standard way. It has the virtue that the set representing the number n has exactly n elements. It also has the virtue that the '<' relationship can be interpreted as the set membership operator '∈'. In other words we know that 5 < 7 because as sets, 5 ∈ 7. [Note that it's absurd in the intuitive, everyday view of the counting numbers to say that "5 is an element of 7." That's why this construction can be criticized on philosophical grounds. /r/fmota mentioned Benacerraf's article addressing this point.] The general construction is known as the Von Neumann ordinals, in honor of John von Neumann, a mathematician of the 40's and 50's who did brilliant work in several fields from set theory to economics and physics. http://en.wikipedia.org/wiki/Ordinal_number#Von_Neumann_definition_of_ordinals http://en.wikipedia.org/wiki/John_von_Neumann [–] 1 point2 points (1 child) Good call on the whole "lets try to explain this" deal. Very helpful and surprisingly easy to understand. Isn't it true that the natural numbers don't contain 0 though? [–] 5 points6 points (0 children) Whether ℕ starts at 0 or 1 depends on what you're doing; some fields use ℕ = {1,2,3,...} while others use ℕ = {0,1,2,...}. [–] 0 points1 point (1 child) How did you get that symbol? The best I could manage is Ø... [–] 0 points1 point (0 children) [–] 0 points1 point (1 child) Is there any reason, other than the < relation, why this recursive and rapidly-exploding definition is more useful than just calling "Contains" to be the successor function, like {}, {{}}, {{{}}}, {{{{}}}}, etc.? Do things like addition have any interesting analogues in this construction? [–] 0 points1 point (0 children) One of the particularly important ideas is that n has n elements, so cardinality is conveniently defined as a bijection with a natural number. EDIT: Also, if you're asking this, I think you've misunderstood the importance of being (well) ordered by set membership. [–] 0 points1 point (0 children) [Note that it's absurd in the intuitive, everyday view of the counting numbers to say that "5 is an element of 7." That's why this construction can be criticized on philosophical grounds. /r/fmota[1] mentioned Benacerraf's article addressing this point.] Just to supplement this point: the criticism isn't of this construction of the natural numbers, but the identification of the natural numbers to this particular construction. He argues that numbers should be understood as the structure common to all such constructions (any omega-sequence). [–] 33 points34 points (1 child) It seems you've discovered Gallifreyan. [–] 1 point2 points (0 children) I thought this was posted in /r/gallifreyan when I first clicked it. [–][S] 15 points16 points (4 children) It's sloppy, I was coding it in mathematica and got sick of it so just photoshopped a bunch of them into place, but I'm trying to figure out a way of making it so if I just type a number in it builds the whole thing. I'm trying to use the project as a way of teaching myself to code properly in mathematica. [–] 2 points3 points (2 children) That's beautiful -- does mathematica natively support vector image representation of algebraic expressions? [–]Mathematical Finance 7 points8 points (1 child) no matter what your problem is, there is a SolveMyProblem[] function in Mathematica /s [–] 2 points3 points (0 children) Which is why I love it. It's a lazy man's dream. [–] 0 points1 point (0 children) It looks great! Is there any (easy) way for you to make this into a gif? [–] 2 points3 points (1 child) This...would make for a very cool tattoo. [–][S] 1 point2 points (0 children) It's totally what I'm getting done next. [–] 2 points3 points (0 children) Looks like a backwards smith chart for the first few circles [–] 2 points3 points (3 children) I am going to paint this onto bones with acrylic pens and lots of tedious dedication. I find this utterly compelling aesthetically, even though I'm struggling to understand it mathematically. [–][deleted] (2 children) [deleted] [–] 2 points3 points (1 child) [–] 4 points5 points (5 children) Nice visualization! This just highlights to me the ridiculousness of using sets to represent natural numbers. And, of course, it's not unique ... you could choose to represent natural numbers as sets in different ways. Actually, there is a deeper issue. See Benacerraf's "What Numbers Could Not Be". Here's a nice introduction to the problem. [–] 6 points7 points (0 children) Isn't that more a criticism of platonist attitudes to set theoretic representations of natural numbers in set theory? If you can prove that these sets have all the desired properties, and then use that to prove other theorems and so on, without claiming that some set is some number on some universal level... what's so ridiculous about that? [–] 1 point2 points (2 children) Why does it matter what the numbers "are" as long as they behave how we expect them to? We have convenient shorthand syntax such as "2" and "348". [–] 1 point2 points (0 children) I'm sure there's a more in depth reason but in my experience the answer is two fold. First is the simple fact that thinking about abstract problems like this has often lead to the creation of practical solutions. I can't actually think of a good one off the top of my head though. Second is that at some point in the future, numbers may not behave how we expect them to. As fields of study become more and more cutting edge, with physics in particular, the universe becomes increasingly strange and it becomes helpful to have a more base understanding of the things we currently take for granted. [–] -2 points-1 points (0 children) I have been thinking about this. Clearly "2" and "3" are related. You can place a line of symmetry through "3" and one part will be a "2". This is illustrated by the "4", which is of course just a intersection like a "+" or an "x". I'm glad that whoever designed these things had short hands, or else there's no way they would act like we would expect. [–] 0 points1 point (0 children) Uhm, both are true identities? Every collection of sets that follows the arithmetic rules you want is isomorphic to each other in a way that preserves addition, multiplication, successor, zero, one, and pretty much any other arithmetic function you'd want. They're just pointing out that "is an element of" isn't mapped to exactly the same thing between the two representations. Which is fine, because we don't care about keeping that relationship - if we did, then representations that do not have smaller numbers as elements of larger ones would not be considered numbers. [–] 1 point2 points (9 children) Why is it useful to represent the natural numbers like this? Or I guess more generally as the Von Neumann representation? [–] 7 points8 points (0 children) Convenience. The usual notion of < becomes set membership, which simplifies things. [–] 5 points6 points (5 children) You can define the language of set theory as a language of first order logic with only one non-logical symbol, representing set membership. Then you can use formal logic to prove basic facts about arithmetic and other fundamental mathematics. Then you can be assured that your mathematical reasoning is as sound as your logic. Nowadays we think of course our mathematics is sound, but we can think that with confidence mainly because of logicians and set theorists working around a century ago (and a few decades before and after) who formalised things like this using set theory (and formalising set theory using logic). [–] 2 points3 points (4 children) Going a bit off topic here but I'm curious... of course our mathematics is sound Can't we attribute some of this to, like, practical application. I realize that this breaks down at some point (everyone knows induction doesn't actually work) but it also happens that when we use math, things tend to work out. [–] 1 point2 points (2 children) Well in the early days of set theory there were some results that were really unsettling. In naive set theory you could define a set to contain pretty much anything, unfortunately this means you can define paradoxical sets like the Russell set {x : x is not a member of itself} which seems to both be a member and not a member of itself. There were a few more set theoretic paradoxes discovered which helped to kick of a research program to find a set theory that did not lead to paradox. Ideally we would be able to prove that there was no contradiction inside the theory, but Godel ruined the party there. [–] 0 points1 point (1 child) I think you should tell the story of Godel the party pooper also while you are at it ; ) Really cool little summation! [–] 0 points1 point (0 children) Ok so partially as a response to the set theoretic paradox's David Hilbert set off on what is now known as Hilbert's program. What Hilbert's program was trying to achieve was a complete and consistent formalization of arithmetic. Complete in that every statement of arithmetic was either true of false, and consistent in that we have a proof that there are no statements come out as true or false. Things seem to be progressing, Russell and Whitehead produce a monstrous book that seems to show how you can produce arithmetic from formal logic. Then in 1931 Kurt Godel put a spanner in works. By encoding sentences about arithmetic as numbers, Godel was able to show how you can treat sentences about arithmetic as sentences of arithmetic. Once you have that you can encode a Godel sentence like "this sentence is not provable in arithmetic" into arithmetic. This kind of put a stop to the research program, as Godel was able to show that any consistent formal theory powerful enough express arthritic is able to provide a proof of all of the theorems in arithmetic, it will be incomplete because it cannot have a proof of the Godel Sentence - Hence why we call them Godel's Incompleteness Theorems. [–] 0 points1 point (0 children) Yes, this might be true. Perhaps this was even more true in the past before rigour became so important in mathematics... even back then it would produce pretty reliable results. Results to do with geometry and simple mechanics problems are relatively easy to verify experimentally. If you're an ancient Greek who isn't quite convinced by that Pythagorus bloke you can just go and measure a tonne of your own triangles and you'll have a hard time proving him wrong! I haven't studied this, but it seems likely that that kind of experimental reliability might be a reason people have an easy time trusting mathematics. Also, in the 19th century when formal logic was being developed and there were the stirrings of the movement to prove mathematics from the ground up, there was significant opposition to those ideas... some mathematicians felt that proper rigour was unnecessary and just got in the way of simple, elegant arguments. (Nowadays I think rigour is appreciated as a part of elegant mathematics to a great degree). And as an aside... (everyone knows induction doesn't actually work) I know you're talking about a different kind of induction, but a nice thing we can do with set theory is prove the soundness of mathematical induction :) [–] 2 points3 points (0 children) Using Birkhoff's representation theorem we can represent the elements of any distributive lattice as sets of join irreducible elements so that join and meet correspond to union and intersection. This leaves us with a partial order on the join irreducible elements in the distributive lattice. If the partial order is a distributive lattice we can apply this representation again. Well orders are the unique class of distributive lattices for which we can repeat this process indefinitely to get pure sets. These pure sets are precisely the Von Nuemann ordinals. [–] 1 point2 points (0 children) Early 20th century mathematicians wanted to formalize all of mathematics. Set theory is the unifying framework. So it's important to be able to represent the counting numbers (and the rationals and reals) within set theory. [–] 1 point2 points (1 child) Does this have a relationship with the Mandelbrot fractal? [–] 7 points8 points (0 children) No, not at all. [–] 1 point2 points (1 child) Why doesn't the structure have symmetry about the horizontal access? Is the relative size and position of the circles fixed by some mechanism (could you shift the locations of the circles without crossing boundaries or would that alter the accuracy of the visualization in some way)? Is there some sort of coordinate system in the plane upon which these circles are drawn? If you replaced the circles with single points at their center, would that imply any structure in the resulting field? I can't tell if the coordinates are arbitrary (set theory shouldn't imply coordinates) or if they are constructed somehow in the complex plane... Thanks for your patience, still learning and enjoying mathematics [–] 1 point2 points (0 children) This image is constructed by iterating 1. Drawing a circle 2. Drawing a new circle (not containing any other circles or contained in other circles) and then drawing a new copy all circles you have already drawn inside it. 3. Repeat number 2 until desired depth is reached. 4. Draw a circle around everything you have drawn so far. The arrangement of the circles is arbitrary as long as no borders are crossed and I personally find the arrangement used by /u/periscallop in a comment on this thread to be more intuitive. As /u/ihcn points out in another comment on this post the diameter of the circles grows as fast as the fibonacci sequence (which you should look at if you're not familiar with it as it is quite interesting), so while this picture could be drawn to have symmetry about the horizontal axis, to do so would require you to place every circle with it's center on the same horizontal line so the diameter of each circle would be the sum of the diameters of all smaller circles (as opposed to the current configuration which gives the diameter of a given circle to be the sum of the two biggest circles that are smaller than it). If this were done the size of the picture would thus increase dramatically and perhaps lose its value as a visual aid through sheer magnitude (or at least it's beauty). edit:Added step 4. [–] 1 point2 points (0 children) Eyes and noses everywhere. [–] 1 point2 points (2 children) I've read all 76 comments and I still have no clue what this picture is [–] 0 points1 point (1 child) In set theory the natural numbers (o,1,2,3,...) are constructed from the previous numbers, starting from 0. So we define 0 as the empty set. We denote sets with the "{,}" notation, so the empty set is "{" and "}" with nothing in between it. We get that 0 is {}. Now, we define 1 as the union of 0 and the set containing zero. The union of two sets is the set whose members are present in either of the original sets (So the union of {1,2} and {A,B} is {1,2,A,B}). So the union of 0 and the set containing zero is 0U{0}. There is nothing in 0, and there is only one thing in {0}, namely 0 itself. So 1 is {0}. Now, 2 is the union of 1 with the set containing 1, or more formally, 1U{1}. Now, the set 1 has only one thing in it, 0, and the set {1} has only one thing in it, 1. So 2 has two things in it, 0 and 1. So 2 is {0,1}. But remember that 1={0}, so in reality we can write 2 as {0,{0}}, or if we wanted to do it in terms of only the empty set 2={{},{{}}}. We do the same for 3 and 4 and so on. Now, what does this have to do with the picture? Well....the smallest circle is the empty set since it has nothing in it. The circle with only the empty circle is 1, and the circle with the empty Circle ALONG with the circle that contains only the empty circle is 2. That is what you are looking at! You are looking at 8. The largest circle is 8. You will see that it has 8 circles inside of it. One of those circles has 7 circles in it, making it 7. Of the circles in 7, one has 6 circles in it, making it 6. Of the circles in 6..... Its a very interesting representation. [–] 0 points1 point (0 children) Thank you for being awesome!!! [–] 0 points1 point (5 children) Is there a way to construct real numbers with set theory? [–] 2 points3 points (1 child) Everything can be constructed in a suitable set theory, pretty much. The usual approach is first constructing the integers from the naturals (pretty easy), then the rationals from the those (also quite simple). Then we construct the reals from the rationals, which is commonly done in one of two ways: Equivalence classes of Cauchy sequences of rationals or Dedekind cuts in rational sets. The former method is the nicest, IMHO, but both end up with objects with the same properties. [–] 0 points1 point (0 children) Or... given a base element 0, The natural numbers are a closure of 0 under the successor operation (induction.) The integers are a closure of the natural numbers under negation (or subtraction.) The rationals are a closure of the integers under coprime pairing. The computable numbers are a closure of the rationals under recursive enumeration. The reals are a closure of the computable numbers under Cauchy sequence convergence. The complex numbers are a closure of the reals under polynomial roots. At least, I'm pretty sure that's all correct. [–] 1 point2 points (1 child) You'll need to be a bit more precise ("set theory" is kind of vague), but I guess construction by Dedekind cuts is probably the closest. It doesn't particularly require any analysis or algebra. [–] 0 points1 point (0 children) But analysis and algebra can be founded upon set theory, so everything is set theory anyway... [–] 0 points1 point (1 child) Something I noticed: Based on that image, the minimum diameter of circle n appears to be the diameter of circle (n - 1) plus the diameter of circle (n - 2). This means if we set the diameter of circle 0 to be 1, and set the diameter of circle 1 to be 2, then the diameter of circle n is equal to fibonacci(n + 2) [–] 0 points1 point (0 children) Beautiful. [–]Topology 0 points1 point (1 child) I guess unions and intersections would be like max and min. How would addition and multiplication be defined? [–] 1 point2 points (0 children) one uses ordinal arithmetic for addition and multiplication, which are defined by recursion. [–] 0 points1 point (2 children) This is incredible. Where did this come from? [–][deleted] (1 child) [deleted] [–] 0 points1 point (0 children) That's really cool. Yeah, I understand basic set theory, but I've never seen a visual representation like this. Recursion for the win! [–] 0 points1 point (1 child) No one has mentioned the Power Set operator in the comment thread. s is a set then P(s) is the set of all subsets of s. Is this the operation performed? [–] 1 point2 points (0 children) No, that's way too powerful. All we're doing here is adding 1 via the successor operation of Peano arithmetic. 0, 1, 2, 3, ... Very primitive stuff. Exponentiation, that's way beyond us at this point! [–] 0 points1 point (0 children) The picture is much less pretty if you do it Zermelo's way. [–] 0 points1 point (0 children) This looks a lot like a 2D version of how I visualize higher dimensions. It'd be better if it was white on green, but it's an interesting comparison about nesting. [–] 0 points1 point (1 child) Was curious if the outermost circle would ever "fill up" at some point, turns out the filled fraction approaches 1/phi. [–][S] 0 points1 point (0 children) That makes sense, since the radii of the circles follow the fibonacci sequence. When I drew them by hand I just did whatever shape, not circles, and I think the hand-drawn versions had a better clarity at larger sizes since I could change how much empty space there was, whereas now up above about size ten the smallest circles are pretty much just dots unless the whole image is enormous. [–] -3 points-2 points (6 children) I'm really sorry if this isn't allowed but this post got me thinking about math and religion. I am a Freemason and in Masonry much is made of the connection between God and His creations (geometry is often talked about) but I am a terrible mathematician and it all goes over my head. I know great mathematical geniuses like Sir Isaac Newton were brethren, for instance, and I watched a BBC documentary series called 'Dangerous Knowledge' about the implications of mathematical study for even the most devout Christians (Georg Cantor) which I found fascinating if a little heady given my lack of math nous. To that end: do any of you see through your mathematical expertise an almost spiritual element to your science? [–] 8 points9 points (1 child) I'm not a religious person but I have always enjoyed the following description: Physics is the study of what God did and didn't do. Mathematics is the study of what God could and couldn't. [–] 1 point2 points (0 children) Interesting quote. I think that instead of saying "religious" I should have said "deist" to rid my comments of any connotations but your comment is thought-provoking to say the least. You'll probably hate me for quoting The Big Bang Theory but this kinda blew me away when I heard it (Leonard when asked about Sheldon's whereabouts): He's "tearing the mask off nature to look at the face of God". [–] 4 points5 points (0 children) I think a lot of people have spent time wondering about why maths is often as neat as it is. There are countless beautiful things in maths that might not have been true if logic had worked differently somehow. Of course whether that's possible or not is another matter... Anyway, I suppose you could view that kind of question as spiritual, but I'm not sure how many people really do. [–][deleted] (2 children) [deleted] [–] 0 points1 point (1 child) Sorry do you mind ELI5? I only did maths up to the equivalent of high school-level :$
  
  [–] -1 points0 points  (3 children)
  
  Hmmm, this engineering student feels stupid.
  
  ELI5
  
  [–] 0 points1 point  (2 children)
  
  Please see my reply a few comments up from here. If that doesn't help, feel free to ask more questions. The basic idea is to formalize the counting numbers using nothing but sets.
  
  [–] 0 points1 point  (1 child)
  
  Thank you. The explanation of the sets makes sense, but I don't understand this visualization of it.
  
  [–] 1 point2 points  (0 children)
  
  I had to stare at at a little. There's a big outer circle, that's 8. It should contain eight circles, which it does. In the upper right portion of the picture you can see a cluster of circles. One circle by itself is the empty set. Then there's a circle containing one circle. Then there's a circle containing the circle, the circle containing the circle, and the circle containing those two.
  
  [–] -1 points0 points  (0 children)
  
  Some good old C code. Hopefully easy to understand:
  
  #include <stdio.h>
  
  void ordinal_seq_output (int ord);
  
  void ordinal_output (int ord) {
  printf ("{");
  if (ord > 1) ordinal_seq_output (ord-1);
  printf ("}");
  }
  
  void ordinal_seq_output (int ord) {
  if (ord > 1) {
  ordinal_seq_output (ord-1);
  printf (",");
  }
  ordinal_output (ord);
  }
  
  int main () {
  int count;
  for (count = 1; count <= 6; count++) {
  ordinal_output (count);
  printf ("\n");
  }
  return 0;
  }
explanation: The provided text is a Reddit thread discussing a visual representation of the Von Neumann construction of natural numbers using nested circles. The thread includes the original post with an image and several comments from users discussing the mathematical concepts, providing explanations, and sharing code implementations.
  
  The thread contains multiple questions and answers, but no single question or answer stands out as the primary focus. Instead, it is a collection of discussions and insights related to the visual representation of natural numbers as sets.
distilabel_metadata.content: Evaluate the user given text extract and determine if it contains a math question and optionally and answer to this question.
  
  Output rules:
  
  1. Briefly describe the document and mention if it contains a question or a question and answer.
  2. Finalize the output with: Label: no-question,question,question-and-answer,multiple-question,multiple-question-and-answer
distilabel_metadata.role: system
distilabel_metadata.content: This is an archived post. You won't be able to vote or comment.
  
  [–] 117 points118 points  (36 children)
  
  how am I supposed to interpret this?
  
  [–][S] 62 points63 points  (33 children)
  
  The smallest circles each represent the empty set. Each circle represents a set. The circle containing only one other circle is of cardinality one, the next size up is two, etc. this whole thing is eight, while the biggest circle inside it is seven, and the circles outside the seven are zero through six, same as inside it.
  
  [–][deleted]  (7 children)
  
  [deleted]
  
  [–] 24 points25 points  (3 children)
  
  Well, "cardinality" isn't used in the definition. Without further axioms (such as foundation), cardinality isn't a convenient concept to work with.
  
  Instead, the numbers are directly defined as being the sets in question.
  
  [–][deleted]  (2 children)
  
  [deleted]
  
  [–] 3 points4 points  (1 child)
  
  I tried to read Knuth's "Surreal Numbers" and it lost me. I got some of it but went off the rails trying to map anything other than zero to any of the sets.
  
  EDIT: Looking at On Numbers and Games, it is a MUCH better treatment of the topic. Thanks for the pointer.
  
  [–] 0 points1 point  (0 children)
  
  I actually learned what surreal numbers are from this paper. I found it very well explained there.
  
  [–]Applied Math 7 points8 points  (0 children)
  
  Not as the cardinality, but as the set itself, or if you want to be fancy, the order type of that set (with elements ordered by set inclusion).
  
  n is not the union of the n–1 previous sets, but the set whose elements are the n–1 previous sets. This is an important difference.
  
  [–] 0 points1 point  (0 children)
  
  Not the union of the n-1 previous sets, but rather the set of the n-1 previous sets. There's another layer of nesting going on.
  
  [–] 2 points3 points  (13 children)
  
  Why is there a circle for zero?
  
  [–]Set Theory 19 points20 points  (8 children)
  
  As he said, the small circles represent the empty set. The smallest circle at the far left represents 0, which is the empty set.
  
  [–] 3 points4 points  (0 children)
  
  A circle containing no other circles seems like a reasonable depiction of the empty set. It's still a set, just one without anything in it.
  
  [–] 3 points4 points  (1 child)
  
  Because zero is the first natural number, at least for set theorists :)
  
  [–]Topology 2 points3 points  (0 children)
  
  And computer scientists!
  
  [–]Geometric Analysis 5 points6 points  (0 children)
  
  Each circle is a set containing the top-level circles within it. Interpreted in this way, the whole diagram is the Von Neumann representation of the integer 8.
  
  [–]Symplectic Topology 1 point2 points  (0 children)
  
  Start from the small circle at the left; this is the empty set = 0. The circle (set) containing it is 1. The circle containing 1 and another empty set is 2. And so on and so forth. In other words, the 9 circles which belong to an Hawaiian earring correspond to the numbers 0 through 8.
  
  [–] 66 points67 points  (9 children)
  
  You inspired me to write some Python code to generate svgs of these.
  
  Edit: With some tweaks, you can get other interesting layouts.
  
  Edit: Here's a version using color. Every circle that is the same color represents the same set.
  
  [–] 10 points11 points  (1 child)
  
  And your code allowed me to try it with shaded circles. Thanks
  
  [–] 13 points14 points  (0 children)
  
  Here's a render of that at about 25% mag.
  
  [–][S] 6 points7 points  (4 children)
  
  That's awesome, especially the use of cosines to find the angles in between them. I'm totally gonna use this to fix my mathematica code up.
  
  [–] 1 point2 points  (3 children)
  
  If any part is unclear, just ask.
  
  [–] 1 point2 points  (0 children)
  
  I changed the last few parts to print to a file. It is a trivial change but I think easier than having to print a buncha stuff to the screen.
  
  def printsvg(c, pos, svg):
  svg.write('<circle cx="%f" cy="%f" r="%f" fill="white" stroke="black" />' % (zoom * pos[0], zoom *  pos[1], zoom * c.radius))
  for p in c.contents:
  printsvg(p.circle, (pos[0] + p.pos[0], pos[1] + p.pos[1]),svg)
  
  zoom = 5
  c = make(10)
  
  size = zoom * c.radius * 2
  svg = open('circles.svg','w')
  svg.write('<svg xmlns="http://www.w3.org/2000/svg" width="%f" height="%f">' % (size, size))
  svg.write('</svg>')
  svg.close()
  
  
  [–] 1 point2 points  (1 child)
  
  Can you describe what you changed for the "tweaked" version? I'm trying to follow the code but I keep ending up with just junk when I try to modify any positional code.
  
  [–] 2 points3 points  (0 children)
  
  The positioning logic stands to be clarified a bit (both the way it works in the code and by explanation). nest() does the logical work of where to be placing circles, and getnestpos() does the math for actually placing a circle in a given spot.
  
  getnestpos() takes three circles (a, b, and c) and returns the location for the third so that it is "below" the first two (so they are in order clockwise). The ap/bp bit is where it gets confusing---since the Circle objects don't actually have positions (there is only one Circle for each set, even though each is referenced many times) it is the Placement object which places a Circle within another Circle. Without ap/bp, the returned position is from the perspective of a Circle containing a and b adjacent to each other left-to-right (as the first two Circles within any Circle are). Given ap/bp, the position is corrected to account for different positions of a and b. It probably should just always be the latter way, but because of the way the code evolved that's how it is.
  
  Hopefully that helps and doesn't just make it more confusing. (:
  
  [–][S] 1 point2 points  (1 child)
  
  You try using shapes other than circles for the larger sets? When I drew it by hand I used teardrop shapes for a lot of them, and just let the arrangement of the contents dictate the size and shape of the overall thing. That meant I could fit more information into less space but the boundaries got jumbled sometimes, which was where having a colour scheme became helpful.
  
  [–] 0 points1 point  (0 children)
  
  I didn't. Here's a sketch of rectangles. I'd be interested to see your hand drawing. A lot of the shapes I just tried don't pack well.
  
  [–] 87 points88 points  (33 children)
  
  the empty set
  the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set and the set that contains the set that contains the empty set
  
  
  [–] 32 points33 points  (1 child)
  
  Oh, now I get it.
  
  [–]Topology 11 points12 points  (0 children)
  
  [–][deleted]  (2 children)
  
  [deleted]
  
  [–] 21 points22 points  (1 child)
  
  Dental plan.
  
  [–] 6 points7 points  (0 children)
  
  Lisa needs braces.
  
  [–]Discrete Math 2 points3 points  (1 child)
  
  #include <stdio.h>
  #define MAXLENGTH 100
  
  int argc = 0;
  int num[MAXLENGTH] = { 0 };
  char** p;
  
  void main(int n, char **p)
  {
  
  int index = (n - 1)*(n) / 2;
  if (index + n + 1 > MAXLENGTH){
  printf("%d\n%d", n, index);
  getchar();
  }
  int tempn = n;
  int i = 0;
  
  switch (tempn){
  case 0: printf("the empty set\n");
  main(n + 1, p);
  case 1: num[index] = 1;
  break;
  default:
  num[index] = 3;
  index++;
  for (i = 0; i<n - 2; i++){
  num[index] = 2;
  index++;
  }
  num[index] = 1;
  break;
  
  }
  for (i = 0; i <= index; i++){
  switch (num[i]){
  case 1: printf("the set that contains the empty set");
  break;
  case 2: printf("the set that contains ");
  break;
  case 3: printf(" and the set that contains ");
  break;
  default:
  printf("error");
  break;
  }
  }
  printf("\n");
  main(n + 1, p);
  }
  
  
  [–]Discrete Math 0 points1 point  (0 children)
  
  This isn't really correct so i fixed it for what the OP did. I made it more obtuse.
  
  #include <stdio.h>
  #define MAXLENGTH 10000
  
  int n = 0;
  int num[MAXLENGTH] = { 0 };
  char** p;
  
  void main(int argc, char **p)
  {
  n = argc - 1;
  int index = 0;
  switch (n){
  case 0:
  break;
  case 1: index = 0;
  break;
  case 2: index = 1;
  break;
  default:
  index = (2 << (n - 1)) - (2 << (n - 2)) - 1;
  }
  if (index + (2 << (n - 1)) > MAXLENGTH){
  printf("%d\n%d", n - 1, index);
  getchar();
  }
  int tempn = n;
  int i = 0;
  
  switch (tempn){
  case 0: printf("the empty set\n");
  main(n + 2, p);
  case 1: num[index] = 1;
  break;
  case 2: num[index] = 2;
  index++;
  num[index] = 1;
  break;
  default:
  for (i = 0; i < (2 << (n - 3)); i++){
  num[index] = 2;
  num[index + 1] = 1;
  index += 2;
  }
  index--;
  break;
  }
  for (i = 0; i <= index; i++){
  switch (num[i]){
  case 1: printf("the set that contains the empty set");
  break;
  case 2: printf(" and ");
  break;
  default:
  printf("error");
  break;
  }
  }
  printf("\n");
  main(n + 2, p);
  }
  
  
  [–] 2 points3 points  (2 children)
  
  Self contained Haskell reading the number to print from the command-line. :)
  
  module Main where
  
  sentence :: [String]
  sentence = "the empty set" : tstc
  : map ((tstc ++ " and ") ++) (tail sentence)
  where tstc = "the set that contains " ++ head sentence
  
  main :: IO ()
  main = do
  n <- fmap read $getLine mapM_ putStrLn$ take (max 0 (1+n)) sentence
  
  
  [–] 3 points4 points  (0 children)
  
  You made a mistake. You are generating
  
  {}
  {{}}
  {{}, {{}}}
  {{}, {{}, {{}}}}
  {{}, {{}, {{}, {{}}}}}
  
  
  which is correct for 0,1,2, but incorrect afterward. Notice your 3 is {0,2} instead of {0,1,2}.
  
  module Sets where
  import Data.List (intercalate)
  
  s = "the empty set" : map g [1..]
  g n = "(the set that contains " ++ intercalate " and " (take n s) ++ ")"
  
  printN n = mapM_ putStrLn $take (n+1) s *Sets> printN 3 the empty set (the set that contains the empty set) (the set that contains the empty set and (the set that contains the empty set)) (the set that contains the empty set and (the set that contains the empty set) and (the set that contains the empty set and (the set that contains the empty set)))  [–] 1 point2 points (0 children) That is beautiful [–] 1 point2 points (0 children) Is this right? Correct me if I'm wrong, but I thought it went more like... 0: {} ("the empty set") 1: {{}} ("the set that contains the empty set") 2: {{},{{}}} ("the set that contains the empty set and the set that contains the empty set"). etc. The final sentence is a bit tricky to parse. Here it is written parenthesized: "the set that contains (the empty set and (the set that contains the empty set))" [–] 0 points1 point (16 children) Here's my semi-recursive, semi-iterative solution. I didn't check any of the math behind it. I don't know any of the math behind it. I'm just following your pattern: public class SetItAndForgetIt { public static void main(String[] args) { for(int k=1; k<=8;k++) System.out.println(set(k)); } public static String set(int num){ if(num<=0) return ""; if(num ==1) return "the empty set"; else if(num==2) return "the set that contains " + set(1); else if(num==3) return set(2) + " and the set that contains the set that contains the empty set"; else{ String appendage = " and the set that contains the set that contains the empty set"; StringBuilder appendSet = new StringBuilder(""); int numIterations = (int)Math.pow(2,num-2)-1; for(int k=0; k<numIterations; k++) appendSet.append(appendage); return set(3) + appendSet; } } }  [–] 0 points1 point (12 children) Java? Why? [–] 20 points21 points (11 children) Because it's the environment I have set up right now. Does the job just as well as anything else! [–] 12 points13 points (10 children) Ah. That makes sense. I just thought you really liked Java if you code up math in it. [–] 6 points7 points (9 children) God forbid someone like java.... Nah, that's right, java is dicks. [–] 2 points3 points (8 children) I'd just expect it in something without boilerplate like Python or pseudocode or a functional language like Lisp or Haskell. Maybe C. [–][deleted] (7 children) [deleted] [–] 0 points1 point (6 children) I just meant for typing out an algorithm in a reddit comment. No need for #includes and all that jazz. [–][deleted] (3 children) [deleted] [–] 0 points1 point (1 child) But C does require includes [–] 0 points1 point (2 children) He did in 8 lines what you did in 25. You could at least up the ante a bit. [–] 15 points16 points (1 child) He did in n lines what I did in 25. I win for high values of n! [–] 0 points1 point (0 children) Except 8! :/ [–] 0 points1 point (0 children) F# although I'm sure there's a better way to do it. [<EntryPoint>] let main argv = let rec gen li = match li with | [] -> "{}" | hd::tl -> "{" + gen tl + "}" let rec appl li f = match li with | [] -> (f [])::[] | li -> (f li)::(appl li.Tail f) printfn "%A" (appl [1..System.Int32.Parse(argv.[0])] gen) 0  [–] -5 points-4 points (3 children) int main(void) { while (1) { printf("the set that contains the empty set and "); } }  [–]Algebra 1 point2 points (2 children) More along the lines of F(n) { Print "the set that contains the empty set and"; F(n-1); } [–] 2 points3 points (1 child) F(n) { print "the set that contains the empty set"; if n>1 print " and "; F(n-1); } [–] 2 points3 points (0 children) Technically you'd need a base case for n=0 [–] 16 points17 points (7 children) Perhaps a simpler representation might help those who haven't seen this before. ∅ is the empty set. {∅} is the set containing the empty set. {∅, {∅}} is the set containing the empty set and the set containing the empty set. {∅, {∅}, {∅, {∅}}} is the set containing the empty set, the set containing the empty set, and the set containing the empty set and the set containing the empty set. etc. In order to model the counting numbers within set theory, we let 0 = ∅ 1 = {0} etc. This is not the only way to model the counting numbers in set theory, but it's the standard way. It has the virtue that the set representing the number n has exactly n elements. It also has the virtue that the '<' relationship can be interpreted as the set membership operator '∈'. In other words we know that 5 < 7 because as sets, 5 ∈ 7. [Note that it's absurd in the intuitive, everyday view of the counting numbers to say that "5 is an element of 7." That's why this construction can be criticized on philosophical grounds. /r/fmota mentioned Benacerraf's article addressing this point.] The general construction is known as the Von Neumann ordinals, in honor of John von Neumann, a mathematician of the 40's and 50's who did brilliant work in several fields from set theory to economics and physics. http://en.wikipedia.org/wiki/Ordinal_number#Von_Neumann_definition_of_ordinals http://en.wikipedia.org/wiki/John_von_Neumann [–] 1 point2 points (1 child) Good call on the whole "lets try to explain this" deal. Very helpful and surprisingly easy to understand. Isn't it true that the natural numbers don't contain 0 though? [–] 5 points6 points (0 children) Whether ℕ starts at 0 or 1 depends on what you're doing; some fields use ℕ = {1,2,3,...} while others use ℕ = {0,1,2,...}. [–] 0 points1 point (1 child) How did you get that symbol? The best I could manage is Ø... [–] 0 points1 point (0 children) [–] 0 points1 point (1 child) Is there any reason, other than the < relation, why this recursive and rapidly-exploding definition is more useful than just calling "Contains" to be the successor function, like {}, {{}}, {{{}}}, {{{{}}}}, etc.? Do things like addition have any interesting analogues in this construction? [–] 0 points1 point (0 children) One of the particularly important ideas is that n has n elements, so cardinality is conveniently defined as a bijection with a natural number. EDIT: Also, if you're asking this, I think you've misunderstood the importance of being (well) ordered by set membership. [–] 0 points1 point (0 children) [Note that it's absurd in the intuitive, everyday view of the counting numbers to say that "5 is an element of 7." That's why this construction can be criticized on philosophical grounds. /r/fmota[1] mentioned Benacerraf's article addressing this point.] Just to supplement this point: the criticism isn't of this construction of the natural numbers, but the identification of the natural numbers to this particular construction. He argues that numbers should be understood as the structure common to all such constructions (any omega-sequence). [–] 33 points34 points (1 child) It seems you've discovered Gallifreyan. [–] 1 point2 points (0 children) I thought this was posted in /r/gallifreyan when I first clicked it. [–][S] 15 points16 points (4 children) It's sloppy, I was coding it in mathematica and got sick of it so just photoshopped a bunch of them into place, but I'm trying to figure out a way of making it so if I just type a number in it builds the whole thing. I'm trying to use the project as a way of teaching myself to code properly in mathematica. [–] 2 points3 points (2 children) That's beautiful -- does mathematica natively support vector image representation of algebraic expressions? [–]Mathematical Finance 7 points8 points (1 child) no matter what your problem is, there is a SolveMyProblem[] function in Mathematica /s [–] 2 points3 points (0 children) Which is why I love it. It's a lazy man's dream. [–] 0 points1 point (0 children) It looks great! Is there any (easy) way for you to make this into a gif? [–] 2 points3 points (1 child) This...would make for a very cool tattoo. [–][S] 1 point2 points (0 children) It's totally what I'm getting done next. [–] 2 points3 points (0 children) Looks like a backwards smith chart for the first few circles [–] 2 points3 points (3 children) I am going to paint this onto bones with acrylic pens and lots of tedious dedication. I find this utterly compelling aesthetically, even though I'm struggling to understand it mathematically. [–][deleted] (2 children) [deleted] [–] 2 points3 points (1 child) [–] 4 points5 points (5 children) Nice visualization! This just highlights to me the ridiculousness of using sets to represent natural numbers. And, of course, it's not unique ... you could choose to represent natural numbers as sets in different ways. Actually, there is a deeper issue. See Benacerraf's "What Numbers Could Not Be". Here's a nice introduction to the problem. [–] 6 points7 points (0 children) Isn't that more a criticism of platonist attitudes to set theoretic representations of natural numbers in set theory? If you can prove that these sets have all the desired properties, and then use that to prove other theorems and so on, without claiming that some set is some number on some universal level... what's so ridiculous about that? [–] 1 point2 points (2 children) Why does it matter what the numbers "are" as long as they behave how we expect them to? We have convenient shorthand syntax such as "2" and "348". [–] 1 point2 points (0 children) I'm sure there's a more in depth reason but in my experience the answer is two fold. First is the simple fact that thinking about abstract problems like this has often lead to the creation of practical solutions. I can't actually think of a good one off the top of my head though. Second is that at some point in the future, numbers may not behave how we expect them to. As fields of study become more and more cutting edge, with physics in particular, the universe becomes increasingly strange and it becomes helpful to have a more base understanding of the things we currently take for granted. [–] -2 points-1 points (0 children) I have been thinking about this. Clearly "2" and "3" are related. You can place a line of symmetry through "3" and one part will be a "2". This is illustrated by the "4", which is of course just a intersection like a "+" or an "x". I'm glad that whoever designed these things had short hands, or else there's no way they would act like we would expect. [–] 0 points1 point (0 children) Uhm, both are true identities? Every collection of sets that follows the arithmetic rules you want is isomorphic to each other in a way that preserves addition, multiplication, successor, zero, one, and pretty much any other arithmetic function you'd want. They're just pointing out that "is an element of" isn't mapped to exactly the same thing between the two representations. Which is fine, because we don't care about keeping that relationship - if we did, then representations that do not have smaller numbers as elements of larger ones would not be considered numbers. [–] 1 point2 points (9 children) Why is it useful to represent the natural numbers like this? Or I guess more generally as the Von Neumann representation? [–] 7 points8 points (0 children) Convenience. The usual notion of < becomes set membership, which simplifies things. [–] 5 points6 points (5 children) You can define the language of set theory as a language of first order logic with only one non-logical symbol, representing set membership. Then you can use formal logic to prove basic facts about arithmetic and other fundamental mathematics. Then you can be assured that your mathematical reasoning is as sound as your logic. Nowadays we think of course our mathematics is sound, but we can think that with confidence mainly because of logicians and set theorists working around a century ago (and a few decades before and after) who formalised things like this using set theory (and formalising set theory using logic). [–] 2 points3 points (4 children) Going a bit off topic here but I'm curious... of course our mathematics is sound Can't we attribute some of this to, like, practical application. I realize that this breaks down at some point (everyone knows induction doesn't actually work) but it also happens that when we use math, things tend to work out. [–] 1 point2 points (2 children) Well in the early days of set theory there were some results that were really unsettling. In naive set theory you could define a set to contain pretty much anything, unfortunately this means you can define paradoxical sets like the Russell set {x : x is not a member of itself} which seems to both be a member and not a member of itself. There were a few more set theoretic paradoxes discovered which helped to kick of a research program to find a set theory that did not lead to paradox. Ideally we would be able to prove that there was no contradiction inside the theory, but Godel ruined the party there. [–] 0 points1 point (1 child) I think you should tell the story of Godel the party pooper also while you are at it ; ) Really cool little summation! [–] 0 points1 point (0 children) Ok so partially as a response to the set theoretic paradox's David Hilbert set off on what is now known as Hilbert's program. What Hilbert's program was trying to achieve was a complete and consistent formalization of arithmetic. Complete in that every statement of arithmetic was either true of false, and consistent in that we have a proof that there are no statements come out as true or false. Things seem to be progressing, Russell and Whitehead produce a monstrous book that seems to show how you can produce arithmetic from formal logic. Then in 1931 Kurt Godel put a spanner in works. By encoding sentences about arithmetic as numbers, Godel was able to show how you can treat sentences about arithmetic as sentences of arithmetic. Once you have that you can encode a Godel sentence like "this sentence is not provable in arithmetic" into arithmetic. This kind of put a stop to the research program, as Godel was able to show that any consistent formal theory powerful enough express arthritic is able to provide a proof of all of the theorems in arithmetic, it will be incomplete because it cannot have a proof of the Godel Sentence - Hence why we call them Godel's Incompleteness Theorems. [–] 0 points1 point (0 children) Yes, this might be true. Perhaps this was even more true in the past before rigour became so important in mathematics... even back then it would produce pretty reliable results. Results to do with geometry and simple mechanics problems are relatively easy to verify experimentally. If you're an ancient Greek who isn't quite convinced by that Pythagorus bloke you can just go and measure a tonne of your own triangles and you'll have a hard time proving him wrong! I haven't studied this, but it seems likely that that kind of experimental reliability might be a reason people have an easy time trusting mathematics. Also, in the 19th century when formal logic was being developed and there were the stirrings of the movement to prove mathematics from the ground up, there was significant opposition to those ideas... some mathematicians felt that proper rigour was unnecessary and just got in the way of simple, elegant arguments. (Nowadays I think rigour is appreciated as a part of elegant mathematics to a great degree). And as an aside... (everyone knows induction doesn't actually work) I know you're talking about a different kind of induction, but a nice thing we can do with set theory is prove the soundness of mathematical induction :) [–] 2 points3 points (0 children) Using Birkhoff's representation theorem we can represent the elements of any distributive lattice as sets of join irreducible elements so that join and meet correspond to union and intersection. This leaves us with a partial order on the join irreducible elements in the distributive lattice. If the partial order is a distributive lattice we can apply this representation again. Well orders are the unique class of distributive lattices for which we can repeat this process indefinitely to get pure sets. These pure sets are precisely the Von Nuemann ordinals. [–] 1 point2 points (0 children) Early 20th century mathematicians wanted to formalize all of mathematics. Set theory is the unifying framework. So it's important to be able to represent the counting numbers (and the rationals and reals) within set theory. [–] 1 point2 points (1 child) Does this have a relationship with the Mandelbrot fractal? [–] 7 points8 points (0 children) No, not at all. [–] 1 point2 points (1 child) Why doesn't the structure have symmetry about the horizontal access? Is the relative size and position of the circles fixed by some mechanism (could you shift the locations of the circles without crossing boundaries or would that alter the accuracy of the visualization in some way)? Is there some sort of coordinate system in the plane upon which these circles are drawn? If you replaced the circles with single points at their center, would that imply any structure in the resulting field? I can't tell if the coordinates are arbitrary (set theory shouldn't imply coordinates) or if they are constructed somehow in the complex plane... Thanks for your patience, still learning and enjoying mathematics [–] 1 point2 points (0 children) This image is constructed by iterating 1. Drawing a circle 2. Drawing a new circle (not containing any other circles or contained in other circles) and then drawing a new copy all circles you have already drawn inside it. 3. Repeat number 2 until desired depth is reached. 4. Draw a circle around everything you have drawn so far. The arrangement of the circles is arbitrary as long as no borders are crossed and I personally find the arrangement used by /u/periscallop in a comment on this thread to be more intuitive. As /u/ihcn points out in another comment on this post the diameter of the circles grows as fast as the fibonacci sequence (which you should look at if you're not familiar with it as it is quite interesting), so while this picture could be drawn to have symmetry about the horizontal axis, to do so would require you to place every circle with it's center on the same horizontal line so the diameter of each circle would be the sum of the diameters of all smaller circles (as opposed to the current configuration which gives the diameter of a given circle to be the sum of the two biggest circles that are smaller than it). If this were done the size of the picture would thus increase dramatically and perhaps lose its value as a visual aid through sheer magnitude (or at least it's beauty). edit:Added step 4. [–] 1 point2 points (0 children) Eyes and noses everywhere. [–] 1 point2 points (2 children) I've read all 76 comments and I still have no clue what this picture is [–] 0 points1 point (1 child) In set theory the natural numbers (o,1,2,3,...) are constructed from the previous numbers, starting from 0. So we define 0 as the empty set. We denote sets with the "{,}" notation, so the empty set is "{" and "}" with nothing in between it. We get that 0 is {}. Now, we define 1 as the union of 0 and the set containing zero. The union of two sets is the set whose members are present in either of the original sets (So the union of {1,2} and {A,B} is {1,2,A,B}). So the union of 0 and the set containing zero is 0U{0}. There is nothing in 0, and there is only one thing in {0}, namely 0 itself. So 1 is {0}. Now, 2 is the union of 1 with the set containing 1, or more formally, 1U{1}. Now, the set 1 has only one thing in it, 0, and the set {1} has only one thing in it, 1. So 2 has two things in it, 0 and 1. So 2 is {0,1}. But remember that 1={0}, so in reality we can write 2 as {0,{0}}, or if we wanted to do it in terms of only the empty set 2={{},{{}}}. We do the same for 3 and 4 and so on. Now, what does this have to do with the picture? Well....the smallest circle is the empty set since it has nothing in it. The circle with only the empty circle is 1, and the circle with the empty Circle ALONG with the circle that contains only the empty circle is 2. That is what you are looking at! You are looking at 8. The largest circle is 8. You will see that it has 8 circles inside of it. One of those circles has 7 circles in it, making it 7. Of the circles in 7, one has 6 circles in it, making it 6. Of the circles in 6..... Its a very interesting representation. [–] 0 points1 point (0 children) Thank you for being awesome!!! [–] 0 points1 point (5 children) Is there a way to construct real numbers with set theory? [–] 2 points3 points (1 child) Everything can be constructed in a suitable set theory, pretty much. The usual approach is first constructing the integers from the naturals (pretty easy), then the rationals from the those (also quite simple). Then we construct the reals from the rationals, which is commonly done in one of two ways: Equivalence classes of Cauchy sequences of rationals or Dedekind cuts in rational sets. The former method is the nicest, IMHO, but both end up with objects with the same properties. [–] 0 points1 point (0 children) Or... given a base element 0, The natural numbers are a closure of 0 under the successor operation (induction.) The integers are a closure of the natural numbers under negation (or subtraction.) The rationals are a closure of the integers under coprime pairing. The computable numbers are a closure of the rationals under recursive enumeration. The reals are a closure of the computable numbers under Cauchy sequence convergence. The complex numbers are a closure of the reals under polynomial roots. At least, I'm pretty sure that's all correct. [–] 1 point2 points (1 child) You'll need to be a bit more precise ("set theory" is kind of vague), but I guess construction by Dedekind cuts is probably the closest. It doesn't particularly require any analysis or algebra. [–] 0 points1 point (0 children) But analysis and algebra can be founded upon set theory, so everything is set theory anyway... [–] 0 points1 point (1 child) Something I noticed: Based on that image, the minimum diameter of circle n appears to be the diameter of circle (n - 1) plus the diameter of circle (n - 2). This means if we set the diameter of circle 0 to be 1, and set the diameter of circle 1 to be 2, then the diameter of circle n is equal to fibonacci(n + 2) [–] 0 points1 point (0 children) Beautiful. [–]Topology 0 points1 point (1 child) I guess unions and intersections would be like max and min. How would addition and multiplication be defined? [–] 1 point2 points (0 children) one uses ordinal arithmetic for addition and multiplication, which are defined by recursion. [–] 0 points1 point (2 children) This is incredible. Where did this come from? [–][deleted] (1 child) [deleted] [–] 0 points1 point (0 children) That's really cool. Yeah, I understand basic set theory, but I've never seen a visual representation like this. Recursion for the win! [–] 0 points1 point (1 child) No one has mentioned the Power Set operator in the comment thread. s is a set then P(s) is the set of all subsets of s. Is this the operation performed? [–] 1 point2 points (0 children) No, that's way too powerful. All we're doing here is adding 1 via the successor operation of Peano arithmetic. 0, 1, 2, 3, ... Very primitive stuff. Exponentiation, that's way beyond us at this point! [–] 0 points1 point (0 children) The picture is much less pretty if you do it Zermelo's way. [–] 0 points1 point (0 children) This looks a lot like a 2D version of how I visualize higher dimensions. It'd be better if it was white on green, but it's an interesting comparison about nesting. [–] 0 points1 point (1 child) Was curious if the outermost circle would ever "fill up" at some point, turns out the filled fraction approaches 1/phi. [–][S] 0 points1 point (0 children) That makes sense, since the radii of the circles follow the fibonacci sequence. When I drew them by hand I just did whatever shape, not circles, and I think the hand-drawn versions had a better clarity at larger sizes since I could change how much empty space there was, whereas now up above about size ten the smallest circles are pretty much just dots unless the whole image is enormous. [–] -3 points-2 points (6 children) I'm really sorry if this isn't allowed but this post got me thinking about math and religion. I am a Freemason and in Masonry much is made of the connection between God and His creations (geometry is often talked about) but I am a terrible mathematician and it all goes over my head. I know great mathematical geniuses like Sir Isaac Newton were brethren, for instance, and I watched a BBC documentary series called 'Dangerous Knowledge' about the implications of mathematical study for even the most devout Christians (Georg Cantor) which I found fascinating if a little heady given my lack of math nous. To that end: do any of you see through your mathematical expertise an almost spiritual element to your science? [–] 8 points9 points (1 child) I'm not a religious person but I have always enjoyed the following description: Physics is the study of what God did and didn't do. Mathematics is the study of what God could and couldn't. [–] 1 point2 points (0 children) Interesting quote. I think that instead of saying "religious" I should have said "deist" to rid my comments of any connotations but your comment is thought-provoking to say the least. You'll probably hate me for quoting The Big Bang Theory but this kinda blew me away when I heard it (Leonard when asked about Sheldon's whereabouts): He's "tearing the mask off nature to look at the face of God". [–] 4 points5 points (0 children) I think a lot of people have spent time wondering about why maths is often as neat as it is. There are countless beautiful things in maths that might not have been true if logic had worked differently somehow. Of course whether that's possible or not is another matter... Anyway, I suppose you could view that kind of question as spiritual, but I'm not sure how many people really do. [–][deleted] (2 children) [deleted] [–] 0 points1 point (1 child) Sorry do you mind ELI5? I only did maths up to the equivalent of high school-level :$
  
  [–] -1 points0 points  (3 children)
  
  Hmmm, this engineering student feels stupid.
  
  ELI5
  
  [–] 0 points1 point  (2 children)
  
  Please see my reply a few comments up from here. If that doesn't help, feel free to ask more questions. The basic idea is to formalize the counting numbers using nothing but sets.
  
  [–] 0 points1 point  (1 child)
  
  Thank you. The explanation of the sets makes sense, but I don't understand this visualization of it.
  
  [–] 1 point2 points  (0 children)
  
  I had to stare at at a little. There's a big outer circle, that's 8. It should contain eight circles, which it does. In the upper right portion of the picture you can see a cluster of circles. One circle by itself is the empty set. Then there's a circle containing one circle. Then there's a circle containing the circle, the circle containing the circle, and the circle containing those two.
  
  [–] -1 points0 points  (0 children)
  
  Some good old C code. Hopefully easy to understand:
  
  #include <stdio.h>
  
  void ordinal_seq_output (int ord);
  
  void ordinal_output (int ord) {
  printf ("{");
  if (ord > 1) ordinal_seq_output (ord-1);
  printf ("}");
  }
  
  void ordinal_seq_output (int ord) {
  if (ord > 1) {
  ordinal_seq_output (ord-1);
  printf (",");
  }
  ordinal_output (ord);
  }
  
  int main () {
  int count;
  for (count = 1; count <= 6; count++) {
  ordinal_output (count);
  printf ("\n");
  }
  return 0;
  }
distilabel_metadata.role: user
distilabel_metadata.raw_output_q_a_detector_0: The provided text is a Reddit thread discussing a visual representation of the Von Neumann construction of natural numbers using nested circles. The thread includes the original post with an image and several comments from users discussing the mathematical concepts, providing explanations, and sharing code implementations.
  
  The thread contains multiple questions and answers, but no single question or answer stands out as the primary focus. Instead, it is a collection of discussions and insights related to the visual representation of natural numbers as sets.
  
  Label: multiple-question-and-answer