randRange( 1, 2 ) randRange( 2, 3, NUM_EXPRESSIONS ) [ [ 1, 1, 1 ], [ 1, 1, 1 ] ] (function() { var variables = [ [ "a", "b", "c" ], [ "x", "y", "z" ] ]; var group = []; for ( var i = 0; i < NUM_EXPRESSIONS; i++ ) { group.push( variables.shift().slice( 0, NUM_TERMS[ i ] ) ); } return group; })() [ randRangeNonZero( -10, 10 ), randRangeNonZero( -10, 10 ) ] [ randRangeNonZero( -10, 10 ), randRangeNonZero( -10, 10 ) ] (function() { var originals = []; jQuery.each( GROUPS, function( index, group ) { var coeffs = COEFFICIENTS[ index ]; var o = []; jQuery.each( group, function( i, variable ) { o.push( expr( [ "*", coeffs[ i ], variable] ) ); }); originals.push( o ); }); return originals; })() (function() { var expression = []; jQuery.each( GROUPS, function( index, group ) { var coeffs = COEFFICIENTS[ index ]; jQuery.each( group, function( i, variable ) { expression.push( expr( [ "*", (coeffs[ i ] * FACTORS[ index ] ), variable ] ) ); }); }); return expression; })() shuffle( MULTIPLIED_EXPRESSIONS ).join( " + " ) (function() { var answer = 0; for ( var i = 0; i < NUM_EXPRESSIONS; i++ ) { answer += ( FACTORS[ i ] * VALUES[ i ] ); } return answer; })()

Jeżeli ORIGINAL_EXPRESSIONS[ 0 ].join( " + " ) = VALUES[ 0 ] i ORIGINAL_EXPRESSIONS[ 1 ].join( " + " ) = VALUES[ 1 ],

ile wynosi QUESTION?

ANSWER

= MULTIPLIED_EXPRESSIONS.join( " + " )

= (FACTORS[ 0 ]) \cdot (ORIGINAL_EXPRESSIONS[ 0 ].join( " + " )) + (FACTORS[ 1 ] ) \cdot (ORIGINAL_EXPRESSIONS[ 1 ].join( " + " ))

= (FACTORS[ 0 ]) \cdot ( VALUES[ 0 ]) + (FACTORS[ 1 ]) \cdot ( VALUES[ 1 ])

= FACTORS[ 0 ] * VALUES[ 0 ] + FACTORS[ 1 ] * VALUES[ 1 ]

= ANSWER