Notation of a function that maps a random element Let there be a functions $f$ and $g$ such that,
 $$f:A \times B \mapsto \Re$$
 $$g: B \mapsto A$$ 
where $\forall b \in B$, $g(b)$ is some $a$ such that, $\forall a' \in A, f(a,b) \geq f(a',b)$. (This is because there could be many elements in $A$ that suffices $\forall a' \in A, f(a,b) \geq f(a',b)$)
My question is, is there a simple notation to write this function $g$?
e.g. I can write $g$ as a relation as,
$$g(b) = \{a|\forall a' \in A, f(a,b) \geq f(a',b)\}$$
But $g$ is a function that chooses one element from the set $\{a|\forall a' \in A, f(a,b) \geq f(a',b)\}$. The mechanism of choosing an element from the set is random.
--EDIT--
I said random to mean that it could be any of those values. No statistics involved. What I have is a computer program that computes the maximum (using a linear searching method) as described and returns (i.e. outputs) it. I want to explain it mathematically. Pardon me since I am a novice to mathematics.
 A: I think it would be best if you would define $g$ in plain words, e.g. first define $$A_b = \{a \mid \forall a' \in A.\ f(a,b) \geq f(a', b)\}$$ and then say that $$g : B \to A \quad \quad \text{ or } \quad \quad g : B \to \bigcup_{b \in B}A_b$$ is a function that assigns any $b \in B$ a random element from $A_b$ (I guess that your $A_b$ is finite and random means uniform distribution). 
However, be aware that this isn't very formal. The problem isn't that its text (there is no problem with text-only definition being formal), but the notion of randomness. To speak about random events and probability you need to define a probability space (usually denoted $\Omega$) and your function would have to depend on it, that is, in math you could have one function
$$g : \Omega \times B \to A$$
or a set
$$g_b : \Omega \to A_b$$
for $b \in B$. To emphasize the difference, functions are deterministic by definition, i.e. for same inputs you get the same outputs. The usual computer-science $\mathtt{rand}$ is not a function, because for same input it returns different outputs (the same goes for things which read from $\mathtt{stdin}$, etc.). Therefore, to simulate the probabilistic behavior, you introduce a dependency on the probability space. That might get messy (I am not saying that it will, only that it might), so I would advise you to avoid formality in this case (unless you really need it), just make the textual description clear enough to get the meaning through.
Some other thoughts, I'm not sure, but it might be easier for you to define a relation $\leq_b$ by $x \leq_b y \iff f(x,b) \leq f(y,b)$ instead of writing $f(x,b)$ everywhere. On the other hand, the construction of $A_b$ suggests that $\leq_b$ is not a partial order, as so consider using some other symbol, as $\leq_b$ might be misleading.
I hope that helps $\ddot\smile$
A: Leaving aside the particular conditions that you want your element $a \in A$ corresponding to an element $b \in B$ to satisfy, I can think of three different ways to talk about what you want to talk about.


*

*You could simply consider the collection $\mathcal{C}$ of all functions $g : B \to A$ such that for all $a \in A$ the element $g(a)$ satisfies the desired condition.  You could talk about an arbitrary element $g$ of this collection $\mathcal{C}$.  This might not be completely satisfactory, because "arbitrary" is not quite the same as "random".

*You could talk about set-valued functions $G: B \to \mathcal{P}(A)$ where $\mathcal{P}(A)$ denotes the power set of $A$.  Defining $G(b)$ to be the set of all $a \in A$ satisfying the desired condition, this gives you a single object $G$ embodying your condition.  You can proceed to talk about arbitrary elements of $G(b)$, but again "arbitrary" is not quite the same as "random".

*You could let $(\Omega,\mathcal{F},P)$ denote a probability space, and consider functions $G : B \times \Omega \to A$.  This is the method that would best capture the mathematical meaning of "random".  However, it is rather technically involved, and you will have to put extra struction or $A$ and $B$ (namely, $\sigma$-algebras) and require the function $f$ to respect this structure in some way (namely, to be measurable.)
