OpenLLM-France/wikimedia huggingface dataset:
# Actually Applicable Application Problems and Brainteasers/Use a Unit Circle to Estimate Sine and Cosine
## Overview

Sometimes you might need to know the sine or cosine value of a certain angle to complete a problem. There are some different ways to do this -- this method is one option.

## General Method

* Open up a GeoGebra tab (or app on your phone, etc.).
* Plot the points (0,0) and (1,0).
* Use the circle tool to make a circle centered on (0,0), through the point (1,0). This is the "unit circle."
* Drop a point onto any other location on the unit circle.
** It should be possible to drag this point around the circle but not off of it. If that doesn't work, delete the point and try again.
* Change this point's settings to show its coordinates.
* Draw a line segment from (0,0) to the new point.
* Use the angle measurement tool to label and measure the angle made by that segment and the x-axis.
** Notice that the angle display and measurement update automatically as you move the point around, as do its coordinates.
* The draggable point's x-coordinate is the cosine of the labeled angle, and its y-coordinate is the sine of the labeled angle. If the angle whose sine and cosine you want is not the angle shown, drag the point until it is.

## Problems
### Evaluate sines

$\sin(90^{\circ })=$
$\sin(37^{\circ })=$
$\sin(120^{\circ })=$

### Evaluate cosines

$\cos(45^{\circ })=$
$\cos(53^{\circ })=$
$\cos(95^{\circ })=$

### Make Your Own Problem

Choose an angle for a particular purpose, like a rotation transformation, and evaluate its sine and cosine.
# Actually Applicable Application Problems and Brainteasers/Scarf with Texture Stripes
## Overview

For people who are interested in fashion design or just like needlecraft, being able to make their own patterns to knit or crochet is definitely a real application problem. A scarf is a good project for beginners because it is rectangular so
Note that this method also works for other rectangular projects like rugs or placemats -- just replace the word "scarf" as needed.

## General Method

* Pick the two (or more) textures which you would like to use as stripes.
** This page has some options of knitting textures: https://www.studioknitsf.com/stitch-patterns-beginner/
** This page has some options of crochet textures: https://www.mybluprint.com/article/8-bold-beautiful-textured-crochet-stitches-to-try
** Do you want to mix knit and crochet? I won't stop you. Make sure you think through how to deal with switching from one to the other.
* Find out how many stitches wide each repetition of the pattern for each texture is.
* Skip-count to make a list of the multiples of each of these numbers.
* Find the numbers that are multiples of both (or all) of the textures you would like to use.
* Choose the number that will give the width you want in your scarf.
** If you aren't sure, you can choose the lowest common multiple, make a sample, measure it, and divide the width you want by the width of the sample.
* Add any stitches you need for "edge stuff" (selvages).
* Cast on or make a foundation chain of that many stitches. (If a foundation chain, also add stitches for the height of the first stitch, as usual.)

## Problems
#### Example 1

The 2x1 Pique Rib knit texture is a three-stitch repeat, and the Chevron Seed Stitch knit texture is an eight-stitch repeat. If you want your scarf to be at least ten inches wide (and not wider than it needs to be, because that will make it take longer to make), and you're using yarn and needles that turn out projects at four stitches per inch, how many stitches should you cast on?

#### Make Your Own Problem

Make your own decisions about what to make and follow the general method outline to create something amazing!
# Actually Applicable Application Problems and Brainteasers/Tip Estimation 1
## Overview

Tipping is a method used in restaurants to thank the server by leaving some money behind. It's important to be aware that in restaurants where tips are expected, the owner is allowed to pay the servers a lower hourly wage and expect the tips to make up for it. So, it's important for everyone who eats at those restaurants to tip appropriately. Usually, 15-20% is considered a reasonable tip -- though if your server has worked particularly hard, such as by bringing you many refills, it's good to leave a little extra.
This type of problem is Actually Applicable for anyone who cares about being a nice customer (or, about getting good service next time they come to the same place).

## General Method

* When you find out how much you must pay for the meal, round up (or down but only a little) to a nearby multiple of 5 to make the numbers convenient to work with.
** For example, if the bill is $15.75, it's OK to round to $15, but if the bill is $18, it would be nicer to round it to $20.
* Divide the rounded amount by 5.
** 20 is a fifth of 100, so a fifth of the bill is 20% of it.

## Problems
### Tip Calculation

Estimate the tip on these bills:
* $23.47
* $32.50
* $19.45

### Extension

If a server needs to earn $150 in tips and the average bill in a restaurant is $25, approximately how many tables must he wait on?

### Make Your Own Problem

Next time you eat out, try this method out to calculate a tip.
# Actually Applicable Application Problems and Brainteasers/Subtraction Trick for Common Factors
## Overview

Rather than a real-world situation, this is a calculation trick that you can use to make other problems easier. Because subtraction is easier than division, it's Actually Applicable in the sense that it takes something you have to do and makes it easier.

## General Method

* Subtract the smaller number from the bigger number. Now you have three numbers.
* Cross out the biggest of the three numbers. Now you have two numbers.
* As long as those two numbers are different, take them back to step 1.
* If those two numbers are actually the same, they are your Greatest Common Factor. All of its factors are other common factors of the two numbers you started with.

### A note about why it works

Factors of a number are smaller numbers that you can skip-count by and get the original number.
A common factor of two numbers is a factor of both.
If you skip-count by the common factor and get to two particular other numbers, the difference between them must be some number of steps of that factor. In other words, the difference between those two numbers is another number with the same common factor.
Smaller numbers are easier to work with, so keep going as long as you can.

## Problems
### Simplifying Fractions

One step in simplifying fractions is finding a common factor of the numerator and denominator. Find a common factor of 4 and 18 to simplify 4/18.

### Make Your Own Problem

Pick any two numbers you are interested in, or are using in a situation, and find their common factors.
# Actually Applicable Application Problems and Brainteasers/Two-Variable Linear Programming
## Overview

This strategy uses graphing two-variable linear inequalities, solving systems of two linear equations, and evaluating formulas to make decisions between two options in business settings. It is a real application problem for any businessperson who needs to choose between two options that are related through linear constraints. There are also related strategies for dealing with situations with more than two variables.

## General Method

* Set up your objective function, z=ax+by, where a and b are usually the profit or revenue per item sold for items x and y.
* For each resource which is in limited supply, known as constraints (materials, time in a production facility, storage space, etc.), set up an inequality showing that the total amount used of that resource must be less than or equal to the maximum.
** The inequalities you set up will often also be called constraints in discussing these types of problems.
* Graph all the inequalities and clearly shade the region where they overlap, called the feasible region.
* Use strategies for solving simultaneous equations to determine the coordinates of the corners of the feasible region.
* Evaluate the objective function at each corner to determine where its value is greatest.

## Problems
### Xylophones and Yo-yos

Situation: You are helping run a business which makes xylophones and premium yo-yos. You need to decide how many of each to make. The following list is a summary of the pertinent facts.
* A xylophone sells for $12 and a yo-yo sells for $17.
* A xylophone requires $3 in materials and a yo-yo requires $5.
* You have $175 to work with to buy materials. (You have budgeted separately for the cost of your production facility, employees, etc.)
* A xylophone takes 1/2 hour in the metal cutting machine and 2 hours in the polishing machine.
* A yo-yo takes 3 hours in the metal cutting machine and 1/2 hour in the polishing machine.
* You run your machines for two shifts, each of which is 8 hours, 5 days a week.
* There is plenty of demand for both xylophones and yo-yos so you will sell whatever you make.
Goal: As in most businesses, your goal is to make as much profit as possible.

### Make Your Own Problem

Find a business with two products (or pick two products from a business which makes more) and research their constraints such as storage space, availability of materials, and tools and labor used in producing the two products. Also find out their profit on each of the two products to set up the objective function (or, if they won't give out that information, use their selling prices, and optimize for revenue instead or profit).
# Actually Applicable Application Problems and Brainteasers/Rain Accumulation
## Overview

Students' task with these graphs is to estimate accumulation by sketching rectangles, multiplying to find each rectangle's area, and adding the rectangles' area to find the total area under the curve. (Technically this is integral calculus, though at a level to be accessible even to elementary students.)
This is an application, not just a brainteaser. The total amount of rain that has fallen or is expected to fall can be important for real world purposes like water conservation and flood safety.

## General Method

* Mark the endpoints of the interval of interest.
* Split the interval into equal subintervals. (How many? The problem may say or you may decide.)
* Going up from each interval, draw a rectangle whose height is given by a point on the graph. (Should you use the left endpoint, right endpoint, or midpoint or the subinterval? The problem may say or you may decide.)
** The problem statement may use abbreviations for the number of rectangles and which point to use for the rectangle's height.
** For example, L$_6$ means you should use left endpoints of six rectangles, M$_3$ means you should use midpoints of three rectangles, and R$_8$ means you should use right endpoints of eight rectangles.
* Multiply to find each rectangle's area
** If you know how to calculate the area of a trapezoid, you may also use a trapezoid where one side goes between the two endpoints (so is usually slanted) and the other three sides are like in the rectangles.
** For example, T$_4$ would mean to find the total area of four trapezoids.
* Add to find the total area of the rectangles. This is an estimate for the total accumulation of rain.

## Problems
### Situation 1

This graph is from Weather Underground predictions for a period of rain that was expected to take place in Lufkin, TX overnight from May 2-3, 2019, as accessed on the afternoon of May 2, and plotted in Google Sheets as a "smooth line chart" with the "aggregate column B" [i.e. the times] option checked.
Estimate the total precipitation predicted during this rainy period (that is, from 6 PM to 1 AM).

### Make Your Own Problem

On a rainy day, use a rain gauge or straight-sided glass and a ruler to record amounts of rain at regular intervals. Then make a graph and use the same calculation strategies to find the total amount of precipitation.
You can also use weather data someone else recorded such as from Weather Underground.
# Actually Applicable Application Problems and Brainteasers/Tipping
## Overview

Information about tipping in general is included in the Tip Estimation 1 Problem.
Now that calculators are so easy to carry with you (and in fact included as apps in devices you need for other reasons), many people prefer to calculate tips exactly (then perhaps round afterward).

## General Method

Choose the tip percentage you want to give.
Convert that percentage to a decimal. For example, 20% is 0.2 (if it helps you to write it as 0.20 that's OK too) and 15% is 0.15.
Multiply the bill for the meal by that decimal. The product is how much you should tip. (You can round at this point if you wish.)

## Problems

Calculate the tip on these bills at 15%, 20%, and 25%:
* $23.47
* $32.50
* $19.45

### Extension 1: Planning

If a server needs to earn $150 in tips and the average bill in a restaurant is $25, approximately how many tables must he wait on?

### Extension 2: Evaluating Estimates

Compare your exact results from this method with at least two methods for estimating a tip, and use that to help you form an opinion about estimation methods.

### Make Your Own Problem

Next time you eat out, use this method out to calculate a tip.
# A Latin Reader/Stories/De Rege Gilgamesh

The following is a version of "The Epic of Gilgamesh." This ancient story comes to us from Mesopotamia, where it was transmitted orally in both Sumerian and Akkadian cultures prior to being recorded in writing. The influence of this story is felt not only in the later Homeric texts, but also in the Hebrew Bible.

## Capitulum Primum

Olim fuit rex cui nomen erat Gilgamesh. Hic autem rex nequaquam bonus fuit. Gilgamesh enim oderunt omnes cives qui urbem Uruk incoluerunt. Gilgamesh filias cepit ante nuptias earum ut eas vi comprimeret. Filios autem et occidit Gilgamesh, et coegit eos strenue laborare.
His rebus turbati, quidam cives deos oraverunt ut aliquid facerent aut auxilium ferrent. Di has orationes exaudiverunt, et novam creaturam creaverunt: Enkidus. Hic fuit homo quasi monstrum, nudus, fortis, ferox, cui nulla virtus nisi saevitia. In omnibus autem rebus fuit par atque aequalis Gilgamesh.
Enkidus per silvas et campos errabat cum eum intuitus est venator. Hic venator deum oravit: Shamash, qui fuit deus solis. Hoc dixit venator Shamash: "O magne Shamash, deus solis, oro ut me adjuves. Monstrum per silvas errat, nudus, pilosus, ferox. Hoc monstrum laqueos meos evertit, neque possum bestias capere. Fac, mi domine, ut hoc monstrum obtruncetur."
His orationibus auditis, nolens destruere Enkidum quem modo creaverant di, Shamash meretricem conduxit ut cum Enkidu coiret, et eo modo eum ad humanitatem vocaret. Haec meretrix cum Enkidu coiit, et factus est Enkidus sicut vir. A muliere in castra ductus, Enkidus mores humanos discere coepit.

## Capitulum Secundum

Ubi ductus est Enkidus in castra, coepit discere mores humanos. Vestes gessit, cibum coctum edit, collocutus est cum sociis suis. Cum circum flammam ederent Enkidus et socii sui, quidam vir questus est de Gilgamesh. "Pessimus est omnium regum, immo omnium hominum. Nos aedes et templa aedificare cogit, morimur laboribus, atque uxores nostras ante nuptias vi compremit. Quis pejor rex in mundo inveni potest?"
Cum Enkidus audivisset hanc famam, iratus est valde. "Hujus scelesti hominis facinora non patiar! Gilgamesh ego occidam. Nunquam posthac compremet uxores vestras, neque coget vos frustra laborare." Progressus est ergo ad Uruk.
# A Level Computer Science Programming Guide/Common Operations
## Input And Output

| Language | General Usage | Example Usage |
| Pseudocode | INPUT <Identifier> | Input Answer Input Age Input DistanceTravelled |
| VB.NET | <Identifier> = Console.Readline Dim <Identifier> As <Data Type> = Console.ReadLine | Answer = Console.ReadLine Dim Age As Integer = Console.ReadLine DistanceTravelled = Console.ReadLine |

## Arithmetic, Relational and Logic Operators

| Language | Arithmetic Operators | Arithmetic Operators | Arithmetic Operators | Arithmetic Operators | Integer Division | Integer Division | Relational Operators | Relational Operators | Relational Operators | Relational Operators | Relational Operators | Relational Operators | Logic Operators | Logic Operators | Logic Operators |
| Language | Addition | Subtraction | Multiplication | Division | Modulus | Division | Greater Than | Less Than | Greater Than or Equal to | Less Than or Equal to | Equal To | Not Equal To | AND | OR | NOT |
| Pseudocode | + | - | * | / | MOD | DIV | > | < | >= | <= | = | <> | AND | OR | NOT |
| VB.NET | + | - | * | / | MOD | \ | > | < | >= | <= | = | <> | AND | OR | NOT |

## String Operators

| Language | General Usage | Example Usage |
| Pseudocode | | |
| VB.NET | | |

## Random Number Generation

| Language | General Usage | Example Usage |
| Pseudocode | RANDOMBETWEEN(<Minimum>, <Maximum>) Generates a random INTEGER between the Minimum and Maximum.RND Generates a random REAL number between 0 and 1. | DECLARE Random : INTEGER Random = RANDOMBETWEEN(10, 17) DECLARE Random : REAL Random = RND |
| VB.NET | <Variable> = <Minimum> + Rnd * (<Maximum> - <Minimum>) Generates a random INTEGER between the Minimum and Maximum.Rnd Generates a random REAL number between 0 and 1. | Dim Random As Integer Random = RANDOMBETWEEN(10, 17) Random = 10 + Rnd * (17 - 10) Dim Random As Double Random = Rnd |
# A Latin Reader/Dialogues/De Familia Sophiae

Personae: Sophia, Petrus
Pet: Salva sis, Sophia.
Sop: Salve similiter, mi Petre. Suntne omnia prospera tibi?
Pet: Bene mihi est. Quid tu?
Sop: Valeo quidem, sed frater meus valde aegrotat. Timeo ne ipsa aegrotare incipiam.
Pet: Curandum est ergo ne visas eum.
Sop: Recte mones, sed quam difficile est cognatos nostros non visere.
Pet: Quot habes fratres et sorores?
Sop: Haha, bene rogas. Mihi sunt tres sorores et duo fratres.
Pet: Quam magnam familiam! Beati sunt parentes vestri.
Sop: Beati quidem sunt. Cum puella essem, nunquam tacita fuit domus nostra. Sed cognatos meos diligo magno amore.
Pet: Inde fit ut difficule sit fratrem aegrotantem non visere.
Sop: Recte dicis. Sed mox ad valetudinem revocabitur. Deinde, eum visam. Bene valeas, Petre!
Pet: Et tu cura ut quam optime valeas!
# A Level Computer Science Programming Guide
## Contents

* Introduction
* Variables, Constants and Data Types
* Arrays
* User-Defined Data Types
* Common Operations
* Selection
* Iteration
* Procedures and Functions
* File Handling
* Object-Oriented Programming
* Algorithms
# A Level Computer Science Programming Guide/Algorithms/Sorting
## Bubble Sort

Regular Bubble Sort :
| Language | General Usage |
| Pseudocode | n ← MaxIndex - 1 FOR i ← 1 TO n FOR j ← 1 TO n IF MyList[j] > MyList[j + 1] THEN Temp ← MyList[j] MyList[j] ← MyList[j + 1] MyList[j + 1] ← Temp ENDIF ENDFOR n ← n - 1 // this means the next time round the inner loop, we don't // look at the values already in the correct positions. ENDFOR |
| VB.NET | |

## Insertion Sort

| Language | General Usage |
| Pseudocode | FOR Pointer ← 2 TO NumberOfitems ItemToBeInserted ← List[Pointer] CurrentItem ← Pointer - 1 // pointer to last item in sorted part of list WHILE (List[CurrentItem] > ItemToBeInserted) AND (CurrentItem > 0) List[CurrentItem + 1] ← List[CurrentItem] // move current item down CurrentItem ← CurrentItem - 1 // look at the item above END WHILE List[CurrentItem + 1] ← ItemToBeInserted // insert item ENDFOR |
| VB.NET | |
# A Latin Reader/Dialogues/Greetings
## Colloquium Primum

Personae: Aurelia, Sophia
Aur: Salve, Sophia!
Sop: Salve similiter, Aurelia!
Aur: Ut vales, amica?
Sop: Bene valeo, ut vales tu?
Aur: Bene valeo!

## Colloquium Secundum

Personae: Paulus, Petrus
Pau: Salve, Petre!
Pet: Salve similiter, Paule!
Pau: Ut vales, amice?
Pet: Male valeo, ut vales tu?
Pau: Bene valeo. Spero te melius valiturum.
Pet: Gratias, et ego hoc spero.

## Colloquium Tertium

Personae: Maria, Johannes
Mar: Salvus sis, mi care Johannes!
Joh: Et tu salva sis, carissima! Usque valuisti?
Mar: Sic valeo ut nunquam melius!
Joh: Gaudeo tua causa.
Mar: Quid tu? Valesne?
Joh: Quam optime mihi est!
# A Latin Reader/Stories/De Bellis Magorum

This story comes from Finland, and describes the northern lights, as well as two traditional characters in Finnish myth: Nischergurgje and Schlipme.

## De Bellis Magorum

TAX TAX TUX TAX! Audite Niscergurgium!
Longe procul in Lapponia, quae terra plena est magis, longe ultra circulum arcticum, sub bruma est semper, et semper est nox. Sed qualem noctem!
Tranquillum est. Micant stellae in caelo sereno et splendet operiens campos et silvas et valles nix. Lacos et rivos tenet frigor.
Ecce! Lucent in caelo aurorae clarae! Rubrae, flavae, roseae, errant sub stellis huc et illuc, virides, violaceae, caeruleae trans caelum saliunt luces!
Et pueruli Lapponiae ubi plurimi magi, quae mysteriis plena est mysteriis capti sunt. Auroram intuentes aures intendunt ut tympana audiant magica, dicentes:
"Ecce! Pugnant bellatores!"
Olim e paludibus glacialibus egressus est Niscergurgius tympana pulsans carminaque canens magica, cum consedit sub pino ut animum relaxaret, et cenam suam carnem cervi coqueret.
Cum autem cenam coqueret, crepitum de arbore audita est. Sursum intendit oculos, et faciem vidit Sclipmi illius scelesti magi Scelestioris Lunae Filiae filii.
Cito cecinit carmen Niscergurgius, ceciditque ad terram Sclipmus.
"Impie Sclipme!" clamavit magus magnus, "Serve scelestae Lunae Filiae! Cui os curvatum! Cui labra semper mala dicentia! Ecce! Carmen meum omnem potestatem tuam arripuit abs te!"
"Niscergurgi!" inquit sceleratus magus, "Adhuc potestatem retineo, vocare queo manes Lunae qui te interficiant!"
Dein stetit Sclipmus et cecinit carmen, et carminis potestate crevit in immensum, et manu sua tenuit clavam ingentem.
"Molam te in tam subtilem quam nix farinam!"
Respondit autem Niscergurgius, "Ecce! Audi carmina mea!"
Cecinit et Niscergurgius, et ipse etiam crevit in immensum, et celsior fuit Sclipmo. Altissima cacumina umbrosorum pinorum vix ad genua ejus tetenderunt, cacumina montium vix ad medium corpus. Inter nubes fuit pectus, tetigit lunam frons, oculi solem intuiti sunt.
"Furatus es meam potestatem!" clamavit scelestus Sclipmus.
Mutati sunt inde ambo in nubes atrae, et in invicem ruerunt. Acris fuit pugna. Strepitus auditus est. Caelum obscurum fuit.
"Iterum potestatem furatus es meam!" clamavit Sclipmus.
Iterum mutati sunt ambo in cervos ingentes, quibus cornua ferrea. Pugna acris fuit. Silvae sonabant fremitu eorum. Terrae motus fecerunt ungulae eorum.
Tandem defatigatus est malus magus, et se mutavit in colubrum grandem, sed Niscergurgius quoque serpens factus est, et amplexi sunt invicem, et conati sunt invicem veneno occidere.
Subito factus est Sclipmus avis ingens, et Niscergurgium adhuc serpentem despexit de alto. Sed et Niscergurgius se mutavit in aquilam, et consecutus est Sclipmum, et ungulis cepit eum, et traxit eum ad terram.
"Nunc omnem furatus es meam potestatem!"
Cruentus mortuus est Sclipmus, corpusque ejus in terram mersus est.
Ad pinum reversus est Niscergurgius ut tympana sua pulsaret et cenam suam coqueret.
Super caput suum luxerunt in caelo aurorae clarae. Rubrae, flavae, roseae, erraverunt sub stellis huc et illuc, virides, violaceae, caeruleae trans caelum saluerunt luces.
# A Level Computer Science Programming Guide/Algorithms

Sorting
* Bubble Sort
* Insertion Sort
Searching
Listing
* Stacks
* Queues
* Linked Lists
* Binary Trees
* Hash Tables