# Season 1 • Episode 01 • Algorithms

(1)

0

## Algorithms

### •

Followan algorithmwith paper and pen.

### •

Slideshow explainingthe main onepts.

### 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

Begin

Input :

;

Output :

### A

end

1. Apply this algorithmtothe following inputs.

Input

### 0 5 − 2 10

Output

2. What seems tobethe purpose of this algorithm?

Begin

Input :

;

If

then

Output :

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?

Begin

Input :

;

;

;

;

Output :

### s

Apply this algorithmtothe following inputs.

Input

Output

(3)

2

Begin

Input :

;

;

;

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?

Begin

Input :

### u 1 →

Step ;

Output : Step 1: ,

Repeat9 times

Step +1

Step ;

If

is even

then

else

### 3 × u + 1 → u

end_if

Output : Step, Step , : ,

### u

end_repeat

end

Applythisalgorithmtothefollowinginputs.

Input

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

Updating...

## References

Related subjects :