https://um.mendelu.cz/...
in URL, click View on GitHub
to open this file on github.com.e
on GitHub). However, an advanced VS Code editor (press .
on GitHub) is better, since it provides preview how the Markdown code renders. Alternatively press pencil for simple editor or press triangle next to the pencil to get access to VS Code described as github.dev
.Ctrl+V
and K
. Keep the preview open as you work, or close using a mouse.Source control
(describe your changes, such as “Polish translation started”) and then press Commit&Push.is_finished: False
in header to is_finished: True
.https://um.mendelu.cz/...
, otevřete jej na serveru github.com.e
na GitHubu). Lepší je však pokročilý editor VS Code (stikněte .
na GitHubu), protože poskytuje náhled, jak se kód Markdown interpretuje. Případně stiskněte tužku pro jednoduchý editor nebo stiskněte trojúhelníček vedle tužky, abyste získali přístup k editoru VS Code popsaný jako github.dev
.Ctrl+V
. a K
. Během práce nechte náhled otevřený nebo jej zavřete pomocí myši.Zpráva
(popište své změny, např. “Zahájen překlad do polštiny”) a poté stiskněte tlačítko Commit&Push.is_finished: False
v záhlaví na is_finished: True
.Řešením ryze matematických problémů dostáváme přesné výsledky. Používáme-li však matematiku k řešení problémů světa kolem nás, dosáhneme absolutní přesnosti odpovědi jen zřídka. Přibližnost je někdy způsobena tím, že při svých úvahách reálnou situaci zjednodušíme. Jindy jsou přibližně stanovena už vstupní data (např. měřit délky nebo čas umíme jen s omezenou přesností) nebo je absolutně přesný výsledek reálně nedosažitelný a musí se zaokrouhlit.
Často se v praxi (a také v následujících úlohách) využívá zaokrouhlování na určitý počet platných číslic. Kladné reálné číslo \(r\) zaokrouhlíme na \(n\) platných číslic následujícím způsobem:
Úloha 1. Vedoucí skladu léčiv obdržel fakturu za objednané dva druhy vakcín. Celkem bylo za dodávku \(597\) balení vakcín Ixodinum proti encefalitidě a \(386\) balení vakcín Nopolio proti obrně zaplaceno \(401\,950\,\text{Kč}\). Při vstupní kontrole však bylo zjištěno, že \(84\) balení vakcíny Ixodinum a \(19\) balení vakcíny Nopolio je prošlých a musí být vráceny. Při reklamaci prošlých léčiv bylo vráceno \(39\,600\,\text{Kč}\).
Protože je zvědavý, chce si spočítat, jaká je nákupní cena jednoho balení obou vakcín. Nemá však po ruce kalkulačku a ani telefon, a proto se spokojí s přibližným řešením. Všechny údaje, které zná, před výpočtem zaokrouhlí na jednu platnou číslici.
Jak moc se bude jeho výsledek lišit od skutečné nákupní ceny? Pro oba druhy vakcín určete absolutní rozdíl vypočítané a skutečné ceny i relativní chybu v procentech.
Řešení. Vyřešme úlohu nejprve bez zaokrouhlování. Označme \(x\) cenu za jedno balení Ixodinu a \(y\) cenu za jedno balení Nopolio. Informace v zadání vedou na soustavu dvou lineárních rovnic o dvou neznámých \[ \begin{alignedat}{2} 597x &\,+& 386 y &= 401\,950 \\ 86x &\,+& 19 y &= 39\,600, \end{alignedat} \] jejímž řešením dostáváme skutečnou nákupní cenu jednoho balení vakcíny Ixodinum \(350\,\text{Kč}\) a cenu jednoho balení vakcíny Nopolio \(500\,\text{Kč}\).
Po zaokrouhlení koeficientů na jednu platnou číslici řešíme soustavu \[ \begin{alignedat}{2} 600x' &\,+ & 400 y' &= 400\,000 \\ 90x' &\,+ & 20 y' &= 40\,000. \end{alignedat} \] Řešením je dvojice \(x'=\frac{1000}{3}\doteq333\) a \(y'=500\). Porovnáme skutečnou cenu a skladníkův cenový odhad. Dále vypočteme relativní chybu v ceně léčiva, která vznikla zaokrouhlením. Relativní chybu určíme jako podíl absolutní chyby (absolutní hodnoty rozdílu cen) a skutečné ceny balení léku. Výsledky shrneme v tabulce:
vakcína | skutečná cena | skladníkův odhad ceny | relativní chyba |
---|---|---|---|
Ixodinum | \(350\,\text{Kč}\) | \(333\,\text{Kč}\) | \(\frac{350-333}{350}=4{,}9\,\%\) |
Nopolio | \(500\,\text{Kč}\) | \(500\,\text{Kč}\) | \(\frac{500-500}{500}=0\,\%\) |
Úloha 2. Po pár měsících přišla do skladu jiná dodávka, a to \(504\) balení vakcín Antiflu proti chřipce a \(81\) balení vakcín Kontradift proti záškrtu. Za tuto dodávku bylo zaplaceno \(198\,900\,\text{Kč}\). Při vstupní kontrole bylo zjištěno, že \(98\) balení Antiflu a \(18\) balení Kontradiftu je prošlých. Při jejich reklamaci bylo zpět vráceno \(40\,700\,\text{Kč}\).
Vedoucí skladu zopakoval svůj postup a spočítal si od ruky přibližnou nákupní cenu obou léků. Tentokrát se však nestačil divit. Z čeho vycházel jeho údiv a jak moc se jeho výsledek od skutečných cen lišil tentokrát?
Řešení. Úlohu budeme řešit stejně jako předchozí, tentokrát označíme \(x\) cenu jednoho balení Antiflu a \(y\) cenu jednoho balení Kontradiftu. Tyto skutečné ceny jsou řešením soustavy \[ \begin{alignedat}{2} 504x &\,+ & 81 y &= 198\,900 \\ 98x &\,+ & 18 y &= 40\,700, \end{alignedat} \] odkud dostáváme \(x=250\) a \(y=900\).
Po zaokrouhlení koeficientů řešíme soustavu \[ \begin{alignedat}{2} 500x' &\,+ & 80 y' &= 200\,000 \\ 100x' &\,+ & 20 y' &= 40\,000, \end{alignedat} \] jejímž řešením je \(x'=400\) a \(y'=0\). Z řešení vedoucího skladu se tedy zdá, že druhá vakcína byla do skladu dodána zadarmo, přitom je ve skutečnosti skoro čtyřikrát dražší než první. Rozdíl mezi skutečnou cenou a skladníkovým odhadem ceny i relativní chybu zaneseme opět do tabulky:
vakcína | skutečná cena | skladníkův odhad ceny | relativní chyba |
---|---|---|---|
Antiflu | \(250\,\text{Kč}\) | \(400\,\text{Kč}\) | \(\frac{400-250}{250}=60\,\%\) |
Kontradift | \(900\,\text{Kč}\) | \(0\,\text{Kč}\) | \(\frac{900-0}{900}=100\,\%\) |
Úloha 3. Soustavy z obou předchozích úloh znázorněte graficky ve vhodném softwaru. Porovnáním znázornění soustav z Úlohy 1 se znázorněním soustav z Úlohy 2 vysvětlete rozdíl v přesnostech výsledků obou úloh.
Řešení. Označme \(p_1\), \(p_2\) (resp. \(q_1\), \(q_2\)) jednotlivé přímky dané rovnicemi soustavy s nezaokrouhlenými koeficienty v Úloze 1 (resp. v Úloze 2), jmenovitě \[ \begin{aligned} p_1 &\colon 597x + 386 y = 401\,950 \\ p_2 &\colon 86x + 19 y = 39\,600 \\[2mm] q_1 &\colon 504x + 81 y = 198\,900 \\ q_2 &\colon 98x + 18 y = 40\,700. \end{aligned} \] Přímky dané odpovídajícími rovnicemi se zaokrouhlenými koeficienty označme \(p'_1\), \(p'_2\), \(q'_1\) a \(q'_2\) a dále označme body \(P\in p_1\cap p_2\), \(P'\in p'_1\cap p'_2\), \(Q\in q_1\cap q_2\) a \(Q'\in q'_1\cap q'_2\). Grafické znázornění dvojice soustav pro každou úlohu zvlášť je vidět na obrázku.
Porovnáním obou grafických znázornění je vidět, že v případě Úlohy 2 je přímky \(q_1\) a \(q_2\) jsou téměř rovnoběžné. Při zaokrouhlování koeficientů rovnice se obecně poloha přímek vůči souřadnému systému mění a tím se mění také poloha jejich průsečíku. Změna polohy průsečíku je přitom daleko větší u přímek, které jsou téměř rovnoběžné. Z obrázku je také vidět, proč bude zaokrouhlením v druhé úloze daleko více ovlivněna druhá souřadnice průsečíku (tj. cena vakcíny Kontradift). Vzhledem ke sklonu přímek \(q_1\) a \(q_2\) by totiž malá změna \(x\)-ové souřadnice průsečíku znamenala velkou změnu jeho \(y\)-ové souřadnice.
When we solve purely mathematical problems, we get exact results. However, when we use mathematics to solve problems in the world around us, we rarely achieve absolute precision in the answer. Approximation is sometimes the result of a simplification of the real situation in our minds. Sometimes the input data are approximated (e.g. we can only measure lengths or time with limited accuracy) or an absolutely exact result is realistically unattainable and must be rounded off.
Rounding to a given number of significant digits is often used in practice (and in the following problems). We round a positive real number \(r\) to \(n\) significant digits as follows:
Notably, rounding input data can have surprising consequences for the accuracy of the result, for example when solving equations, as we will see in the following series of problems.
Exercise 1. The manager of the pharmaceutical warehouse received an invoice for two types of ordered vaccines. A total of \(401{,}950\,\text{CZK}\) was paid for the delivery of \(597\) packages of Ixodinum vaccines against encephalitis and \(386\) packages of Nopolio vaccines against polio. However, during initial inspection, \(86\) packages of Ixodinum vaccine and \(19\) packages of Nopolio vaccine were found to be expired and had to be returned. A total of \(39{,}600\,\text{CZK}\) was refunded for the expired medicines.
Out of curiosity, the manager wants to calculate the purchase price of one package of both vaccines. However, he does not have a calculator or a mobile phone on hand, so he settles for an approximate solution. He rounds all the figures he knows to one significant digit before calculating.
How much will his result differ from the actual purchase price? For both types of vaccines, determine the absolute difference between the calculated and actual prices, as well as the relative error expressed as a percentage.
Solution. First, let’s solve the problem without rounding. Let \(x\) be the price per package of Ixodine and \(y\) be the price per package of Nopolio. The information in the assignment leads to a system of two linear equations with two unknowns \[ \begin{alignat*}{2} 597x &\,+& 386 y &= 401{,}950 \\ 86x &\,+& 19 y &= 39{,}600 \end{alignat*} \] whose solution gives us the real purchase price of a package of Ixodin vaccine \(350\,\text{CZK}\) and of a package of Nopolio vaccine \(500\,\text{CZK}\).
After rounding the coefficients to one significant digit, we solve the system \[ \begin{alignat*}{2} 600x' &\,+ & 400 y' &= 400\,000 \\ 90x' &\,+ & 20 y' &= 40\,000. \end{alignat*} \] The solution is the pair \(x'=\frac{1{,}000}{3}\doteq333\) and \(y'=500\). Now we have the actual price of the medicine and the estimate of the price by the warehause manager. Let’s also calculate the relative error in the price of the medicine due to rounding. Relative error is the absolute error (absolute value of price difference) divided by the actual price per package. We summarize the results in the table:
vaccine | actual price | price estimate | relative error |
---|---|---|---|
Ixodinum | \(350\,\text{Kč}\) | \(333\,\text{Kč}\) | \(\frac{350-333}{350}=4{,}9\,\%\) |
Nopolio | \(500\,\text{Kč}\) | \(500\,\text{Kč}\) | \(\frac{500-500}{500}=0\,\%\) |
Exercise 2. After a few months, another delivery arrived at the warehouse, namely \(504\) packages of Antiflu vaccines against influenza and \(81\) packages of Kontradift vaccines against diphtheria. \(198{,}900\,\text{CZK}\) was paid for this delivery. During initial inspection, \(98\) packages of Antiflu and \(18\) packages of Contradift were found to be expired. A total of \(40{,}700\,\text{CZK}\) was refunded.
The warehouse manager repeated his procedure and calculated the approximate purchase price of the two drugs off the top of his head. This time, however, he was surprised. What was the reason for his surprise and how much did his result differ from the actual prices?
Solution. We will solve the problem in the same way as before, this time we will denote \(x\) the price of one package of Antiflu and \(y\) the price of one package of Contradift. The real prices are the solution of the system \[ \begin{alignat*}{2} 504x &\,+\,& 81 y &= 198{,}900 \\ 98x &\,+\,& 18 y &= 40{,}700 \end{alignat*} \] where we get \(x=250\) and \(y=900\).
When rounding the coefficients, we solve the system \[ \begin{alignat*}{2} 500x' &\,+\,& 80 y' &= 200{,}000 \\ 100x' &\,+\,& 20 y' &= 40{,}000, \end{alignat*} \] whose solution is \(x'=400\) and \(y'=0\). From the solution of the warehouse manager, it seems that that the second vaccine was delivered to the warehouse free of charge, while it is actually almost four times more expensive than the first one. We calculate the relative error and enter all the values in the table again:
vaccine | actual price | price estimate | relative error |
---|---|---|---|
Antiflu | \(250\,\text{Kč}\) | \(400\,\text{Kč}\) | \(\frac{400-250}{250}=60\,\%\) |
Kontradift | \(900\,\text{Kč}\) | \(0\,\text{Kč}\) | \(\frac{900-0}{900}=100\,\%\) |
Exercise 3. Graphically represent the systems of equations from the previous two problems using appropriate software. Explain the difference in the accuracy of the results of the two exercises by comparing their graphs.
Solution. Let \(p_1\), \(p_2\) (or \(q_1\), \(q_2\)) be the lines given by the equations of the system with unrounded coefficients in Exercise 1 (or Exercise 2), namely \[ \begin{align*} p_1 &\colon 597x + 386 y = 401{,}950 \\ p_2 &\colon 86x + 19 y = 39{,}600 \\[2mm] q_1 &\colon 504x + 81 y = 198{,}900 \\ q_2 &\colon 98x + 18 y = 40{,}700. \end{align*} \] Let us denote the lines given by the corresponding equations with rounded coefficients by \(p'_1\), \(p'_2\), \(q'_1\) and \(q'_2\) and further denote the points \(P\in p_1\cap p_2\), \(P'\in p'_1\cap p'_2\), \(Q\in q_1\cap q_2\) and \(Q'\in q'_1\cap q'_2\). A graphical representation of the pair of systems for each problem separately is shown in following figure.
By comparing the two graphical representations, it can be seen that in the case of Exercise 2, the pair of lines \(q_1\) and \(q_2\) are almost parallel. When rounding the coefficients of the equation, the position of the lines relative to the coordinate system generally changes and the position of the intersection changes as well. The change in the position of the intersection is much greater for lines that are almost parallel. The figure also shows why the second coordinate of the intercept (i.e., the price of the vaccine Contradift) will be much more affected by rounding in the second problem. Because of the slope of the lines \(q_1\) and \(q_2\), a small change in the \(x\) coordinate of the intersection would mean a large change in its \(y\) coordinate.