I am trying to study about converting algorithms into mathematical equations. For this I just started with a simple random example :
function set_b( int b):int { if ( b >= 0) { a = 5 ; } else if ( b < 0 ) { a = -20 } }
By looking at the above algorithm, one can say :
a is dependent upon b. So : a = f(b). Also, the two blocks of Ifs are actually talking about -ve and +ve number lines.
But after this i get stuck, where to start approaching the solution from. Some equation like
a = b + blah blah - blah blah * blah blah etc.
Any clues or hints pls ?