• Aucun résultat trouvé

Season 1 • Episode 01 • Algorithms

N/A
N/A
Protected

Academic year: 2022

Partager "Season 1 • Episode 01 • Algorithms"

Copied!
3
0
0

Texte intégral

(1)

Season 1Episode 01Algorithms

0

Algorithms

Season 1

Episode 01 Time frame 1 period

Objectives :

Read an algorithm.

Followan algorithmwith paper and pen.

Materials :

Slideshow explainingthe main onepts.

Task sheet.

Answersheet.

1 – Short lecture about algorithm 10 mins

Usinga slideshow, the teaher explainsthe main onepts about algorithmsandgivesan

example.

2 – Group work 45 mins

The lass is divided in four groups. Eah group has to arry out a few tasks involving

algorithms. Eah task is awarded a ertain mark to make up a nal mark at the end of

(2)

Algorithms

Season 1

Episode 01 Document Task sheet

Algorithm # 1

Begin

Input :

A A + 2 → A

;

Output :

A

end

1. Apply this algorithmtothe following inputs.

Input

0 5 − 2 10

Output

2. What seems tobethe purpose of this algorithm?

Algorithm # 2

Begin

Input :

x

;

If

x > 0

then

Output :

x

else

Output :

− x

end_if

end

1. Apply this algorithmtothe following inputs.

Input

2 − 2 5 − 5 − 8 − 9

Output

2. What seems tobethe purpose of this algorithm?

Algorithm # 3

Begin

Input :

( x, y ) 10x + y → u

;

100 u → v

;

100 v → w

;

u + v + w → s

;

Output :

s

Apply this algorithmtothe following inputs.

Input

(5 , 3) (2 , 1) (6 , 7)

Output

(3)

Season 1Episode 01Algorithms

2

Algorithm # 4

Begin

Input :

(A, B) A + B → A

;

A − B → B

;

A − B → A

;

Output :

( A, B )

end

1. Apply this algorithmtothe following inputs.

Input

(2 , 3) (5451 , 721) ( √ 5 , π )

Output

2. What seems tobethe purpose of this algorithm?

Algorithm # 5

Begin

Input :

u 1 →

Step ;

Output : Step 1: ,

u

Repeat9 times

Step +1

Step ;

If

u

is even

then

u 2 → u

else

3 × u + 1 → u

end_if

Output : Step, Step , : ,

u

end_repeat

end

Applythisalgorithmtothefollowinginputs.

Input

1 6

Output1

Output2

Output3

Output4

Output5

Output6

Output7

Output8

Output9

Output10

Extras

1. In a shop, during sale time, there is a 10% disount if the amount of the purhase

is greater than or equal to

500

pounds. Write an aglorithm that omputes atual

amount paid by the ustomer.

Begin

end

2. Write analgorithmthat builds the multipliationtable for anumberless than 10.

Begin

Références

Documents relatifs

A low standard deviation indiates that the data points tend to be very lose. to the mean, whereas high standard deviation indiates that the data is spread out

administrators suspect that the two consultants do not interpret and apply the scheme in the same way, resulting in differences in scores between the exams scored by the

Episode 16 – Points and line equations. European section,

Any line has an equation of this form, and in fact many as it’s always possible to apply a. coefficient to the

Subject Snakes Middle term Reptiles Predicate Fur.. Structure

The monomino, the domino, the triominoes and most of the tetrominoes and pentomi- noes have order 1 or 2, except the T tetromino which has order 4 and the Y pentomino which has

• Eah group is given some large paper sheets (half lip-board sheets) and some pens.. • Eah group has to build a large tree showing all the possible moves, with one

For any polygon P in a lattice, we note B P the number of points on its border and I P the number of points strictly inside the polygon..