(31)育教 日七初月十年巴巴夏·

報日僑華

六期星 日四月一十九八九一)年八十七國民華中

日光

Discussions (1) The values stored in the array A(1), A(2),...A(11) Exercise on flowchart tracing:.

are covered..

"1990 中學再考預習連瀾

Computer (5)

MILL & DALE PRESS

K. Choy

LUIGA, MAKAN

Search to look for the existence of a particular number

character string in a sorted sequence.

Binary search method is a systematic way to search.

Algorithm: (a) Look for the middle term. If there are a terms in the sequence, the position of the mid-tera can be

calculated by

of start and end term

sure of the positions of

(b) Compare the selected middle term with the particular

number to be search,

(c) (i)

E

7.

=

20,

94.

Figures flowchart of binary search. Suppose there are (2) Steps (a), (b) and (c) are repeated until the and 10 elements in ascending order in an array.

of the list.

[R(1) 6. N(2) =

N(3) - 15, N(4) -17, N(5) = 24, M(7) 37, N(8) = 64, N(9) 72. N(10). - (3) At each round, half of the terms in the remaining (6) list are discarded because we are certain that the

-Complete the following number would not turn up in this half as the terms and X is the number to be looked for.

Lagles. (A round means the loop between boxes 5 and 10) are arranged in escending order.

(ii) Similar steps are used to locate the position of 160.

(A(1) M2) |A(3) A(4) A(5) A(6) A(7) A(6) A(9) A(10) |A(11)

(11 terms)

110

(i)

Number to be looked for : X. = 24

ROUND

I

Start.

N(1)

?

LOW

HIGH

10

LOWSHIGH!

2 3

(2 teras left) (i) Number to be looked for : X =-8

110 < 160

A(7) A(S) A(9) M(10) A(11)

(5 terms left)

159

what is the printed outout?

159 160

(10) A(11)

300 }

ROUND

I

300 160

(Not found)

the unsition if bota

Start

i

N(1)

!

1

A

elements in the list are discarded. in the list.

The number 150 is not

2

3

4

Discard the upper half (including the mid- term if the numbers loss than the mid-zerin (ii) Discard the lower half (including the mid- term) if the tomber 3 qreater than the mid- term.

(iii) The ters

is found

numbers are equal.

(0) The above three stops are repeated until the last

number remind is compared.

(e) If the number is not found for the whole search

process, the number is not in the array.

Example: Suppose theen is a sorted array of eleven numbers.

numbers storad are

1

START

The

2

the number to

be lacked few:

21, 35, 47, 99, 131, 10, 144, 145, 159, 300, 310. If the numbers are covered and we cannot see the values. Search for the existence of (1) 101 and (ii) 160.

Solution: (i)

3

LOW - 1

HIGH- 10

What is the printed output?

Unit

A

LOW

HIGH

LOWONIGH

Hyi

10

(ii) From the above example, to search a number in an array of 10

elencats, there are at most 4 trials (rounds).

What is the number of trials at most if an array contains 20 elements?

Position

Num

(a)

ויני

45 3:0

aware than at me in A151 with 101.

1- Inteyrsl

M:1 al

({LOWNISCH)/23

(c)

AS ONLY 170, the elements After A(5) as discarded,

f

X = N

YES

35

:M

[6]

(c)

1 ! -try n;"%།༢།་re

teen

3rd Teen

tommee the when shared to 4131 E 101.

As (0) 47, the plementy before 604) 16 esscarded.

A141 MSH

99

10

YI.S

LOW HIGI

NO

¡PRINT

Answer: (i) Number to be looked for : X = 24

ROUND

1

N(1)

LOW

RIGH

|LOW HIGH}

Start

1.

1

19

20

10

2

64

6

3

24

CONY

/

Yes

Yes

The outgut is "The number is at 6th position.

I

(ii) Number to be looked For: X = 18

ROUND

N(I)

LOW

HIGH

LOWSHIGH

tart

10

20

?

Yes

15

A

Yes

17

5

4

No

AM

thi

1990 中學會考預蠶專欄

出版社

MIET & DALE PRESS

Mathematics (5)

12

the number

Vis NOT IN

-ray"

STOP

.....(3)

Subsitute (3) nto (2)

10. :-wwkeat post equations

A

NG KONG

HONG

3. | 4x

3

..(1)

!.....(2)

(4) - (3)

2b = 5

solutions, determine

From (1)

53

Solutions

Section A

1.

:.

Exercise 5:

Section A

H. K. LO

Simultaneous Equations.

(1)

1. Selve the stem of equations

1.

fir

!

2. valve the system and aggtropy

3. Sale the system of aquattusi

1

......(3)

bate (3) PL (2)

Ly

6x4-7x-13 - 1

40+13)-1) = 0

13

X = 0

1

Zx2

4x + 1 = 0

= 1 =0.7021

PUBLIC

When x =

1.7071

3 4130711 -0.4393

when x 0.2929

y = 470-29297 = 2.5506

= 1.7071

0.4393

orl*

0.2929

(Ans.)

= 2.5606

2 x (3)

28 +

(5)

1

:

The number is NOT in the array."

(iii) of an array contains 20 events. the number う

(rounds) is 5.

trials

全帽

RIES

8.

Let the distance be 5, speed.

v be the

即新

.(1)

3-

(Ans.)

(2) = (1)

25

w

-(2)

九龍旺

41

6. Let ax! 2. b = y + 3

1

1

=

5

.{1}

{Ans.)

v{v÷1)

3v(y-1) - Evlv-t)

For v 0

3(v+1)=5(v-1)

a+3b= 40 .....(2)

Froz (2)

a = 40- 3b .....(3)

Substitute v 4 into (1)

311-36

+

1

5

b-(49-35) = {{b}{40-35}

394 - 50b - 200 - 0.

5

4

AR 126

化、適合省

?

x2 + 16y2 = 25 5x2-19xy-3y0.....(2)

.(1)

.. (b = 10)(35 - 20) = C

.*. b 10 Car

20

5 = 25

20

From (2)

When 16

4.

Wow the water!

2

(6x-y)(x-3)= 0

y = 6x

(3)

3y

.(4)

- 11/

5. Selve to waston of waratan

(ins, F

Consider y = 6x

.. y = 7

a = 10-35 = 10

3 = 10

1 x + 2 = 10

and

Substitute into (1)

x2 -16(6x)2 = 25

When b

9.

3x + y = ......{1}

x2 + y2 = 25 .....(2)

X = 8

(Ans.)

From (1)

y =

[Ans.)

the distance between A and B is 25 km.

尖沙咀星

3-735186

中医皇后:

5-217205

5-890713

旺角週

3-125655

荃灣地

0 49207

官嫵地鐵 3-797302 票: 釐期一

6. Selve me sistem of acetam

(2)

15...(1)

.(2)

2....(3)

Section B

7.

If the equations Bary Shell, Precedent ant (p-1)x-y 1:0 and all satesfond simulta musly is une pare of carui y. Pet the value

f

x'

577

x = 0.708 or

2.08

x = -0.208

- 1.249

་ ་

LY = -1.249

natirate (3) into (1)

Consider x 34

Substitute into (1)

(3)

16y= 25

16

y' = 1

101

J. 40

35 = 20

y + 3

नु

¡x - -0.203 (Ars.)

20

25x2

and x 12

[Ans.!

Since

it is

only ONE root

1 Cr

7-1

3

-3

(Ans.)

y=-1

Section B

7.

V - 5 = 0 3xy 49...

(1) .(2)

(1) + (2)

10.

ex - 100

..1.25

(K-3292 - 25

16x2 + (k-3x)2 = 400

16x2 + k2 - 6kx 9x2 - 400

6kx - (k2-400) = 0

a Langent, there is

‚*. (-6x)2 - 4(25)(k2-400) = 0

-64k2 + 40000 = 0

.*. k = 25 m k = -25

(Ans.)

t

» 馬豪馬七艹馬

یا

8.

A

A

un fan speed.

-3.23

.927

reduce, hy

speed by 1 kes par hrun the journey will te

hall's

www. good! be 1 km, your,

Substitute into (2)

-3.235

- 3 .....(1)

at will take 2

ניין:

i

more.

Pari qistance best woon: A

- 9 .....(2)

y = -0.25 Substitute the values at into

X

and y

and B.

9. 1 3x+4y-K

circle,

constant.

4,927

tanged af

1

whoes

201

BULQ2715 - 3,891

-2.353

ing.

Ans

Let a = and c =

a. 2b 3 .....(3)

a : 4b = 9 .....(4)

(p-1)x - 8y +1 = 0

.. (0-11.25)-8(-0.25):1-0

from which

D = -1.4

(Ans.)

1 A .........(2)

Substitute (2) into (1)

X + Ķ - x2 - 5x + 4

.*. * - 6x + (4-k1 = 0.....(3)

For no real solution,

B2 - 4AC < 0

(-6)2 - 4(1)(4~k) < 0

36 - 15+ 4K CO

4k < -20

k <-5

[Ans.)

Share This Page