Phase Portraits of Random Planar Homogeneous Vector Fields

In this paper, we study the probability of occurrence of phase portraits in the set of random planar homogeneous polynomial vector fields, of degree n. In particular, for n=1,2,3,\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$n=1,2,3,$$\end{document} we give the complete solution of the problem; that is, we either give the exact value of each probability of occurrence or we estimate it by using the Monte Carlo method. Remarkably is that all but two of these phase portraits are characterized by the index at the origin and by the number of invariant straight lines through this point.


Introduction and Main Results
Systems of ordinary differential equations, or equivalently vector fields, are ubiquitous tools in the mathematical modelling of physical phenomenon. When studying parametric families of such vector fields typically one tries to know the different types of phase portraits that can appear in the family and what are their characterizations: that is, to obtain the parametric bifurcation diagram of the family. A second level of study could be to establish the measure of the occurrence, or repetitiveness of each possible phase portrait among the different phase portraits in the family. Looking for this coincidence, or other dynamic characteristic such as the existence of attractors, invariant straight lines, or limit cycles, are the aims of some recent works: [4,9,20] and [25].
The study of the probability of appearance of the different phase portraits may be also of practical interest. For instance, in some cases, to model real-life situations, we deal with dynamical systems having natural variability in the parameters. To include this uncertainty in the model, we must treat with families of vector fields whose parameters vary randomly. See [8,17,26] for example.
Historically, the interest in this approach can be also traced back to A.N. Kolmogorov, from whom there is an interesting anecdote that we have encountered in [18]. According to Arnold [2], it seems that Kolmogorov proposed to his students of the Moscow State University a problem that should give a statistical measure of the quadratic vector fields having limit cycles. He gave them several hundreds of such vector fields with randomly chosen coefficients. Each student was asked to find the number of limit cycles of his/her vector field. Surprisingly, the experiment gave that none of the vector fields had any limit cycle, although, since hyperbolic limit cycles form open sets in the space of coefficients, the probability to get them for a random choice of the coefficients is positive. In fact, the probability of having obtained this result is very low: if p is the probability of a quadratic vector field to have some limit cycle then, assuming independence, the probability that none of the vector fields had limit cycles is (1 − p) n , where n is the number of students involved. In [4], p is estimated to be p ≈ 0.0323, hence assuming n = 200 we get (1 − p) 200 ≈ 0.0014.
In this paper we study the probabilities of the different phase portraits appearing in random planar homogeneous polynomial vector fields of degree n. Their phase portraits in the Poincaré disk [14] are well understood and they can be described in terms of the number of real zeroes of some associated polynomials, their relative position and several algebraic inequalities involving these zeroes and the parameters of the vector fields, see [1,11,13].
We will focus on the quadratic and cubic cases and for completeness we also will tackle the linear case. In fact, the results for n = 1 are well-known [20,25] and, for instance, they are proposed as an exercise in the S. Strogatz book [28, Exer. 5.2.14, p. 143]. We include a simple and self-contained proof for this case. Our characterization of the different phase portraits, for n ∈ {1, 2, 3}, will be mainly based on the computation of the index at the origin, i, and on the study of the number of invariant lines through it, l. As we will see, these two numbers provide a complete algebraic characterization, by means of inequalities, of all the different classes of phase portraits with positive probability when n is 1 or 2, and almost a complete one for n = 3. In the cases that we have not been able to compute analytically the probabilities, we give their estimations by using the Monte Carlo method [7,23] and the algebraic classification tools developed in this paper.
We will say that is a random planar homogeneous polynomial vector field of degree n if all the variables A i, j and B i, j are independent normal random variables with zero mean and standard deviation one. For short, we will write A i, j ∼ N(0, 1) and B i, j ∼ N(0, 1). The hypothesis that all the coefficients are N(0, 1) is commonly used, see for instance [4,9,20,25] and it is quite natural and well motivated. In Sect. 3 we briefly recall this motivation.
In general we will denote by P(W ) the probability that a phase portrait of type W occurs, modulus time orientation. Next results collect our main achievements. Theorem 1 Consider the linear random vector fields F 1 of the form (1). Their phase portraits (modulus time orientation) with positive probability are the three ones shown in Fig. 1. They are completely determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, Finally, the probability of the origin to be a global attractor is 1/4 and the one of being a global repeller is also 1/4.
To state our results for n = 2, 3 we need to introduce next two values which, as we will see in item (c) of Theorem 10, correspond to the expected number of invariant straight lines for vector field (1) through the origin, for n = 2 and n = 3, respectively. These values are obtained by using the powerful tools introduced in the nice paper of Edelman and Kostlan [15].
Theorem 2 Consider the quadratic random vector fields F 2 of the form (1). Their phase portraits with positive probability are the five ones shown in Fig. 2. They are completely determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, their corresponding probabilities, in addition to 5 j=1 P(Q j ) = 1, satisfy and they are estimated in Table 1.
To estimate the values P(Q j ) we have applied the Monte Carlo method to 10 8 quadratic homogeneous vector fields, randomly generated; that is, we have set up 10 8 vectors in R 6 whose entries are pseudo-random numbers simulating the six independent random variables of the quadratic random vector field F 2 , with N(0, 1) distribution. This algorithm consists in a repeated random sampling and gives estimations of the desired probabilities due to the laws of large numbers and that of the iterated logarithm, see [7,23]. In almost all cases, the corresponding phase portrait for the generated sample is obtained by checking the sign of algebraic inequalities among the obtained values of these six independent random variables. These signs allow us to know the index of the origin and number of invariant straight lines through it.
It turns out that using m samples, the Monte Carlo method gives the sought value with an absolute error of order O ((log log m)/m) 1/2 , which practically behaves as O(m −1/2 ). Since in our simulations we take m = 10 8 , the approaches found for the desired probabilities will have an absolute error of order 10 −4 . The results are given in Table 1. In the right-hand side of that table the observed frequencies are also collected in terms of the index of the critical point.
Notice that the estimated probabilities of the phase portraits Q 1 , Q 2 , Q 3 , Q 4 and Q 5 are in good agreement with the relations given in Theorem 2.
Observe that precisely P(Q 1 ) + P(Q 2 ) + P(Q 3 ) is the probability of having three invariant straight lines and P(Q 4 ) + P(Q 5 ) = 3− 2 2 ≈ 0.67828 is the probability of having one invariant straight line. These results are also in good agreement with the ones of [4]. More in detail, in that paper the authors give estimations of the probabilities of the different phase portraits of structurally stable quadratic vector fields, Observed frequency not necessarily homogeneous. It is easy to see that structurally stable vector fields are vector fields with full probability. Their phase portraits near infinity are related with the ones of homogeneous quadratic vector fields. In particular, the number of critical points at the equator of the Poincaré disk is twice the number of invariant straight lines of the corresponding homogeneous quadratic vector field. In [4], attending to the behavior at infinity, twelve different families are considered; the first five having only a couple of diametrically opposed singularities at infinite and the other ones having three pairs of singularities. If, for the first five families in Table 2 in [4], Observed frequencies  Fig. 3. Except for the phase portraits C 3 and C 4 , they are determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, their corresponding probabilities, in addition to 9 j=1 P(C j ) = 1, satisfy , and they are estimated in Table 2.
Again, the estimated probabilities given in Table 2 are in good agreement with the relations given in Theorem 3.

Remark 4
Notice that when n is even, all phase portraits of homogeneous vector fields are conjugated with the ones obtained reversing the orientation of all trajectories. This is so, because the associated differential equations are invariant with the change (x, y, t) → (−x, −y, −t). This is no more true when n is odd. For instance, if we  Fig. 1, or C 2 or C 5 in Fig. 3, and we reverse the arrows, the new phase portraits are not conjugated, but topologically equivalent.
Since the distribution of the coefficients of random planar homogeneous vector fields of degree n is absolutely continuous and with a positive density, the phase portraits that have positive probability coincide with the ones that are structurally stable, in the world of polynomial homogeneous vector fields od degree n, see for instance [19] for the precise definitions. Fixed n, the number of topologically equivalent different classes of phase portraits S n of such systems is given in Table 1 of that paper. The first ten values are reproduced in Table 3. Observe that the value S 2 coincides with the number of different phase portraits given in Theorem 2. On the other hand, the values S 1 and S 3 are bigger than the corresponding ones of Theorems 1 and 3, respectively. This is so, because recall that by Remark 4, when n is even the phase portraits are invariant with respect the change (x, y, t) → (−x, −y, −t) and when n is odd this is no more true. In fact, changing the direction of all the arrows, when n = 1, only one of the three obtained vector fields is topologically equivalent to itself and so, the three phase portraits of Theorem 1 split into 1 + 2 × 2 = 5 = S 1 phase portraits. Similarly, for n = 3, only four of the phase portraits of Theorem 3 remain invariant and as a consequence we obtain 4 + 2 × 5 = 14 = S 3 phase portraits. Finally, notice also that by the invariance of the distribution of the coefficients of vector field (1), the probability of a phase portrait and the one obtained by changing the arrows direction coincide. For instance, in the linear case, as a corollary of Theorem 1, the probabilities of attracting node is ( √ 2 − 1)/4 and the one of repelling node is the same. We organize the paper as follows. In Sect. 2 we recall the main results of qualitative theory that allow to study the phase portraits of homogeneous vector fields together with the usual methods to know the multiplicity, the index i and the number of invariant straight of planar vector fields, l. Section 3 collects all the probabilistic preliminaries and results that we will use. In particular we discuss the reason that justifies our definition of random planar homogeneous vector field (1), as well as a tool to study the expected number of real zeroes of random polynomials [15]. Sections 4, 5 and 6 are devoted to prove Theorems 1, 2 and 3, respectively. Finally in the "Appendix" we study the number and location of the real roots of polynomials of degree 3 and 4. As we will see, these results will be needed to study the couple i and l, that we recall gives the index of the origin and the number of invariant lines of the vector field through this point.

Algebraic Tools for the Classification of the Phase Portraits
Consider planar polynomial vector fields of type where p n (x, y) and q n (x, y) are real homogeneous polynomials of degree n. Their phase portraits on the Poincaré disk can be obtained following the procedure detailed in [1]. For the cases n = 2, 3 they are given in [1,11,13] respectively. For n = 1, they correspond to the well-known linear homogeneous vector fields. Since our objective is to compute the probability of the different available phase portraits we need to characterize them in terms of algebraic equalities and inequalities. As we will see, except in two cases that will be explained in Sect. 6, the characterization of their phase portraits occurring with positive probability can be done by using only two objects: the index i of the vector field associated to (4) at the origin and the number of invariant straight lines l, through this point. We dedicate next two subsections first to recall how to know the number of invariant straight lines through the origin and secondly to explain how to compute the index of an isolated critical point. Since there are no essential differences, most results in this second section deal with m-dimensional vector fields.

Invariant Straight Lines
It is straightforward to see that the line αx + β y = 0 is invariant by the flow of the homogeneous system (4) if and only if αx + β y is a factor of x q n (x, y) − y p n (x, y). Due to the homogeneity we see that the slopes of these invariant straight lines, different from x = 0, are the values of κ ∈ R that satisfy Hence, if t n (κ) ≡ 0 and p n (0, y) ≡ 0 the number of invariant straight lines l ≤ n + 1 is exactly the number of real zeros of t n (κ). If t n (κ) ≡ 0 or p n (0, y) ≡ 0, the number of invariant straight lines is either infinity or l + 1.
Finally, we remark that the number of real roots of a general polynomial of a fixed degree can be characterized in terms of algebraic inequalities among its coefficients. This fact can be proved for instance by using Sturm sequences. See the "Appendix" for the explicit results for polynomials of degree 3 and 4.

Index at Isolated Singular Points
To simplify the notation, we will do the following abuse of notation: we will write f = ( f 1 . . . , f m ) to denote an analytic map of R m but also a finite map germ, or even the vector field f = m j=1 f j ∂/∂ x j . In all the cases, the meaning will be explicitly stated or clearly deducible from the context. In this section we will assume that f (0) = 0, since we will always work with the singular point at the origin.
In general, if f : If f is a C ∞ map we can consider the local ring of germs of C ∞ functions at the origin C ∞ 0 (R m ) and the quotient ring where ( f ) denotes the ideal generated by the components of f . It holds that when 0 is an isolated singularity then Q( f ) is a finite dimensional real vector space and its dimension is called the multiplicity of f at 0, μ( f ). In fact, when f is polynomial this multiplicity coincide with the number of complex preimages of any regular value near 0. As mentioned above, we want to determine the index by means of algebraic inequalities among the coefficients of our vector fields. This can be done, for instance, by using the Eisenbud-Levine signature formula for the index, see [16] or also [3,Chap. 5] for instance.
Since the signature of a quadratic form is the difference between the number of positive eigenvalues and the number of negative ones of its associated matrix, we need to know this number in terms of algebraic inequalities among the coefficients of its characteristic polynomial. This always can be done by using Sturm sequences [27]. Since we will study the index of the quadratic and cubic planar homogeneous vector fields, we need to know the number of real roots for polynomials of degree 3 and 4. For polynomials of degree 3 we also need to know the number of positive and negative real roots. These characterizations are done in the "Appendix".
We will also use the following simple properties of the index.
, be a C ∞ finite map germ. Then: Finally, it is also known, see [10], that Applying the above results to (4) we have:

Probabilistic Tools for the Study of the Phase Portraits
In this section we start motivating our definition of random homogeneous vector field (1). We also prove Theorem 10 that contains relationships among several probabilities of the phase portraits of (1) with positive probability.
Consider families of vector fields in the plane that are written as where Y 1 , Y 2 , . . . , Y k are fixed vector fields on R 2 and A 1 , A 2 , . . . , A k are random variables to be fixed, taking values on R. In this way each event ω consists on a given vector field with a j = A j (ω) (notice that in the whole paper we will use capital letters to denote the coefficients of vector fields or polynomials when they are random variables, and lowercase letters when they are real numbers). In order to give a measure of the different phase portraits a fundamental issue is to determine which is the natural election of distribution of the random variables A j . Only after this step is properly done we can ask for the probabilities of some dynamical features. It is natural to assume that the random variables A j are continuous, independent and identically distributed on R. The principle of indifference [12] would seem to indicate that we should take a distribution for the variables A j in such a way that the vector (A 1 , . . . , A k ) had some kind of uniform distribution in R k . But there is no uniform distribution for unbounded probability spaces. However notice that any phase portrait is invariant under positive linear time scalings. Hence all systems (7) with parameters (λa 1 , . . . , λa k ) with λ > 0 have topologically equivalent phase portraits. Thus it is also natural to consider a distribution for the coefficients A j such that the random vector (A 1 /S, A 2 /S, . . . , A k /S) , where S = k j=1 A 2 j , has a uniform distribution on the sphere S k−1 ⊂ R k . Next result will justify our choice of distribution for the random variables A j . Theorem 8 ([9,21,24]) Let X 1 , X 2 , . . . , X k be independent and identically distributed one-dimensional random variables with a continuous positive density function f .
The random vector X = (X 1 /S, X 2 /S, . . . , X k /S) , where S = k j=1 X 2 j , has a uniform distribution in S k−1 ⊂ R k if and only if all X j are normal random variables with zero mean.
Hence, in the random vector field (6) we consider the probability space ( , F, P) where = R k , F is the σ -algebra generated by the open sets of R k and P : F → [0, 1] is the probability with joint density ψ (a 1 , a 2 , . . . , a k Notice that for simplicity it is not restrictive to consider that the variance for the centered normal random variables is 1. The above explanation justifies the definition of random homogeneous vector field given in (1). Notice that they are under the formulation of (6) with k = 2n + 2 and each Y i either as x j y n− j ∂ ∂ x or x m y n−m ∂ ∂ y , for some j and m with 0 ≤ j ≤ n, and 0 ≤ m ≤ n.

Remark 9
Observe that the probability density function associated to (1) is positive. Therefore, any non-empty event described by algebraic inequalities is measurable and has positive probability. Similarly, the measurable events such that in their description appears a non trivial algebraic equality have probability zero.
Next result collects most of the information needed to prove our main results.

Theorem 10
(a) Set u n (k) = P( the index of (1) at 0 is k). Then: (i) u n (k) = 0 if and only if |k| ≤ n and k ≡ n (mod 2), (ii) u n (k) = u n (−k) and as a consequence the expected index of the random vector field (1) is |k|≤n ku n (k) = 0.
(b) Set a n = P(0 is a global attractor for (1) ) and r n = P(0 is a global repeller for (1)). Then a n = r n . Moreover a n = 0 if and only if n is odd. (c) Set n (k) = P( vector field (1) has exactly k invariant straight lines). Then n (k) = 0 if and only if k ≤ n + 1 and k ≡ n + 1 (mod 2). Moreover the expected number of invariant straight lines is n = n+1 k=0 k n (k). In particular, 1 = √ 2 and 2 and 3 are given in (2) and (3), respectively.
Proof First observe that from the results of [1,16] the events we are interested in are measurable, because they are defined by algebraic inequalities (see next sections to have more details of how to characterize these events). Observe that by Remark 9 the probability of P n (x, y) and Q n (x, y) to have a common factor is zero since this fact is characterized by an algebraic equality among the coefficients of P n and Q n (as can be seen taking successive resultants). Hence we can always assume that the origin is isolated. In particular, we are under the hypotheses of Corollary 7, and therefore the statement (i) of item (a) follows. To prove item (ii) consider the associated random vector field G n (x, y) = P n (x, y) ∂ ∂ x − Q n (x, y) ∂ ∂ y . Observe that P(ind(F n ) = k) = P(ind(G n ) = k) because, due to their symmetry, the variables B i, j ∼ −B i, j ∼ N(0, 1). From Lemma 6 (a) we have ind(G n ) = −ind(F n ), and the result follows.
(b) Recall that x = 0 is a global attractor (resp. a global repeller) if lim t→∞ (x(t), y(t)) = 0 for all the solutions (x(t), y(t)) of the system (resp. lim t→−∞ (x(t), y(t)) = 0). In the homogeneous case, if x = 0 is a global attractor it cannot have neither elliptic nor hyperbolic sectors since otherwise there would appear an invariant straight line with an escaping orbit. Hence, according to the Bendixon's index formula, ind( f ) = 1 + (e − h)/2, since e = h = 0 we have ind( f ) = 1 and therefore, from Corollary 7, n must odd. The same argument holds for the existence of global repellers. Using again the tools introduced in [1] to determine the phase portraits we know that the events of having a global attractor or a global repeller are measurable. Moreover, in particular we know that a n = r n = 0 when n is even.
Notice that f has x = 0 as a global attractor if and only if − f has x = 0 as a global repeller, and again due to the symmetry of the distribution of the random variables A i, j and B i, j , we know that f and − f have the same distribution. Hence a n = r n as we wanted to prove. Finally, it is not difficult to find an open set of vector fields with the desired properties, so a n = r n = 0 when n is odd.
(c) In the paper [15], Edelman and Kostlan give the expected number of real zeros of any equation of type where A j i = 0, . . . , k are normal distributed with zero mean, not necessarily being neither identically distributed nor independent, and f j are differentiable functions. Following the notation in [15,Thm 3.1] if we consider a random polynomial P(κ) = n+1 j=0 P j κ j (9) where P j are normal random variables with mean zero and covariance matrix M n+1 ; κ, κ 2 , . . . , κ n+1 ) t and w(κ) = w(κ)/||w(κ)||, then the expected number of real zeros of P is given by the Edelman-Kostlan formula: A straightforward computation gives that the random polynomials T n (κ) in (5) that control the number of invariant straight lines of the random system (1) are Moreover since all A i, j and B i, j have N(0, 1) distribution and are independent, it holds that where C 0 and C n+1 are N(0, 1) and the other C j are centered normal random variables with standard deviation √ 2, being all the n + 2 random variables independent. Thus we deal with an expression of the form (9). In particular, their covariance matrices are respectively. The values of n can be obtained by straightforward computations. For instance, for n = 1, Hence, For n = 2, 3 we skip the details.

Random Linear Vector Fields and Proof of Theorem 1
We give a simple self contained proof of Theorem 1 and also an alternative proof based on the results given in item (c) of Theorem 10, as a corollary of the computation of the expected number of invariant straight lines, 1 .

Proof of Theorem 1
For shortness we denote l j = P(L j ), j = 1, 2, 3. The only phase portraits of linear vector fields given by inequalities among the parameters of the vector field are the saddle; the (generic) node with two different eigenvalues; and the focus. Their phase portraits in the Poincaré disk [14], modulus time orientation, are the ones of Fig. 1. Moreover l 1 + l 2 + l 3 = 1. A distinction between nodes and focus comes from the fact that for the case of focus there are not invariant straight lines while generic nodes have two invariant straight lines. It is also well-known that the index of the origin in the saddle case is −1 while in the node and focus cases it is +1. Therefore, by item (a) of Theorem 10, l 1 = l 2 + l 3 . By using both equalities we get that l 1 = 1 2 and l 2 + l 3 = 1 2 . Hence to prove the theorem it suffices to calculate either l 2 or l 3 .
Let us prove that l 3 = 1 − √ 2 2 . The characteristic polynomial associated to the linear vector fields (Ax + By) Hence, the probability that x = 0 is a focus is l 3 = P((A − D) 2 + 4BC < 0). Since A − D is a normal random variable with zero mean and standard deviation √ 2, to compute the probability of x = 0 being a focus we consider the random vector (X , Y , Z ) := (B, C, A − D), where X , Y and Z are independent normal variables with zero mean, and σ X = σ Y = 1 and σ Z = √ 2. Thus, the joint density function is: To compute this integral, we perform the change of variables where t ∈ − π 2 , π 2 , s ∈ (0, 2π) and r > 0. Since the determinant of the Jacobian of the change is √ 2 sin(t)r 2 , we have 2 sin(t)r 2 e −1/2r 2 dr ds dt where K = {(s, t) : cos(t) 2 + 2 sin(t) 2 sin(s) cos(s) < 0}. Recall that To calculate the remainder part of the integral, K sin(t)dtds, we consider the curve cos 2 (t)+2 sin 2 (t) sin(s) cos(s) = 0, that is, t = ± arctan 1 √ − sin(2s) , which is depicted in Fig. 4.
It is easy to see that the shadowed area in Fig. 4 corresponds to K . Using the symmetries of this curve, and calling g 1 (s) := arctan 1 √ − sin(2s) , we get that K sin(t) ds dt = 4 π π/2 π/2 g 1 (s) sin(t) dt ds.  Taking into account that cos(arctan(ξ )) = 1/ ξ 2 + 1, and doing the change u = 2s, we get π π/2 π/2 Hence and the computation of all probabilities follows. Finally, notice that if a vector field has the phase portrait L 2 (or L 3 ) and we perform a time reversion t → −t then we get the same picture with reversed time arrows, and hence the two phase portraits are not conjugated, but topologically equivalent. In fact, the pictures of L 2 and L 3 in Fig. 1 correspond to global attractors. For the phase portrait L 1 a time reversal gives a conjugated one.
Due to the symmetry of the random variables that give the coefficients of the random homogeneous vector field (1) we know that f and − f have the same distribution. Hence the probability to get an attractive node (resp. focus) coincides with the probability to get a repulsive node (resp. focus), see also item (b) of Theorem 10. Therefore, P(0 is and attractor) = P(0 is an attractive node) + P(0 in an attractive focus) Alternative proof of Theorem 1 Set l j = P(L j ), j = 1, 2, 3. Following the same steps that in the previous proof Theorem 1, we obtain that l 1 = 1 2 and l 2 + l 3 = 1 2 . The only difference in this proof is how to find l 2 and l 3 . By item (c) of Theorem 10, By joining the three equalities we obtain that l 3 = 1 − √ 2/2 and the result follows.

Random Homogeneous Quadratic Vector Fields
Since we are interested in knowing the phase portraits (1) with positive probability, we can assume that the components of our vector fields have not common factors (see Sect. 2.2). Hence the multiplicity at 0 is n 2 . For the quadratic case (n = 2), it is 4.
To prove Theorem 2 we need to algebraically characterize the indices at the origin and also the number of invariant straight lines though it for quadratic homogenous vector fields with the origin being an isolated singularity. This is so because, as we will see, the phase portrait of the quadratic homogeneous vector fields with positive measure in the event space (which is given by the parameter space = R 6 ) is characterized by these two numbers.

Index at the Origin
By Corollary 7 the index at the origin of (10) is −2, 0 or 2. The next result, explicitly characterizes ind( f 2 ) for generic vector fields, in terms of algebraic inequalities (hence open sets in the parameter space R 6 ). Set We introduce an additional genericity condition for vector field (10). We will say that the vector field f 2 is well-posed if a f − cd = 0, λ· μ = 0, λμ− 1 = 0 and λ + μ = 0. Observe that well-posed random homogeneous quadratic vector fields (10) have full probability.
Theorem 12 Let f 2 as in (10) be a well-posed vector field, and let = ±1 be such that j > 0. Then the following holds: Proof We will start proving that Notice that the dimension of this space is 4 as expected because we already knew that the multiplicity of f 2 at 0 is 4. Indeed, observe that since the components of f 2 are zero in Q( f 2 ), and using that f 2 is well-posed, we get that Since μλ = 1 we get thatx 2ȳ = 0 in Q( f 2 ). It easily implies that all the monomials of degree k ≥ 3 are zero in the quotient ring. Furthermore, some computations give that Hence, the residual class of the Jacobian of f 2 isJ = jxȳ. Let ϕ : Q( f 2 ) → R be the functional sendingxȳ to = ±1 with j > 0, and sending the other basis elements to 0. Then the matrix of <, > ϕ with respect this basis is: ⎛ The characteristic polynomial is given by Let z 1 , z 2 be the two roots of z 2 − (λ + μ) z + λμ − 1 = 0. Since z 1 z 2 = λμ − 1, z 1 + z 2 = (λ + μ) and the signature of a quadratic form is the difference between positive eigenvalues and the negative ones, the result follows.

Number of Invariant Straight Lines Trough the Origin
Concerning the number of invariant straight lines passing through the origin of (10), as we have proved in Sect. 2.1, generically it suffices to look at Eq. (5), which writes t 2 (κ) = −cκ 3 + ( f − b)κ 2 + (e − a)κ + d = 0, with c = 0. Again, generically a cubic equation has either three different real roots or one simple real root. These two possibilities are distinguished by the discriminant of t 2 , t 2 which is given by The result is that t 2 has three different real roots if and only t 2 > 0 and t 2 has just one simple real root if and only t 2 < 0. These two cases give a full probability event for the random vector field (1) with n = 2. Table 1 Proof of Theorem 2 The phase portarits of quadratic homogeneous vector fields are well-know, see [1,13]. It is not difficult to see that the only one with positive probability are the five ones given in Fig. 2. This is so, because all the other ones are characterized by some equality among the coefficients and the vector field, and so, they have probability 0 of appearance. Set q j = P(Q j ), j = 1, 2, . . . , 5. By looking at these phase portraits and using the notation of Theorem 10 we have that
Taking into account the three relations among the q j given in Theorem 2, only two more relations among these five probabilities have to be found in order obtain their exact values. For instance one of these new relations could be u 2 (0) = q 2 + q 4 . By using item (a) of Theorem 12 and the probability density function given in (8) we obtain We have not been able to calculate the above integral analytically. It could be approximated by several numerical methods. In fact, one of the most used is Monte Carlo method to evaluate multiple integrals. For this reason we have decided to compute directly the values P(Q j ) by direct Monte Carlo simulation instead of approaching u 2 (0).
The results of Theorem 12 and the ones of Sect. 5.2 that give algebraic inequalities among the coefficients to know the index at the origin, and the number of invariant straight lines through it, respectively, allow to determine the phase portrait of any well-posed homogeneous quadratic vector field with an isolated singularity. Notice that these vector fields have full probability. We use these results to know which phase portrait corresponds to each sample generated by Monte Carlo method. The obtained approximations of the values q j are given in Table 1.

Remark 13
Another way to distinguish the five phase portraits with positive probability for planar quadratic homogeneous systems consists on using the invariants approach adopted in [5] for quadratic systems. There, the nature and configuration of the singular points at the infinity in the Poincaré Compactification are given in terms of some invariants called η, μ 0 and κ, which are certain homogeneous polynomials of degree 4 on the coefficients of the systems. The phase portraits Q i , i = 1, . . . , 5 correspond with the configurations of the infinite singular points number 1,5,7,30 and 34 respectively, classified in Diagrams 1 and 2 and depicted in Figure 6 of [5] (or the configurations (69), (71), (68), {47} and (67) respectively, given in Diagram 1 of [6]). In fact, the invariant η is the numerator of the discriminant t 2 given in Sect. 5.2.

Random Homogeneous Cubic Vector Fields
This section mimics the previous one but with more involved computations. There is only one essential difference, as we will see, for first time there appear two phase portraits that are neither conjugated nor equivalent but share index and number of invariant straight lines.
Consider a cubic homogeneous vector field where for j = 0, ∈ {−1, 1} is such that j > 0, and We introduce a genericity condition for this cubic case. We say that f 3 is well-posed if ah − ed = 0 and ps = 1; r · s · p · q = 0 and h 1 · h 2 · h 3 · h 4 · j = 0; α · β · γ = 0 and C 2 · D 3 = 0. As in the quadratic case, well-posed random cubic vector fields have full probability.
Theorem 14 Let f 3 as in (10) be a well-posed cubic vector field. Then the following holds:

and only if either
Proof Since the components of f 3 are zero in Q( f 3 ), we get thatx 3 = rx 2ȳ + sxȳ 2 andȳ 3 = px 2ȳ + qxȳ 2 and simple computations givē From the above equalities and taking into account that f 3 is well-posed we get that all the monomials of degree greater than four are zero in Q( f 3 ). Hence, with a basis of nine elements, as expected. Since the Jacobian of f 3 is its residual class is jx 2ȳ2 , with j = 0. Let ϕ : Q( f 3 ) → R be the functional sendingx 2ȳ2 to = ±1 with j > 0 and sending the other basis elements to 0. Then the matrix of <, > ϕ with respect this basis is: ⎛ The characteristic polynomial is given by where S(z) = z 3 + α z 2 + β z + γ, and α, β, γ are defined above. In order to compute the signature of this matrix it is not difficult to see that the only relevant part of the characteristic polynomial is S. The conditions on the coefficients of a cubic polynomial equation to give the number of positive and negative zeros are established in Lemma 15 in the "Appendix". Applying it we get the result.
Concerning the number of invariant straight lines passing through the origin for vector field (11), generically we have to look at equation: t 3 (κ) = −dκ 4 + (−c + h) κ 3 + (−b + g) κ 2 +(−a + f ) κ +e, with d = 0. Again, under more generic assumptions, t 3 has either four different real roots, or two simple real roots, or no real root. These three possibilities can be distinguished by the sign of three algebraic expressions depending on its coefficients, given in Lemma 16. Once more, these inequalities imply that the set of parameters for which the vector field has a given number of invariant straight lines is measurable. They are also useful to decide which phase portrait happens when we apply the Monte Carlo method to estimate the desired probabilities.

Proof of Theorem 3
The phase portraits of cubic homogeneous vector fields are given in [1,11]. It can be seen that the only ones with positive probability, modulus time orientation, are the 9 phase portraits given in Fig. 3. Set c j = P(C j ), j = 1, 2, . . . , 9. By looking at these phase portraits and with the notation introduced in Theorem 10 it holds that By Theorem 10 we know that u 3 (3) = u 3 (−3), u 3 (1) = u 3 (−1) and 2 3 (2) + 4 3 (4) = 3 . Joining all these equalities, the ones stated in the theorem follow.
Finally, notice that, contrary to what happen in the quadratic case, the index at the origin and the number of invariant straight lines are not enough to distinguish between different phase portraits. The phase portraits C 3 and C 4 have both index equal to 1 and have 4 invariant straight lines.
If we look at the equator of the Poincaré sphere we see that in the phase portrait C 4 the infinite singular points are successively node-saddle-node-saddle. It can be seen (see [1]) that if t 3 (κ j ) = 0, then s j := −t 3 (κ j ) p 3 (1, κ j ) < 0 (resp. s j > 0) is the condition to get a saddle (resp. a node) at the singular point at infinity determined by the direction y = κ j x. Hence, in the case with index 1 and 4 invariant straight lines, in order to distinguish between the phase portraits C 3 and C 4 it is necessary to consider the four roots of the polynomial equation t 3 (κ) = 0, κ 1 < κ 2 < κ 3 < κ 4 , and compute the four signs s j . If we find that s 1 s 2 < 0 and s 2 s 3 < 0, then we have the phase portrait C 4 . Otherwise we have phase portrait C 3 . We note that this type of conditions on the coefficients give measurable sets.
Hence in this case to get the values of Table 2 we use again the Monte Carlo method generating 10 8 random cubic homogeneous vector fields with the desired distribution. For each sample we compute its index at the origin by using Theorem 14 and we apply Lemma 16 to know its number of invariant straight lines. These two values are enough to know the corresponding phase portrait in seven of the nine cases. To distinguish between the phase portraits C 3 and C 4 , in the case (i, l) = (1, 4), we compute the values introduced in the previous paragraph.