Chemical Formula Generator:

Much of Chemistry is about knowing that stable molecules form a rule driven selection among possible combinations of a given set of atoms. This little program generates all combinations with repetitions of a given set of atoms to molecules of a selected range of sizes. In order to expose the rules the first step has no chemical information. You can then choose or invent any type of filter - perhaps a 'theory' of chemical bonding - to eliminate those combinations which you find absurd when applying your chemical knowledge. A preselected filter (which you can modify orcompletely remove on the fly) is the set of rules commonly applied in Organic Chemistry. We may now test its validity and predictive power within a certain context of ambient conditions, perhaps temperature and atmospheric pressure (and composition) at the surface of earth and a time span comparable to our daily chemical routine. Of course, we know about conditions where almost any combination of atoms has a certain probability of transient existence. But let us think about the more common world of those compounds you can find on the shelves of the chemical stockrooms for which the rules of existence have been invented in the first place.
Chefog outputThe figure shows a run with the four atoms C, H, N, O, the most common in organic compounds, to produce molecules consisting of 4 and 5 atoms. Any one atom symbol may occur as many times as possible. Only the results with 5-atomic molecules can be seen completely in the table. The summary row states that the applied filter eliminated 54% of the combinations produced.
The 'filter' consisted of  the standard chemical valence "rules of (organic) chemistry" due to G.N. Lewis and J.K. Senior - electron pair 'dashes', multiple bonds and rings, as required. Try to identify the predicted compounds which most textbooks would clandestinely suggest that they exist and investigate whether they have been synthesized as stable substances. It might well be that you get into trouble doing this even with this small set of 26 five atomic formulas! "Pairs" are the number of electron pairs in the sense of Lewis, "D+R" pertains to Senior's Double bonds and Ring(closure)s (a triple bond counts 2), and"Successful" refers to the percentage of combinationsretained by the valence rules. Do you suspect that the filter eliminated existing compounds which don't satisfy its constraints? Or, that it retained nonexistent compounds? You can test this with the program by relaxing part of the set of rules which are shown at startup and then run again. If you find known compounds eliminated by the applied rules or are sure that a retained molecule does not exist (e.g. CO4) the rules are not reliably predicting existing molecules and have to be modified in order to describe even this small sample of the Chemical Universe correctly. Here are the rules for you to consider:
rulesFrom this exercise which is rather "silly" but systematic (!)  you may learn that it is not at all trivial to invent better rules. (see E. Schumacher, Chimia 48(1994)26: "Some Rules Are Better than Others"). The program offers several possibilities to alter them and investigate the consequences. Doing this thoroughly, embraces everything you can learn in chemistry.
It is easy to write at least one "Lewis Formula" for every compound retained. This is implicit in the set of rules applied here. But the total number of connectivity isomers of these 26 compounds, you can write valid Lewis formulae for, is at least 142 (not counting enantiomers, if they exist). The largest number of formulae for this 5-atomic selection is generated by C2N2O which contributes 20 to the 142 (checked) Lewis formulae. However, more than 3/4 of the 142 species have not been prepared and are very likely unstable. This gets rapidly worse when the size of the molecules or the number of selected atoms increases.It becomes obvious that the "rules of organic chemistry" are not sufficient to predict which compounds really exist. Of course, most chemists, presented with the breakdown of their rules, have ideas and additional empirical rules, why this should be so, i.e. they invent, ad hoc, further constraints to justify every failure of the Lewis/Senior "theory". Then, teachers often just present the successful cases to their pupils and call this a 'good theory' - very bad science! This rubbish fills chemical textbooks, and not only for high schools where the poor adolescents are drilled to memorize it (and reproduce it e.g. at Chemical Olympiads), often unqualified!

Do you want to jump off?

Much of this "rubbish" is part of "non-communicable chemical knowledge" still transfused from teacher (or the chemical literature) to pupil similar to an old-fashioned apprenticeship. The chemical formula language is not complete: We don't really know how to express a large part of chemical experience about a substance by means of its molecular formula. And when we try to apply a better theory, e.g. Quantum Chemistry, 'the more accurate the calculations become, the more the concepts tend to vanish into thin air' (R.S. Mulliken, J.C.P. 43,S2(1965)). Consider the popular concepts "electron pair bond", "double bond", "lone pair", "aromaticity", "VSEPR", "Electronegativity", "soft and hard acids and bases" and
many others: They cannot be justified rigorously by Quantum Chemistry! Hence, a good chemical education strives to develop several layers of reasoning, i.e. of "educated hand waving" (sic!) which allows to come to fairly accurate predictions of structure, stability and reactivity of a molecule. But, there is no guarantee of not being dead wrong once in a while, especially in a field in which one has no direct practical experience (think about how long it took to prepare compounds of Xe and Kr (later than 1962) although it was obvious before 1940, e.g. to Linus Pauling, that they very likely exist). A competent chemist uses all the tools available to improve his predictions, including Quantum Chemistry and an exhaustive, non biased, search of the pertinent Chemical Universe.

Several decades ago, W.E. Dasent wrote the booklet "Nonexistent Compounds" (Marcel Dekker Inc., New York,, 1965), which treated the subject of compounds with well behaved formulas but low stability for the first time. He tried to systematize some of the causes why simple rules break down, e.g. reluctance to undergo catenation by most elements except carbon (and to a much lesser extent silicon), instability of multiple bonds with π-π overlap with second (and higher) row elements, "inert pair effect", instability of highest oxidation states, etc. Most of what he found was not unexpected by knowledgeable chemists. His "explanations" have long been in the inventory of "non communicable knowledge", i.e. he did not give the communicable theory for the apparent "misbehavior". Furthermore, much of Dasent's types of theorizing have now fallen into disuse, and even disrepute.
Since Chefog starts with all combinations of the given atoms to a chosen class of molecules, many more instabilities come forth. The question is, whether today's advanced theoretical tools might shed light on the more subtle causes of them.
This web page tries to follow-up on this issue. Stay tuned.