Set notation and mappings question Good evening. I have a question.
Suppose I have two sets, $A=\{1,2,3,4\}$ and $B=\{5,6\}$. I want
to write the notation for a function that takes each element in $A$
and assigns to it a value in $B$. However, suppose that I want to
make sure that the four-element set I wind up with has a certain number
of 5's and 6's in it. Let's say $C=\{3,1\}$ and $c_{k}\in C$, where
$c_{k}$ denotes the number of times $k^{th}$ element in $B$ appears
in the list in the end. This means that $\{5,5,6,5\}$ is a possible
list but $\{5,6,6,5\}$ is not. Is a way to write this procedure the
following? $f:\{A\rightarrow B:\left|f^{-1}(k)\right|=c_{k}\}$
Once again, thanks in advance.
 A: You are close. I think some people use $B^A$ to denote the set of all functions from $A$ to $B$. So you could write $$\left\{f \in B^A: \left|f^{-1}(\{k\})\right|=c_k\right\}$$
to denote the set of all functions such that $c_k$ elements of $A$ are sent to $k \in B$.
A: As this is a question about notation allow me a few remarks:


*

*You won't wind up with a "four-element set".  As $B$ has only two elements, $f[A]$ - i.e. the image of $A$ - will have at most two elements.

*This also means that your $\{5,5,6,5\}$ and $\{5,6,6,5\}$ are the same set, namely just $\{5,6\}$.

*The functions will differ, though.  If you write your functions as sets of ordered pairs, one could have been $\{(1,5),(2,{\color{red}5}),(3,6),(4,5)\}$ while another one with the same image could have been $\{(1,5),(2,{\color{red}6}),(3,6),(4,5)\}$.

*Depending on your conditions there might be more than one function fulfilling them (or there could be none), so as @angryavian wrote you're essentially defining a set of functions.
I can't read your mind, but I think something like this might fit the bill: Given two finite sets $A$ and $B$ and a sequence $(c_b)_{b\in B}$ of natural numbers let $F$ be the following set of functions:
$$ \{ f \in B^A : |f^{-1}[\{b\}]| = c_b \text{ for all } b \in B \} $$
The contents of $F$ will depend on the sequence and $F$ will be non-empty if $\sum_{b\in B}c_b=|A|$. 
A: No. That's not a way to write that (although you could perhaps define that notation to mean that...but people would be puzzled). The arrow notation has the form
$$
f: A \to B
$$
where $f$ is a function, and $A$ and $B$ are sets. Your example doesns't follow that pattern. 
I don't know a standard way to write what you want, except perhaps to say 
$$
f: A \to B, \text{ such that } |f^{-1}(\{5\})|= 3.
$$
