You are talking about piecewise defined functions - so use.Code:Piecewise[definition,condition]
What I want to be able to do with Mathematica is define a discrete function with a discrete domain and range that I create and designate. For example:
So that when I type f[a] in Mathematica, it spits out 1, f[b] spits out , etc.
I have plowed through the DC trying to find out how to do something like this, and although I discovered a lot of neat things you can do involving functions with Mathematica, I could not find how to do something as simple as this.
Thanks for any help!