OpenLLM-France/wikimedia huggingface dataset:
# A-level Chemistry/OCR (Salters)/Entropy

$\Delta S_{\mbox{total}}=\Delta S_{\mbox{sys}}+\Delta S_{\mbox{surr}}\,\!$
$\Delta S_{\mbox{surr}}={\frac {-\Delta H_{\mbox{sys}}}{T}}$
$\Delta S_{\mbox{total}}>0\,\!$
# A-level Chemistry/OCR (Salters)/Equilibrium constants
## Mathematical definition of an equilibrium constant

For a reversible reaction,
$a{\mbox{A}}+b{\mbox{B}}\rightleftharpoons c{\mbox{C}}+d{\mbox{D}}\,\!$
the equilibrium constant K is defined as
$K={\frac {[{\mbox{C}}]^{c}[{\mbox{D}}]^{d}}{[{\mbox{A}}]^{a}[{\mbox{B}}]^{b}}}$
where [X] denotes the concentration of chemical species X.
For example, for the Haber process reaction,
${\mbox{N}}_{2}({\mbox{g}})+3{\mbox{H}}_{2}({\mbox{g}})\rightleftharpoons 2{\mbox{NH}}_{3}({\mbox{g}})\,\!$
the equilibrium constant can be calculated by
$K={\frac {[{\mbox{NH}}_{3}({\mbox{g}})]^{2}}{[{\mbox{N}}_{2}({\mbox{g}})][{\mbox{H}}_{2}({\mbox{g}})]^{3}}}$
# A-level Chemistry/OCR (Salters)/Engineering Proteins

Engineering Proteins is the eighth unit in the Salters Advanced Chemistry course.

## Chemical Storylines sections

* EP1 Christopher's story
* EP2 Protein building
* EP3 Genetic engineering
* EP4 Proteins in 3D
* EP5 Giving evolution a push
* EP6 Enzymes
* EP7 Summary

## Chemical Ideas sections

* 3.3 Shapes of molecules (revision)
* 3.5 Geometric isomerism (revision)
* 3.6 Optical isomerism
* 5.3 Forces between molecules: temporary and permanent dipoles (revision)
* 5.4 Forces between molecules: hydrogen bonding (revision)
* 6.6 Nuclear magnetic resonance spectroscopy
* 7.1 Chemical equilibrium (revision)
* 7.2 Equilibria and concentrations
* 10.2 The effect of temperature on rate (revision)
* 10.3 The effect of concentration on rate
* 10.5 How do catalysts work? (revision)
* 13.3 Carboxylic acids and their derivatives (revision)
* 13.4 The –OH group in alcohols, phenols and acids (revision)
* 13.8 Amines and amides (revision)
* 13.9 Amino acids

## Activities

* EP2.1 Investigating amines and amino acids
* EP2.2 What’s in aspartame?
* EP2.3 Using nuclear magnetic resonance (n.m.r.) spectroscopy for structure determination
* EP2.4 The shapes of a-amino acids
* EP2.5 A testing smell
* EP2.6 Taking note of proteins
* EP2.7 Modelling DNA
* EP2.8 Life reveals its twisted secret
* EP6.1 Testing for glucose
* EP6.2 Succinate dehydrogenase (Optional extension)
* EP6.3 The effect of enzyme and substrate concentration on the rate of a reaction
* EP6.4 Using the iodine clock method to find the order of a reaction
* EP6.5 Enzyme kinetics
* EP7 Check your notes on Engineering Proteins

## External links

* EP unit map
* EP Check Your Notes
# A-level Chemistry/OCR (Salters)/Hydrogen

Hydrogen is the first element in the periodic table. The hydrogen nucleus contains one proton.

## Isotopes

Most hydrogen nuclei have no neutrons, and are called hydrogen-1 or protium, $^1$H. The two other isotopes are extremely rare: $^2$H (hydrogen-2, also known as deuterium, symbol D) accounts for 1 in every 6500 hydrogen nuclei and $^3$H (hydrogen-3, also known as tritium, symbol T) exists only in trace amounts.

## Electron configuration

The electron configuration of the neutral hydrogen atom, H, is
$1{\mbox{s}}^{1}\,\!$

## Dihydrogen

In its standard elemental state, hydrogen exists as diatomic H$_2$ molecules, sometimes referred to as dihydrogen.
* length of the H−H single bond in H$_2$
* space-filling model of H$_2$

## Compounds

Hydrogen forms compounds with almost every other element in the periodic table.

### Hydrides

In compounds with very electropositive elements, as in sodium hydride, NaH, hydrogen exists as the hydride ion, H$^−$. H$^−$ does not exist in solution because it is exceptionally reactive. For example, if you try to dissolve NaH in water, the following reaction occurs:
    H$^−$ + H$_2$O(l) → H$_2$(g) + OH$^−$(aq)
In compounds with elements whose electronegativity is similar to or greater than hydrogen, such as hydrogen fluoride, HF, hydrogen is covalently bonded to the other element.

### Organic compounds

Hydrogen is present in the vast majority of organic compounds. In fact, some sources define organic compounds as those with C-H bonds, but this definition is controversial because there are some organic compounds, such as oxalic acid, which are behave exactly like other organic compounds, yet lack C-H bonds.
# A-level Chemistry/OCR (Salters)/IR

Infrared spectroscopy is a spectroscopic technique used for structure determination. You can use the infrared spectrum of an unknown compound to help identify it.

## Animations

animation of C=O stretching in propanone (5.4 MB)

## External links

* More detailed discussion of IR
# A-level Chemistry/OCR (Salters)/Experimental Skills

Experimental Skills, code 2852/02, is the AS practical coursework component of Salters Advanced Chemistry. A total of 45 UMS is available to score, which is 15% of the AS marks, or 7.5% or the total A-level marks.
2852/02 assesses four skills:
* planning (P)
* implementing (I)
* analysing evidence and drawing conclusions (A)
* evaluating evidence and procedures (E)
# A-level Chemistry/OCR (Salters)/Froth flotation
## Exam-style description of froth flotation

* grains are given water repellent coating
* air and detergent cause the solution to froth
* ore grains are / metal is concentrated in the froth
* ore grains are scooped off with the froth
# A-level Chemistry/OCR (Salters)/Halogens
## Gallery

* Cl$_2$(g) in a gas jar
* gaseous chlorine consists of separate diatomic Cl$_2$ molecules
* crystals of I$_2$(s)
* solid iodine consists of very closely packed I$_2$ molecules

## Diatomic halogen molecules

| halogen | molecule | d(X−X) / pm (gas phase) | d(X−X) / pm (solid phase) |
| fluorine | F$_2$ | 143 | 149 |
| chlorine | Cl$_2$ | 199 | 198 |
| bromine | Br$_2$ | 228 | 227 |
| iodine | I$_2$ | 266 | 272 |

## Fluorine

Fluorine is the most electronegative element in the periodic table, and is also the most reactive. Flourine is a special case as Fluorine has anomalous properties due to its small size. It has a lower electron affinity than Chlorine due to electron repulsions in the overcrowded outer shell. However, it is a stronger oxidising agent than Chlorine due to its unusually low bond energy. This is due to the repulsions between outer electrons in the F$_2$ molecule.
# A-level Chemistry/OCR (Salters)/Hydrocarbons

Hydrocarbons can be classified into four main categories:
* Alkanes
* Alkenes
* Alkynes
* Arenes
# Chess Opening Theory/1. d4/1...d5/2. c4/2...dxc4/3. Nf3/3...Nf6/4. e3/4...e6
## 4...e6

This move prepares to release the f8-bishop into action. The light-squared bishop is supposed to go to b7, but sometimes has to settle for the passive d7-square.
When contributing to this Wikibook, please follow the Conventions for organization.
# Queen's Gambit Accepted
### 3. e3

This move is not quite so popular as the main lines 3. e4 or 3. Nf3, but respectable nonetheless. It is a more conservative move. White opts to defend d4 instead of taking the center with pawns. Black cannot try to hold on to his c-pawn because of the famous trap 3...b5? (black should pursue development with ...e5) 4. a4! (getting the base of the pawn chain) c6? (further weakening the h1 to a8 diagonal) 5. axb5! cxb5?? (it would still be better to develop now, even though white will end with a pawn up or a huge lead in development) 6. Qf3! when Black must part with at least a minor piece because the weak h1 to a8 diagonal can't be defended anymore. Note: 6... Bb7 loses to 7. Qxb7.
Common Black continuations include:
* 3... e5 - a newer, aggressive move that tries to open up the position and likely results in an isolated queen pawn for white (4. dxe5? fails to 4...Qxd1! when white loses castling rights).
* 3... e6 - The more classical, conservative approach, although it results in limited mobility for the light-squared bishop.
* 3... Nf6 - Typical developing move. White then usually takes the c-pawn.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation.
1. d4 d5 2. c4 dxc4 3. e3
| 2 |
| e6 ... | += |
| e5 ... | = |
| Nf6 ... | = |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Queen's Gambit Declined
## 4. Bg5

With 4. Bg5 White pins Black's Knight against the Black Queen.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5
| 4. Bg5 ... |
| Be7 ... | = |
| Nbd7 ... | = |
| Nc6 ... | = |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Queen's Gambit Declined
## 4...Nbd7

With 4...Nbd7, black intends to play the Cambridge Springs Defense, which continues 5. Nf3 c6 6. e3 Qa5. The Cambridge Springs Defense is a solid line of the QGD and is often played both in the amateur level (because of the easier to understand theme) and the grandmaster level. This move also sets a trap that has ensnared quite a few players. White can continue 5. cxd5 exd5, resulting in a position that resembles the QGD Exchange variation (which is fine for both camps), as long as he/she doesn't play 6. Nxd5??. While it superficially appears to win a pawn (because the black knight is pinned), black can capture with his knight with 6... Nxd5!. Then after 7. Bxd8, white has not won black's queen because of 7... Bb4+!, where the only legal move is 8. Qd2, and black gets his/her queen back and emerges a minor piece ahead.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1. d4 d5 2. c4 e6 3. Nc3 Nf6 4. Bg5 Nbd7
| | 5 | 6 | 7 | 8 |
| Cambridge Springs Defense | Nf3 c6 | e3 Qa5 | cxd5 Nxd5 | Qd2 Bb4 | = |
| | cxd5 exd5 | e3 c6 | Qc2 h6 | Bh4 Be7 | = |
| Elephant Trap | ... ... | Nxd5?? Nxd5! | Bxd8 Bb4+ | Qd2 Bxd2+ | -+ |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Chess Opening Theory/1. d4/1...d5/2. c4/2...dxc4/3. Nf3/3...Nf6/4. e3
## 4. e3

This move prepares to develop the kingside and win c4.

## Theory Table

| 4 | 5 |
| ... e6 | Bxc4 |
When contributing to this Wikibook, please follow the Conventions for organization.
# Albin Countergambit
### 2...e5

The Albin Countergambit is an uncommon defense to the Queen's Gambit. Although it is rarely played by masters, it seems to be better than its reputation.
The usual continuation is 3.dxe5 d4, where in exchange for the gambit pawn Black has a central wedge at d4 and gets some chances for an attack. Often White will try to return the pawn at an appropriate moment in order to gain a positional advantage.
The Black pawn at d4 is stronger than it may appear. The careless move 4.e3? can lead to the Lasker Trap (see diagram below). After 4...Bb4+ 5.Bd2 dxe3!! 6.Bxb4?? is a blunder — 6...exf2+! 7.Ke2 fxg1=N+!! and Black's position is superior. The Lasker Trap is notable because it is rare to see an underpromotion as early as move 7.
Instead the game usually continues 4.Nf3 Nc6 (4...c5 allows 5.e3 because Black no longer has the bishop check) and now White's primary options are 5.a3, 5.Nbd2, and 5.g3. Perhaps White's surest try for an advantage is to fianchetto his king bishop with 5.g3 followed by Bg2 and Nbd2. Black will often castle queenside. A typical continuation is 5.g3 Be6 6.Nbd2 Qd7 7.Bg2 0-0-0 8.0-0 Bh3.
In the Spassky Variation, White plays 4.e4 to take advantage of the fact that an en passant capture must be made immediately after the enemy pawn moves. Now after 4...Bb4+ 5.Bd2 the en passant capture ...dxe3 is no longer available for Black because of the intervening moves.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1. d4 d5 2. c4 e5
| | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
| Main line | dxe5 d4 | Nf3 Nc6 | g3 Bg4 | Bg2 Qd7 | O-O O-O-O | += |
| | ... ... | ... ... | ... Nge7 | Bg2 Ng6 | O-O Ngxe5 | Nxe5 Nxe5 | b3 Bc5 | += |
| Lasker Trap | ... ... | e3?! Bb4+ | Bd2 dxe3!! | Bxb4?? exf2+! | Ke2 fxg1(N)+!! | -+ |
| | ... dxc4 | Qa4+ Nc6 | Nf3 | += |
| | cxd5 Qxd5 | Nc3 Qxd4 | Qxd4 exd4 | = |
| | cxd5 Qxd5 | Nc3 Qxd4 | Qxd4 exd4 | Nb5 Na6 | Nxd4 Bb4+ | Bd2 Bxd2 | Kxd2 c5 | Nb5 Nf6 | = |
| | cxd5 Qxd5 | Nc3 Qxd4 | Qxd4 exd4 | Nb5 Na6 | Nxd4 Bb4+ | Bd2 Bxd2 | Kxd2 c5 | Nb3? Nf6 | e3 b6 | =+ |
| | e3?! exd4 | exd4 Nf6 | =+ |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Queen's Gambit Declined
### 3.Nc3

After building a pawn center with their first two moves, White begins the development of their minor pieces with 3.Nc3. On c3, the knight controls the d5 and e4 squares. White would like to play e4 at some point to gain even more presence in the center, and 3.Nc3 facilitates this break.
White's dark-squared bishop will likely go to g5 after Black plays Nf6.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1. d4 d5 2. c4 e6 3. Nc3
| | 3 | 4 | 5 | 6 |
| Queen's Gambit Declined Semi-Slav | ... Nf6 | Bg5 Be7 | e3 O-O | Nf3 Nbd7 | = |
| Tarrasch Defence | ... c5 | cxd5 exd5 | Nf3 Nc6 | g3 Nf6 | = |
| Semi-Slav Defence | ... c6 | Nf3 Nf6 | e3 Nbd7 | Bd3 dxc4 | = |
| | ... Be7 | Nf3 Nf6 | Bg5 h6 | Bh4 O-O | = |
| Dutch Stonewall | ... f5 | Nf3 Nf6 | Bf4 c6 | e3 Be7 | += |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Queen's Gambit Declined
### 2...e6

With 2...e6, Black declines the Queen's Gambit in the traditional fashion. 2...e6 bolsters the d5 pawn and opens a diagonal for the development of Black's dark-squared bishop. However, 2...e6 also blocks the c8-h3 diagonal for Black's light-squared bishop. Finding a way to productively develop this piece is a perennial challenge for Black players in the QGD.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
1. d4 d5 2. c4 e6
| 3 | 4 | 5 | 6 |
| Nc3 Nf6 | Bg5 Be7 | e3 O-O | Nf3 Nbd7 | += |
| ... c6 | Nf3 Nf6 | e3 Nbd7 | Bd3 dxc4 | = |
| ... c5 | cxd5 exd5 | Nf3 Nc6 | g3 Nf6 | = |
| Nf3 Nf6 | Bg5 dxc4 | Nc3 c6 | e4 b5 | = |
| cxd5 exd5 | Nc3 c6 | Bf4 Bd6 | Bg3 Ne7 | = |
| g3 dxc4 | Bg2 c5 | Nf3 Nc6 | | = |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
* This Chess related article is a stub. Please assist Wikibooks by expanding it.
# Queen's Gambit Declined
### 3...Nf6

With 3...Nf6 Black begins the development of his minor pieces, continues to fight for the center, including the battleground squares d5 and e4, and gets closer to castling.
This is the classical main-line of the QGD. White has several options, though some of these may transpose into each other at some point:
* 4. cxd5 - The exchange variation. Unlike other exchange variations notorious for yielding a quiet game (e.g. French, Slav), this exchange has several aggressive plans including the "minority attack" on the queenside or a preparation for an all-out assault by seizing the center by an eventual e2-e4 or e3-e4.
* 4. Nf3 - This is the solid classical option.
* 4. Bg5 - Since this move is usually played anyway, it is both constructive while keeping options open.

## Theory table

For explanation of theory tables, see theory table and for notation, see algebraic notation. .
'1. d4 d5 2. c4 e6 3. Nc3 Nf6'
| 2 |
| cxd5 ... | = |
| Nf3 ... | = |
| Bg5 ... | = |
When contributing to this Wikibook, please follow the Conventions for organization.

## References

* Kasparov, Garry, & Keene, Raymond 1989 Batsford chess openings 2. ISBN 0-8050-3409-9.
# Erlang Programming/List Comments
## Comments

The preferred style for comments in Erlang is to use:
# History

The Erlang language was first written in Prolog by Joe Armstrong. Joe is a known fan of Prolog and borrowed much syntax from Prolog in the design of Erlang. This first Prolog version of Erlang was slow and motivated the creation of a virtual machine. Later an emulator called the BEAM (Bogdan's Erlang Abstract Machine) was written in C and is about 200,000 lines of code. It is thought that Erlang is both a reference to mathematician Agner Krarup Erlang and short for "Ericsson Language", due to its place of birth.

## References

* ↑ Audio interview with Joe Armstrong from (http://www.se-radio.net)
* ↑ Mailing list discussion, 1999 (https://erlang.org/pipermail/erlang-questions/1999-February/000098.html)
# Erlang Programming/Kernel and Stdlib
## Kernel and Stdlib

The kernel provides simple process-management services, module access, and garbage collection.
The Stdlib includes a large number of commonly used utility functions. Packages included in STDLIB include utilities for math, regexp, printing, various data structures (array, dictionary, tree) and process management (slave, supervisor). A list of functions available in each module can be listed with
where Mod is some module from list:
# Erlang Programming/Operators

Logical operators
Binary operators
String operators
Disjunction Guards
# Erlang Programming/List Comprehensions
## List Comprehensions
### Intro to Comprehensions

A list comprehension is a mathematical way to construct a list. To do list comprehension we have to use a new operator "<-", "taken from".
English translation is: build a list L, with elements that have the value X*X, such that X is taken from the list [1,2,3,4]. It gives the output:
Notice that this is similar to
In fact, list comprehension provides a shorthand notation for most of the functions in the lists module.

### Simple Comprehensions

You can use them to solve equations.
output:

#### Lists version

Can you figure out the lists functions used in the above comprehension ?
How about
That is 5 functions in one succinct line. For the remainder of the examples take some time and find the corresponding lists functions that do the same thing.

#### Permutations

Here we flip two coins:
Note: strings are lists in erlang. all combinations are: output:

### Intermediate list comprehensions

An important use of List Comprehensions is to help translate Prolog-like statements into Erlang. [Why is this "important"?]
1- Erlang is a functional language designed for message passing (MIMD) parallel processing. Prolog is designed for logic programming. Sometimes a problem is most easily defined as a logical set of constraints on some set of data. If one thinks logically or thinks in constraints, or thinks in prolog, this style of list comprehensions can be a helpful way to do your tasks in erlang. There exist many useful solutions in prolog that can be moved to erlang via list comprehensions.
2- Constraint programming and logic programming are considered a higher level way to program than functions, and hence, are a good way to save you time and increase terseness.
Warning: constraint and logic based programs can be harder to debug because strict step by step actions are hidden and delegated to the list comprehension engine. Order of constraints in erlang list comprehensions can affect the output. Order dependence of constraints can be a non-intuitive distraction.
Note: in general, using huge numbers of atoms is not a good idea as they are never garbage collected.
compile with c(think). and generate output with:

### Advanced List Comprehensions

Example with quicksort in 7 lines.
(Btw: This isn't actually "quicksort," as you'd want to use it, because it uses more memory than necessary, and doesn't get the VM page/cache benefits of an in-place quicksort. But it's neat nevertheless!)

### Exercises

1) Write a program using list comprehension that finds the integer solutions {X,Y} for a circle of radius 5.

### Solutions

1)
# Macros

The code makes A = [1,2,3,4,5].
Some handy predefined macros include:
# Erlang Programming/Making Parsers with yecc

Making Parsers with yecc
Yecc is an erlang version of yacc/bison.
We have a BNF(Backus-Naur_form) grammar in a source file ending in .yrl, yrl means yecc rule list. We can parse a simple xhtml file using yecc. Actually, we will apply yecc to html.yrl to create a parser called html_parser.erl. Next we use the html_parser to parse some xhtml, voila.
All tags in the xhtml code must have matching open and close. (Of course a more powerful way to parse an xml file in erlang is to use xmerl).
html.yrl source:
It can be a pain to build and run a parser each time we edit the source yrl file. To speed things up, we can use a program to build and run the parser for us. We compile and run the test program which builds the parser and tests it for us on some document.
# Erlang Programming/Modules
## Erlang modules

Each Erlang Programming source file
is required to be a separate module. Modules are created with the module statement.
compile with
run with
and get
"utility" is the module created by the file utility.erl
utility functions like rotate can be imported elsewhere with:
so now we do not need to use the "utility:" prefix. Importing modules is not generally recommended. This is very similar to python and Java imports.
# Erlang Programming/Getting Started

← Overview | Terms →

## Getting Erlang

Erlang/OTP is available as free software from Open Source Erlang Downloads. Once you have downloaded the Erlang/OTP distribution, you will need to compile it (if on a Unix platform) and install it.

## Installing Erlang

In addition to the brief instructions below, you may wish to consult the Installation Guide.

### Unix

Unpack the source distribution. Decide where you want Erlang and its libraries installed. For our example, we will assume you want it in /usr/local/erlang/otp_r11b. Create this directory, as well as a build directory for building the Erlang sources.
From within the top-level directory, type ./Install /usr/local/erlang/otp_r11b. This will configure, build and install the Erlang/OTP distribution.
Add the distribution's bin directory to your path. You may wish to set this in your shell initialization file.

### Microsoft Windows

The distribution is a self-installing .exe file. Invoke it (for example, by double-clicking on its icon) and answer the prompts.

## The Erlang Shell

Erlang comes with a shell which is used interactively when controlling the Erlang environment and developing programs. On Unix, invoke the shell by typing erl on the command line. On Windows, type werl on the command line, or double-click the Erlang shortcut icon.
This starts the Erlang system and provides a shell for input and evaluation of Erlang.

## Your First Erlang Code

At the shell prompt, type "hello, world!" followed by a dot (.). You can follow that up with some arithmetic. Or answer the question "What is six times 9?" in base-13 notation:
When you are ready to exit, you can stop the Erlang system using the halt built-in function:
# Erlang Programming/How To Do It Example

-module(tut).
please note the scope of local variables in the above code
run :
another module which is call quicksort
run :