• Aucun résultat trouvé

Algebra, Functions as algorithms2

N/A
N/A
Protected

Academic year: 2022

Partager "Algebra, Functions as algorithms2"

Copied!
1
0
0

Texte intégral

(1)

Section Européenne DNL mathématiques

Algebra, Functions as algorithms 2

nde

2012-2013

Example 1. A solved problem to start with

● Directions: Show that the following algorithm1 produces a number that is four times the original number.

Algorithm: Pick a number. Multiply the number by 8, add 6 to the product, divide the sum by 2, and subtract 3.

● Solution:Let n represent the original number.

multiply the number by 8 : 8n add 6 to the product : 8n+6 divide the sum by 2 : 8n+6

2 =4n+3

subtract 3 : 4n

We started with n and ended with 4n. Therefore the algorithm given in this example produces a number that is four times the original number.

Exercise 2. Check your progress

Show that the following algorithm produces a number that is three times the original number.

Algorithm: Pick a number. Multiply the number by 6, add 10 to the product, divide the sum by 2, and subtract 5.

Exercise 3. Your turn to create an algorithm!

Write an algorithm that, from the number x, produces

3x2−5 .

Exercise 4. In-class game “Guess what my function is”

1) Pick a function (it could be something like f (x)=(2x−1)3+5 or f (x)=2+

4−x2 or even f (x)=(3x−5)x+22+6 …etc)and write it on a piece of paper without letting your neighbour see it. Put the paper face down.

2) Describe orally your function with an algorithm (in English of course!!!) to your neighbour and he/she will write the corresponding function down. When he/she is done, show him/her the paper with your function on it: Is it the same one? (It should be!)

3) Now it is your turn to guess your neighbour’s function: Switch roles.

4) Finally, assess you team: You get one point for each function written correctly and one extra point for using English only (A single word of French, Wolof or Spanish and you lose that point!!). Allow yourselves an extra point if it was a “hard” function. What is you score? . . . / 3.

Exercise 5. Arithmetic and algorithm

Consider the following algorithm: Pick an integer; Multiply it by 6;

add 5 to the product; square the result; subtract 25.

1) Is it true that this algorithm will always yield a positive number?

2) Is it true that this algorithm will always yield a multiple of 5?

3) Is it true that this algorithm will always yield a multiple of 12?

1 An algorithm /ˈælgəˌrɪðəm/ is a sequence of instructions.

Laure Helme-Guizon, http://mathematoques.weebly.com 1 Useful words

▪ When you square x, you getx2 (Read x squared).

▪ When you take the inverse of x, you get

x

1(Read “1 over x”)..

▪ When you take the square root of x, you get x .

Useful words

▪ “x is positive” means x>0 .

▪ “x is nonnegative” means x⩾0 .

x⩾0 reads “x is greater than or equal to zero.”

x>0 reads “x is greater than zero”

x<0 reads “x is less than zero”.

Références

Documents relatifs

Linux comes with a complete and free Office Suite, similar to Microsoft’s WORD, EXCEL, POWERPOINT etc.. Linux is practically invulnerable to viruses, which makes your system

A cheap thing does not lack defect, nor does an expensive thing lack quality.. (You get what you

An application on a STM32 SoC do process an analog signal : every n us, the application must get a new data from an analog to digital converter (ADC), filter the new data

Fr- Pendant l’injection de cyanoacrylate dans la grande veine saphène (ablation par glue), la compression de la jonction saphéno-fémorale est … (Cocher la bonne réponse):.. In

Our advanced trial setup allows users to choose in real time between a broad range of fine granular quality classes of an HD video sub- ject to different price plans, and

Token Object of System Process [0x62: Trust Label Protected(PP) PsProtectedSignerTcb(6)]..

al [12] where the imagined latent state is used to compute the reward value for optimizing reinforcement learning tasks and the work of Finn and Levine [5], where a predictive model

PSEUDONYMS: Pseudonyms can be used in Confer II conferences for items, responses, and messages, and participants can register in the conference under a