## Ideal Gas Law Oracle

- This tool solves the ideal gas law equation by turning input/output data into a question/answer oracle session. The tool takes care of all unit conversions, and processes the results to the proper number of significant figures. Most online calculators, even the scientific ones, are not designed to accomplish these tasks.
- This is our first attempt at building an oracle-like tool. The term
*oracle*is used here to mean a black box that accepts and responds to questions. The input data is transformed into a question, and the output into the answer to said question. - To use the tool, enter the data and its units, leaving empty the field to be computed. The answer is given on the same page.
- Teachers can use this tool to add content to lecture notes, quizzes, and tests. Students can use it to double-check exercise results from homeworks and textbooks.
**Important Notes**

This tool enforces the use of significant figures. By default, the tool transforms temperature values to kelvins and then counts the number of significant figures of these. Thus, temperature scale conversions can affect the number of significant figures of results obtained by solving the ideal gas law equation.For instance, a temperature reading of 25 degrees Celsius has two significant figures, but on the Kelvin scale the same reading has three (i.e., 25 + 273.15 = 298). By contrast, 405 degree Fahrenheit has three significant figures, but on the Kelvin scale this corresponds to 480 K. In this case, the tool will count three significant figures if a trailing period is included, otherwise two if no trailing period is included.

A word of caution: A previous result can be used as part of a new oracle session without resetting the form. However, submitting a previous result with a number of significant figures that deviate from those required to compute the new result can introduce precision errors.

**On the Notion of Ideal Gases**

An ideal gas is an imaginary collection of volume-less atoms which do not interact with each other, but can undergo elastic collisions with each other. Many common gases tend to exhibit this behavior at ambient temperature and pressure, and in general at high temperature or at low pressure.Under some experimental conditions, real gases like He, Ne, Ar, O

_{2}, N_{2}, CO, CO_{2}, and others exhibit an ideal gas state behavior. Said state is defined by a gas constant (*R*) and four experimental variables: pressure (P), volume (V), number of moles (n), and temperature (T). These are expressed in SI units, if necessary, by applying conversion factors (NIST, 2006; 2016). The ideal gas lawPV = n

*R*T(1)describes the relationships between these variables, where

*R*is the gas constant, defined as the product of the Boltzmann constant (*k*= 1.380649 x 10_{B}^{-23}J/K) and the Avogadro's constant (*N*= 6.02214076 x 10_{A}^{23}/mol).*R = k*(2)_{B}N_{A}Because

*k*is defined on the Kelvin scale, the value of_{B}*R*only changes with the units of P and V. The following values are commonly used, among others:- 8.31446261815324 J/(K*mol)
- 8.31446261815324 m
^{3}*Pa/(K*mol) - 0.082057366080960 L*atm/(K*mol)
- 1.98720425864083... x 10
^{-3}kcal/(K*mol) - 62.363598221529 L*Torr/(K*mol)

Many chemistry textbooks use four or five significant digits (figures) for

*R*, like 0.08206 L*atm/(K*mol) or 8.3145 J/(K*mol). This is done to simplify and reduce computational costs.Given three operand terms out of the above four terms (P, V, n, and T), the missing one can be determined from the ideal gas law. However, this may require the conversion of units to match those of the ideal gas constant.

In addition, the missing term should be evaluated to the proper number of significant figures. And temperature values should always be converted to kelvins before counting significant figures. See the section

*Significant Figures and the Ideal Gas Law*.

Introducing the Ideal Gas Law Oracle

**An Oracle-like Tool**

We have developed a form-based online tool that solves the ideal gas law equation and takes care of conversions of units and significant figures: The Ideal Gas Law Oracle. The term*oracle*is used here to mean a black box that accepts and responds to questions.To use the tool, users only need to submit the input data with the corresponding units. The field of the quantity to be computed, the missing term, must be left empty. Users can empty a field by double-clicking it or with the computer backspace key. Resetting the tool clears all form fields.

To emulate an oracle behavior, the tool transforms the submitted data into a question, which is then answered to the proper number of significant figures. The tool reacts to mistakes made by a user, and takes care of all unit conversions, selection of

*R*, and evaluation of significant figures. All units are given in singular, per SI writing style conventions (NIST, 2004).Users can make changes to the input data without having to reset the form, unless they want to. The field to be computed, however, must remain empty. All results are displayed on the same page so users don't need to navigate between web pages.

While it is possible to use a previous result as part of a new oracle session, without resetting the form, this can introduce numerical errors, especially if the computer returns operand terms with too many decimal places.

**Pros and Cons of Oracles**

Educational tools developed to emulate oracles can take care of repetitive tasks and be of great benefit. After all, science requires certain degree of reductionism. However, relying entirely on reductionistic approaches is not necessarily a good idea.Teachers might want to ponder how frequently students should be exposed to oracle-like tools. A savvy teacher might want to help students rationalize the answers given by an oracle--in our case, why an answer was generated to a given precision. It makes more sense exposing students to oracles after they master the tasks for which said tools were developed.

This is our first attempt at developing an online oracle. Any suggestion for improving this project is more than welcome. The development of more oracle-oriented tools seems an attractive goal.

Significant Figures and the Ideal Gas Law

**Useful Guidelines**

For multiplications and divisions, as is the case of the ideal gas law, a result should be reported to the same number of significant figures as that of the operand term with the least number of significant figures.The following are useful guidelines for evaluating significant figures.

- All non-zero digits are significant.
- All zeros between non-zero digits are significant.
- Leading zeros are not significant, but mere place holders.
- Trailing zeros in decimal numbers are significant.
- Trailing zeros in integer numbers may or may not be significant. For instance, 100 might has 1, 2, or 3 significant figures. To avoid ambiguities and state that all trailing zeros are significant, the number should be given with a trailing mark, usually using a period. If no mark is given, it is assumed that none of the trailing zeros are significant.
- All digits of a number given in scientific notation are significant.
- No significant figures are attributed to non-measured quantities, like constants and conversion factors.
- No significant figures are attributed to a number where all of its digits are zero.

The reason for the latter comes from numerical analysis theory. The number of significant figures is related to the notion of relative error (Burden & Faires, 2010; Norminton, 2007; Harder, 2010). Let the number

*p**be an approximation of*p*. Then*p**is said to approximate*p*to*t*significant figures if*t*is the largest nonnegative integer for which the relative error (*rel_err*) is(3)

Accordingly, no significant figures attribution is possible if

*p*,*p**, or both are zero.If the relative error is known,

*t*can be computed as(4)

where $t is the number of significant figures, $rel_err is the relative error, and floor() is a function that rounds a number down to the nearest integer, if necessary. This function is found in most programming languages.

**Significant Figures vs. Meaningful Figures**

Not all significant figures reported from a calculator are meaningful. When solving the ideal gas law equation, one may want to limit P, V, n, and T values to the nearest marked gradation of instrumental displays. This is done to insure that the significant figures reported for the missing term are meaningful and describe real world experimental conditions (Thorncroft, 2016).

For instance, for typical temperature sensors, half a degree increments are more likely to be within the temperature sensor's instrumental error range. This is why temperature readings from analog displays are commonly reported as integers, or to no more than one decimal place. On the other hand, specialized temperature sensors can handle temperatures to a tenth of a degree at the most.

Therefore, reporting temperature values to more decimal places than those measured by a temperature sensor (e.g., 76.004 degree Fahrenheit), are not very meaningful. The same goes for barometric pressures. In the mmHg scale, pressure is commonly, though not always, reported to two decimal places. We must conclude that not all significant figures computed with a calculator are meaningful figures.

In general, analog displays should be read to the nearest marked gradation or half-way between if possible. With digital displays the procedure is simpler: use exactly the displayed reading. If the uncertainty of a value is not given, the least count is assumed. In general the reading uncertainty for an analog or digital device is defined as

(5)

**Significant Figures and Temperature Conversions**

Kelvin = Celsius + 273.15 should be used in Celsius-Kelvin temperature conversions. However, the value of 273 is frequently used instead of 273.15 because of the above instrumental limitations. For the curious minds, 273.15 K is 0 degree Celsius, which is the freezing point of water. The triple point of water has been redefined and is now 273.1600(1) K.When measured quantities are added or subtracted, the number of significant figures can be affected as the result is determined by counting the number of decimal places. In this case the number of decimal places in a result should be the same as that in the quantity with the smallest number of decimal places, where integers are assumed to end with an implicit decimal point; e.g., 25 is taken as 25., 105 as 105., and so forth.

For instance, 25 degrees Celsius has two significant figures. When converted to kelvins using 273 or 273.15, the result is 298, to three significant figures. By contrast, 25.0 degrees Celsius has three significant figures. When converted using 273, the result is 298, to three significant figures, but when converted using 273.15, the result is 298.2, to four significant figures.

- Teachers can use this tool to add content to lecture notes, quizzes, and tests. Students looking for an easy way of double-checking results from textbooks and homeworks, or interested in learning how significant figures impact a result might find this tool quite useful.

- A 5 L sealed container at 18 degree Celsius contains 0.10 mol of oxygen and 0.15 mol of nitrogen gas. What is the pressure in the container? How much of this pressure is due to each gas? Hint: Consider partial pressures.
- A 2 L container has two gases inside. It is known that at 68 degree Fahrenheit the total pressure of the combined gases is 0.8 atm. If there are 0.20 mol of one gas, how many moles of the other gas are in the container?
- A solid sample of CaCO
_{3}is decomposed upon heating to give CaO(s) and CO_{2}(g). The carbon dioxide is collected in a 250-mL flask. After the decomposition is complete, the gas exerts a pressure of 1.32 kPa at a temperature of 500 degree Rankine. How many molecules of CO_{2}gas were generated? How many grams of CaO(s) were in the sample?

- Burden, R. L. and Faires, J. D. (2010).
*Numerical Analysis*. 9th Edition. Chapter 1, p. 20. Brooks/Cole, Cengage Learning. - Harder, D. W. (2010). Numerical Analysis for Engineering. University of Waterloo, Canada.
- NIST (2016). Factors for Units Listed by Kind of Quantity or Field of Science. NIST Guide to the SI, Appendix B.9.
- NIST (2006). The International System of Units (SI) - Conversion Factors for General Use. Nist Special Publication 1038.
- NIST (2004). SI Unit Rules and Style Conventions. NIST Reference on Constants, Units, and Uncertainty.
- Norminton, T. (2007). Errors. Math3806. Carleton, Canada.
- Thorncroft, G. E. (2016). Introduction to Measurement Practice. ME236 Lab Manual. CalPoly.edu

#### Feedback

Contact us for any suggestion or question regarding this tool.