OpenLLM-France/wikimedia huggingface dataset:
# Visualizing Computation

Diagrams play a central role in communication in many fields, and computer science is no exception—our classroom lectures, research talks, textbooks, and Wikipedia pages are full of visual material to complements to our words. The forms of these diagrams are typically defined vaguely if at all. While this may be appropriate in a lecture setting, uncertainty about the diagram can lead to confusion as students study their notes or books. Visualizing Computation is an archive of definitions of useful visualization techniques that are often used in lectures without extensive discussion.

## Scope

Each page of this book covers a particular approach to visualizing some aspect of the execution of software. Each page should serve as a stand-alone definition of the diagram style, but not a complete description of the system being visualized. For example, Visualizing Computation describes diagrams that can be used to illustrate stack frame layout or evolving stack frame layouts, but leaves the definition and use of stack frames for the Wikipedia call stack entry or professor's lectures. The visualizations themselves may be static illustrations of static entities, techniques for capturing evolution-over-time in a static image, or (in principle) animations.

## Why a Wikibook?

This book is designed to collect topics too specialized even for Wikipedia's notability policy ("Wikipedia is not a directory of everything in existence"). In particular, descriptions of interesting local variations in drawing style are encouraged, not discouraged. This project itself stems from repeated observations by Wonnacott's students at Haverford College, who pointed out the difficulties of taking good notes when the professor keeps erasing and overwriting the same diagram.

## Contributing

Policy: If a diagram you draw or see isn't defined in this text, please add it (or have your student add it). Refer to the style guide for ideas of what belongs in a page, or the quick-start guide if you have never added to a Wikibooks or Wikipedia entry before.
Note to authors of papers and textbooks: According to the answer I got in the reading room, uploading your content constitutes a non-exclusive grant to copy. As I understand things, this means you can still use the version you uploaded however you like (as long as you don't grant someone else an exclusive copyright), so you can still include your original material in non-GFDL documents (though you should probably make a traditional publisher aware of the GFDL version that's out there). If you are unsure about the legal status of material you are using, it should be sufficient to pick a different example and draw a fresh diagram that's not covered by someone else's copyright.

## The Visualizations

* Memory layout and memory evolution diagrams
* Drawings of call trees
* Drawing graphs of data-flow among statements of a function or among different executions of statements
* Function Machine
# Visualizing Computation/Call Trees

Call trees are visual representations of the functions being called upon in a particular instance. For example, consider the recursive function:
The power(2, 7) function will call on both the even function and the power function multiple times. This diagram shows the progression of the function.
Each time a function calls on another function, an arrow points from the function to the function it is calling. Multiple arrows can, of course, originate from the same function.
Call trees can be designed utilizing different conventions to emphasize different points of the function. If the values each function is returning are important to the problem, those values can be placed in the call tree with arrows pointing upwards toward the function that will use that value. If the timing is most important and multiple arrows are originating from the same function, the first function called upon should be placed furthest to the left. Additionally, call trees can help to show the complexity of a function. Consider this power function:
This function forms the following call tree.
It is obvious while looking at the call trees that the original function is much less complex and therefore much faster.
# Visual physics and mathematics/Shock waves

A shock wave generally obeys the Lax conditions: the speed of small perturbations behind the wave front is greater than the speed of the wave front which is itself greater than the speed of small perturbations in front of the wave front:
Such shock waves are said to be compressive.
All shock waves are expected to be compressive. Peter D. Lax proposed his conditions as universal conditions for a mathematical theory of all shock waves. If the Lax conditions are not verified, the wave front is expected to gradually spread out and therefore a shock wave can never form. However, we can observe, in exceptional conditions, shock waves which do not obey the Lax conditions:
Such shock waves are said to be undercompressive.
# A-level Chemistry/AQA/Module 5/Thermodynamics/Partition Function

The Boltzmann distribution gives the probability of a system to be in a given state (specified by the coordinates and momenta of its constituents) as proportional to the exponential function of the energy of that state, in units of kT.
For calculating the exact probability for a given range of states, you must normalize the distribution, i.e., you must divide by the total integral for all states (be careful, not the same as "for all energies").
Partition function is the name for this total integral. It is given an special name because, in fact, mathematically, you can derive a lot of information from this integral. For example: to calculate the mean value of a given function of the state, the standar formula of integrating the product of the function by the probability, and dividing by the partition function, is the same as the derivative of the logarithm of the partition function.
# A-level Chemistry/AQA/Module 5/Thermodynamics/Thermodynamic Temperature
## What is Temperature?

There are a few ways we can describe temperature. But a large amount of them are surprisingly poor. Sadi Carnot for instance imagined heat as a liquid, and it was this view that allowed him to develop heat engine theory.
Here we will develop a way of viewing temperature that makes it useful in a Thermodynamic point of View.

## Two systems in Thermal Contact

Imagine two systems, 1 and 2, with total energy E = E$_1$ + E$_2$ and Entropy S = S$_1$ + S$_2$.
Conservation of energy of the system means that E$_2$ = E - E$_1$ always.
Differentiating by E$_1$ we see that:
${\begin{matrix}{\frac {dE_{2}}{dE_{1}}}&=&{\frac {d(E-E_{1})}{dE_{1}}}\\&=&-{\frac {dE_{1}}{dE_{1}}}\\&=&-1\end{matrix}}$
Now if we look at Entropy changing with Energy.
${\frac {\partial S}{\partial E_{1}}}={\frac {dS_{1}}{dE_{1}}}+{\frac {dS_{2}}{dE_{1}}}={\frac {dS_{1}}{dE_{1}}}+{\frac {dS_{2}}{dE_{2}}}{\frac {dE_{2}}{dE_{1}}}={\frac {dS_{1}}{dE_{1}}}-{\frac {dS_{2}}{dE_{2}}}$
At equilibrium there is no change in entropy, so when the systems are at the same temperature
${\frac {\partial S}{\partial E_{1}}}={\frac {dS_{1}}{dE_{1}}}-{\frac {dS_{2}}{dE_{2}}}=0$
We use this to define Temperature.
$T^{-1}={\frac {\partial S}{\partial E}}_{N,V}$
N and V means the Volume and Number of Particles is fixed.
Or for a specific system
$T_{i}^{-1}={\frac {\partial S_{i}}{\partial E_{i}}}_{N_{i},V_{i}}$

## Usage

If we were to look at how entropy changed with temperature, it is easy to show that as entropy always increases, energy always flows from the hotter body to the cooler one. Try it.

### Authors

--Frontier 11:51, 23 Apr 2005 (UTC)

#### Note

One of the equations wasn't parsing correctly at the time of writing. I've left it as is because the error message was 'Unknown Function \begin' which should be recognised. I'm not really sure what the problem is.
# A-level Chemistry/AQA/Module 5/Thermodynamics/Ideal Gas/Triple Point

Triple Point is the temperature where the three phases of matter can coexist (solid, liquid, gas) and this point is at temperature -273.15 °C and at pressure 0.66 cm of Hg.
# A-level Chemistry/CCEA

This is the branch of the A-level Chemistry book, designed to follow the AQA specification. It is not endorsed by AQA. It will hopefully be useful as a revision guide, or for those seeking a basic grounding in the principles of the course.

## AS Units

* Module 1: Atomic Structure, Bonding and Periodicity
** Atomic Structure (Nov 23rd, 2006)
** Amount of Substance (Nov 8th 2006)
** Bonding (Nov 23rd, 2006)
** Periodicity (Nov 8th, 2006)
* Module 2: Foundation Physical and Inorganic Chemistry
** Energetics (Nov 8th, 2006)
** Kinetics (Nov 8th, 2006)
** Equilibria (Nov 30th, 2006)
** Redox Reactions (Nov 8th, 2006)
** Group VII: The Halogens (Nov 30th, 2006)
** Extraction of Metals (Nov 30th, 2006)
* Module 3: Introduction to Organic Chemistry
** Nomenclature and Isomerism (Nov 8th, 2006)
** Petroleum and Alkanes (Nov 8th, 2006)
** Alkenes and Epoxyethane (Nov 8th, 2006)
** Haloalkanes (Nov 8th, 2006)
** Alcohols (Nov 8th, 2006)
AS Chemistry Specification, 2007 Entry

## A2 Units

* Module 4: Further Physical and Organic Chemistry
** Kinetics
** Equilibria
** Acids and Bases
** Nomenclature and Isomerism in Organic Chemistry
** Compounds Containing the Carbonyl Group
** Aromatic Chemistry
** Amines
** Amino Acids
** Polymers
** Organic Synthesis and Analysis
** Structure Determination
# A-level Chemistry/Edexcel
## The Pattern of Periodic Table - Periodicity

In the periodic table, all elements are arrived in order of increasing relative atomic mass and elements with similar properties recurred at regular intervals. The vertical column of similar elements are called groups and the horizontal row is called period. If there is one outermost electron, that element belongs to Group I. If there are 7, it belongs to Group VII.
In Group 0, the electron structure is -s(square) or -s(square)p(to the power of sixth). Because of their stable electron arrangement, noble gases have large first ionisation energies and exist as monatomic molecules. They have very low melting points and very low boiling points. The melting point increases down the column. The melting point of Helium is the lowest (3K), the 'highest' melting point of noble gases is (211K).
Group I and Group II - Alkali and Alkaline-Earth Metals The chemical properties in Group I and II metals are very similar. There are one / two s-electrons, which are held weakly by the positive nucleus. The atoms readily lose the outermost electrons and form positively charged ions.
e.g. Na = Na+ + e-
e.g. Mg = Mg2+ + 2e-
The first ionisation energy is lower than the second, as the number of shells increases, the distance between the nucleus and the electrons increases, thus the force that held the atoms and nucleus together decreases. They can form ionic bond with Group VI / VII elements and metallic structure. In metallic structure, a 'sea' of electrons between each atom held them together. This arrangement allow the atoms to 'slide' above one another without breaking the bonds. It explains the electrical and thermal conductivity of Group I and II metals.
# A-level Chemistry/AQA/Module 5/Thermodynamics/Slow and Fast Expansions
## Adiabatic and Isothermal Expansions

What is the difference between a slow and fast expansion or compression? Thermodynamically we say that if an expansion is fast it is Adiabatic, i.e. A process where there is no heat flow into the system. A slow expansion is generally an isothermal expansion, where the temperature of the system remains constant throughout the process.

### Adiabatic Processes

Adiabatic Process are reversible as the entropy stays the same. No heat flows into the system and all work is done at the expense of Internal Energy.
For an Ideal Gas the equation of a PV equation of an Adiabatic Process is
$PV^{\gamma }\propto 1$
where γ is the ratio of the Specific Heat at Constant Pressure to that of Constant Volume.

### Isothermal Processes

Isothermal Processes are a little different, the system must be connected to a heat bath so that heat can flow into or out of the system in order to keep the temperature constant.
For an Ideal Gas the PV plot is hyperbolic, i.e.
$PV\propto 1$
# A-level Chemistry/AQA/Module 5/Thermodynamics/Specific Heat

Measuring the heat capacity of solids and gases was one of the first clues that we live in a quantum world. Classically, the heat capacity was constant at 1/2Nk per degree of freedom. This would put at a gas at 3/2Nk. Where k is Boltzmann's constant.
The specific heat capacity of a substance is defined as heat capacity per unit mass.

## Experimental Values

When people started looking at heat capacity around the turn of century, they discovered some interesting things about how it changed with temperature. These problems took many years to figure out, including many attempts to create models.

## Heat Capacity of a Quantum Oscillator

If we take a single quantum oscillator with energy
$\epsilon =\hbar \omega \left(n+{\frac {1}{2}}\right)$
Then by summing over n with a Boltzmann distribution for energy. We get a value fot the internal energy of the oscillator.
* $=\sum _{n}^{\infty }e_{n}p_{n}$
* $=\sum _{n}\hbar \omega \left(n+{\frac {1}{2}}\right)e^{\hbar \omega \left(n+{\frac {1}{2}}\right)/kT}$
* $={\frac {\hbar \omega }{2}}+\sum _{n}\hbar \omega ne^{\hbar \omega \left(n+{\frac {1}{2}}\right)/kT}$
* $={\frac {\hbar \omega }{2}}+{\frac {\hbar \omega }{e^{\hbar \omega /{kT}+1}}}$
When we differentiate this with respect to T, we get the Heat Capacity.
$C={\frac {dU}{dT}}$
When we look at the high a low temperature limits for this we see that at high temperatures we get the classical result: C = k$_B$. At the low temperature limit we get that
$C=k_{B}\left({\frac {\hbar \omega }{k_{b}T}}\right)^{2}e^{\frac {\hbar \omega }{k_{b}T}}$

## The Harmonic crystal approximation

One reason why solids are easy to study is that the atoms in a solid are held very tightly to their equilibrium positions. So tightly, in fact, that all the atoms may be assumed to execute coupled simple harmonic motion about their mean positions.

## Einstein's model for a solid

Einstein's model pretty much said that a solid was comprised of 3N quantum oscillators, it provided quite a good model at higher temperatures, but near T = 0K, it didn't agree with experimental values.Let derive the mathematical expression for that.
First Einstein assumed that in solids, the electrons are in the form of waves that don't react with each other (in the real case this does not happen but it can be a good approximating in some cases). Making this assumption, according to Einstein, the probability f(v) that an oscillator has frequency v is given by $f(v)={\frac {1}{e^{\frac {hv}{kT}}-1}}$.also internal energy of a solid is E=3Nhvf(v).So Einstein specific heat is $c_{v}={\frac {dE}{dT}}_{v}=3R{\frac {hv}{kT}}*{\frac {hv}{kT}}*{\frac {e^{\frac {hv}{kT}}}{\left(e^{\frac {hv}{kT}}-1\right)^{2}}}$

## Debye's Model

Debye's model was a large improvement over Einstein's, it was based on the fact that the individual atoms do not oscillate independently. He said that waves travel through the material, these phonons were the important part. The maths is a bit more complicated in Debye's model, but is essentially the same as a boson gas, for example, it's analogous to photons.
# 99 Elm Problems/Problem 37/Solutions

Description of first solution.
# 99 Elm Problems/Problem 4/Solutions

Solution 1: Recursive version
Solution 2: Using List.foldl
# 99 Elm Problems/Problem 35

Determine the prime factors of a given positive integer. Construct a flat list containing the prime factors in ascending order.
# # # THIS IS A STUB # # #
Result:
Solutions
# 99 Elm Problems/Problem 40

Goldbach's conjecture. Goldbach's conjecture says that every positive even number greater than 2 is the sum of two prime numbers. Example: 28 = 5 + 23. Find two prime numbers that sum up to a given even integer.
# # # THIS IS A STUB # # #
Result:
Solutions
# 99 Elm Problems/Problem 36

Determine the prime factors of a given positive integer. Construct a flat list containing the prime factors in ascending order.
# # # THIS IS A STUB # # #
Result:
Solutions
# 99 Elm Problems/Problem 38

Create a program to compare the performance of the two functions to calculate Euler's totient function define in problems 34 and 38.
Solutions
# 99 Elm Problems/Problem 39

Given a range of integers, construct a list of all prime numbers in that range.
# # # THIS IS A STUB # # #
Result:
Solutions
# 99 Elm Problems/Problem 4

Elm provides the function List.length. See if you can implement it.
Result:
Solutions
# 99 Elm Problems/Problem 41

41.a) Given a range of integers, print a list of all even numbers and their Goldbach composition.
41.b) Find how many even numbers between 2 and 3000 are sums of two primes both larger 50.
# # # THIS IS A STUB # # #
Result:
Solutions
# 99 Elm Problems/Problem 37

Calculate Euler's totient function phi(m) (improved).See problem 34 for the definition of Euler's totient function. If the list of the prime factors of a number m is known in the form of problem 36 then the function phi(m) can be efficiently calculated as follows: Let ((p1 m1) (p2 m2) (p3 m3) ...) be the list of prime factors (and their multiplicities) of a given number m. Then phi(m) can be calculated with the following formula:
# # # THIS IS A STUB # # #
Result:
Solutions
# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2016 Exam/Sample Question Papers/June 2016 Practice Questions 1
## June 2016 Practice Questions 1

1. Write an explanation of how get RowColumn works below
3 marks
2. Enter a break-point at an appropriate point and then debug the program. Enter a column value of a and enter nothing when asked for a row number. Insert a screenshot below of the values of the row and column integer variable values after the data has been input
2 marks
3. Modify the getRowColumn method so that it will not allow the user to make a move that is off the board. It must repeat until the user enters a valid move and output an error if they do not enter a correct row or column value. Insert a screenshot of your code below
4 marks
Test your code by entering a column value of 10, then a, then -1, then 5. Then enter a row value of 10, then a, then -1, then 5. Insert a screenshot(s) of the result below
2 marks
4. List all the characters that are stored within the array board and for each one, describe what it represents.
| Character | Explanation |
8 marks
5. Several of the characters stored within the board are automatically generated. State the name below of the user-defined method in which this is performed.
1 mark
6. Several of the characters stored within the board are automatically generated. State the name below of the built-in method which is used to performed this operation.
1 mark
# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Skeleton code/2016 Exam/Sample Question Papers/June 2016 Practice Questions 3

1. Within the subroutine printBoard there is a conditional statement which is extremely long and not dynamic. Explain in the box below why it is not dynamic and in what situations it may not work correctly. The statement is shown below:-
2 marks
2. Rewrite the statement within printBoard to make it work dynamically.
* Insert a screenshot of your code below
4 marks
* Test your code by loading the training map, then entering a column value of 8, then a row value of 1. Then make another attack and enter a column value of 7, then a row value of 6. Then make another attack and enter a column value of 3, then a row value of 1. Insert a screenshot(s) of the result below
3 mark
3. Within the subroutine checkWin there is a conditional statement which is the same as the one within printBoard. If you were to just copy your dynamic statement from printBoard to replace this it would not work. Explain why below:-
2 marks
4. Rewrite the statement within checkWin to make it work dynamically.
* Insert a screenshot of your code below
4 mark
5. Add another ship with a size of 1 and the name “Row Boat” to the appropriate subroutine
* Insert a screenshot of your code below
2 marks
6. In order to make use of your additional ship, there is another change you must make to the program code. Make that change.
* Insert a screenshot of your code below
1 mark
7. In order to test your code, you need to be able to see the positions of the ships on the board. To do this, there is a change you must make to the line console.print(" "); within the subroutine printBoard. Comment out this line of code (DO NOT DELETE IT) and add an alternate line below it that will display the actual character stored within the board array instead of an empty space.
* Insert a screenshot of your code below
4 marks
* Run the game and choose option 1 from the menu. Screenshot the program output below
2 marks
8. So that the game performs as it used to, comment out your additional line of code and remove the comments from the line console.print(" ");
* Insert a screenshot of your code below
1 mark
* Run the game and choose option 1 from the menu. Screenshot the program output below
1 mark
# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Systems Development Life Cycle/Evaluation

The final thing you should do is evaluate how it all went. Remember we are talking about a systems development life cycle here, so if you made any mistakes or things didn't go to plan it's best to make a note of them. Then next time round you won't make the same mistake. However, the main part of the evaluation is to reflect on how successful the operational system is:
* Review to confirm the new system meets the original objectives
* Identify any necessary modifications
An example of a Project Evaluation :
| Objective | Complete | Notes |
| Create 3D models of stadia | Yes | These are all complete and imported |
| Implement a multiplayer internet game | No | internet multiplayer is laggy and unplayable. We need to spend more time testing. |
| Implement Computer player AI | Yes | AI is implemented, but doesn't offer enough challenge, next time we need to recruit an AI specialist |
# A-level Computing/AQA/Problem Solving, Programming, Data Representation and Practical Exercise/Systems Development Life Cycle/Implementation

You might think that all implementation involves is creating the game. You'd be wrong, it involves the following:
* Programming the software / creation of hardware
* Installation of hardware and software
* Preparation of data files
* Training of users
* Writing the system documentation
And at the same time make sure that the system that you build fits in with what you designed
* Example: Electronic Crafts Implementation
* Electronic Crafts will use the designs and code from previous products to code the game, probably in C++.
* They will set up the servers to handle the online play, they will write code to install the game automatically on users machines after paying for it and downloading/putting the disc in the drive.
* They will set up data files on the users Super MES and on the online server to handle user and game data
* They will create a user manual and website to guide users in playing the game
* Exercise: Implementation
* On top of programming a solution, what else does the Implementation involve?
* Answer:
* Installation of hardware and software
* Preparation of data files
* Training of users
* Writing the system documentation
* For a firm creating supermarket checkout machines, explain what they would do for each stage:
* Answer:
* Programming the software / creation of hardware
* Put hardware together and program software
* Installation of hardware and software
* put new machines in store, and install software on them. Make sure that tills talk to central pricing database
* Preparation of data files
* make sure pricing information is up to date
* Training of users
* train shop staff in using the new system
* Writing the system documentation
* create user manual and online resources to aid use
* What forms might system documentation take:
* Answer:
* The most common is a user manual. There might also be a website and videos