I have search a lot on Internet and my own researches on a sheet of paper failed to found an analytical closed formula for the following problem:


  • Common ranges of temperature and pressure
  • A FINITE number of given pure elements with their respective valence

Found a lower-bound of all possible complete/incomplete molecules formed involving ALL the given elements (ignoring valences that are indistinguishable).


  • Given one C, one H. We can form only one "incomplete" molecule: CH (lowerbound=1)
  • Given two H. We can form only one "complete" molecule H_2 (lowerbound=1)
  • Given one O and two H. We can form H_2 but also H_2O, but also incomplete HO (lowerbound=3)

Thx for feedback

  • $\begingroup$ Not sure what temperature and pressure have to do with this problem. How would you expect T and P to restrict formulae? $\endgroup$ – Curt F. Jan 5 at 23:44
  • $\begingroup$ Also, when you say "molecule" I assume you mean "empirical formulae". You're not expecting this algorithm to tell apart glucose (C6H12O6) and galactose (also C6H12O6), right? If what you really want is just empirical formulae, OK. There is no way an algorithm could enumerate all of the possible _structures_/molecules, though. $\endgroup$ – Curt F. Jan 5 at 23:46
  • 1
    $\begingroup$ As a first answer, ignore valence requirements and just do the combinatorics. If O is in {0, 1} and H is in {0, 1, 2}, then there are six possible formulae, one of which is the nonsense H0O0. I guess that leaves five. $\endgroup$ – Curt F. Jan 5 at 23:57
  • $\begingroup$ Check out the database at academic.oup.com/bioinformatics/article/29/2/290/201920 $\endgroup$ – Curt F. Jan 5 at 23:58

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.