The component counts of random functions

Consider functions f : A → A ∪ C , where A and C are disjoint ﬁnite sets. The weakly connected components of the digraph of such a function are cycles of rooted trees, as in random mappings, and isolated rooted trees. Let n 1 = | A | and n 3 = | C | . When a function is chosen from all ( n 1 + n 3 ) n 1 possibilities uniformly at random, then we ﬁnd the following limiting behaviour as n 1 → ∞ . If n 3 = o ( n 1 ), then the size of the maximal mapping component goes to inﬁnity almost surely; if n 3 ∼ γn 1 , γ > 0 a constant, then process counting numbers of mapping components of diﬀerent sizes converges; if n 1 = o ( n 3 ), then the number of mapping components converges to 0 in probability. We get estimates on the size of the largest tree component which are of order log n 3 when n 3 ∼ γn 1 and constant when n 3 ∼ n α 1 , α > 1. These results are similar to ones obtained previously for random injections, for which the weakly connected components are cycles and linear trees. We deﬁne a new combinatorial structure called mixed assemblies which contains both random injections and random functions.

(Typically, a random mapping is defined for A = {1, 2, . . ., n}, but for this paper it is convenient to keep A general.)In the example above, there is one component of size 9 and another of size 1.The distribution of the process of counts of components of different sizes has been of considerable interest for random mappings distributed in various ways and for related random combinatorial objects; see, for example, [1,2,3,4,5].
The generalisation of random mappings we will consider in this paper is random functions between arbitrary finite sets which may not be equal.The related topic of random injections was studied in [6].
Let the domain of a function be D and let its codomain be R.We may decompose D and R as D = A ∪ B and R = A∪C, where A B and C are mutually disjoint.Let G f be the digraph with vertices D∪R = A∪B ∪C and with directed edges {(x, f (x)) : x ∈ D}.If B = C = ∅, then G f is the digraph of a mapping f : A → A as discussed above.In G f , the vertices in A have out-degree 1 and arbitrary in-degree, the vertices in B have out-degree 1 and in-degree 0, and the vertices in C have out-degree 0 and arbitrary in-degree.
Consider a vertex v in C. The set of vertices f −1 (v) ⊆ A ∪ B satisfies f −1 (f −1 (v) ∩ B) = ∅.By considering f −n successively for n = 1, 2, . . ., n 1 + 1 we find that restricting G f to the set of vertices V v = n1+1 n=1 f −n (v) induces a directed tree T v in G f oriented towards its root v with V v ∩ B contained in the leaves of T v .As no vertex in G f has an out-degree which is larger than 1, we have shown that the directed graph induced by cannot map to vertices in A 1 ∪ C or they would be in A 1 .Therefore the vertices in A 2 must map to A 2 .It follows that f A2 is a mapping from A 2 to A 2 , whose components are cycles of rooted trees.Similarly, the vertices in B 2 must map to vertices in A 2 .The result is that the components whose vertices are contained in A 2 ∪ B 2 consist of cycles of rooted trees (components of the mapping f A2 ) with the vertices in B 2 attached to them as leaves.
We have shown the following lemma.
chosen uniformly at random from all (n 1 + n 3 ) n1+n2 possibilities, the vertices in B may point to any of the n 1 + n 3 elements of A ∪ C uniformly at random independently of each other.As the vertices in B simply point randomly to the other vertices in this rather uninteresting way, we will assume from now on that B = ∅, i.e. n 2 = 0. Equivalently, given A, B, and C, one may take a random function F and delete the elements of B. As the particular labels of the elements comprising A and C are insignificant, the sizes n 1 and n 3 of A and C are parameters for our model of random functions.The size of a component will be the number of vertices in the component.For example, if the vertices in B are deleted in Figure 2, then a function results which consists of a directed rooted tree of size 6, a directed rooted tree of size 1, a cycle of rooted trees of size 9 and a cycle of rooted trees of size 1.
We will let n 3 be a function of n 1 and investigate the components of random functions as n 1 → ∞.We find the following limiting behaviour as n 1 → ∞: if n 3 = o(n 1 ), then |A 2 | → ∞ almost surely and the component counting process (to be defined in Section 2) behaves like the component counting process of a random mapping with n replaced by |A 2 |; if n 3 ∼ γn 1 , γ > 0 a constant, then the component counting process converges in total variation distance; if n 1 = o(n 3 ), then the number of mapping components converges to 0 in probability.We get estimates on the size of the largest tree component which are of order log n 3 when [6].The possible components of an injection are 1.Directed cycles, all of whose vertices are from A.
2. Directed paths, all of which end in a vertex from C and whose other elements are in A, except for possibly the first element, which may be from B.
Let n 1 = |A|, n 2 = |B| and n 2 = |C|, as for functions.A random injection is obtained by choosing from all ) injection uniformly at random.Unlike for random functions, for random injections the vertices in B play an important role, because there must be at least n 2 paths in a random injection beginning with an element of B.
In Section 2 we obtain results components of the random mapping part of a random function by estimating |A 2 | and using known results.In Section 3 we approximate the size of the largest tree in a random function.
In Section 4 a new class of combinatorial objects called mixed assemblies is defined of which injections and functions are members.A representation of the component counting process of mixed assemblies as conditioned independent Poisson distributed random variables is derived.This representation is not used elsewhere in this paper, but indicates a direction future research in this area may take.

The random mapping
It was shown in Section 1 that f A2 is a mapping from A 2 to A 2 which decomposes components consisting of cycles of rooted trees.We will now present some results from [2] about random mappings.The number of random mapping components of size i is Let (C 1 (n), . . ., C n (n)) be the random process for which C i (n) counts the number of components of size i for a randomly chosen mapping of total size n.The distribution of the component counting process may be expressed as where the Z i are mutually independent Poisson(λ i ) distributed random variables with parameters The representation (2) actually holds with for any x > 0, but in the case of random mappings it is Given random elements X and Y taking values on a finite or countable state space S, define the total variation distance between the distributions L(X) and L(Y ) of X and Y to be Random mappings are in the logarithmic class of combinatorial objects defined in [2] due to the asymptotic in (1).Therefore, we have distribution, which is defined in [2].
The random mapping part of a random function is related to random mappings in the following way.Let (S 1 , S 2 , . ..) be the random process for which S i is the number of mapping components of size i in a random function.Conditional on |A 2 |, (S 1 , S 2 , . ..) has exactly the distribution of (C 1 (n), . . ., C n (n)) for random mappings, where n = |A 2 |.This is because of the independence of the restricted functions f A1 and f A2 conditional on A 1 .
We next state and prove a theorem giving the distribution of |A 2 |.
Theorem 4. The probability distribution of the random variable |A 2 | is given by where we take 0 0 = 1.Therefore, Moreover, if n 3 = o(n 1 ) and ω = ω(n 1 ) is defined to be Proof.To prove (5) it will be enough to show that and then to use the fact that denote the number of forests on n labelled nodes consisting of k disjoint trees such that k specified nodes belong to distinct trees.Theorem 3.3 of [7] states that the number of ways of choosing a rooted forest on A 1 ∪ C with precisely the elements of C as roots is n 3 (n 3 + b) b−1 .The number of ways of choosing a mapping on the Multiplying together the previous expressions and dividing by the total number of functions (n 1 + n 3 ) n1 results in (5).
We obtain (7) by Remark 1.The fact that which also follows from the Abel sum (13a) in [8].
If n 3 ∼ γn 1 for a constant γ > 0, then for each fixed b ≥ 1, the process of small cycles satisfies where the Z i are mutually independent Poisson( λi ) distributed random variables with parameters If where the Z i are mutually independent Poisson(λ i ) distributed random variables with parameters given by (3).Let ( L1 , L2 , . ..) be the process of largest mapping components sizes of a random function, where L i (n 1 , n 3 ) is the size of the ith largest component.Let (L 1 , L 2 , . ..) be a random element having the Poisson-Dirichlet(1/2) distribution.If n 3 = o(n 1 ), then Proof.The statement (9) follows immediately from (6).We will prove (10) by using the method of moments (Theorem 6.2 of [9]).For any µ i ≥ 0, i = 1, . . ., d, let Γ(µ 1 , . . ., µ d ) denote the set of sequences of d i=1 µ i vertex disjoint cycles of rooted trees such that the first µ 1 of them have size 1, the next µ 2 of them have size 2, and so on until the last µ d of them have size where we have used The statements (12) and (13) follow easily from Theorem 2, Theorem 3, and (7).
It is possible to improve on (10).We will show that the whole process of mapping component counts converges in distribution.
Proof.Suppose that for each > 0 there is a b > 0 such that Assuming (15), the following argument directly using the definition of weak convergence (see [10]) shows that the conclusion of the theorem holds.Let f be a continuous function on Z ∞ + and let K > 0 be a constant such that |f | < K. Then

It follows by the triangle inequality that
Now, choose b large enough so that each of the second and third terms of the last expression are less then /3 for large enough n 1 .We know that for large enough n 1 by (10).Since > 0 is arbitrary, we have shown that and therefore the conclusion of the theorem holds.
It remains to prove (15).Assume that n 3 ≥ γn 1 , γ > 0. By ( 14) with µ i = 1 and µ j = 0 for j = i, we have We see that where we have used the fact that that the function xe −x is increasing for 0 < x < 1 at (17) and 1 at the next step.Therefore, since 1 1+γ exp − 1 1+γ e < 1, we may choose b large enough so that for some constant θ > 0 for large enough n 1 .For b fixed, from ( 1) and ( 16) we have Apparently, b may be chosen large enough so that for n 1 large enough.Markov's inequality, ( 18) and ( 19) imply In a similar manner, Markov's inequality and (11) may be used to show that b may be chosen large enough so that The method used in the proof of Theorem 6 can be used to obtain a similar result about cycles in random injections.Let S * i be the number of cycles in a random injection for which 16) of [6] and let Z i ∼ Poisson(λ * i ) be mutually random variables.Then (S * 1 , S * 2 , . ..) ⇒ (Z * 1 , Z * 2 , . ..), extending Theorem 9 of [6].The author would like to record that after the proof of Theorem 9 in [6] he made an erroneous remark that the λ * i are the same as for the Ewens sampling formula with parameter (1 + γ) −1 .This mistake did not effect any of the results in [6].

The size of the largest tree
In this section we will approximate the size of the largest tree.We are only able to do this when n 1 = O(n 3 ).Theorem 7. Let M = M n1,n3 be the size of the largest tree in a random function.Define η + and η − by Proof.Note that 0 < n1 n1+n3 − log n1 n1+n3 − 1 is bounded below by a positive number by the assumption n 1 = O(n 3 ) and so We will now argue that Let X k be the number of trees of size k in a random function.The expected number of trees of size k for 1 where n 3 is the number of ways of choosing a root from C, n1 k−1 is the number of ways of choosing k − 1 vertices from A, k k−2 is the number of ways of forming a tree on the k chosen vertices and (n 1 + n 3 − k) n1−k+1 is the number of ways of choosing a function on the remaining n 1 − k + 1 A-vertices and n 3 − 1 C-vertices.Using κ instead of k ± for readability, because of (21) we have Therefore, by the definition of k ± , observing that the second term in (20) times the term in square brackets in (24) cancels with log n 3 and that the ± term in η ± times the term in square brackets in (24) dominates O(log κ) = O(log log n 3 ), we have We will now show that lim n1→∞ P(M n1,n3 < k + ) = 1.For all 1 ≤ k ≤ n 1 , we have where we have used the fact that φ(x) := xe −x is increasing for 0 < x < 1 in the last step.By assumption n 3 ≥ γn 1 for a constant γ > 0, and so Therefore, because φ(x) < e −1 for 0 < x < 1, we have It now follows using geometric series that It remains to be shown that lim n1→∞ P(M n1,n3 ≥ k − ) = 1.For a sequence of random variables X n and a sequence a k , define X n P ∼ a n iff P Xn an − 1 > = 0 for all > 0. By the second moment method, using κ instead of k − for readability, we have . By choosing ordered pairs of trees in all possible ways, Because of (23) and because κ = k − = o √ n 1 by (21), we have Therefore, X k− P ∼ E(X k− ) and so lim n1→∞ P(M n1,n3 ≥ k − ) ≥ lim n1→∞ P(X k− > 0) = 1.
Corollary 1.Let M = M n1,n3 ≥ 1 be the size of the largest tree in a random function.Then, if n 3 ∼ γn 1 , γ > 0, Let R be the real numbers and let Z be the integers.If Proof.The statement about n 3 ∼ γn 1 follows from

Mixed assemblies
In this section we define a new combinatorial object which contains both functions and bijections.In an assembly (see [2]), the underlying set [n] := {1, 2, . . ., n} is partitioned into blocks, and for each block of size i one of mi possible structures is chosen.Random mappings are an assembly with mi = m i given by (1).
Random functions and injections belong to an apparently new class of combinatorial objects called mixed assemblies, defined below.In this section, we will defined mixed assemblies and their component counts, and then show that the stochastic process of component counts can be represented as a conditioned independent random process.This conditioned independent random process is quite similar to (2), which we stated for random mappings.For an arbitrary assembly, if C i (n) is the number of components of size i of a randomly chosen representative of an assembly of size n, and Z i ∼ Poisson( λi ) are mutually independent random variables with parameters λi = mi x i /i!, x > 0 arbitrary, then (2) holds.
Given parameters ρ ≥ 1 and n 1 , n 2 , . . ., n ρ ∈ Z + := {0, 1, 2, . ..}, with n t > 0 for at least one t, let V t , 1 ≤ t ≤ ρ be mutually disjoint sets of labelled vertices such that the number of vertices in class t is For example, one may take V t = [n t ] × {t}.Define [n] + = {0, 1, 2, . . ., n} and let be an index set.A block of type i ∈ I is a (necessarily non-empty) subset of ρ t=1 V t containing i t elements of V t for 1 ≤ t ≤ ρ.Let parameters µ i > 0, i ∈ I be given.Definition 1.A mixed assembly is obtained by partitioning ρ t=1 V t into blocks and, for each block of type i, choosing one of µ i structures.
If ρ = 1, then a mixed assembly is the same as an assembly.For functions, considering B = ∅ so that n 2 = 0, we have ρ = 3 and where m i1 is given by (1), For injections, ρ = 3 and Let s i be the number of blocks of type i in a mixed assembly.The s i are the component counts of the mixed assembly.For each 1 ≤ t ≤ ρ, we must have i=(i1,...,iρ)∈I Lemma 8. Define i! = ρ t=1 i t !. Let s i be a function from I to Z + satisfying (28).Then, the number of representatives of a mixed assembly with parameters µ i and component counts s i is given by Proof.Consider i∈I s i unlabelled blocks ordered from left to right with exactly s i of the blocks of type i for each i ∈ I. Label the blocks in ρ t=1 n t !ways and impose a structure on each block in i∈Z ρ + µ i s i ways.
In this way, each mixed assembly is constructed in exactly i∈I s i !(i!) s i ways (which comes from a factor of i∈I s i ! from permutations of blocks of the same type times a factor i∈I (i!) s i from permutations of i t vertices from the same vertex set V t , 1 ≤ t ≤ ρ).We therefore divide ρ t=1 n t !i∈Z ρ + µ i s i by this expression to obtain the number of mixed assemblies with component counts s i .
There may not be any s i satisfying (28); for example, if ρ = 1,I is the set of even integers, and n 1 is odd.
Assuming that there is at least one s i satisfying (28), a random mixed assembly may be obtained by choosing from all N (n 1 , n 2 . . ., n ρ ) > 0 possibilities uniformly at random.The process of block counts of different types in a uniformly chosen mixed assembly will be denoted by S i , i ∈ I.We will express the joint distribution of the S i as a conditioned independent process similar to (2).Let x = (x 1 , x 2 , . . ., x ρ ) be a vector of arbitrary positive real numbers.For i ∈ I, define x i = ρ t=1 x it t , parameters and mutually independent Poisson distributed random variables Z i ∼ Po(λ i ).
Theorem 9. Suppose that there is at least one s i satisfying (28).Let s i be given, not necessarily solving (28).Then, Comparing ( 30) and (31), we see that the dependencies on the s i are exactly the same in those two expressions.
For injections, the independent random variables are Poisson with parameters given by ( 27) and (29).The conditioning events are

Figure 1 :
Figure 1: The components of a mapping

Figure 2 :
Figure 2: The components of a function be the set of vertices in the cycle of rooted trees α l , l = 1, . . ., d i=1 µ i , and define F = d i=1 µi l=1 A l .The functions for which all α l are components are precisely those for which f | F is determined by the α l and f | (A\F ) is a function with codomain (A \ F ) ∪ C. Note that |F | = τ .The joint falling moments of the S i corresponding to the µ i are