randRange( 1, 9 ) randRange( N1 + 1, 13 ) getGCD( N1, D1 ) N1 / GCD1 D1 / GCD1 randRange( 1, 9 ) randRange( N2 + 1, 13 ) getGCD( N2, D2 ) N2 / GCD2 D2 / GCD2 getLCM( SIMP_D1, SIMP_D2 )

fraction( N1, D1 ) + fraction( N2, D2 ) = {?}

N1 / D1 + N2 / D2

Taanda mõlemad murrud.

fraction( SIMP_N1, SIMP_D1 ) + fraction( SIMP_N2, SIMP_D2 )

Leia vähim ühine nimetaja leides väikseima arvu, mis jagub nii SIMP_D1 kui ka SIMP_D2-ga.

\lcm(SIMP_D1, SIMP_D2) = LCM

Teisenda mõlemat murdu nii, et nimetaja oleks LCM.

fraction( SIMP_N1, SIMP_D1 ) + fraction( SIMP_N2, SIMP_D2 )

=fraction( SIMP_N1, SIMP_D1 ) \cdot fraction( LCM / SIMP_D1, LCM / SIMP_D1 ) + fraction( SIMP_N2, SIMP_D2 ) \cdot fraction( LCM / SIMP_D2, LCM / SIMP_D2 )

=fraction( SIMP_N1 * LCM / SIMP_D1, LCM ) + fraction( SIMP_N2 * LCM / SIMP_D2, LCM )

=fraction( SIMP_N1 * LCM / SIMP_D1 + SIMP_N2 * LCM / SIMP_D2, LCM )

Taanda.

=fractionReduce( SIMP_N1 * LCM / SIMP_D1 + SIMP_N2 * LCM / SIMP_D2, LCM )

(sulge)
ülesanne Selline on ülesanne alusta selle lahendamist.
Vajad abi? Vaata vihjet. See tegevus nullib sinu praegused punktid!
 
Tagasiside