In need of special function

Joined
Aug 17, 2021
Messages
2
Reaction score
1
Hi guys!
first thread in this forum so I apologize if I make any formal errors here :)

So, my question is whether there is a simpler function to one particular problem:

The function only needs to deal with these four cases and output exactly these outputs:

f( 1, 1) = 1
f( 1, -1) = 1
f(-1, 1) = 1
f(-1, -1) = -1

Only approach I came up with was the function f(a,b) = ((a-1)*(b-1)-2)/-2

But I am in need of a much simpler function. Please help!
 
Last edited:
I would try this function:

f(a,b) =(a)^3*b^2

f(1,1) =1^3*1^2=1
f(1,-1) =1^3*(-1)^2=1
f(-1,1) =(-1)^3*1^2=-1
f(-1,-1) =(-1)^3*(-1)^2=-1
 
I would try this function:

f(a,b) =(a)^3*b^2

f(1,1) =1^3*1^2=1
f(1,-1) =1^3*(-1)^2=1
f(-1,1) =(-1)^3*1^2=-1
f(-1,-1) =(-1)^3*(-1)^2=-1
Wow! I didnt expect an answer that fast, it was only like 1.5hrs.
And first of all, thank you for your suggestion, but sadly, if you only look at the specific cases, f(a,b)=a³*b² =a (we only deal with 1s), and that is for the case of f(-1,1)=1 wrong. But thank you again, anyways!
 
Wow! I didnt expect an answer that fast, it was only like 1.5hrs.
And first of all, thank you for your suggestion, but sadly, if you only look at the specific cases, f(a,b)=a³*b² =a (we only deal with 1s), and that is for the case of f(-1,1)=1 wrong. But thank you again, anyways!

At least she tried. Anyone can make an error.
 

Members online

No members online now.

Forum statistics

Threads
2,555
Messages
9,909
Members
706
Latest member
irlenBingus
Back
Top