Paraffins: Difference between revisions

Content added Content deleted
m (added whitespace)
m (aligned formulas, used colored window, increased whitespace.)
Line 9:
 
 
Paraffins are built up using only carbon atoms, which has four bonds, and hydrogen, which has one bond.   All bonds for each atom must be used, so it is easiest to think of an alkane as linked carbon atoms forming the "backbone" structure, with adding hydrogen atoms linking the remaining unused bonds.
 
In a paraffin, one is allowed neither double bonds (two bonds between the same pair of atoms), nor cycles of linked carbons. &nbsp; So all paraffins with &nbsp; '''n''' &nbsp; carbon atoms share the empirical formula &nbsp; &nbsp; <big>C<sub>n</sub>H<sub>2n+2</sub></big>
Line 17:
The number of isomers rises rather rapidly when &nbsp; '''n''' &nbsp; increases.
 
In counting isomers it should be borne in mind that the four bond positions on a given carbon atom can be freely interchanged and bonds rotated (including 3-D "out of the paper" rotations when it's being observed on a flat diagram), &nbsp; so rotations or re-orientations of parts of the molecule (without breaking bonds) do not give different isomers. &nbsp; So what seem at first to be different molecules may in fact turn out to be different orientations of the same molecule.
 
 
Line 50:
A flat 1D representation, with arrays or lists is enough, for instance:
 
<lang haskell>*Main> all_paraffins 1
[CCP H H H H]
*Main> all_paraffins 2
[BCP (C H H H) (C H H H)]
*Main> all_paraffins 3
[CCP H H (C H H H) (C H H H)]
*Main> all_paraffins 4
[BCP (C H H (C H H H)) [BCP (C H H (C H H H)),CCP H (C H H H) (C H H H)),
CCP H (C H H H) (C H H H) (C H H H)]
(C H H H)]
*Main> all_paraffins 5
[CCP H H (C H H (C H H H)) (C H H (C H H H)),CCP H (C H H H)
(C H H H) (C H CCP H (C H H H)),CCP (C H H H) (C H H H) (C H H H)),
CCP (C H H H) (C H H H) (C H H H) (C H H H)]
(C H H H)]
*Main> all_paraffins 6
[BCP (C H H (C H H (C H H H))) (C H H (C H H (C H H H))),BCP
BCP (C H H (C H H (C H H H))) (C H (C H H H) (C H H H)),BCP (C H
BCP (C H (C H H H) (C H H H)) (C H (C H H H) (C H H H)),CCP H (C H H H)
(C H CCP H (C H H H)) (C H H (C H H H)),CCP (C H H H) (C H H H)),
CCP (C H H H) (C H H H) (C H H H) (C H H (C H H H))]</lang>
 
Showing a basic 2D ASCII-art representation of the paraffins is better; for instance (molecule names aren't necessary):
<prelang> Methane methane Ethane ethane Propane propane Isobutane isobutane
H H H H H H H H H
| | | | | | | | | │ │ │
H - C - H H - C - C - H H - C - C - C - H H - C - C - C - H
| | | | | | | | | │ │ │
H H H H H H H | H
|
H - C - H
|
H</prelang>
 
 
;Links:
* &nbsp; A paper that explains the problem and its solution in a functional language:
http://www.cs.wright.edu/~tkprasad/courses/cs776/paraffins-turner.pdf
 
* &nbsp; A Haskell implementation:
https://github.com/ghc/nofib/blob/master/imaginary/paraffins/Main.hs
 
* &nbsp; A Scheme implementation:
http://www.ccs.neu.edu/home/will/Twobit/src/paraffins.scm
 
* &nbsp; A Fortress implementation: &nbsp; &nbsp; &nbsp; &nbsp; (this site has been closed)
http://java.net/projects/projectfortress/sources/sources/content/ProjectFortress/demos/turnersParaffins0.fss?rev=3005
<br><br>