Talk:Paraffins: Difference between revisions

From Rosetta Code
Content added Content deleted
m (→‎Algorithm?: Too many carbons on one of the 5 ones)
(stereo-isomers)
Line 23: Line 23:
|
|
c</lang>--[[User:Ledrug|Ledrug]] 21:02, 30 November 2011 (UTC)
c</lang>--[[User:Ledrug|Ledrug]] 21:02, 30 November 2011 (UTC)

=== stereo-isomers ===
Someone (IP:79.54.58.148) has reverted part of my edit because they incorrectly think paraffins cannot have stereo-isomers. In fact they can, for example C(H)(CH<sub>3</sub>)(C<sub>2</sub>H<sub>5</sub>)(C<sub>3</sub>H<sub>7</sub>) (better known as 3-methylhexane: CH3CH2CH(CH3)CH2CH2CH3) is [http://www.wwnorton.com/college/chemistry/orgo3/ch4/2_methylhexane.htm chiral] and so exists in stereo-isomeric form. If you disagree please discuss it here before I change the page back. [[User:TobyK|TobyK]] 00:09, 1 December 2011 (UTC)

Revision as of 00:09, 1 December 2011

Algorithm?

would it be possible to describe an algorithm for the solution in a few paragraphs?

and explain why there is only 1 paraffin for 4 or less carbon atoms? and why there are 2 for 5 and a few more, so that those of us who don't know organic chemistry can get some understanding of how the results are created?--eMBee 16:53, 30 November 2011 (UTC)

Even just some general rules about how the atoms are allowed to be arranged would help. I know that carbon atoms can have 4 bonds (usually...I remember a Christmas carol from my high school chemistry class called "Rudolph the 5-bond Carbon"). It also looks like for this class of molecules that cycles aren't allowed? --Mwn3d 17:24, 30 November 2011 (UTC)
4 to 6 carbon configuations: (if any "c" doesn't have 4 bonds already, imagine it's connected to invisable hydrogens). The basic algorithm would be some kind of recursive tree generation, probably with memoization for large numbers.<lang>4:

c-c-c c-c-c-c

 |
 c

5: c-c-c-c-c c-c-c-c c

             |         |
             c       c-c-c
                       |
                       c

6: c-c-c-c-c-c c-c-c-c-c c-c-c-c-c c-c-c-c c

               |             |         | |         |
               c             c         c c       c-c-c-c
                                                   |
                                                   c</lang>--Ledrug 21:02, 30 November 2011 (UTC)

stereo-isomers

Someone (IP:79.54.58.148) has reverted part of my edit because they incorrectly think paraffins cannot have stereo-isomers. In fact they can, for example C(H)(CH3)(C2H5)(C3H7) (better known as 3-methylhexane: CH3CH2CH(CH3)CH2CH2CH3) is chiral and so exists in stereo-isomeric form. If you disagree please discuss it here before I change the page back. TobyK 00:09, 1 December 2011 (UTC)