Question about an example of forcing where we adjoin a new set of natural numbers Forcing is quite new to me and there is a basic example in Jech that I don't understand. Let $P$ be the following notion of forcing: the forcing conditions are 0-1 sequences  and $p$ is stronger than $q$ is $p$ extends $q$. If $M$ is a ground model, let $G\subset P$ be generic over $M$. Then let $f=\cup G$. Since $G$ is a filter then $f$ is a function.
My question is why does $G$ being a filter entails that $f$ is a function? 
Since $G$ is a generic set, it has to meet all dense sets in $P$ which are in $M$ (so we can guarantee that the generic set exists). So $G$ contains some 0-1 sequences, and so $f$ is a bunch of 0-1 sequences. 
But why is this guaranteed by $G$ being a filter? And what kind of function is $f$, more explicitly? Is $f$ a function taking natural numbers (maybe the length of the sequences) and have the sequences $p$ in its range?
Also: why do generic sets exist only if the ground model is countable. Does it have to do something with the dense sets?
Thanks
 A: Your example is known as Cohen forcing; this was the very first notion of forcing ever used!
You're correct, the generic $G$ is not itself a function, it consists of a bunch of finite binary sequences. However, the fact that $G$ is a filter ensures that any two elements of $G$ agree on their common domain. Therefore, $g = \bigcup G$ is a (possibly partial) function $g:\omega\to2$ which extends all elements of $G$. In fact, $g$ must be a total function since each of the sets $D_n = \{p : n \in \mathrm{dom}(p)\}$ is open dense.
It is not true that generic sets exist only over countable model. What is true is that generic sets always exist over countable models (whatever the forcing may be). For example, Cohen generics exist over any model with size less than the cardinal $\mathrm{cov}(\mathcal{M})$. This cardinal can be strictly larger than $\aleph_1$, in which case Cohen generics exist over models of size $\aleph_1$. In fact, the canonical way to force $\mathrm{cov}(\mathcal{M}) > \aleph_1$ is to add $\aleph_2$ (or more) Cohen reals over the ground model!
A: Yes, the union of a filter in this case is a function. 
The reason is that the conditions in your poset are themselves (I think you probably mean finite) functions, and the order ensures that compatible conditions agree on their common domain. The filter G is therefore a bunch of finite functions that each agree on their common domain. Thus, the union of the filter is a function on the union of the domains of the conditions appearing in it. 
You asked what kind of function is f, the union of G. The function f in this case will be an infinite binary sequence, that is, a function from ω to 2. The function f has the common values of the conditions appearing in G, so that f(n) = p(n) for any p appearing in G for which n is in dom(p). 
Perhaps the confusion results from using the terms string or sequence to mean a function on the natural numbers. In this set-theoretic conctext, a finite binary string means a function from the set {0,1,...,n-1} to {0,1}, that is, a function from n to 2. So the partial order here is 2<ω, the set of finite binary sequences. 
