  Let F_k be the free group on k generators. A word w \in F_k is called
primitive if it belongs to some basis of F_k. We investigate two criteria for
primitivity, and consider more generally, subgroups of F_k which are free
factors.
  The first criterion is graph-theoretic and uses Stallings core graphs: given
subgroups of finite rank H \le J \le F_k we present a simple procedure to
determine whether H is a free factor of J. This yields, in particular, a
procedure to determine whether a given element in F_k is primitive.
  Again let w \in F_k and consider the word map w:G x G x ... x G \to G (from
the direct product of k copies of G to G), where G is an arbitrary finite
group. We call w measure preserving if given uniform measure on G x G x ... x
G, w induces uniform measure on G (for every finite G). This is the second
criterion we investigate: it is not hard to see that primitivity implies
measure preservation and it was conjectured that the two properties are
equivalent. Our combinatorial approach to primitivity allows us to make
progress on this problem and in particular prove the conjecture for k=2.
  It was asked whether the primitive elements of F_k form a closed set in the
profinite topology of free groups. Our results provide a positive answer for
F_2.
