This is a preprint of: “Phase portraits of random planar homogeneous vector fields”, Anna Cima, Armengol Gasull, Vı́ctor Mañosa, Qual. Theory Dyn. Syst., vol. 20(3), 2021. DOI: [10.1007/s12346-020-00437-7] Phase portraits of random planar homogeneous vector fields∗ Anna Cima(1) , Armengol Gasull(1) and Vı́ctor Mañosa(2) (1) Departament de Matemàtiques, Facultat de Ciències, Universitat Autònoma de Barcelona, 08193 Bellaterra, Barcelona, Spain cima@mat.uab.cat, gasull@mat.uab.cat (2) Departament de Matemàtiques, Universitat Politècnica de Catalunya Colom 11, 08222 Terrassa, Spain victor.manosa@upc.edu Abstract 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, 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. Mathematics Subject Classification 2010: 37H10, 34F05. Keywords: Ordinary differential equations with random coefficients; planar homogeneous vector fields; index; phase portraits. 1 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 ∗ The authors are supported by Ministry of Science and Innovation–State Research Agency of the Spanish Government through grants PID2019-104658GB-I00 (MICINN/AEI, first and second authors) and DPI2016- 77407-P (MICINN/AEI/FEDER, UE, third author). The first and second authors are also supported by the grant 2017-SGR-1617 from AGAUR, Generalitat de Catalunya. The third author acknowledges the group’s research recognition 2017-SGR-388 from AGAUR, Generalitat de Catalunya. 1 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 [28]. 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, 25] 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 V.I. 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, 28]) and, for instance, they are proposed as an exercise in the S. Strogatz book [27, 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, 2 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 ∂ ∂ Fn (x, y) = Pn (x, y) + Qn (x, y) ∂x ∂y     X ∂ X ∂ = Ai,j xi y j  + Bi,j xi y j  (1) ∂x ∂y i+j=n i+j=n is a random planar homogeneous polynomial vector field of degree n if all the variables Ai,j and Bi,j are independent normal random variables with zero mean and standard deviation one. For short, we will write Ai,j ∼ N(0, 1) and Bi,j ∼ N(0, 1). The hypothesis that all the coefficients are N(0, 1) is commonly used, see for instance [4, 9, 20, 28] and it is quite natural and well motivated. In Section 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 F1 of the form (1). Their phase portraits (modulus time orientation) with positive probability are the three ones shown in Figure 1. They are completely determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, √ √ 1 2 1 2 P (L1 ) = , P (L2 ) = − ' 0.20711 and P (L3 ) = 1 − ' 0.29289. 2 2 2 2 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. 3 Type L1 Type L2 Type L3 i = −1, l = 2 i = 1, l = 2 i = 1, l = 0 Figure 1: Phase portraits of planar linear vector fields with positive probability, modulus time orientation. To state our results for n = 2, 3 we need to introduce next two values Z √ 1 ∞ 2 t8 + 8 t6 + 13 t4 + 8 t2 + 2 Λ2 = dt ' 1.64343, (2) π −∞ (t2 + 1) (t4 + t2 + 1) Z √ 1 ∞ 2t8 + 4 t6 + 12 t4 + 4 t2 + 2 Λ3 = dt ' 1.81225, (3) π −∞ (t2 + 1) (t4 + 1) 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, respec- tively. 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 F2 of the form (1). Their phase portraits with positive probability are the five ones shown in Figure 2. They are completely determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, P their corresponding probabilities, in addition to 5j=1 P (Qj ) = 1, satisfy Λ2 − 1 P (Q1 ) + P (Q2 ) + P (Q3 ) = ' 0.32172, P (Q1 ) = P (Q3 ) + P (Q5 ), 2 and they are estimated in Table 1. 4 (a) Type Q1 (b) Type Q2 (c) Type Q3 i = −2, l = 3 i = 0, l = 3 i = 2, l = 3 (d) Type Q4 (e) Type Q5 i = 0, l = 1 i = 2, l = 1 Figure 2: Phase portraits of planar quadratic homogeneous vector fields with positive prob- ability. Estimated probabilities P (Q1 ) 0.11588 Observed frequency P (Q2 ) 0.18583 i(f ) = −2 0.11588 P (Q3 ) 0.01999 i(f ) = 0 0.76825 P (Q4 ) 0.58242 i(f ) = 2 0.11587 P (Q5 ) 0.09588 Table 1: Estimations of the probabilities P (Qj ), j = 1, 2, . . . , 5, of quadratic random vector fields, F2 , of the form (1), in accordance with Figure 2. To estimate the values P (Qj ) we have applied the Monte Carlo method to 108 quadratic homogeneous vector fields, randomly generated; that is, we have set up 108 vectors in R6 whose entries are pseudo-random numbers simulating the six independent random variables of the quadratic random vector field F2 , with N(0, 1) distribution. This algorithm consists in a repeated random sampling and gives estimations of the desired probabilities due to the 5 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 = 108 , 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 Q1 , Q2 , Q3 , Q4 and Q5 are in good agreement with the relations given in Theorem 2. Observe that precisely P (Q1 )+P (Q2 )+P (Q3 ) is the probability of having three invariant 3−Λ2 straight lines and P (Q4 )+P (Q5 ) = 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, 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], we add their observed frequencies, also obtained by Monte Carlo simulation, we get 0.25422 + 0.25424 + 0.07396 + 0.07749 + 0.01839 = 0.6783. This value is in good agreement with the probability of having one invariant line given above. For n = 3, the results are similar to the quadratic case. Theorem 3. Consider cubic random vector fields F3 of the form (1). Their phase portraits (modulus time orientation) with positive probability are the nine ones shown in Figure 3. Except for the phase portraits C3 and C4 , they are determined by the couple (i, l) =(index, number of invariant lines) at the origin. Moreover, their corresponding probabilities, in 6 P9 addition to j=1 P (Cj ) = 1, satisfy 5 X 8 X 4 P (Cj ) + 2 P (Cj ) = Λ3 , P (C1 ) = P (C5 ) + P (C8 ), j=1 j=6 P (C2 ) + P (C6 ) = P (C3 ) + P (C4 ) + P (C7 ) + P (C9 ), and they are estimated in Table 2. Estimated probabilities P (C1 ) 0.00909 Observed frequencies P (C2 ) 0.04193 i(f ) = −3 0.00909 P (C3 ) 0.00615 i(f ) = −1 0.49090 P (C4 ) 0.02394 i(f ) = 1 0.49091 P (C5 ) 0.00065 i(f ) = 3 0.00910 P (C6 ) 0.44897 0 is a global attractor 0.24238 P (C7 ) 0.28521 0 is a global repeller 0.24238 P (C8 ) 0.00845 P (C9 ) 0.17561 Table 2: Estimations of the probabilities P (Cj ), j = 1, 2, . . . , 9, of cubic random vector fields, F3 , of the form (1), in accordance with Figure 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 consider phase portraits L2 or L3 in Figure 1, or C2 or C5 in Figure 3, and we reverse the arrows, the new phase portraits are not conjugated, but topologically equivalent. 7 Type C1 Type C2 Type C3 i = −3, l = 4 i = −1, l = 4 i = 1, l = 4 Type C4 Type C5 Type C6 i = 1, l = 4 i = 3, l = 4 i = −1, l = 2 Type C7 Type C8 Type C9 i = 1, l = 2 i = 3, l = 2 i = 1, l = 0 Figure 3: Phase portraits of planar cubic homogeneous vector fields with positive probabil- ity, modulus time orientation. 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 defini- tions. Fixed n, the number of topologically equivalent different classes of phase portraits Sn of such systems is given in Table 1 of that paper. The first ten values are reproduced in Ta- ble 3. Observe that the value S2 coincides with the number of different phase portraits given 8 in Theorem 2. On the other hand, the values S1 and S3 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 = S1 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 = S3 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. n 1 2 3 4 5 6 7 8 9 10 Sn 5 5 14 13 34 31 85 77 221 203 Table 3: Number of phase portraits with positive probability Sn for vector field (1). We organize the paper as follows. In Section 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. 2 Algebraic tools for the classification of the phase portraits Consider planar polynomial vector fields of type ∂ ∂ f (x, y) = pn (x, y) + qn (x, y) , (4) ∂x ∂y where pn (x, y) and qn (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 9 the cases n = 2, 3 they are given in [1, 13] and [11] 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 Section 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. 2.1 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 qn (x, y) − y pn (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 tn (κ) := qn (1, κ) − κ pn (1, κ) = 0. (5) Hence, if tn (κ) 6≡ 0 and pn (0, y) 6≡ 0 the number of invariant straight lines l ≤ n + 1 is exactly the number of real zeros of tn (κ). If tn (κ) ≡ 0 or pn (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. 2.2 Index at isolated singular points To simplify the notation, we will do the following abuse of notation: we will write f = (f1 . . . , fm ) to denote an analytic map of Rm but also a finite map germ, or even the vector P field f = m j=1 fj ∂/∂xj . 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 : (Rm , 0) → (Rm , 0) is a continuous map and 0 is isolated in f −1 (0), then the index of f at 0, ind(f ), is defined as the degree of the map f /||f || : S → S1 , T where S is the boundary of a ball of radius , B , such that f −1 (0) B = {0}. If f is 10 differentiable, this number can be computed as the sum of the signs of the Jacobian of f at all the preimages near 0 of a regular value of f near 0, see [22, Lemmas 3 and 4]. If f is a C ∞ map we can consider the local ring of germs of C ∞ functions at the origin C0∞ (Rm ) and the quotient ring Q(f ) = C0∞ (Rm )/(f ), 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. Theorem 5 ([16]). Let f : (Rm , 0) → (Rm , 0) be a C ∞ a finite map germ, and let J¯ ∈ Q(f ) be the residue class of the Jacobian of f, J = det(Df ). If ϕ : Q(f ) → R is a linear functional such that ϕ(J)¯ > 0, and if <, > = <, >ϕ is the symmetric bilinear form on the ring Q(f ) defined by < p, q >= ϕ(pq) for p, q ∈ Q(f ), then the index of f at 0, is ind(f ) = signature <, > . 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 ([26]). 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. Lemma 6. Let f : (Rm , 0) → (Rm , 0), be a C ∞ finite map germ. Then: (a) If g = (f1 , f2 , . . . , −fm ), then ind(f ) = −ind(g). (b) If g = (−f1 , −f2 , . . . , −fm ) then ind(f ) = (−1)m ind(g). Proof. (a) The proof is straightforward by using the algebraic formula for the index given in Theorem 5. Clearly Q(f ) = Q(g) and the Jacobian determinant of g, Jg , is minus the 11 Jacobian determinant of f, Jf . Now consider ϕf : Q(f ) → R a linear functional such that ϕf (J¯f ) > 0, and let A be the associated matrix. Then, if we define ϕg (p) = −ϕf (p), ϕg is a linear functional which satisfies that ϕg (J¯g ) > 0, and its corresponding matrix B is B = −A. This fact implies that PB (λ) = 0 if and only if PA (−λ) = 0, where PA and PB are the characteristic polynomials of A and B respectively. Hence the signature of <>ϕg is minus the signature of <>ϕf . (b) This proof follows similarly. Finally, it is also known, see [10], that 1 |ind(f )| ≤ (µ(f ))1− m and ind(f ) ≡ µ(f ) (mod 2). Applying the above results to (4) we have: Corollary 7. Let f be a homogeneous planar vector field (4) of degree n. Assume that the origin is an isolated singularity. Then µ(f ) = n2 and |ind(f )| ≤ n with ind(f ) ≡ n (mod 2). In particular, for n = 1 the index i ∈ {−1, 1}, for n = 2 the index i ∈ {−2, 0, 2} and for n = 3 the index i ∈ {−3, −1, 1, 3}. For m = 2, there is an alternative way to compute the index of an isolated singularity of an analytic planar vector field f. The Bendixon’s index formula says that ind(f ) = 1 + (e − h)/2, where e and h are respectively the number of elliptic and hyperbolic sectors of this singularity. 3 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 Y = A1 Y1 + A2 Y2 + · · · + Ak Yk , (6) where Y1 , Y2 , . . . , Yk are fixed vector fields on R2 and A1 , A2 , . . . , Ak are random variables to be fixed, taking values on R. In this way each event ω consists on a given vector field Y = a1 Y1 + a2 Y2 + · · · + ak Yk , (7) 12 with aj = Aj (ω) (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 Aj . 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 Aj 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 Aj in such a way that the vector (A1 , . . . , Ak ) had some kind of uniform distribution in Rk . 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 (λa1 , . . . , λak ) with λ > 0 have topologically equivalent phase portraits. Thus it is also natural to consider a distributionq for the coefficients Aj such that the random vector (A1 /S, A2 /S, . . . , Ak /S) , Pk j=1 Aj , has a uniform distribution on the sphere S where S = 2 k−1 ⊂ Rk . Next result will justify our choice of distribution for the random variables Aj . Theorem 8. ([9, 21, 24]) Let X1 , X2 , . . . , Xk be independent and identically distributed one- dimensional random variables with a continuous q positive density function f . The random Pk 2 vector X = (X1 /S, X2 /S, . . . , Xk /S) , where S = j=1 Xj , has a uniform distribution in Sk−1 ⊂ Rk if and only if all Xj are normal random variables with zero mean. Hence, in the random vector field (6) we consider the probability space (Ω, F, P ) where Ω = Rk , F is the σ-algebra generated by the open sets of Rk and P : F → [0, 1] is the probability with joint density 1 a2 2 2 1 +a2 +...+ak − ψ(a1 , a2 , . . . , ak ) = √ k e 2 . (8) 2π 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 Yi either ∂ ∂ as xj y n−j ∂x or xm 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. 13 Next result collects most of the information needed to prove our main results. Theorem 10. (a) Set un (k) = P (the index of (1) at 0 is k). Then: (i) un (k) 6= 0 if and only if |k| ≤ n and k ≡ n (mod 2), (ii) un (k) = un (−k) and as a consequence the expected index of the random vector P field (1) is |k|≤n kun (k) = 0. (b) Set an = P (0 is a global attractor for (1)) and rn = P (0 is a global repeller for (1)). Then an = rn . Moreover an 6= 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) 6= 0 if and only if k ≤ n + 1 and k ≡ n + 1 (mod 2). Moreover the expected number of invariant P √ 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] and [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 Pn (x, y) and Qn (x, y) to have a common factor is zero since this fact is characterized by an algebraic equality among the coefficients of Pn and Qn (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 ∂ ∂ Gn (x, y) = Pn (x, y) ∂x − Qn (x, y) ∂y . Observe that P (ind(Fn ) = k) = P (ind(Gn ) = k) because, due to their symmetry, the variables Bi,j ∼ −Bi,j ∼ N(0, 1). From Lemma 6 (a) we have ind(Gn ) = −ind(Fn ), and the result follows. (b) Recall that x = 0 is a global attractor (resp. a global repeller) if limt→∞ (x(t), y(t)) = 0 for all the solutions (x(t), y(t)) of the system (resp. limt→−∞ (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 an = rn = 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 Ai,j and Bi,j , we know that f and −f have the same distribution. Hence an = rn as we wanted 14 to prove. Finally, it is not difficult to find an open set of vector fields with the desired properties, so an = rn 6= 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 A0 f0 (t) + A1 f1 (t) + . . . + Ak fk (t) = 0, where Aj i = 0, . . . , k are normal distributed with zero mean, not necessarily being neither identically distributed nor independent, and fj are differentiable functions. Following the notation in [15, Thm 3.1] if we consider a random polynomial n+1 X P (κ) = Pj κj (9) j=0 where Pj are normal random variables with mean zero and covariance matrix Mn+1 ; w(κ) = 1/2 Mn+1 ·(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: Z ∞ 1 ||w0 (κ)|| dκ. −∞ π A straightforward computation gives that the random polynomials Tn (κ) in (5) that control the number of invariant straight lines of the random system (1) are n X  Tn (κ) = Bn,0 + Bn−j,j − An−j+1.j−1 κj + A0,n κn+1 . j=1 Moreover since all Ai,j and Bi,j have N(0, 1) distribution and are independent, it holds that n X Tn (κ) = C0 + Cj κj + Cn+1 κn+1 , j=1 where C0 and Cn+1 are N(0, 1) and the other Cj 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     1 0 0 0 0   1 0 0 0   1 0 0    0 2 0 0 0     0 2 0 0          M2 =  0 2 0  , M3 =   and M4 =  0 0 2 0 0 ,  0 0 2 0    0 0 1  0 0 0 2 0  0 0 0 1   0 0 0 0 1 respectively. The values of Λn can be obtained by straightforward computations. For instance, for n = 1, √ ! √ ! 1 2κ κ2 0 −2κ 2(1 − κ2 ) 2κ w(κ) = , , and w (κ) = , , . 1 + κ2 1 + κ2 1 + κ2 (1 + κ2 )2 (1 + κ2 )2 (1 + κ2 )2 15 Hence, √ Z Z √ 1 ∞ 0 1 ∞ 2 Λ1 = ||w (κ)|| dκ = 2 dκ = 2. π −∞ π −∞ (1 + κ ) For n = 2, 3 we skip the details. Remark 11. By using the same tools that in the proof of item (c) of Theorem 10, other values of Λn can be obtained. For instance Λ4 ≈ 1.94648, Λ5 ≈ 2.05788, Λ6 ≈ 2.15303, Λ7 ≈ 2.23603, . . . Λ10 ≈ 2.43552. 4 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 lj = P (Lj ), j = 1, 2, 3. The only phase por- traits 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 Figure 1. Moreover l1 + l2 + l3 = 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, l1 = l2 + l3 . By using 1 both equalities we get that l1 = 2 and l2 + l3 = 12 . Hence to prove the theorem it suffices to calculate either l2 or l3 . √ 2 Let us prove that l3 = 1 − 2 . The characteristic polynomial associated to the linear ∂ ∂ vector fields (Ax+By) ∂x +(Cx+Dy) ∂y is λ2 −(A+D)λ+AD −BC. Hence, the probability that x = 0 is a focus is l3 = 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: 1 2 − 2x +2y 2 +z 2 ψ(x, y, z) = e 4 . 4 π 3/2 R Hence l3 = P (Z 2 + 4XY < 0) = K ψ(x, y, z)dx dy dz, where K := {(x, y, z) ∈ R3 : z 2 + 4xy < 0}. To compute this integral, we perform the change of variables √ x := r sin (t) cos (s) , y := r sin (t) sin (s) , z := 2r cos (t) , 16  where t ∈ − π2 , π2 , s ∈ (0, 2π) and r > 0. Since the determinant of the Jacobian of the √ change is 2 sin(t)r2 , we have Z Z +∞ √ 1 2 l3 = 3/2 2 sin(t)r2 e−1/2r dr ds dt 4π e 0 K e = {(s, t) : cos(t)2 + 2 sin(t)2 sin(s) cos(s) < 0}. Recall that where K Z ∞√ 2 √ 2r2 e−1/2r dr = π. 0 R To calculate the remainder part of the integral, e K sin(t)dtds, we consider the curve cos2 (t)+ 1 2 sin2 (t) sin(s) cos(s) = 0, that is, t = ± arctan √ , which is depicted in Figure 4. − sin(2s) e is shadowed. Figure 4: Graphic of the curve cos2 (t) + 2 sin2 (t) sin(s) cos(s) = 0. The set K e Using the sym- It is easy to see that the shadowed area in Figure 4 corresponds to K. metries of this curve, and calling g1 (s) := arctan √ 1 , we get that − sin(2s) Z Z π Z π/2 sin(t) ds dt = 4 sin(t) dt ds. e K π/2 g1 (s) p Taking into account that cos(arctan(ξ)) = 1/ ξ 2 + 1, and doing the change u = 2s, we get Z π Z π/2 Z s 1 2π sin(u) π √ sin(t) dt ds = du = (2 − 2). π/2 g1 (s) 2 π sin(u) − 1 2 Hence √ Z √ π 1 4π √ 2 l3 = sin(t) dt ds = (2 − 2) = 1 − 4π 3/2 e K 4π 2 2 17 and the computation of all probabilities follows. Finally, notice that if a vector field has the phase portrait L2 (or L3 ) 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 L2 and L3 in Figure 1 correspond to global attractors. For the phase portrait L1 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) 1 1 1 1 1 1 = P (0 is a node) + P (0 is a focus) = l2 + l3 = (l2 + l3 ) = . 2 2 2 2 2 4 Alternative proof of Theorem 1. Set lj = P (Lj ), j = 1, 2, 3. Following the same steps that 1 in the previous proof Theorem 1, we obtain that l1 = 2 and l2 + l3 = 12 . The only difference in this proof is how to find l2 and l3 . By item (c) of Theorem 10,  √ 2 l1 + l2 + 0 · l3 = 2`1 (2) + 0 · `1 (0) = Λ1 = 2. √ By joining the three equalities we obtain that l3 = 1 − 2/2 and the result follows. 5 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 Section 2.2). Hence the multiplicity at 0 is n2 . 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 ∂ ∂ f2 (x, y) = (ax2 + bxy + cy 2 ) + (dx2 + exy + f y 2 ) , (10) ∂x ∂y 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 Ω = R6 ) is characterized by these two numbers. 18 5.1 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(f2 ) for generic vector fields, in terms of algebraic inequalities (hence open sets in the parameter space R6 ). Set ae − bd bf − ce λ := − , µ := − , j := 4(af − cd)(1 − λµ). af − cd af − cd We introduce an additional genericity condition for vector field (10). We will say that the vector field f2 is well-posed if af − cd 6= 0, λ · µ 6= 0, λµ − 1 6= 0 and λ + µ 6= 0. Observe that well-posed random homogeneous quadratic vector fields (10) have full probability. Theorem 12. Let f2 as in (10) be a well-posed vector field, and let  = ±1 be such that  j > 0. Then the following holds: (a) ind(f2 ) = 0 if and only if λµ − 1 < 0. (b) ind(f2 ) = 2 if and only if λµ − 1 > 0 and (λ + µ) > 0. (c) ind(f2 ) = −2 if and only if λµ − 1 > 0 and (λ + µ) < 0. Proof. We will start proving that Q(f2 ) = C0∞ (R2 )/(f2 ) = h1, x̄, ȳ, x̄ȳi . Notice that the dimension of this space is 4 as expected because we already knew that the multiplicity of f2 at 0 is 4. Indeed, observe that since the components of f2 are zero in Q(f2 ), and using that f2 is well-posed, we get that a(dx̄2 + ex̄ȳ + f ȳ 2 ) − d(ax̄2 + bx̄ȳ + cȳ 2 ) = (ae − bd)x̄ȳ + (af − cd)ȳ 2 = 0, hence ȳ 2 = λx̄ȳ. Similarly x̄2 = µx̄ȳ. It implies that x̄2 ȳ = (µx̄ȳ)ȳ = µx̄ȳ 2 = µx̄(λx̄ȳ) = µλx̄2 ȳ. Since µλ 6= 1 we get that x̄2 ȳ = 0 in Q(f2 ). It easily implies that all the monomials of degree k ≥ 3 are zero in the quotient ring. Furthermore, some computations give that j = 2(bf − ce)λ + 4(af − cd) + 2(ae − bd)µ = 4(af − cd)(1 − λµ). Hence, the residual class of the Jacobian of f2 is J¯ = j x̄ȳ. 19 Let ϕ : Q(f2 ) → R be the functional sending x̄ȳ to  = ±1 with j > 0, and sending the other basis elements to 0. Then the matrix of <, >ϕ with respect this basis is:   0 0 0       0 µ  0     .  0  λ 0       0 0 0  The characteristic polynomial is given by P (z) = (z 2 − 1) z 2 − (λ + µ)z + λµ − 1 . Let z1 , z2 be the two roots of z 2 − (λ + µ)z + λµ − 1 = 0. Since z1 z2 = λµ − 1, z1 + z2 = (λ + µ) and the signature of a quadratic form is the difference between positive eigenvalues and the negative ones, the result follows. 5.2 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 Section 2.1, generically it suffices to look at equation (5), which writes t2 (κ) = −cκ3 + (f − b)κ2 + (e − a)κ + d = 0, with c 6= 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 t2 , ∆t2 which is given by 1 h i ∆t2 = 4 −27 c2 d2 − 18 cd (b − f ) (a − e) + 4 d (b − f )3 + (b − f )2 (a − e)2 − 4 c (a − e)3 . c The result is that t2 has three different real roots if and only ∆t2 > 0 and t2 has just one simple real root if and only ∆t2 < 0. These two cases give a full probability event for the random vector field (1) with n = 2. 5.3 Proof of Theorem 2 and 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 Figure 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 qj = P (Qj ), j = 1, 2, . . . , 5. By looking at these phase portraits and using the notation of Theorem 10 we have that u2 (−2) = q1 , u2 (0) = q2 + q4 , u2 (2) = q3 + q5 , `2 (1) = q4 + q5 , `2 (3) = q1 + q2 + q3 . By Theorem 10 we know that u2 (2) = u2 (−2), and `2 (1) + 3`2 (3) = Λ2 . Hence q1 = q3 + q5 P and q4 + q5 + 3(q1 + q2 + q3 ) = Λ2 . Using that 5j=1 qj = 1, these two equalities give the two ones in the statement of the theorem. 20 Taking into account the three relations among the qj 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 u2 (0) = q2 + q4 . By using item (a) of Theorem 12 and the probability density function given in (8) we obtain Z a2 +b2 +c2 +d2 +e2 +f 2 u2 (0) = e− 2 da db dc dd de df, K where K = {(a, b, c, d, e, f ) ∈ R6 : (ae − bd)(bf − ce) < (af − cd)2 }. 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 (Qj ) by direct Monte Carlo simulation instead of approaching u2 (0). The results of Theorem 12 and the ones of Section 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 homo- geneous 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 qj 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 Qi , 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 ∆t2 given in Section 5.2. 6 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 ∂ ∂ f3 (x, y) = (ax3 + bx2 y + cxy 2 + dy 3 ) + (ex3 + f x2 y + gxy 2 + hy 3 ) . (11) ∂x ∂y 21 Arguing as in Section 5 we can assume that it has the origin as an isolated singularity and hence it has multiplicity 9. We start studying the index of (11). By Corollary 7 we already know that the only indices of the origin for (11) are −3, −1, 1, 3. Set: bf − df ch − dg af − be ag − ec r := − , s := − , p := − , q := − , ah − de ah − de ah − de ah − de r(r + sq) + s(1 − ps) r + sq pr + q p(1 − ps) + q(pr + q) h1 : = , h2 := , h3 := , h4 := , 1 − ps 1 − ps 1 − ps 1 − ps j := (3af − 3be) h1 + (6ag − 6ce) h2 + (9ah + 3bg − 3cf − 9de) + (6bh − 6df ) h3 + (3ch − 3dg) h4 . We also will need: α := − (1 + h1 + h4 ), β := h1 h4 − h22 − h23 + h1 + h4 − 1, γ :=  (h1 h23 + h22 h4 − h1 h4 − 2h2 h3 + 1), where for j 6= 0,  ∈ {−1, 1} is such that j > 0, and C2 := αβ − 9γ, D3 := −27γ 2 + 18αβγ − 4α3 γ + α2 β 2 − 4β 3 . We introduce a genericity condition for this cubic case. We say that f3 is well-posed if ah − ed 6= 0 and ps 6= 1; r · s · p · q 6= 0 and h1 · h2 · h3 · h4 · j 6= 0; α · β · γ 6= 0 and C2 · D3 6= 0. As in the quadratic case, well-posed random cubic vector fields have full probability. Theorem 14. Let f3 as in (10) be a well-posed cubic vector field. Then the following holds: (a) ind(f3 ) = −3 if and only if D3 > 0 , C2 > 0 , β > 0 , γ > 0. (b) ind(f3 ) = −1 if and only if either D3 < 0 , γ > 0 or D3 > 0 , γ < 0 , C2 > 0 or D3 > 0 , γ < 0 , C2 < 0 , β < 0. (c) ind(f3 ) = 1 if and only if either D3 < 0 , γ < 0 or D3 > 0 , γ > 0 , C2 < 0 or D3 > 0 , γ > 0 , C2 > 0 , β < 0. (d) ind(f3 ) = 3 if and only if D3 > 0 , C2 < 0 , β > 0 , γ < 0. 22 Proof. Since the components of f3 are zero in Q(f3 ), we get that x̄3 = rx̄2 ȳ + sx̄ȳ 2 and ȳ 3 = px̄2 ȳ + qx̄ȳ 2 and simple computations give x̄4 = h1 x̄2 ȳ 2 , x̄3 ȳ = h2 x̄2 ȳ 2 , x̄ȳ 3 = h3 x̄2 ȳ 2 , ȳ 4 = h4 x̄2 ȳ 2 . From the above equalities and taking into account that f3 is well-posed we get that all the monomials of degree greater than four are zero in Q(f3 ). Hence, Q(f3 ) = 1 , x̄ , ȳ , x̄2 , x̄ȳ , ȳ 2 , x̄2 ȳ , x̄ȳ 2 , x̄2 ȳ 2 , with a basis of nine elements, as expected. Since the Jacobian of f3 is (3af − 3be) x4 + (6ag − 6ce) yx3 + (9ah + 3bg − 3cf − 9de) y 2 x2 + (6bh − 6df ) y 3 x + (3ch − 3dg) y 4 its residual class is j x̄2 ȳ 2 , with j 6= 0. Let ϕ : Q(f3 ) → R be the functional sending x̄2 ȳ 2 to  = ±1 with j > 0 and sending the other basis elements to 0. Then the matrix of <, >ϕ with respect this basis is:   0 0 0 0 0 0 0 0       0 0 0 0 0 0  h2  0       0 0 0 0 0 0   h3 0         0 0 0  h1  h2  0 0 0       0 0 0  h2   h3 0 0 0 .        0 0 0   h3  h4 0 0 0       0  h2  0 0 0 0 0 0         0   h3 0 0 0 0 0 0     0 0 0 0 0 0 0 0 The characteristic polynomial is given by P (z) = −( + z) · ( − z) · (z 2 − (h2 + h3 )z + h2 h3 − 1) · (z 2 + (h2 + h3 )z + h2 h3 − 1) · S(z) 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. 23 Concerning the number of invariant straight lines passing through the origin for vector field (11), generically we have to look at equation: t3 (κ) = −dκ4 +(−c + h) κ3 +(−b + g) κ2 + (−a + f ) κ + e, with d 6= 0. Again, under more generic assumptions, t3 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 Figure 3. Set cj = P (Cj ), j = 1, 2, . . . , 9. By looking at these phase portraits and with the notation introduced in Theorem 10 it holds that u3 (−3) = c1 , u3 (−1) = c2 + c6 , u3 (1) = c3 + c4 + c7 + c9 , u3 (3) = c5 + c8 , 8 X 5 X `3 (0) = c9 , `3 (2) = cj , `3 (4) = cj . j=6 j=1 By Theorem 10 we know that u3 (3) = u3 (−3), u3 (1) = u3 (−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 C3 and C4 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 C4 the infinite singular points are successively node-saddle-node-saddle. It can be seen (see [1]) that if t3 (κj ) = 0, then sj := −t03 (κj )p3 (1, κj ) < 0 (resp. sj > 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 C3 and C4 it is necessary to consider the four roots of the polynomial equation t3 (κ) = 0, κ1 < κ2 < κ3 < κ4 , and compute the four signs sj . If we find that s1 s2 < 0 and s2 s3 < 0, then we have the phase portrait C4 . Otherwise we have phase portrait C3 . 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 108 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 24 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 C3 and C4 , in the case (i, l) = (1, 4), we compute the values introduced in the previous paragraph. Appendix In this appendix we give conditions on the coefficients of polynomial equations of degree 3 or 4 to know its number real zeros zeros and for degree 3 also their signs. Lemma 15. Set p(x) = x3 + ax2 + bx + c, c2 = ab − 9c, d2 = a2 − 3b and d3 = −27c2 + 18abc − 4a3 c + a2 b2 − 4b3 . Assume that a · b · c · c2 · d2 · d3 6= 0. Then the following holds: (i) p has a unique real root of multiplicity one, if and only if d3 < 0. This root is negative (resp. positive) if c > 0 (resp. c < 0). (ii) p has three negative real roots if and only if d3 > 0, c2 > 0, b > 0, c > 0. (iii) p has two negative roots and one positive one if and only if either, d3 > 0, c < 0, c2 > 0 or d3 > 0, c < 0, c2 < 0, b < 0. (iv) p has one negative root and two positive roots if and only if either, d3 > 0, c > 0, c2 < 0 or d3 > 0, c > 0, c2 > 0, b < 0. (v) p has three positive roots if and only if d3 > 0, c2 < 0, b > 0, c < 0.  Proof. The proof is based in Sturm’s method which asserts that if p0 = p, p1 . . . , pn is a Sturm’s sequence of p in [a, b] with p(a) · p(b) 6= 0, then the number of real zeros of p in (a, b) is V (a) − V (b) where V (x) is the number of changes of sign in the ordered sequence  p0 (x), p1 (x), . . . , pn (x) , where the zeroes are disregarded. For any polynomial without multiple roots such a sequence always exists, see [26]. For p, without multiple roots and d2 6= 0, one Sturm sequence is p0 = p, p1 = p0 and 1 9 p2 (x) = (2d2 x + c2 ) , p3 (x) = d3 . 9 4 d22 The quantity d3 is the classical discriminant of p and it is known that d3 < 0 if and only if p has a real root and two complex ones whereas d3 > 0 if and only if p has three real roots (see [11] for instance). We are going to consider the following two tables depending on the sign of d3 where b, c, d2 , c2 stands for their respective signs. 25 −∞ 0 ∞ −∞ 0 ∞ p0 − c + p0 − c + p1 + b + p1 + b + p2 −d2 c2 d2 p2 −d2 c2 d2 p3 − − − p3 + + + d3 < 0 d3 > 0 We separate the proof in two cases, depending on the sign of d3 . Case 1. Assume that d3 < 0. We observe that V (−∞) = 2 and V (+∞) = 1. Then • The polynomial p has a negative real root if and only if V (0) = 1. It is easy to see that it happens when c > 0 and one of the three following conditions hold: c2 > 0, b > 0; c2 < 0, b > 0; c2 < 0, b < 0. We observe that d3 < 0 , c2 > 0 , b < 0 , c > 0 is not compatible because then V (0) − V (+∞) = 3 but V (−∞) − V (+∞) = 1. Summarizing, p has a negative real root and two more complex ones if and only if d3 < 0, c > 0. • The polynomial p has a positive real root if and only if V (0) = 2. It is easy to see that it happens when c < 0 and one of the three following conditions hold: c2 > 0, b > 0; c2 > 0, b < 0; c2 < 0, b > 0. As before conditions d3 < 0, c2 < 0, b < 0, c < 0 are incompatible and then p has a positive real root and two more complex ones if and only if d3 < 0, c < 0 as announced. Case 2. Assume that d3 > 0 and consider the above right-hand side table of signs. We see that in that case d2 must be positive. Otherwise V (−∞) = 1, V (∞) = 2 which is not possible (we can also argue that since d3 > 0 implies that p has three real roots, its derivative has two real roots and hence its discriminant which is equal to 4 d2 has to be positive). It is straightforward to see that items (ii), (iii), (iv), (v) are equivalent to V (0) = 0, V (0) = 1, V (0) = 2, V (0) = 3 respectively and that these number of changes of sign are satisfied exactly when the conditions on b, c, c2 are the ones stated in the lemma. Lemma 16. Let p(x) = x4 + ax3 + bx2 + cx + d. Assume that c · d · c2 · c3 · d2 · d3 · d4 6= 0. Then the following holds: (a) p has two simple real and two complex roots if and only if d4 < 0. 26 (b) p has four different real roots if and only if d4 > 0, d2 > 0 and d3 > 0. (c) p has no real root if and only if d4 > 0 and either, d2 < 0 or d3 < 0. Proof. A Sturm sequence of p, is p0 = p, p1 = p0 , 1  16(2d3 x + c3 ) d22 d4 p2 (x) = d2 x2 + 2(ab − 2c)x + c2 , p3 (x) = , p4 (x) = . 16 d22 64d23 where d2 = 3 a2 − 8 b, c2 = ac − 16d, d3 = −3 a3 c + a2 b2 − 6 a2 d + 14 abc − 4 b3 + 16 bd − 18 c2 , c3 = −9 a3 d + a2 bc + 32 abd + 3 ac2 − 4 b2 c − 48 cd, d4 = −27 a4 d2 + 18 a3 bcd − 4 a3 c3 − 4 a2 b3 d + a2 b2 c2 + 144 a2 bd2 − 6 a2 c2 d − 80 ab2 cd+ +18 abc3 + 16 b4 d − 4 b3 c2 − 192 acd2 − 128 b2 d2 + 144 bc2 d − 27 c4 + 256 d3 . We note that d4 is the discriminant of p and since d4 6= 0 all its roots are simple. It is known, see [11] for instance, that d4 < 0 if and only if p has two simple real and two complex roots. And that d4 > 0 if and only if p has either, four different real roots or no real root. It is very easy to distinguish between these last two possibilities using the Sturm method. Consider the corresponding table when d4 > 0, where again each value stands for its sign. −∞ 0 ∞ p0 + d + p1 − c + p2 d2 c2 d2 p3 −d3 c3 d3 p4 + + + If p has four real roots then V (−∞) − V (∞) must be four and this only can happen if V (−∞) = 4 and V (∞) = 0 what immediately says that d2 and d3 must be positive. If d4 > 0 and d2 < 0 or d3 < 0 then V (−∞) − V (+∞) = 2 − 2 = 0 and the result follows. Acknowledgments We want to acknowledge Prof. Maria Jolis for her helpful indications. We also acknowledge the anonymous reviewer for the careful reading and for addressing us very interesting comments. Some of his/her indications are summarized in Remark 13. We 27 also thank him/her for sharing with us the results of his/her Monte Carlo simulations using the approximation of that remark, which are consistent with our results. Data availability All data analyzed in this study are included in this article. References [1] J. Argèmi. Sur les points singuliers multiples de systèmes dynamiques dans R2 . Ann. Mat. Pure and Appl. 79 (1968), 35–69. [2] V.I. Arnold. Eksperimental’naya matematika (Experimental Mathematics). Fazis, Moscow 2005. [3] V.I. Arnold, A.N. Varchenko, S.M. Gusein-Zade. Singularities of differentiable maps, Volume 1. The classification of critical points, caustics and wave fronts. Birk- häuser/Springer, New York 2012. [4] J.C. Artés, J. Llibre. Statistical measure of quadratic vector fields. Resenhas 6 (2003), 85–97. [5] J.C. Artés, J. Llibre, D. Schlomiuk, N. Vulpe. From topological to geometric equiva- lence in the classification of singularities at infinity for quadratic vector fields. Rocky Mountain J. Math. 45 (2015), 29–113. [6] J.C. Artés, J. Llibre, D. Schlomiuk, N. Vulpe. Global topological configurations of singularities for the whole family of quadratic differential systems. Qual. Theory Dyn. Syst. 19 (2020), Paper No. 51, 32 pp. [7] P. Bratley, B.L. Fox, L. E. Schrage. A guide to simulation, 2d ed. Springer, New York, 1987. [8] B.M. Chen-Charpentier, D. Stanescu. Epidemic models with random coefficients. Math. Comput. Modelling 52 (2010), 1004–1010. [9] A. Cima, A. Gasull, V. Mañosa. Stability index of linear random dynamical systems. arXiv:1904.05725 [math.DS]. To appear in Electron. J. Qual. Theory Differ. Equ. [10] A. Cima, A. Gasull, J. Torregrosa. On the relation between index and multiplicity. J. London Math. Soc. 57 (1998), 757–768. 28 [11] A. Cima, J. Llibre. Algebraic and topological classification of the homogeneous cubic vector fields in the plane J. Math. Anal. Appl. 747 (1990), 420–448. [12] K. Conrad. Probability distributions and maximum entropy. https://kconrad.math. uconn.edu/blurbs/analysis/entropypost.pdf (Accessed November 29, 2020). [13] T. Date. Classification and analysis of two–dimensional real homogeneous quadratic differential equation systems. J. Differential Equations 32 (1979), 311-334. [14] F. Dumortier, J.C. Artés, J. Llibre. Qualitative theory of planar differential systems. Springer, Berlin 2006. [15] A. Edelman, E. Kostlan. How many zeros of a random polynomial are real? Bull. Amer. Math. Soc. 32 (1995), 1–37. [16] D. Eisenbud, I. Levine. An algebraic formula for the degree of a C ∞ map germ. Annals of Math. 106 (1977), 19–44. [17] M. Grigoriu, T. Soong. Random vibration in mechanical and structural systems. Prentice-Hall, Englewood Cliffs NJ 1993. [18] G.A. Leonov, I.G. Burova, K.D. Aleksandrov. Visualization of four limit cycles of two-dimensional quadratic systems in the parameter space. Differential Equations 49 (2013), 1675–1703. [19] J. Llibre, J.S. Pérez del Rı́o, J.A. Rodrı́guez. Structural stability of planar homogeneous polynomial vector fields: applications to critical points and to infinity. J. Differential Equations 125 (1996), 490–520. [20] H. Lopes, B. Pagnoncelli, C. Palmeira. Coeficientes aleatórios de equações diferenciais ordinárias lineares. Matemática Universitária 14 (2008), 44–50. English version: [28]. [21] G. Marsaglia. Choosing a point from the surface of a sphere. The Annals of Mathe- matical Statistics 43 (1972), 645–646. [22] J. Milnor. Topology from a differentiable Viewpoint. The University Press of Virginia, Charlottesville, 1965. [23] B.J.T. Morgan. Applied stochastic modelling. Arnold Publishers/Oxford, London, 2000. [24] M.E. Muller. A note on a method for generationg points uniformly on N -dimensional spheres. Communications of the ACM 2 (1959), 19–20. 29 [25] B. Pagnoncelli, H. Lopes, C. Palmeira, B. Palmeira. Random linear systems and sim- ulation. Preprint MAT. 18/06, Pontifı́cia Universidade Católica de Rio de Janeiro. http://bernardokp.uai.cl/preprint.pdf (Accessed November 29, 2020). [26] D. Stanescu, B.M. Chen-Charpentier. Random coefficient differential equation models for bacterial growth. Math. Comput. Modelling 50 (2009), 885–895. [27] J. Stoer, R. Bulirsch. Introduction to Numerical Analysis. Springer, New York 2002. [28] S.H. Strogatz. Nonlinear dynamics and chaos. Westview Press, Cambridge MA, 1994. 30