Chapterبەش 3 · Lectureوانە 3.4

Piecewise Functions: Absolute Value, Floor and Ceilingنەخشە ڕێسا پەلدارەکان: نرخی ڕووت، نەخشەی گەورەترین ژمارەی تەواو و نەخشەی بچووکترین ژمارەی تەواو

Functions that use different formulas on different parts of their domain: the absolute value, the floor ⌊x⌋\lfloor x\rfloor and the ceiling ⌈x⌉\lceil x\rceil, with all the course examples, their step graphs and how programs use them.

کە لە بەشە جیاوازەکانی فۆرمولەی جیاواز بەکار دەهێنن: ، ⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil، لەگەڵ هەموو نموونەکانی خولەکە، هێڵکارییە پلیکانەییەکانیان و چۆنیەتی بەکارهێنانیان لە .

14 min read16 خولەک خوێندنەوە · 13 stepsهەنگاو

What you will learnچی فێر دەبیت

  • Evaluate and draw a piecewise function, using filled and open dots correctly.
  • Write the absolute value as a piecewise function and give its domain and range.
  • Compute floors and ceilings, also of negative numbers, and draw their step graphs.
  • Use floor and ceiling in everyday counting problems and recognise them in Python.
  • بەهای بدۆزەرەوە و بیکێشە، بە بەکارهێنانی ڕاستی خاڵی پڕکراو و کراوە.
  • وەک بنووسە و و بدە.
  • ⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil بژمێرە، تەنانەت بۆ و هێڵکارییە پلیکانەییەکانیان بکێشە.
  • بەرەو خوار و بەرەو سەر لە کێشەی ژماردنی ڕۆژانەدا بەکار بهێنە و لە Pythonـدا بیناسەوە.

One function, several formulasیەک نەخشە، چەند فۆرمولەیەک

Sometimes one formula is not enough to describe a function. A piecewise-defined function uses different formulas on different parts of its domain; each formula comes with a condition that says where it applies.

هەندێک جار یەک فۆرمولە بەس نییە بۆ وەسفکردنی . لە بەشە جیاوازەکانی فۆرمولەی جیاواز بەکار دەهێنێت؛ لەگەڵ هەر فۆرمولەیەک مەرجێک هەیە کە دەڵێت لە کوێ جێبەجێ دەکرێت.

Walnuts in the bazaarگوێز لە بازاڕدا

A walnut seller charges 12,000 dinars per kilogram for less than 1 kg, but only 10,000 dinars per kilogram if you buy 1 kg or more. The price for w kilograms is one function with two formulas: P(w)=12000wP(w)=12000w when 0<w<10<w<1, and P(w)=10000wP(w)=10000w when w≥1w\ge1. So 0.8 kg costs 9,600 dinars and 1.5 kg costs 15,000 dinars.

گوێزفرۆشێک بۆ کەمتر لە 1 کیلۆ، کیلۆی بە ⁦12,000⁩ دینار دەفرۆشێت، بەڵام ئەگەر 1 کیلۆ یان زیاتر بکڕیت کیلۆی بە ⁦10,000⁩ دینار. نرخی w کیلۆ یەک بە دوو فۆرمولە: P(w)=12000wP(w)=12000w کاتێک 0<w<10<w<1 و P(w)=10000wP(w)=10000w کاتێک w≥1w\ge1. کەواتە ⁦0.8⁩ کیلۆ ⁦9,600⁩ دینار و ⁦1.5⁩ کیلۆ ⁦15,000⁩ دینار تێدەچێت.

Where the analogy stops workingسنووری ئەم نموونەیە

In a real bazaar you can bargain. A piecewise function decides the boundary exactly: exactly 1 kg uses the second price, because the condition is w≥1w\ge1.

لە بازاڕی ڕاستەقینەدا دەتوانیت مامەڵە بکەیت. سنوورەکە بە وردی دیاری دەکات: ڕێک 1 کیلۆ نرخی دووەم وەردەگرێت، چونکە مەرجەکە w≥1w\ge1ـە.

The conditions must fit together so that every x of the domain gets exactly one output: usually they do not overlap, and together they cover the whole domain. If two conditions both included the same x and gave different values, the rule would not be a function (What is a function?).

مەرجەکان دەبێت وا لەگەڵ یەک بگونجێن کە هەر xـێکی تەنها یەک وەربگرێت: زۆرجار یەکتر داناپۆشن و پێکەوە هەموو دەگرنەوە. ئەگەر دوو مەرج هەمان xـیان بگرتایەتەوە و دوو بەهای جیاوازیان بدایە، یاساکە نەدەبوو (نەخشە چییە؟).

Quick checkپشکنینی خێراWith the walnut prices above, how much do 2 kg cost?بەپێی نرخەکانی گوێزی سەرەوە، 2 کیلۆ بە چەند دەبێت؟

One function, several formulasیەک نەخشە، چەند فۆرمولەیەک

Evaluating and drawing a piecewise functionدۆزینەوەی بەها و کێشانی نەخشەیەکی ڕێسا پەلدار

f(x)={2−x,x<1x+2,x≥1f(x)=\begin{cases}2-x, & x<1\\ x+2, & x\ge1\end{cases}

A function with two pieces: the first formula for x<1x<1, the second for x≥1x\ge1.

بە دوو پارچە: فۆرمولەی یەکەم بۆ x<1x<1 و فۆرمولەی دووەم بۆ x≥1x\ge1.

Evaluating fدۆزینەوەی بەهای f
  1. Find the right pieceپارچە ڕاستەکە بدۆزەرەوە

    Check which condition the input satisfies. For x=−2x=-2: −2<1-2<1, so the first piece applies.

    بپشکنە کام مەرج پڕ دەکاتەوە. بۆ x=−2x=-2: −2<1-2<1، بۆیە پارچەی یەکەم جێبەجێ دەبێت.

  2. Use only that formulaتەنها ئەو فۆرمولەیە بەکار بهێنە

    f(−2)=2−(−2)=4f(-2)=2-(-2)=4. In the same way f(1)=1+2=3f(1)=1+2=3 (because 1≥11\ge1) and f(4)=4+2=6f(4)=4+2=6.

    f(−2)=2−(−2)=4f(-2)=2-(-2)=4. بە هەمان شێوە f(1)=1+2=3f(1)=1+2=3 (چونکە 1≥11\ge1) و f(4)=4+2=6f(4)=4+2=6.

To draw it, draw each piece only on its own part of the domain. At a boundary, a filled dot means the point belongs to the graph and an open dot means it does not. At x=1x=1 the second piece is used, so (1,3)(1,3) is filled, while (1,1)(1,1), where the first piece would end, is open.

بۆ کێشانی، هەر پارچەیەک تەنها لەسەر بەشی خۆی لە بکێشە. لە سنووردا، خاڵی پڕکراو واتە خاڵەکە سەر بە هێڵکارییەکەیە و خاڵی کراوە واتە نییە. لە x=1x=1ـدا پارچەی دووەم بەکار دێت، بۆیە (1,3)(1,3) پڕکراوە، بەڵام (1,1)(1,1)، کە پارچەی یەکەم لێی کۆتایی دێت، کراوەیە.

Graph of the piecewise function. For x < 1 an orange line y = 2 − x comes down from the upper left and ends at an open dot at (1, 1). For x ≥ 1 a green line y = x + 2 starts at a filled dot at (1, 3) and rises to the right. A note says: open dot, not included.هێڵکاریی نەخشە ڕێسا پەلدارەکە. بۆ x < 1 هێڵێکی پرتەقاڵیی y = 2 − x لە سەرەوەی چەپەوە دادەبەزێت و لە خاڵێکی کراوەدا لە (1, 1) کۆتایی دێت. بۆ x ≥ 1 هێڵێکی سەوزی y = x + 2 لە خاڵێکی پڕکراوی (1, 3)ـەوە دەست پێدەکات و بەرەو ڕاست بەرز دەبێتەوە. تێبینییەک دەڵێت: خاڵی کراوە، ناگرێتەوە.
Each piece lives on its own part of the domain. The graph jumps at x=1x=1.هەر پارچەیەک لەسەر بەشی خۆیەتی لە . هێڵکارییەکە لە x=1x=1ـدا باز دەدات.CêIT
Quick checkپشکنینی خێراFor the same function f, what is f(3)f(3)?بۆ هەمان f، f(3)f(3) چەندە؟

Graph Piecewise Functions | Find the Domain & Range | Eat PiEat Pi · Englishئینگلیزی · 235K viewsبینین · 4.6K likesلایک

Graphs a piecewise function one piece at a time with small tables, explains open and filled dots, then reads the domain and range.

پارچە بە پارچە بە خشتەی بچووک دەکێشێت، خاڵی کراوە و پڕکراو ڕوون دەکاتەوە، پاشان و دەخوێنێتەوە.

Whole video (6:43): three pieces drawn on their own parts of the domain; open dot = not included, filled dot = included.

هەموو ڤیدیۆکە ⁦(6:43)⁩: سێ پارچە، هەر یەکەیان لەسەر بەشی خۆی لە دەکێشرێت؛ خاڵی کراوە = تێدا نییە، خاڵی پڕکراو = تێدایە.

The absolute value as a piecewise functionنرخی ڕووت وەک نەخشەیەکی ڕێسا پەلدار

The first piecewise function in the notes is the absolute value:

یەکەم لە تێبینییەکاندا :

∣x∣={x,x≥0−x,x<0|x|=\begin{cases}x, & x\ge0\\ -x, & x<0\end{cases}

Why −x-x for negative numbers? Because the minus sign turns a negative number into a positive one: ∣−5∣=−(−5)=5|-5|=-(-5)=5. For the others nothing changes: ∣0∣=0|0|=0, ∣2.5∣=2.5|2.5|=2.5. The meaning of ∣x∣|x| as the distance from 0 is taught in Absolute value.

بۆچی بۆ −x-x؟ چونکە نیشانەی سالب دەکات بە : ∣−5∣=−(−5)=5|-5|=-(-5)=5. بۆ ئەوانی تر هیچ ناگۆڕێت: ∣0∣=0|0|=0، ∣2.5∣=2.5|2.5|=2.5. واتای ∣x∣|x| وەک دووری لە 0ـەوە لە نرخی ڕووت دەخوێنرێت.

Graph of y = |x|: an orange half-line y = −x for x < 0 and a green half-line y = x for x ≥ 0 meet at the origin and form a V. The points (−3, 3) and (3, 3) are marked. Below: D = (−∞, ∞) and R = [0, ∞).هێڵکاریی نەخشەی y = |x|: نیوەهێڵێکی پرتەقاڵیی y = −x بۆ x < 0 و نیوەهێڵێکی سەوزی y = x بۆ x ≥ 0 لە خاڵی بنەڕەتدا بەیەک دەگەن و شێوەی V دروست دەکەن. خاڵەکانی (−3, 3) و (3, 3) نیشان کراون. لە خوارەوە: D = (−∞, ∞) و R = [0, ∞).
Two pieces, one V: the graph of the absolute value function.دوو پارچە، یەک V: .CêIT

Every real number has an absolute value, so Df=(−∞,∞)D_f=(-\infty,\infty). The output is never negative and every y≥0y\ge0 is reached (by x=yx=y), so Rf=[0,∞)R_f=[0,\infty).

هەموو هەیە، بۆیە Df=(−∞,∞)D_f=(-\infty,\infty). هەرگیز سالب نییە و هەموو y≥0y\ge0 بەدەست دێت (بە x=yx=y)، بۆیە Rf=[0,∞)R_f=[0,\infty).

Quick checkپشکنینی خێراWhich piece of the definition gives ∣−7∣|-7|, and what is the value?کام پارچەی پێناسەکە ∣−7∣|-7| دەدات و بەهاکەی چەندە؟

بیرکاری ١٢ ی زانستی | ڕێگەی خێرا نووسینی نەخشەی بەھای ڕووت بۆ نەخشەی پەلدارShaho Math Academy · Kurdish (Sorani)کوردی (سۆرانی) · 3K viewsبینین · 185 likesلایک

In Sorani: rewrite sums of absolute values, such as |x|+|x-2|, as piecewise functions, using a number line to choose the sign of each bar.

بە سۆرانی: کۆی ، وەک ∣x∣+∣x−2∣|x|+|x-2|، دەکاتە ؛ بە هێمای ناو هەر دیاری دەکات.

Sorani (8:33), harder examples than this screen: |x| + |x - 2| and |x + 1| - |x - 2| rewritten as three-piece functions with a sign chart; each bar becomes + or - on each region.

بە سۆرانی ⁦(8:33)⁩، نموونەی قورستر لەم شاشەیە: ∣x∣+∣x−2∣|x| + |x - 2| و ∣x+1∣−∣x−2∣|x + 1| - |x - 2| وەک سێپارچەیی بە دەنووسرێنەوە؛ لە هەر ناوچەیەکدا هەر دەبێتە + یان −.

The floor function ⌊x⌋\lfloor x\rfloorنەخشەی گەورەترین ژمارەی تەواو ⌊x⌋\lfloor x\rfloor

The greatest integer function, also called the integer floor function, gives for every number x the greatest integer that is less than or equal to x. It is written ⌊x⌋\lfloor x\rfloor; some books write [x][x] or [ ⁣[x] ⁣][\![x]\!]. On the number line: if x is an integer, stay where you are; otherwise walk left to the nearest integer.

، کە پێی دەوترێت greatest integer function یان integer floor function، بۆ هەر ژمارەیەکی x گەورەترین دەدات کە لە x بچووکترە یان یەکسانە. بە ⌊x⌋\lfloor x\rfloor دەنووسرێت؛ هەندێک کتێب [x][x] یان [ ⁣[x] ⁣][\![x]\!] دەنووسن. لەسەر : ئەگەر x بێت، لە شوێنی خۆت بمێنەوە؛ ئەگەر نا، بەرەو چەپ بڕۆ بۆ نزیکترین .

A number line from −3 to 2 with a dot at −1.2 between −2 and −1. An orange arrow goes left from −1.2 to −2, labelled ⌊−1.2⌋ = −2, round down (left). A green arrow goes right from −1.2 to −1, labelled ⌈−1.2⌉ = −1, round up (right).هێڵی ژمارەکان لە −3ـەوە تا 2 بە خاڵێک لە −1.2، لە نێوان −2 و −1. تیرێکی پرتەقاڵی لە −1.2ـەوە بۆ چەپ دەچێت بۆ −2: ⌊−1.2⌋ = −2، بەرەو خوار (چەپ). تیرێکی سەوز لە −1.2ـەوە بۆ ڕاست دەچێت بۆ −1: ⌈−1.2⌉ = −1، بەرەو سەر (ڕاست).
Floor walks left, ceiling walks right.⌊x⌋\lfloor x\rfloor بەرەو چەپ دەڕوات و ⌈x⌉\lceil x\rceil بەرەو ڕاست.CêIT
Every floor example of the notes (−1.2-1.2 appears in both lists)هەموو نموونەکانی ⌊x⌋\lfloor x\rfloor لە تێبینییەکاندا (−1.2-1.2 لە هەردوو لیستەکەدا هاتووە)
xx⌊x⌋\lfloor x\rfloorBecauseچونکە
2.22.2⌊2.2⌋=2\lfloor 2.2\rfloor=22≤2.2<32\le 2.2<3
3.93.9⌊3.9⌋=3\lfloor 3.9\rfloor=33≤3.9<43\le 3.9<4
−0.6-0.6⌊−0.6⌋=−1\lfloor -0.6\rfloor=-1−1≤−0.6<0-1\le -0.6<0
−1.2-1.2⌊−1.2⌋=−2\lfloor -1.2\rfloor=-2−2≤−1.2<−1-2\le -1.2<-1
2.42.4⌊2.4⌋=2\lfloor 2.4\rfloor=22≤2.4<32\le 2.4<3
1.91.9⌊1.9⌋=1\lfloor 1.9\rfloor=11≤1.9<21\le 1.9<2
00⌊0⌋=0\lfloor 0\rfloor=00 is already an integer0 خۆی
22⌊2⌋=2\lfloor 2\rfloor=22 is already an integer2 خۆی
0.20.2⌊0.2⌋=0\lfloor 0.2\rfloor=00≤0.2<10\le 0.2<1
−0.3-0.3⌊−0.3⌋=−1\lfloor -0.3\rfloor=-1−1≤−0.3<0-1\le -0.3<0
−2-2⌊−2⌋=−2\lfloor -2\rfloor=-2−2-2 is already an integer−2-2 خۆی
Quick checkپشکنینی خێراWhat is ⌊−0.3⌋\lfloor-0.3\rfloor?⌊−0.3⌋\lfloor-0.3\rfloor چەندە؟

🥰وانه‌یه‌كی زۆر تایبه‌ت له‌ سه‌ر نه‌خشه‌ی فلۆر مامۆستا وەرزێز حەسەنمامۆستا وەرزێر Warzer hasan · Kurdish (Sorani)کوردی (سۆرانی) · 12K viewsبینین · 628 likesلایک · Partبەشی 2:30–11:25 (ofلە 30:47)

In Sorani: the floor function, its symbols [x], ⟦x⟧ and ⌊x⌋, and how to find it for whole numbers and for positive and negative decimals.

بە سۆرانی: و هێماکانی [x][x]، ⟦x⟧\llbracket x \rrbracket و ⌊x⌋\lfloor x \rfloor، هەروەها دۆزینەوەی بۆ و بۆ ژمارەی دەیی موجەب و سالب.

Sorani segment 2:30-11:25: the symbols [x], ⟦x⟧, ⌊x⌋ for the floor ("نەخشەی فلۆر") and how to find it for whole numbers and for positive and negative decimals.

بەشێکی سۆرانی، لە ⁦2:30⁩ تا ⁦11:25⁩: هێماکانی [x][x]، ⟦x⟧\llbracket x \rrbracket و ⌊x⌋\lfloor x \rfloor بۆ (لە ڤیدیۆکەدا « فلۆر»)، هەروەها دۆزینەوەی بۆ و بۆ ژمارەی دەیی موجەب و سالب.

The floor function ⌊x⌋\lfloor x\rfloorنەخشەی گەورەترین ژمارەی تەواو ⌊x⌋\lfloor x\rfloor

The graph of the floor functionهێڵکاریی نەخشەی ⌊x⌋\lfloor x\rfloor

For every x with n≤x<n+1n\le x<n+1 (n an integer) the floor is n. So the graph is a horizontal segment at height n over each interval [n,n+1)[n,n+1): a filled dot on the left end (x=nx=n belongs to this step) and an open dot on the right end (x=n+1x=n+1 already belongs to the next step). Written as a piecewise function with infinitely many pieces:

بۆ هەر xـێک کە n≤x<n+1n\le x<n+1 (n )، ⌊x⌋=n\lfloor x\rfloor=n. بۆیە هێڵکارییەکە لەسەر هەر [n,n+1)[n,n+1) پارچە هێڵێکی ئاسۆییە بە بەرزیی n: خاڵی پڕکراو لە لای چەپ (x=nx=n سەر بەم پلەیەیە) و خاڵی کراوە لە لای ڕاست (x=n+1x=n+1 سەر بە پلەی دواترە). وەک بە ژمارەیەکی بێکۆتا پارچە:

⌊x⌋=n⟺n≤x<n+1,n∈Z\lfloor x\rfloor=n\quad\Longleftrightarrow\quad n\le x<n+1,\qquad n\in\mathbb{Z}
Step graph of y = ⌊x⌋ from x = −3 to 4. Each step is a horizontal segment one unit long at heights −3, −2, …, 4, with a filled dot at its left end and an open dot at its right end. Below: D = ℝ and R = ℤ.هێڵکاریی پلیکانەیی y = ⌊x⌋ لە x = −3ـەوە تا 4. هەر پلەیەک پارچە هێڵێکی ئاسۆیی بە درێژیی یەک یەکەیە لە بەرزییەکانی −3، −2، …، 4، بە خاڵێکی پڕکراو لە سەری چەپ و خاڵێکی کراوە لە سەری ڕاست. لە خوارەوە: D = ℝ و R = ℤ.
The floor function is a step function: it is constant on each [n,n+1)[n,n+1) and jumps at every integer.⌊x⌋\lfloor x\rfloor : لەسەر هەر [n,n+1)[n,n+1) نەگۆڕە و لە هەموو باز دەدات.CêIT

Every real number has a floor, so D=RD=\mathbb{R}; the outputs are exactly the integers, so R=ZR=\mathbb{Z}. A function whose graph looks like stairs is called a step function.

⌊x⌋\lfloor x\rfloor بۆ هەموو هەیە، بۆیە D=RD=\mathbb{R}؛ ڕێک ، بۆیە R=ZR=\mathbb{Z}. کە وەک پلیکانە بێت پێی دەوترێت .

Quick checkپشکنینی خێراOn the graph of y=⌊x⌋y=\lfloor x\rfloor, which point at x=2x=2 is filled?لەسەر y=⌊x⌋y=\lfloor x\rfloor، کام خاڵ لە x=2x=2ـدا پڕکراوە؟

The ceiling function ⌈x⌉\lceil x\rceilنەخشەی بچووکترین ژمارەی تەواو ⌈x⌉\lceil x\rceil

The least integer function, also called the integer ceiling function, gives for every x the smallest integer that is greater than or equal to x. It is written ⌈x⌉\lceil x\rceil. On the number line: an integer stays; any other number walks right to the nearest integer.

، کە پێی دەوترێت least integer function یان integer ceiling function، بۆ هەر xـێک بچووکترین دەدات کە لە x گەورەترە یان یەکسانە. بە ⌈x⌉\lceil x\rceil دەنووسرێت. لەسەر : لە شوێنی خۆی دەمێنێتەوە؛ هەر ژمارەیەکی تر بەرەو ڕاست دەڕوات بۆ نزیکترین .

Every ceiling example of the notes (−1.2-1.2 appears in both lists)هەموو نموونەکانی ⌈x⌉\lceil x\rceil لە تێبینییەکاندا (−1.2-1.2 لە هەردوو لیستەکەدا هاتووە)
xx⌈x⌉\lceil x\rceil
2.22.2⌈2.2⌉=3\lceil 2.2\rceil=3
3.93.9⌈3.9⌉=4\lceil 3.9\rceil=4
−0.6-0.6⌈−0.6⌉=0\lceil -0.6\rceil=0
−1.2-1.2⌈−1.2⌉=−1\lceil -1.2\rceil=-1
2.42.4⌈2.4⌉=3\lceil 2.4\rceil=3
1.91.9⌈1.9⌉=2\lceil 1.9\rceil=2
00⌈0⌉=0\lceil 0\rceil=0
22⌈2⌉=2\lceil 2\rceil=2
0.20.2⌈0.2⌉=1\lceil 0.2\rceil=1
−0.3-0.3⌈−0.3⌉=0\lceil -0.3\rceil=0
−2-2⌈−2⌉=−2\lceil -2\rceil=-2
Quick checkپشکنینی خێراWhat is ⌈0.2⌉\lceil0.2\rceil?⌈0.2⌉\lceil0.2\rceil چەندە؟

The ceiling function ⌈x⌉\lceil x\rceilنەخشەی بچووکترین ژمارەی تەواو ⌈x⌉\lceil x\rceil

The graph of the ceiling functionهێڵکاریی نەخشەی ⌈x⌉\lceil x\rceil

For every x with n−1<x≤nn-1<x\le n the ceiling is n. So each step sits over (n−1,n](n-1,n], with an open dot on the left and a filled dot on the right, the opposite of the floor graph.

بۆ هەر xـێک کە n−1<x≤nn-1<x\le n، ⌈x⌉=n\lceil x\rceil=n. بۆیە هەر پلەیەک لەسەر (n−1,n](n-1,n]ـە، بە خاڵی کراوە لە چەپ و خاڵی پڕکراو لە ڕاست، بە پێچەوانەی ⌊x⌋\lfloor x\rfloor.

⌈x⌉=n⟺n−1<x≤n,n∈Z\lceil x\rceil=n\quad\Longleftrightarrow\quad n-1<x\le n,\qquad n\in\mathbb{Z}
Step graph of y = ⌈x⌉ from x = −3 to 4. Each step is a horizontal segment one unit long with an open dot at its left end and a filled dot at its right end; for example the step at height 1 runs from an open dot at (0, 1) to a filled dot at (1, 1). Below: D = ℝ and R = ℤ.هێڵکاریی پلیکانەیی y = ⌈x⌉ لە x = −3ـەوە تا 4. هەر پلەیەک پارچە هێڵێکی ئاسۆیی بە درێژیی یەک یەکەیە بە خاڵێکی کراوە لە سەری چەپ و خاڵێکی پڕکراو لە سەری ڕاست؛ بۆ نموونە پلەی بەرزیی 1 لە خاڵی کراوەی (0, 1)ـەوە دەچێت بۆ خاڵی پڕکراوی (1, 1). لە خوارەوە: D = ℝ و R = ℤ.
The ceiling steps: open on the left, filled on the right. D=RD=\mathbb{R}, R=ZR=\mathbb{Z}.پلەکانی ⌈x⌉\lceil x\rceil: لە چەپ کراوە و لە ڕاست پڕکراو. D=RD=\mathbb{R}، R=ZR=\mathbb{Z}.CêIT
Quick checkپشکنینی خێراWhat are the domain and the range of y=⌈x⌉y=\lceil x\rceil? و y=⌈x⌉y=\lceil x\rceil چین؟

Floor and ceiling side by side⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil پێکەوە

Watch the blue ring slide along the x-axis. The floor value (orange) stays the same until x reaches the next integer, then jumps up by 1; the ceiling value is always the integer just above, unless x itself is an integer.

سەیری بازنە شینەکە بکە کە بە درێژایی x دەخزێت. بەهای ⌊x⌋\lfloor x\rfloor (پرتەقاڵی) وەک خۆی دەمێنێتەوە تا x دەگاتە دواتر، پاشان 1 بەرز دەبێتەوە؛ بەهای ⌈x⌉\lceil x\rceil هەمیشە ئەو کە ڕێک لە سەرەوەیە، مەگەر x خۆی بێت.

Animation. On the left the graph of y = ⌊x⌋ is drawn from left to right while a blue ring moves along the x-axis from −1.5 to 3.4. On the right three boxes show the current x, ⌊x⌋ and ⌈x⌉, for example x = 1.7, ⌊x⌋ = 1, ⌈x⌉ = 2; at x = 2 both are 2.
Floor and ceiling as x slides: equal at integers, one apart everywhere else.⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil کاتێک x دەخزێت: لە یەکسانن و لە هەموو شوێنێکی تر یەک یەکە لێک دوورن.CêIT
  • For an integer n: ⌊n⌋=⌈n⌉=n\lfloor n\rfloor=\lceil n\rceil=n.
  • For any x that is not an integer: ⌈x⌉=⌊x⌋+1\lceil x\rceil=\lfloor x\rfloor+1.
  • Always ⌊x⌋≤x<⌊x⌋+1\lfloor x\rfloor\le x<\lfloor x\rfloor+1 and ⌈x⌉−1<x≤⌈x⌉\lceil x\rceil-1<x\le\lceil x\rceil.
  • A minus sign swaps them: ⌈x⌉=−⌊−x⌋\lceil x\rceil=-\lfloor -x\rfloor; for example ⌈1.2⌉=2=−⌊−1.2⌋\lceil1.2\rceil=2=-\lfloor-1.2\rfloor.
  • بۆ n: ⌊n⌋=⌈n⌉=n\lfloor n\rfloor=\lceil n\rceil=n.
  • بۆ هەر xـێک کە نەبێت: ⌈x⌉=⌊x⌋+1\lceil x\rceil=\lfloor x\rfloor+1.
  • هەمیشە ⌊x⌋≤x<⌊x⌋+1\lfloor x\rfloor\le x<\lfloor x\rfloor+1 و ⌈x⌉−1<x≤⌈x⌉\lceil x\rceil-1<x\le\lceil x\rceil.
  • نیشانەی سالب جێیان دەگۆڕێتەوە: ⌈x⌉=−⌊−x⌋\lceil x\rceil=-\lfloor -x\rfloor؛ بۆ نموونە ⌈1.2⌉=2=−⌊−1.2⌋\lceil1.2\rceil=2=-\lfloor-1.2\rfloor.
Quick checkپشکنینی خێراx is not an integer and ⌊x⌋=4\lfloor x\rfloor=4. What is ⌈x⌉\lceil x\rceil?x نییە و ⌊x⌋=4\lfloor x\rfloor=4. ⌈x⌉\lceil x\rceil چەندە؟

Floor and ceiling in programs⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil لە بەرنامەکاندا

Programmers meet floor and ceiling all the time: how many full boxes, how many pages, how many rows. A search shows 47 results, 10 per page. It needs ⌈47/10⌉=5\lceil 47/10\rceil=5 pages, and only ⌊47/10⌋=4\lfloor 47/10\rfloor=4 of them are full.

بەرنامەسازەکان بەردەوام پێویستیان بە بەرەو خوار و بەرەو سەر دەبێت: چەند سندوقی پڕ، چەند لاپەڕە، چەند ڕیز. گەڕانێک ⁦47⁩ ئەنجام پیشان دەدات، ⁦10⁩ دانە لە هەر لاپەڕەیەکدا. پێویستی بە ⌈47/10⌉=5\lceil 47/10\rceil=5 لاپەڕە هەیە و تەنها ⌊47/10⌋=4\lfloor 47/10\rfloor=4 لەوانە پڕن.

Quick checkپشکنینی خێراA shop's website shows 47 products, 10 per page. How many pages does it need?ماڵپەڕی دوکانێک ⁦47⁩ کاڵا پیشان دەدات، ⁦10⁩ دانە لە هەر لاپەڕەیەکدا. چەند لاپەڕەی پێویستە؟

Common mistakesهەڵە باوەکان

MistakeهەڵەWhat is trueڕاستییەکە
"⌊−1.2⌋=−1\lfloor-1.2\rfloor=-1: just drop the decimals."«⌊−1.2⌋=−1\lfloor-1.2\rfloor=-1: تەنها بەشی دەیی فڕێ بدە.»Floor goes left on the number line: ⌊−1.2⌋=−2\lfloor-1.2\rfloor=-2.⌊x⌋\lfloor x\rfloor لەسەر بەرەو چەپ دەڕوات: ⌊−1.2⌋=−2\lfloor-1.2\rfloor=-2.
Filled and open dots swapped on the floor graph.گۆڕینەوەی خاڵی پڕکراو و کراوە لە ⌊x⌋\lfloor x\rfloorـدا.Floor: filled on the left of each step; ceiling: filled on the right.⌊x⌋\lfloor x\rfloor: لە چەپی هەر پلەیەک پڕکراو؛ ⌈x⌉\lceil x\rceil: لە ڕاست پڕکراو.
"The range of the floor function is R\mathbb{R}."« ⌊x⌋\lfloor x\rfloor، R\mathbb{R}ـە.»Only integers come out: the range is Z\mathbb{Z}.تەنها دێنە دەرەوە: Z\mathbb{Z}ـە.
"∣x∣=x|x|=x for every x."«بۆ هەموو xـێک ∣x∣=x|x|=x.»Only for x≥0x\ge0; for x<0x<0 use −x-x.تەنها بۆ x≥0x\ge0؛ بۆ x<0x<0 −x-x بەکار بهێنە.
Two pieces whose conditions overlap and give different values.دوو پارچە کە مەرجەکانیان یەکتر دادەپۆشن و بەهای جیاواز دەدەن.Then one x has two outputs: not a function. Make the conditions fit together.ئەو کاتە یەک x دوو دەبێت: نییە. مەرجەکان وا دابنێ کە لەگەڵ یەک بگونجێن.
Using int() in Python as the floor.بەکارهێنانی int() لە Pythonـدا بۆ دۆزینەوەی ⌊x⌋\lfloor x\rfloor.int(-3.5) is −3, but ⌊−3.5⌋=−4\lfloor-3.5\rfloor=-4; use math.floor or //.int(-3.5) دەکاتە −3-3، بەڵام ⌊−3.5⌋=−4\lfloor-3.5\rfloor=-4؛ math.floor یان // بەکار بهێنە.
Quick checkپشکنینی خێراWhich statement is true?کام ڕستە ڕاستە؟

Exercisesڕاهێنانەکان

ExerciseڕاهێنانExercise 1: a function with three piecesڕاهێنانی 1: نەخشەیەک بە سێ پارچە

Let g(x)=x2g(x)=x^2 if x≤0x\le0, g(x)=3g(x)=3 if 0<x<20<x<2, and g(x)=2x−1g(x)=2x-1 if x≥2x\ge2. Find g(−3)g(-3), g(0)g(0), g(1)g(1), g(2)g(2) and g(5)g(5).

با g(x)=x2g(x)=x^2 بێت ئەگەر x≤0x\le0، g(x)=3g(x)=3 ئەگەر 0<x<20<x<2 و g(x)=2x−1g(x)=2x-1 ئەگەر x≥2x\ge2. g(−3)g(-3)، g(0)g(0)، g(1)g(1)، g(2)g(2) و g(5)g(5) بدۆزەرەوە.

Hintئاماژە

First decide which condition each input satisfies.

سەرەتا بڕیار بدە هەر کام مەرج پڕ دەکاتەوە.

Show answerوەڵامەکە پیشان بدە
g(−3)=(−3)2=9(−3≤0)g(0)=02=0(0≤0)g(1)=3(0<1<2)g(2)=2⋅2−1=3(2≥2)g(5)=2⋅5−1=9(5≥2)\begin{aligned}g(-3)&=(-3)^2=9 &&(-3\le0)\\ g(0)&=0^2=0 &&(0\le0)\\ g(1)&=3 &&(0<1<2)\\ g(2)&=2\cdot2-1=3 &&(2\ge2)\\ g(5)&=2\cdot5-1=9 &&(5\ge2)\end{aligned}
ExerciseڕاهێنانExercise 2: ∣x−2∣|x-2| in piecesڕاهێنانی 2: ∣x−2∣|x-2| بە پارچە

Write ∣x−2∣|x-2| as a piecewise function and check it at x=5x=5, x=−1x=-1 and x=2x=2.

∣x−2∣|x-2| وەک بنووسە و لە x=5x=5، x=−1x=-1 و x=2x=2ـدا بیپشکنە.

Show answerوەڵامەکە پیشان بدە
∣x−2∣={x−2,x≥22−x,x<2|x-2|=\begin{cases}x-2, & x\ge2\\ 2-x, & x<2\end{cases}

Replace x by x−2x-2 in the definition of ∣x∣|x|: the inside x−2x-2 is ≥0\ge0 exactly when x≥2x\ge2. Check: ∣5−2∣=3=5−2|5-2|=3=5-2, ∣−1−2∣=3=2−(−1)|-1-2|=3=2-(-1), ∣2−2∣=0|2-2|=0.

لە پێناسەی ∣x∣|x|ـدا x بە x−2x-2 بگۆڕە: ناوەوەکەی، x−2x-2، ڕێک کاتێک ≥0\ge0ـە کە x≥2x\ge2. پشکنین: ∣5−2∣=3=5−2|5-2|=3=5-2، ∣−1−2∣=3=2−(−1)|-1-2|=3=2-(-1)، ∣2−2∣=0|2-2|=0.

ExerciseڕاهێنانExercise 3: floor and ceiling valuesڕاهێنانی 3: بەهاکانی ⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil

Find ⌊π⌋\lfloor\pi\rfloor, ⌈−π⌉\lceil-\pi\rceil, ⌊−5⌋\lfloor-5\rfloor, ⌈4.0001⌉\lceil4.0001\rceil, ⌊−0.5⌋\lfloor-0.5\rfloor and ⌈7⌉\lceil7\rceil.

⌊π⌋\lfloor\pi\rfloor، ⌈−π⌉\lceil-\pi\rceil، ⌊−5⌋\lfloor-5\rfloor، ⌈4.0001⌉\lceil4.0001\rceil، ⌊−0.5⌋\lfloor-0.5\rfloor و ⌈7⌉\lceil7\rceil بدۆزەرەوە.

Show answerوەڵامەکە پیشان بدە

⌊π⌋=3\lfloor\pi\rfloor=3 (π≈3.14\pi\approx3.14); ⌈−π⌉=−3\lceil-\pi\rceil=-3 (walk right from −3.14); ⌊−5⌋=−5\lfloor-5\rfloor=-5 (an integer); ⌈4.0001⌉=5\lceil4.0001\rceil=5 (just above 4 is enough); ⌊−0.5⌋=−1\lfloor-0.5\rfloor=-1; ⌈7⌉=7\lceil7\rceil=7.

⌊π⌋=3\lfloor\pi\rfloor=3 (π≈3.14\pi\approx3.14)؛ ⌈−π⌉=−3\lceil-\pi\rceil=-3 (لە −3.14-3.14ـەوە بەرەو ڕاست بڕۆ)؛ ⌊−5⌋=−5\lfloor-5\rfloor=-5 ()؛ ⌈4.0001⌉=5\lceil4.0001\rceil=5 (کەمێک لە سەرووی 4 بەسە)؛ ⌊−0.5⌋=−1\lfloor-0.5\rfloor=-1؛ ⌈7⌉=7\lceil7\rceil=7.

ExerciseڕاهێنانExercise 4: solve with floor and ceilingڕاهێنانی 4: چارەسەرکردن بە ⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil

Find all x with (a) ⌊x⌋=2\lfloor x\rfloor=2 and (b) ⌈x⌉=2\lceil x\rceil=2. Write each answer as an interval.

هەموو ئەو xـانە بدۆزەرەوە کە (أ) ⌊x⌋=2\lfloor x\rfloor=2 و (ب) ⌈x⌉=2\lceil x\rceil=2. هەر وەڵامێک وەک بنووسە.

Show answerوەڵامەکە پیشان بدە

(a) 2≤x<32\le x<3, the half-open interval [2,3)[2,3): 2 itself gives 2, but 3 already gives 3. (b) 1<x≤21<x\le2, the interval (1,2](1,2]: ⌈1⌉=1\lceil1\rceil=1, but anything just above 1 up to 2 gives 2.

(أ) 2≤x<32\le x<3، [2,3)[2,3): 2 خۆی 2 دەدات، بەڵام 3 ئیتر 3 دەدات. (ب) 1<x≤21<x\le2، (1,2](1,2]: ⌈1⌉=1\lceil1\rceil=1، بەڵام هەر ژمارەیەک کەمێک لە سەرووی 1ـەوە تا 2 دەبێتە 2.

ExerciseڕاهێنانExercise 5: paying for parkingڕاهێنانی 5: پارەی شوێنی ئۆتۆمبێل

A car park charges 1,000 dinars for every started hour. Write the cost for t hours (t>0t>0) with floor or ceiling, and find the cost for 7.5 hours and for exactly 3 hours.

شوێنێکی ڕاگرتنی ئۆتۆمبێل بۆ هەر کاتژمێرێکی دەستپێکراو ⁦1,000⁩ دینار وەردەگرێت. تێچووی t کاتژمێر (t>0t>0) بە ⌊ ⌋\lfloor\ \rfloor یان ⌈ ⌉\lceil\ \rceil بنووسە و تێچووی ⁦7.5⁩ کاتژمێر و ڕێک 3 کاتژمێر بدۆزەرەوە.

Show answerوەڵامەکە پیشان بدە
C(t)=1000⋅⌈t⌉,C(7.5)=1000⋅8=8000,C(3)=1000⋅3=3000C(t)=1000\cdot\lceil t\rceil,\qquad C(7.5)=1000\cdot8=8000,\qquad C(3)=1000\cdot3=3000

A started hour counts as a whole hour, so we round up. Exactly 3 hours is not rounded, because ⌈3⌉=3\lceil3\rceil=3.

کاتژمێرێکی دەستپێکراو وەک کاتژمێرێکی تەواو دەژمێردرێت، بۆیە بەرەو سەر نزیکی دەکەینەوە. ڕێک 3 کاتژمێر نزیک ناکرێتەوە، چونکە ⌈3⌉=3\lceil3\rceil=3.

Exercisesڕاهێنانەکان

Exercises 6–8: graphs with dots and jumpsڕاهێنانەکانی ⁦6–8⁩: هێڵکاری بە خاڵ و بازدانەوە

ExerciseڕاهێنانExercise 6: spot the mistakeڕاهێنانی 6: هەڵەکە بدۆزەرەوە

A student defines the function below and fills a table: f(−2)=2f(-2)=2, f(−1)=1f(-1)=1, f(0)=0f(0)=0, f(12)=14f(\frac12)=\frac14, f(2)=4f(2)=4. What happens at x=1x=1? Is f a function? Fix it, then compare with g.

خوێندکارێک f و g وەک خوارەوە پێناسە دەکات و بۆ f خشتەیەک پڕ دەکاتەوە: f(−2)=2f(-2)=2، f(−1)=1f(-1)=1، f(0)=0f(0)=0، f(12)=14f(\frac12)=\frac14، f(2)=4f(2)=4. لە x=1x=1ـدا چی ڕوو دەدات؟ ئایا f ؟ چاکی بکەرەوە، پاشان لەگەڵ g بەراوردی بکە.

f(x)={−x,x<0x2,0≤x≤14,x≥1g(x)={x,x<0x2,0≤x≤24,x≥2f(x)=\begin{cases}-x, & x<0\\ x^2, & 0\le x\le1\\ 4, & x\ge1\end{cases}\qquad g(x)=\begin{cases}x, & x<0\\ x^2, & 0\le x\le2\\ 4, & x\ge2\end{cases}
Hintئاماژە

Check which conditions x=1x=1 satisfies.

بپشکنە x=1x=1 کام مەرجانە پڕ دەکاتەوە.

Show answerوەڵامەکە پیشان بدە

At x=1x=1 two conditions hold, 0≤1≤10\le1\le1 and 1≥11\ge1, and they give two outputs, 12=11^2=1 and 4. One input with two outputs: as written, f is not a function. Fix: use x>1x>1 for the last piece. Then f(1)=1f(1)=1, and the graph jumps from the filled dot (1,1)(1,1) to the open dot (1,4)(1,4).

لە x=1x=1ـدا هەردوو مەرجی 0≤1≤10\le1\le1 و 1≥11\ge1 ڕاستن و دوو دەدەن: 12=11^2=1 و 4. یەک بە دوو : وەک نووسراوە، f نییە. چاککردنەوە: بۆ پارچەی کۆتایی x>1x>1 بەکار بهێنە. ئەو کاتە f(1)=1f(1)=1 و هێڵکارییەکە لە خاڵی پڕکراوی (1,1)(1,1)ـەوە باز دەدات بۆ خاڵی کراوەی (1,4)(1,4).

The corrected f. An orange line y = −x comes down from the upper left (arrow) to the origin; a green arc of y = x² goes from the origin to a filled dot at (1, 1); an open dot at (1, 4) starts a grey horizontal ray y = 4 to the right (arrow).fـی چاککراو. هێڵێکی پرتەقاڵیی y = −x لە سەرەوەی چەپەوە (تیر) دادەبەزێت بۆ خاڵی بنەڕەت؛ کەوانەیەکی سەوزی y = x² لە خاڵی بنەڕەتەوە دەچێت بۆ خاڵێکی پڕکراو لە (1, 1)؛ خاڵێکی کراوە لە (1, 4) دەستپێکی تیشکێکی ئاسۆیی خۆڵەمێشیی y = 4ـە بەرەو ڕاست (تیر).
The fixed f: a jump at x=1x=1, with exactly one output there.fـی چاککراو: بازدانێک لە x=1x=1ـدا، بە تەنها یەک لەوێ.CêIT

In g the conditions also overlap, at x=2x=2, but both pieces give the same output, 22=42^2=4 and 4. So g is a function, and its graph has no jump at 2: g(−1)=−1g(-1)=-1, g(0)=0g(0)=0, g(1)=1g(1)=1, g(2)=4g(2)=4, g(3)=4g(3)=4. Still, write x>2x>2 for the last piece so that the conditions do not overlap.

لە gـدا مەرجەکان دیسان یەکتر دادەپۆشن، لە x=2x=2ـدا، بەڵام هەردوو پارچەکە هەمان دەدەن: 22=42^2=4 و 4. کەواتە g و هێڵکارییەکەی لە 2ـدا باز نادات: g(−1)=−1g(-1)=-1، g(0)=0g(0)=0، g(1)=1g(1)=1، g(2)=4g(2)=4، g(3)=4g(3)=4. لەگەڵ ئەوەشدا بۆ پارچەی کۆتایی x>2x>2 بنووسە بۆ ئەوەی مەرجەکان یەکتر دانەپۆشن.

ExerciseڕاهێنانExercise 7: one point movedڕاهێنانی 7: یەک خاڵی جووڵاو

Let h(x)=x2h(x)=x^2 for x≠2x\ne2 and h(2)=7h(2)=7. Find h(−2)h(-2), h(2)h(2) and h(3)h(3), sketch h, and give its domain and range.

با h(x)=x2h(x)=x^2 بێت بۆ x≠2x\ne2 و h(2)=7h(2)=7. h(−2)h(-2)، h(2)h(2) و h(3)h(3) بدۆزەرەوە، h بکێشە و و بنووسە.

Show answerوەڵامەکە پیشان بدە

h(−2)=4h(-2)=4, h(2)=7h(2)=7, h(3)=9h(3)=9. The graph is the parabola y=x2y=x^2 with a hole (open dot) at (2,4)(2,4), plus one filled dot at (2,7)(2,7). Domain: R\mathbb{R}. Range: [0,∞)[0,\infty). The hole does not remove 4 from the range, because h(−2)=4h(-2)=4; and 7 was there anyway, at x=±7x=\pm\sqrt7.

h(−2)=4h(-2)=4، h(2)=7h(2)=7، h(3)=9h(3)=9. هێڵکارییەکە y=x2y=x^2ـە بە کونێک (خاڵێکی کراوە) لە (2,4)(2,4)، لەگەڵ یەک خاڵی پڕکراو لە (2,7)(2,7). : R\mathbb{R}. : [0,∞)[0,\infty). کونەکە 4 لە دەرناکات، چونکە h(−2)=4h(-2)=4؛ 7ـیش هەر لەوێ بوو، لە x=±7x=\pm\sqrt7.

The parabola y = x² with arrows at both ends, an open dot at (2, 4) and an orange filled dot above it at (2, 7). A dashed horizontal line at height 4 reaches the parabola again at (−2, 4).بڕگەی هاوتای y = x² بە تیر لە هەردوو سەر، خاڵێکی کراوە لە (2, 4) و خاڵێکی پڕکراوی پرتەقاڵی لە سەرووی ئەوەوە لە (2, 7). هێڵێکی ئاسۆیی پچڕپچڕ لە بەرزیی 4 دیسان لە (−2, 4)ـدا دەگاتە بڕگە هاوتاکە.
One point moved: a hole at (2,4)(2,4), the value 7 above it.یەک خاڵی جووڵاو: کونێک لە (2,4)(2,4) و بەهای 7 لە سەرووی ئەوەوە.CêIT
ExerciseڕاهێنانExercise 8: the clampڕاهێنانی 8: گیرکردن لە ناو ماوەیەکدا

Sketch c(x)=−5c(x)=-5 for x<−5x<-5, c(x)=xc(x)=x for −5≤x≤5-5\le x\le5 and c(x)=5c(x)=5 for x>5x>5. Give its range and say in words what it does to a number.

c(x)=−5c(x)=-5 بۆ x<−5x<-5، c(x)=xc(x)=x بۆ −5≤x≤5-5\le x\le5 و c(x)=5c(x)=5 بۆ x>5x>5 بکێشە. بنووسە و بە وشە بڵێ چی بە ژمارەیەک دەکات.

Show answerوەڵامەکە پیشان بدە

Flat at −5-5 on the left, the line y=xy=x in the middle, flat at 5 on the right. The pieces meet at (−5,−5)(-5,-5) and (5,5)(5,5), so there is no jump. Range: [−5,5][-5,5]. It clamps a number into the interval [−5,5][-5,5]: numbers inside stay the same, numbers outside are pushed to the nearest end: c(−8)=−5c(-8)=-5, c(3)=3c(3)=3, c(12)=5c(12)=5.

لە چەپ لە −5-5ـدا تەختە، لە ناوەڕاست هێڵی y=xy=xـە و لە ڕاست لە 5ـدا تەختە. پارچەکان لە (−5,−5)(-5,-5) و (5,5)(5,5)ـدا بە یەک دەگەن، بۆیە هیچ بازدانێک نییە. : [−5,5][-5,5]. ژمارەیەک لە ناو [−5,5][-5,5]ـدا گیر دەکات: ژمارەکانی ناوەوە وەک خۆیان دەمێننەوە و ژمارەکانی دەرەوە دەبرێنە نزیکترین سەر: c(−8)=−5c(-8)=-5، c(3)=3c(3)=3، c(12)=5c(12)=5.

The clamp graph: an orange horizontal ray at height −5 comes from the left (arrow) to the point (−5, −5), a green segment of y = x rises from (−5, −5) to (5, 5), and an orange horizontal ray at height 5 goes from (5, 5) to the right (arrow).هێڵکاریی گیرکردن: تیشکێکی ئاسۆیی پرتەقاڵی لە بەرزیی −5 لە چەپەوە (تیر) دێت بۆ خاڵی (−5, −5)، پارچەیەکی سەوزی y = x لە (−5, −5)ـەوە بەرز دەبێتەوە بۆ (5, 5) و تیشکێکی ئاسۆیی پرتەقاڵی لە بەرزیی 5 لە (5, 5)ـەوە بەرەو ڕاست دەڕوات (تیر).
The clamp keeps every output between −5-5 and 5.گیرکردنەکە هەموو لە نێوان −5-5 و 5دا دەهێڵێتەوە.CêIT

In computing: programs clamp values all the time: a volume slider stays between 0 and 100, a game character stays inside the screen. In Python the clamp is one line with the built-in min() and max():

لە کۆمپیوتەردا: بەردەوام بەهاکان بەم شێوەیە گیر دەکەن: دەنگی ئامێرێک لە نێوان 0 و ⁦100⁩دا دەمێنێتەوە و کارەکتەرێکی یاری لە ناو شاشەکەدا دەمێنێتەوە. لە Pythonـدا گیرکردن یەک دێڕە بە min() و max()ـی ناوخۆیی:

PYTHONType in a terminalلە تێرمیناڵدا بینووسە
def clamp(x, low=-5, high=5):
    return min(max(x, low), high)

print(clamp(-8), clamp(3), clamp(12))
print(clamp(250, 0, 100))   # a volume slider stays between 0 and 100

Summaryکورتە

  • A piecewise function uses different formulas on different parts of its domain; find the right piece first, and draw each piece only on its part (filled dot = included, open dot = not).
  • ∣x∣=x|x|=x for x≥0x\ge0 and −x-x for x<0x<0; D=(−∞,∞)D=(-\infty,\infty), R=[0,∞)R=[0,\infty).
  • Floor ⌊x⌋\lfloor x\rfloor: the greatest integer ≤x\le x (walk left). Ceiling ⌈x⌉\lceil x\rceil: the smallest integer ≥x\ge x (walk right).
  • Both are step functions with D=RD=\mathbb{R} and R=ZR=\mathbb{Z}; floor steps are filled on the left, ceiling steps on the right.
  • In Python: math.floor, math.ceil and //; int() cuts towards 0.
  • لە بەشە جیاوازەکانی فۆرمولەی جیاواز بەکار دەهێنێت؛ سەرەتا پارچە ڕاستەکە بدۆزەرەوە و هەر پارچەیەک تەنها لەسەر بەشی خۆی بکێشە (خاڵی پڕکراو = دەیگرێتەوە، خاڵی کراوە = نایگرێتەوە).
  • ∣x∣=x|x|=x بۆ x≥0x\ge0 و −x-x بۆ x<0x<0؛ D=(−∞,∞)D=(-\infty,\infty)، R=[0,∞)R=[0,\infty).
  • ⌊x⌋\lfloor x\rfloor: گەورەترین کە ≤x\le x بێت (بەرەو چەپ). ⌈x⌉\lceil x\rceil: بچووکترین کە ≥x\ge x بێت (بەرەو ڕاست).
  • هەردووکیان بە D=RD=\mathbb{R} و R=ZR=\mathbb{Z}؛ پلەکانی ⌊x⌋\lfloor x\rfloor لە چەپ پڕکراون و هی ⌈x⌉\lceil x\rceil لە ڕاست.
  • لە Pythonـدا: math.floor، math.ceil و //؛ int() بەرەو 0 دەبڕێت.
Review questionsپرسیارەکانی پێداچوونەوە
What is ⌊−2.5⌋\lfloor-2.5\rfloor, and what is ⌈−2.5⌉\lceil-2.5\rceil?⌊−2.5⌋\lfloor-2.5\rfloor چەندە و ⌈−2.5⌉\lceil-2.5\rceil چەندە؟

−3-3 and −2-2.

−3-3 و −2-2.

When are the floor and the ceiling of x equal?کەی ⌊x⌋\lfloor x\rfloor و ⌈x⌉\lceil x\rceil یەکسانن؟

Exactly when x is an integer.

ڕێک کاتێک x بێت.

Why is ∣x∣|x| called piecewise?بۆچی ∣x∣|x| پێی دەوترێت نەخشەی ڕێسا پەلدار؟

Because it uses the formula x for x≥0x\ge0 and the formula −x-x for x<0x<0.

چونکە بۆ x≥0x\ge0 فۆرمولەی x و بۆ x<0x<0 فۆرمولەی −x-x بەکار دەهێنێت.

Lesson complete!وانەکە تەواو بوو!

Well done. Review the key terms, then go on to the next lesson.دەستخۆش. سەیرێکی زاراوە سەرەکییەکان بکەرەوە، پاشان بڕۆ بۆ وانەی داهاتوو.

Key termsزاراوە سەرەکییەکان

Next lessonوانەی داهاتوو

Equal, Constant, One-to-One and Onto Functionsنەخشەی یەکسان، نەخشەی نەگۆڕ، نەخشەی یەک بۆ یەک و نەخشەی گشتگر

References and further readingسەرچاوەکان و خوێندنەوەی زیاتر

This lecture is a first edition. The Kurdish text and terminology are waiting for review by Kurdish IT teachers.ئەم وانەیە چاپی یەکەمە. دەقە کوردییەکە و زاراوەکانی چاوەڕێی پێداچوونەوەی مامۆستایانی کوردی بواری IT ن.