Fichier:Collatz-graph-20-iterations.svg

Le contenu de la page n’est pas pris en charge dans d’autres langues.
Une page de Wikipédia, l'encyclopédie libre.

Fichier d’origine(Fichier SVG, nominalement de 1 440 × 1 406 pixels, taille : 520 kio)

Ce fichier et sa description proviennent de Wikimedia Commons.

Description

Description
English: This is a graph, generated in bottom-up fashion, of the orbits of all numbers under the Collatz map with an orbit length of 20 or less.

Created with Graphviz, with the help of this Python program:

 # This python script generates a graph that shows 20 levels of the Collatz Conjecture.
 
 level = [1] # The root of the tree contains only "1"
 results = {} # This will hold the relationships for the graph
 
 # Loop 20 times
 for c in range(20):
     newlevel = set() # This will be the set of numbers in the level above us
     for x in level: # We now loop through each number in our current level
 
         # There will only sometimes be an odd multiple of 3 (plus one) above us
         # When (x-1) mod 3 is 0, x is an even number half the time
         # So we check against (x-4) mod 6 because we don't want to find evens
         odd = (x-1)/3 if not (x-4)%6 else 0
         if odd > 1: # We don't want 1 (the root) or 0 (no odd found)
             newlevel.add(odd) # Put this into the next level
             results[odd] = x # Add a relationship to the graph
 
         newlevel.add(x*2); # There will always be an even number above us
         results[x*2] = x # Add a relationship to the graph
 
     # Finally, advance to the next level
     level = newlevel
 
 # Technically, 1 is odd so 1*3+1 = 4. If included though, this tends to make 2 and 1 overlap on the graph, which is ugly.
 # Uncomment to include this relationship:
 # results[1] = 4;
 
 # Now we write the graph out to a file in dot format so that graphviz can read it
 f = open('collatz.dot', 'w')
 # For aesthetic reasons we set 8 as the centre node instead of 1
 f.write('digraph G {\n    size="16,16";\n    root=8;\n    splines=true;\n')
 for x in results:
     f.write("    %d -> %d;\n" % (x, results[x]))
 f.write('}\n')
 f.close()
 print "Generated %d nodes" % len(results)
Date 7 mars 2010 (date de téléversement originale)
Source Transféré de en.wikipedia à Commons par Derlay utilisant CommonsHelper.
Auteur TerrorBite sur Wikipédia anglais

Conditions d’utilisation

Public domain Cette œuvre a été placée dans le domaine public par son auteur, TerrorBite sur Wikipédia anglais. Ceci s’applique dans le monde entier.
Dans certains pays, ceci peut ne pas être possible ; dans ce cas :
TerrorBite accorde à toute personne le droit d’utiliser cette œuvre dans n’importe quel but, sans aucune condition, sauf celles requises par la loi.

Journal des téléversements d’origine

La page de description originale était ici. Tous les noms d'utilisateur qui suivent se rapportent à en.wikipedia.
  • 2010-03-07 16:29 TerrorBite 1440×1406× (532396 bytes) This is a graph, generated in bottom-up fashion, of the orbits of all numbers under the Collatz map with an orbit length of 20 or less. Created with [[Graphviz]], with the help of this [[Python (programming language)|Python]] program: # This python sc

Légendes

Ajoutez en une ligne la description de ce que représente ce fichier

Éléments décrits dans ce fichier

dépeint

image/svg+xml

e228f25d455662fa61e6e4f16b60ef24be090161

532 396 octet

1 406 pixel

1 440 pixel

Historique du fichier

Cliquer sur une date et heure pour voir le fichier tel qu'il était à ce moment-là.

Date et heureVignetteDimensionsUtilisateurCommentaire
actuel25 mai 2010 à 12:00Vignette pour la version du 25 mai 2010 à 12:001 440 × 1 406 (520 kio)Derlay{{Information |Description={{en|This is a graph, generated in bottom-up fashion, of the orbits of all numbers under the Collatz map with an orbit length of 20 or less. Created with en:Graphviz, with the help of this [[:en:Python (programming langua

Aucune page n’utilise ce fichier.

Usage global du fichier

Les autres wikis suivants utilisent ce fichier :