Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
70e5b0d
content: rewrite big-number-names for first-time learners in both lan…
ru44 Nov 16, 2026
c94be6b
content: rewrite binary-and-other-bases for first-time learners in bo…
ru44 Nov 16, 2026
1fc8a82
content: rewrite composing-functions for first-time learners in both …
ru44 Nov 16, 2026
b475ba4
content: rewrite domain-and-range for first-time learners in both lan…
ru44 Nov 16, 2026
060be71
content: rewrite doubling-and-the-chessboard for first-time learners …
ru44 Nov 16, 2026
be6001e
content: rewrite estimation-and-rounding for first-time learners in b…
ru44 Nov 16, 2026
1d1d7a7
content: rewrite exponential-and-logarithmic-functions for first-time…
ru44 Nov 16, 2026
5dcc86d
content: rewrite function-graph for first-time learners in both langu…
ru44 Nov 16, 2026
50a29f7
content: rewrite how-big-is-a-million for first-time learners in both…
ru44 Nov 16, 2026
49ba77e
content: rewrite inverse-functions for first-time learners in both la…
ru44 Nov 16, 2026
a4f035e
content: rewrite percentages-in-daily-life for first-time learners in…
ru44 Nov 16, 2026
b3a91c4
content: rewrite periodic-functions for first-time learners in both l…
ru44 Nov 16, 2026
a65f03d
content: rewrite piecewise-and-absolute-value for first-time learners…
ru44 Nov 16, 2026
e988c7e
content: rewrite polynomial-shape for first-time learners in both lan…
ru44 Nov 16, 2026
9d23718
content: rewrite powers-of-ten for first-time learners in both languages
ru44 Nov 16, 2026
f28e63b
content: rewrite prime-numbers for first-time learners in both languages
ru44 Nov 16, 2026
4adb3aa
content: rewrite quadratic-functions for first-time learners in both …
ru44 Nov 16, 2026
d66fc81
content: rewrite rational-functions-and-asymptotes for first-time lea…
ru44 Nov 16, 2026
707afde
content: rewrite scientific-notation for first-time learners in both …
ru44 Nov 16, 2026
454e381
content: rewrite transformations-of-graphs for first-time learners in…
ru44 Nov 16, 2026
e8f7c8e
docs: track bilingual editorial review across all lessons
ru44 Nov 16, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
481 changes: 481 additions & 0 deletions content/lessons/EDITORIAL_REVIEW.md

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions content/lessons/STYLE.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ Run `pnpm check` after editing. It validates structure, formulas and challenge s

## Reviewed examples and remaining work

The following lessons have received a complete bilingual editorial pass under this guide: `place-value`, `negative-numbers`, `fractions-and-decimals`, `slope`, and `derivative`. They demonstrate the intended approach, not a claim that the catalog has been reviewed.
See [the lesson-by-lesson review checklist](EDITORIAL_REVIEW.md) for coverage. The Numbers and Functions sections and the derivative lesson have received a complete bilingual editorial pass under this guide.

The remaining lessons still need individual review of their summaries, controls, explanations, examples and challenges. Track progress by lesson, and do not treat a global phrase replacement or a successful build as an editorial review.
The remaining lessons still need individual review of their summaries, controls, explanations, examples and challenges. Do not treat a global phrase replacement or a successful build as an editorial review.
66 changes: 35 additions & 31 deletions content/lessons/functions/composing-functions/ar.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,68 @@
---
title: تركيب الدوال
summary: >-
حوّل العملة ثم أضف الضريبة. قاعدتان في واحدة، والترتيب يغيّر الجواب.
summary: طبق قاعدة أولى، ثم استخدم نتيجتها مدخلًا لقاعدة ثانية.
parameters:
x: دولارات x
r: r — سعر الصرف (الآلة g)
t: t — نسبة الضريبة (الآلة f)
x: المبلغ الابتدائي x
r: معامل التحويل r
t: الجزء المضاف t؛ القيمة 0.15 تعني 15%
variables:
- المبلغ الذي تبدأ به، بالدولار
- سعر الصرف، وكل دولار يصبح هذا العدد من الوحدات
- نسبة الضريبة المضافة بعد التحويل، كنسبة عشرية
- المبلغ الابتدائي بالوحدة الأصلية
- عدد الوحدات الجديدة المقابلة لكل وحدة أصلية
- الجزء الذي نضيفه إلى المبلغ بعد التحويل
---

## Try it

1. حرّك «x»، وهو مبلغ بالدولار، وراقب المنحنى يُظهر الناتج بعد مرور المبلغ بالآلتين.
2. ارفع «r»، آلة التحويل. يميل المنحنى كله أكثر. كل دولار يساوي الآن أكثر حتى قبل حساب الضريبة.
3. الآن ارفع «t»، آلة الضريبة. يميل المنحنى أكثر مرة أخرى، فوق الميل الأول. آلتان تعملان معًا، وأثراهما يتراكبان.
1. اضبط x على 100 وr على 3.75 وt على 0.15. يعطي الضرب أولًا 375، ثم نضيف 15% منها فنحصل على 431.25. يعرض الرسم الناتج النهائي.
2. أبقِ x وr ثابتين واضبط t على 0. يصبح الناتج 375، لأن القاعدة الثانية تترك مدخلها دون تغيير.
3. أبقِ x عند 100 وt عند 0، واضبط r على 2. يصبح الناتج 200. قاعدة التحويل وحدها تضاعف المدخل الآن.

## Real-life examples

1. **تحويل دولارات إلى ريالات ثم دفع الضريبة.** 100 دولار بسعر صرف r=3.75 تصبح 375 ريالًا. ضريبة 15% بعد التحويل ترفع المجموع إلى 431.25.
2. **دولارات إلى يورو بضريبة أصغر.** 50 دولارًا بسعر r=0.85 تصبح 42.5 يورو. ضريبة 8% بعد ذلك ترفعها إلى 45.90.
3. **تحويل عملة بلا ضريبة.** 150 دولارًا بسعر r=1.35 تصبح 202.50 دولارًا كنديًا، بلا ضريبة (t=0)، فالآلة الثانية لا تغيّر شيئًا هنا.
1. **تحويل تتبعه رسوم.** بمعامل افتراضي قدره 3.75، يصبح المبلغ 100 مساويًا لـ375. إضافة 15% تعطي 431.25. هذه قيم للتدريب، وليست أسعار صرف حالية.
2. **قيم تدريبية أخرى.** ضرب 50 في 0.85 يعطي 42.50. إضافة 8% تعطي 45.90.
3. **دون رسوم إضافية.** ضرب 150 في 1.35 يعطي 202.50. عند t = 0، تترك القاعدة الثانية هذه النتيجة كما هي.

## Test yourself

1. جد x وr وt بحيث يكون المبلغ النهائي 300 بالضبط.
2. جد r وx وt بحيث يكون مقدار الضريبة وحدها 15 بالضبط.
3. جد r وt بحيث يضاعف التحويل ثم الضريبة مالك بالضبط.
1. اختر x وr وt ليكون الناتج النهائي نحو 300.
2. اختر قيمًا تجعل الجزء المضاف وحده، حاصل ضرب r وx وt، نحو 15.
3. اختر r وt ليبتعد معامل الضرب الكلي عن 2 بأقل من 0.05.

## Intuition

تخيل آلتين مثبتتين على حزام ناقل، الواحدة خلف الأخرى. الآلة الأولى، g، تأخذ x دولاراتك وتحوّلها. أدخل 100 دولار بسعر صرف r=3.75 فيخرج 375 ريالًا. الآلة الثانية، f، تأخذ ما خرج من الأولى وتضيف الضريبة. أدخل 375 ريالًا بضريبة 15% فيخرج 431.25. تركيب f مع g يعني ببساطة تمرير ناتج الأولى إلى الثانية مباشرة، بلا أي شيء بينهما.
لنفترض أننا نحول كمية بالضرب في 3.75. إذا بدأنا من 100 نحصل على 375. ثم تطبق قاعدة ثانية زيادة قدرها 15% على المبلغ الذي يصل إليها، فتحول 375 إلى 431.25. تستخدم العملية الثانية ناتج الأولى.

المنحنى على الشاشة هو خط الإنتاج كله مرسومًا كقاعدة واحدة. لكل x دولار تبدأ به، يُظهر المنحنى بالضبط ما يخرج من الطرف الآخر بعد مرور المبلغ بالآلتين. حرّك «r» فتتغيّر آلة التحويل، فتتحرك كل نقطة على المنحنى. حرّك «t» بدلًا منها فتتغيّر الآلة الثانية وحدها، ومع ذلك يتحرك المنحنى كله، لأن كل ما يأتي بعد آلة تغيّرت يتغيّر معها.
هذا هو تركيب الدوال. نسمي القاعدة الأولى g والثانية f. تعني الكتابة f(g(x)) أن نحسب g(x) أولًا، ثم نطبق f على الناتج. نقرأها من الداخل إلى الخارج.

يعرض الرسم القاعدة المركبة؛ المبلغ الابتدائي على المحور الأفقي، والمبلغ النهائي على الرأسي. لا يرسم نقطة مستقلة للمبلغ الوسيط. احسب هذه القيمة الوسيطة لتفهم كيف وصلنا إلى الناتج النهائي.

## Formal

لدالتين $g$ و$f$، تركيبهما $(f \circ g)(x) = f(g(x))$ يطبّق $g$ أولًا، ثم يطبّق $f$ على الناتج. التركيب معرَّف فقط حين تقع $g(x)$ داخل مجموعة المدخلات التي تقبلها $f$.
نكتب التركيب بالصورة $(f\circ g)(x)=f(g(x))$. لا يمكن حسابه إلا إذا كان x مدخلًا مسموحًا للدالة g، وكانت g(x) مدخلًا مسموحًا للدالة f.

هنا $g(x) = rx$ و$f(u) = u(1+t)$، فيكون $(f \circ g)(x) = rx(1+t)$. هذه قاعدة جديدة واحدة مبنية كليًا من القاعدتين الأخريين، بلا أي قيمة أُهملت أو استُخدمت مرتين.
هنا $g(x)=rx$ و$f(u)=u(1+t)$، حيث u اسم مدخل القاعدة الثانية. بالتعويض نحصل على $(f\circ g)(x)=rx(1+t)$. القيمة العشرية t = 0.15 تعني 15%، وليس 0.15%.

## Advanced

التركيب تجميعي، أي $(f \circ g) \circ h = f \circ (g \circ h)$، لكنه ليس تبديليًا عمومًا. التحويل ثم فرض الضريبة ليس القاعدة نفسها كفرض الضريبة ثم التحويل، إلا إذا انطبقت الضريبة على العملة الأصلية بالتساوي. لهذا يهم ترتيب الآلات الحقيقية كهذه فعلًا.
القاعدتان في هذا المثال عمليتا ضرب، ولذلك يعطي عكس ترتيبهما النتيجة العددية نفسها إذا سمحت الوحدات والتفسير بذلك. لكن تركيب الدوال ليس تبادليًا عمومًا. إضافة 3 إلى 4 ثم مضاعفة الناتج تعطي 14، بينما مضاعفة 4 ثم إضافة 3 تعطي 11. ويكون التركيب تجميعيًا حيثما كانت المدخلات المطلوبة مسموحة.

## Derivation

1. الآلة الأولى تحوّل المدخل: g(x) = rx.
2. الآلة الثانية تضيف الضريبة إلى ما تستقبله: f(u) = u(1+t).
3. تمرير إحداهما إلى الأخرى يعطي القاعدة المركّبة الواحدة: f(g(x)) = rx(1+t).
1. نضرب المدخل الابتدائي x في معامل التحويل r.
2. نعرّف القاعدة الثانية لأي مبلغ تستقبله ونسميه u: نحتفظ به ونضيف إليه الجزء t منه.
3. نستبدل u بناتج القاعدة الأولى rx للحصول على القاعدة المركبة.

## Real world

### خطوط معالجة البيانات
خط معالجة بيانات ينظّف البيانات ثم يحوّلها ثم يحمّلها هو تركيب ثلاث دوال، تُطبَّق بترتيب ثابت.
### تحويل الوحدات

نحول طولًا إلى وحدة جديدة، ثم نصغره لبناء نموذج. يصبح ناتج التحويل مدخلًا لعملية التصغير.

### تحرير الصور

قص الصورة ثم تغيير حجمها تركيب لعمليتين. قد يعطي عكس الترتيب صورة مختلفة.

### سلاسل تحويل الوحدات
تحويل الإنش إلى سنتيمتر، ثم السنتيمتر إلى مقياس نموذج مصغّر، هو دالة تحويل مركّبة مع دالة أخرى.
### البرمجة

### معالجة البنوك والمدفوعات
تحويل العملة وخصم الرسوم والضريبة غالبًا ثلاث دوال منفصلة مركّبة تُطبَّق على المعاملة نفسها، بهذا الترتيب.
يمكن للبرنامج تمرير ناتج دالة مباشرة إلى دالة أخرى. يجب أن تقبل كل دالة نوع القيمة التي تصل إليها.
67 changes: 35 additions & 32 deletions content/lessons/functions/composing-functions/en.md
Original file line number Diff line number Diff line change
@@ -1,65 +1,68 @@
---
title: Composing functions
summary: >-
Chain two simple rules — convert currency, then add tax — into one, and see
why the order in which you run them can change the final answer.
summary: Apply one rule, then use its result as the input to a second rule.
parameters:
x: dollars x
r: r — exchange rate (machine g)
t: t — tax rate (machine f)
x: starting amount x
r: conversion multiplier r
t: added fraction t (0.15 means 15%)
variables:
- the amount of money you start with, in dollars
- the exchange rate — dollars become this many units for every one dollar
- the tax rate applied after conversion, as a fraction
- starting amount in the original units
- number of new units for each original unit
- fraction added to the converted amount
---

## Try it

1. Drag «x», money in dollars, and watch the curve show what comes out after both machines run.
2. Raise «r», the conversion machine. The whole curve tilts steeper: every dollar is now worth more before tax even applies.
3. Now raise «t», the tax machine. The curve tilts steeper again, on top of the first tilt — two machines, two effects, stacked.
1. Set x to 100, r to 3.75 and t to 0.15. First multiply to get 375; then add 15% of 375 to get 431.25. The graph shows the final output.
2. Keep x and r fixed and set t to 0. The output becomes 375, because the second rule now leaves its input unchanged.
3. Keep x at 100 and t at 0, and set r to 2. The output becomes 200. The conversion rule alone now doubles the input.

## Real-life examples

1. **Converting dollars to riyals, then paying tax.** 1 dollars 00 at a rate of r=3.75 becomes 375 riyals; a 15% tax after conversion brings the total to 431.25.
2. **Dollars to euros with a smaller tax.** 5 dollars 0 at r=0.85 becomes 42.5 euros; an 8% tax after that brings it to 45.90.
3. **A tax-free currency swap.** 1 dollars 50 at r=1.35 becomes 202.50 Canadian dollars, with no tax added (t=0), so the second machine changes nothing at all.
1. **Conversion followed by a charge.** Using an illustrative multiplier of 3.75, an amount of 100 becomes 375. Adding 15% gives 431.25. These are practice settings, not a current exchange-rate quote.
2. **A second set of practice values.** An amount of 50 multiplied by 0.85 gives 42.50. Adding 8% gives 45.90.
3. **No added charge.** An amount of 150 multiplied by 1.35 gives 202.50. With t = 0, the second rule leaves that result unchanged.

## Test yourself

1. Find x, r and t so the final amount comes out to exactly 300.
2. Find r, x and t so the tax portion alone equals exactly 15.
3. Find r and t so that converting and then taxing exactly doubles your money.
1. Choose x, r and t to make the final output about 300.
2. Choose settings so the added portion alone, r times x times t, is about 15.
3. Choose r and t so the combined multiplier is within 0.05 of 2.

## Intuition

Picture two machines bolted one after the other on a conveyor belt. The first machine, g, takes your x dollars and converts them: feed in 100 dollars at a rate of r=3.75 and out comes 375 riyals. The second machine, f, takes whatever comes out of the first and adds tax: feed in 375 riyals at 15% tax and out comes 431.25. Composing f and g just means running the output of one straight into the input of the other, with nothing in between.
Suppose a quantity is converted by multiplying it by 3.75. Starting with 100 gives 375. A second rule adds 15% to whatever it receives, so it takes 375 to 431.25. The second calculation uses the first calculation's answer.

The curve on screen is the whole pipeline drawn as a single rule: for every x dollars you could start with, it shows exactly what comes out the far end after both machines have run. Slide «r» and the conversion machine changes, which shifts every point on the curve. Slide «t» instead and only the second machine changes, yet the whole curve still moves, because everything downstream of a changed machine changes too.
This is composition of functions. Call the first rule g and the second rule f. The notation f(g(x)) means calculate g(x) first, then apply f to that result. Read it from the inside out.

The graph shows the combined rule, with the starting amount on the horizontal axis and the final amount on the vertical axis. It does not plot a separate point for the intermediate amount. Calculate that intermediate value to understand how the final result was obtained.

## Formal

Given two functions $g$ and $f$, their composition $(f \circ g)(x) = f(g(x))$ first applies $g$, then applies $f$ to the result. Composition is only defined where $g(x)$ lands inside the set of inputs $f$ is willing to accept.
The composition is $(f\circ g)(x)=f(g(x))$. It is defined only when x is an allowed input for g and g(x) is an allowed input for f.

Here $g(x) = rx$ and $f(u) = u(1+t)$, so $(f \circ g)(x) = rx(1+t)$: a single new function built entirely from the other two, with no value skipped or reused.
Here $g(x)=rx$ and $f(u)=u(1+t)$, where u names the second rule's input. Substitution gives $(f\circ g)(x)=rx(1+t)$. The decimal t = 0.15 means 15%, not 0.15%.

## Advanced

Composition is associative, $(f \circ g) \circ h = f \circ (g \circ h)$, but not commutative in general: converting then taxing is not the same rule as taxing then converting unless the tax applies equally to the original currency, which is why the order of real-world machines like these genuinely matters.
These two particular rules are multiplications, so reversing their order gives the same numerical result when their units and interpretation permit it. Composition does not generally commute: adding 3 and then doubling sends 4 to 14, while doubling and then adding 3 sends 4 to 11. Composition is associative wherever the relevant inputs are allowed.

## Derivation

1. The first machine converts the input: g(x) = rx.
2. The second machine adds tax to whatever it receives: f(u) = u(1+t).
3. Feeding one into the other gives the single combined rule: f(g(x)) = rx(1+t).
1. Apply the conversion multiplier r to the initial input x.
2. Define the second rule for any received amount u: keep that amount and add the fraction t of it.
3. Replace u with the first rule's output rx to obtain the combined rule.

## Real world

### Software pipelines
A data pipeline that cleans data, then transforms it, then loads it is a composition of three functions, applied in a fixed order.
### Unit conversions

Convert a length into a new unit, then scale it for a model. The output of the conversion becomes the input to scaling.

### Image editing

Cropping an image and then resizing it combines two operations. Reversing their order can produce a different image.

### Unit conversion chains
Converting inches to centimetres, then centimetres to a scale-model size, is one conversion function composed with another.
### Software

### Bank and payment processing
Currency conversion, fee deduction and tax are often three separate composed functions applied to the same transaction, in that order.
A program can pass the result of one function directly into another. Each function must accept the type of value it receives.
Loading
Loading