text:
# Vincenzo Viviani

### Quick Info

Born
5 April 1622
Florence (now Italy)
Died
22 September 1703
Florence (now Italy)

Summary
Vincenzo Viviani was an Italian engineer who worked on the geometry of the cycloid.

### Biography

Vincenzo Viviani's father was Jacopo di Michelangelo Viviani and his mother was Maria Alamanno del Nente; both were members of a noble families. Vincenzo studied at a Jesuit school where he learnt the humanities. He was taught mathematics by Clemente Settimi, a Scolopian friar and a friend of Galileo. Settimi quickly saw Viviani's exceptional intelligence and, in 1638, presented him at court to Ferdinando II de' Medici, Grand Duke of Tuscany. The court was in Livorno, so Viviani had to make the long journey from Florence. While on the road he did not waste his time but spent the many hours studying the first three books of Euclid's Elements. He made a presentation to the Tuscan Court explaining the first sixteen propositions in the first book of the Elements. Famiano Michelini, Ferdinando's Court mathematician, then set him a problem to which he responded confidently. Ferdinando was greatly impressed and provided a monthly salary for Viviani that enabled him to purchase mathematical books. He also arranged for Viviani to meet Galileo, who was living in his villa in Arcetri, near Florence, where he had been put under house arrest by the Catholic Church. Despite the house arrest, Galileo was still Ferdinando's Tuscan Court Mathematician.

Galileo, who by this time was totally blind, was very impressed by Viviani's knowledge and abilities. In 1639, he took Viviani into his home as a companion, student and collaborator, and Viviani continued in this role until Galileo died in January 1642. Viviani learnt much from Galileo over this period, working with him on physics and geometry. However, as Viviani relates himself, their relationship went well beyond that of scientist and assistant, becoming much more like that of a father and son. He wrote (see for example [4]):-
Soon after the unexpected publication of 'Discourses and mathematical demonstrations concerning the two new sciences', Signor Galileo allowed me into his villa in Arcetri where he was staying. I was able to benefit from our intelligent conversations and his precious teachings and he was content that in the study of mathematics, which I had only recently begun, I could turn to his own voice for the solution of those doubts and difficulties that I often found through the natural weakness of my intellect.
In October 1641, Galileo and Viviani were joined in the villa at Arcetri by Evangelista Torricelli when he moved from Rome. After Galileo's death, Torricelli was appointed to fill Galileo's post as Ferdinando II de' Medici's Tuscan Court Mathematician and Viviani continued his collaboration with him. Torricelli is most famed as the first person to create a sustained vacuum and to discover the principle of a barometer. In 1643 Torricelli proposed an experiment which would demonstrate that atmospheric pressure determines the height to which a fluid will rise in a tube filled with a liquid, then inverted over the same liquid. In 1644 Viviani, as Torricelli's collaborator, carried out the experiment which proved a major scientific advance and led to the development of the barometer. When Torricelli died in 1647, Viviani was appointed to fill the lectureship at the Accademia del Disegno in Florence, holding this post for two years. The Grand Duke also appointed Viviani as mathematics teacher to the Medici family at Court, and as engineer with the Uffiziali dei Fiumi, a position he held for the rest of his life [4]:-
While his responsibilities as a Court Mathematician often varied according to the desires of the Grand Duke, the travels of the Tuscan Court, and the arrival on the scene of other thinkers, all his life he was kept busy by his duties to the Medici Court. Particularly exhausting for him was his role of engineer, which required substantial travel on horseback and led to illness on more than one occasion.
The main thrust of Viviani's life, however, was to keep Galileo's memory alive and he wanted to do so by publishing his collected works. Michael Segre writes [15]:-
Viviani had in mind a grand edition of Galileo's works, in which the Latin works would be translated into Italian and vice versa, and throughout his life he collected an enormous quantity of material related to Galileo .... But he never brought this ambitious project to completion, mainly because he was too much of a perfectionist, never entirely satisfied with the material he had amassed and reluctant to stop collecting and begin publishing. For much the same reason, most of Viviani's own scientific work remained unpublished, and an edition of Galileo's works, as Viviani would have liked to see it, only appeared two centuries after his death, under Favaro's supervision. Favaro, however, could hardly have published his National Edition without the materials collected by Viviani.
In [1] Natucci suggests that it was the Church that prevented the publication of Galileo's works and caused a serious blow to science in Italy. Segre, however, counters that view when he writes [15]:-
... the role of the church in Italy's scientific decline during this period, though no doubt major, has sometimes been exaggerated. In Viviani's case I found little evidence of interference. As early as 1656 he had at his disposal enough material to publish an outstanding edition of Galileo's works, even within the limitations set by the Inquisition; his papers testify that primarily his own hesitations prevented him from completing the work.
Throughout his life, one of Viviani's main interests was in ancient Greek mathematics. As early as 1646, while collaborating with Torricelli, he was also working on a project to restore the work of Aristaeus the Elder. Pappus gave Aristaeus great credit for a work entitled Five Books concerning Solid Loci which had been lost. (Solid Loci is the Greek term for conic sections.) Pappus, however, indicated propositions from the work and Viviani reconstructed the original from these references by Pappus. It was a project that Viviani worked on for most of his life. In 1673 he published a first edition of his restoration but he continued to work on it and his final effort De locis solidis secunda divinatio geometrica in quinque libros iniuria temporum amissos tristaei senioris geometrae was only published in 1701, two years before his death.

Another restoration of a Greek text by Viviani is interesting for a number of reasons. This was his restoration of the fifth book of Apollonius's Conics. At the time he began the restoration only the first four books of this eight-book work had been found and Viviani set about reconstructing the fifth. By 1656 Viviani's work was quite close to completion when Giovanni Alfonso Borelli (a fellow Tuscan Court mathematician) discovered an Arabic version of the first seven books of Apollonius's Conics in the Laurentian Library in Florence. Borelli took the manuscript to Rome where it was translated into Latin by Abrahamus Ecchellensis. In 1659 both the translation from the Arabic and Viviani's restoration were published. Viviani's work was entitled De maximis et minimis geometrica Divinatio and was certainly written by him without any knowledge of the translation of Apollonius's work. It is interesting, of course, to see how faithfully Viviani was able to reconstruct Apollonius's book since now both the reconstruction and the original had become available. Viviani had done an excellent job, his biggest 'error' being that he had been able to penetrate deeper than Apollonius himself. The realisation that Viviani was, in some sense, a better geometer than the revered Apollonius, gave him instant fame throughout the centres of learning in Europe. His reputation as a mathematician was high throughout Europe. Louis XIV of France offered him a position at the Académie Royale in 1666, John II Casimir of Poland offered Viviani a post as his astronomer, also in 1666. The Grand Duke, not wishing to lose Viviani, appointed him as his mathematician. Viviani accepted this post and turned down the offers from Louis XIV and John II Casimir.

In 1657 Viviani became one of the first members of the Grand Duke's new academy, the Accademia del Cimento, which was formally founded in June of that year. However, the Academy had informally existed for some time before that with Viviani organising a group of natural philosophers to carry out a variety of scientific experiments. One such experiment, carried out before the formal founding of the Accademia del Cimento, related to the speed and propagation of sound. On 10 October 1656, together with Giovanni Borelli, Viviani used a pendulum as a timing device to show that sound travels twice a fixed distance in twice the time taken to travel the original distance. In other words, its velocity is uniform. Two days later, at the palace in Florence, he measured the velocity of sound by timing, again using a pendulum, the difference between the flash and the sound of a cannon fired at the villa of Petraia. They obtained the value of 350 metres per second, which is considerably better than the previous value of 478 metres per second obtained by Gassendi (the currently accepted value is 331.29 metres per second at 0°C. After the Academy was formally founded, Viviani was involved in most of the experimental work they carried out, such as experiments with Torricelli's barometer and experiments relating to properties of freezing water.

Another important work by Viviani is Quinto libro degli Elementi d'Euclide: ovvero Scienza universale delle proporzioni spiegata colla dottrina del Galileo, con nuov'ordine distesa . This was another restoration, this time of Euclid's fifth book, building on work already carried out with Torricelli and Galileo in 1641. In the Preface he acknowledges his great debt to Galileo, calling himself 'Galileo's last disciple' (see [4]):-
The fact is that through my good fortune, I am his last disciple, because he was my teacher continually during the last three years of his life, and from all of us who were present while he took his last breath (who apart from two priests, included Torricelli, his son Vincenzio Galilei, and others from his home), I alone have survived them all.
The first edition was published in a short form in 1674, then in an enlarged second edition was printed in 15 April 1676. Natucci writes [1]:-
With the rigour and prolixity of the ancients, Viviani devoted an appendix to geometric problems, among which was one on the trisection of an angle, solved by the use of the cylindrical spiral or of a cycloid; another was the problem of duplicating the cube, solved by means of conics or of the cubic $xy^{2} = k$.
He also published Diporto Geometrico (1676) and Enodatio problematum universis geometris propositorum (1677). The first of these contained solutions to twelve geometrical problems which had been published as challenges by Cristoforo Sadler. It appears that Viviani found these easy and did not consider it worthwhile to publish his solutions but Prince Leopoldo, brother of the Grand Duke, had strongly encouraged him to do so. As he was an engineer all his life Viviani also published on engineering. In particular he published Discorso intorno al difendersi da' riempimenti e dalle corrosione de' fiumi (1687).

We have not yet commented on the thing for which Viviani is best known, namely his Racconto istorico della vita di Galileo Galilei . Soon after 1650, Carlo Manolessi began preparing an edition of Galileo's writings. It could never have contained all the writings since publication of Dialogue on the Great World Systems was banned by the Catholic Church, but the project tp publish the rest had widespread support. Prince Leopoldo asked Viviani to write a sketch of Galileo's life for inclusion in Manolessi's edition of his works. However, things did not go as planned for although Viviani wrote his Life of Galileo it did not appear in the edition of Galileo's Collected Works published by Manolessi in Bologna 1655-56. It would appear that Viviani, and the Medici family, felt that Manolessi's edition was not grand enough to honour Galileo. Viviani wanted to publish his own edition of Galileo's Collected Works so he kept the Life of Galileo which he had written intending to include it in a publication of Galileo's Collected Works which he hoped to edit. In 1659 Viviani wrote a second essay on Galileo's work Lettera di Vincenzio Viviani al Principe Leopoldo de' Medici intorno all'applicazione del pendolo all'orologio. Neither essay was published in Viviani's lifetime, but his Racconto istorico was published in 1717. It became the main source of material for Galileo's later biographers. However, in the 20th century historians began to argue that certain details in the essay had been invented by Viviani, particularly those relating to the experiments carried out by Galileo. Viviani was certainly very careful and put in a great amount of effort collecting information about Galileo's life. If he did invent certain incidents, such as Galileo dropping weights from the leaning tower of Pisa, then they were done to illustrate Galileo's approach to science. See [15] for an interesting detailed discussion.

Despite his great expertise in geometry, Viviani seems to have done little original in this area, He did determine the tangent to the cycloid but he was not the first to succeed in this. He believed passionately in the value of geometry, however, writing:-
Speculative geometry is the unique teacher of the honest acquisition of what is useful, delightful, beautiful and good. Geometry is the only true science because it produces knowledge from itself without mediation of causes. Geometry alone teaches how to achieve knowledge and even reminds the human intellect - which is a spark of the divine one - that as a knower through the principles most known with the light of nature it can, if it so wishes, without deceiving itself or others, know the existence and properties of all things concerning the created universe and the order disposed by God, in number, weight, and measure.
However, he lived at a time when the calculus was beginning to be used to prove geometric results. Leibniz was interested in the papers left by Galileo and met Viviani in Florence in late November 1689. The two got on well during this meeting but after Leibniz published Solutio problematis a Galilaeo propositi de linea catenaria in 1692, Viviani became unhappy about the use of the differential and integral calculus which he believed to be nothing but a kind of game that could only solve its own problems. For this reason, in 1692, he challenged European mathematicians to solve a problem of the quadrature of a part of the surface of a sphere. In Aenigma geometricum de miro opificio testudinis quadrabilis hemisphaericae he asked how four equal windows could be cut from a hemisphere so that the remaining surface can be exactly squared. His solution involved using the intersection of four right cylinders, the bases of which are tangent to the base of the hemisphere. See [12] for a discussion of this problem.

We note also that Viviani published an Italian version of Euclid's Elements in 1690. This was reprinted in 1867 by Enrico Betti and Francesco Brioschi who, at that time, were trying to improve the teaching of geometry in Italy. On his death Viviani left an almost completed work on the resistance of solids which was completed and published by Guido Grandi.

Bernard de Fontenelle [7] says that Viviani had an innocence and simplicity of manners which persons commonly preserve who have less commerce with men than with books. He was affable, modest, grateful in the highest degree, and a fast and faithful friend.

Viviani built a handsome house in Florence, and placed the bust of Galileo over the door, with inscriptions on each side of it, to honour his name. This house was commonly called 'Galileo's house' although this is incorrect. The inscriptions are given in the article [16].

### References (show)

1. A Natucci, Biography in Dictionary of Scientific Biography (New York 1970-1990).
2. Biography in The Penny Cyclopaedia of the Society for the Diffusion of Useful Knowledge (Society for the Diffusion of Useful Knowledge, London, 1843).
3. A Johnson, Famous Problems and Their Mathematicians (Libraries Unlimited, 1999).
4. L Boschiero, Post-Galilean Thought and Experiment in Seventeenth-century Italy: The Life and Work of Vincenzio Viviani, History of Science 43 (2005), 77-100.
5. L Conte, Vincenzo Viviani e l'invenzione di due medie proporzionali, Period. Mat. (4) 30 (1952), 185-193.
6. A Fabroni, Vitae italorum doctrina excellentium I (Pisa, 1777), 307-344.
7. B de Fontenelle, Eloge de Viviani, in Histoire de l'Académie des Sciences (1703).
8. F Halbwachs and A Torunczyk, On Galileo's writings on mechanics : an attempt at a semantic analysis of Viviani's scholium, Synthese 62 (3) (1985), 459-484.
9. D Lanier, Leibniz, la nouvelle analyse et la géométrie ou Enquête sur la fenêtre de Viviani, in Cahiers du séminaire d'histoire des mathématiques 8 (Paris, 1987), 203-224.
10. A Procissi, La traduzione italiana delle Opere di Archimede nelle carte inedite di Vincenzo Viviani (1622-1702), Boll. Un. Mat. Ital. (3) 8 (1953), 74-82.
11. A Robinet, Les rencontres de G W Leibniz avec V Viviani et leurs suites, Florence, novembre-décembre 1689, Boll. Storia Sci. Mat. 7 (1) (1987), 61-92.
12. C S Roero, Leibniz and the temple of Viviani : Leibniz's prompt reply to the challenge and the repercussions in the field of mathematics, Ann. of Sci. 47 (5) (1990), 423-443.
13. H Samelson, Proof without Words: Viviani's Theorem with Vectors, Math. Mag. 76 (3) (2003), 225.
14. M Segre, Galileo, Viviani and the tower of Pisa, Stud. Hist. Philos. Sci. 20 (4) (1989), 435-451.
15. M Segre, Viviani's life of Galileo, Isis 80 (2) (1989), 207-231.
16. R Suter, The Galileian Inscriptions on the Facade of Viviani's House in Florence, Osiris 12 (1956), 225-243.
17. L Tenca, I presunti contrasti fra Evangelista Torricelli e Vincenzio Viviani, Period. Mat. (4) 38 (1960), 87-94.
18. L Tenca, Relazioni fra Vincenzio Viviani e Michel Angelo Ricci, Ist. Lombardo Sci. Lett. Rend. Cl. Sci. Mat. Nat. (3) 18 (87) (1954), 212-228.
19. L Tenca, Relazioni fra Stefano Angeli e Vincenzio Viviani, Ist. Veneto Sci. Lett. Arti. Atti 112 (1954), 1-15.
20. L Tenca, Relazioni fra i due Pietro-Paolo Caravaggi e Vincenzio Viviani, Ist. Lombardo Sci. Lett. Rend. Cl. Sci. Mat. Nat. (3) 17 (86) (1953), 835-846.
21. L Tenca, Sulla risoluzione dell'enigma di Vincenzio Viviani in lettere sue e di suoi contemporanei, Ist. Lombardo Sci. Lett. Rend. Cl. Sci. Mat. Nat. (3) 17 (86) (1953), 113-126.
22. L Tenca, Sulle vele secondarie di Vincenzio Viviani, Boll. Un. Mat. Ital. (3) 8 (1953), 456-459.
23. L Tenca, I contrasti fra Alessandro Marchetti e Vincenzio Viviani, Ist. Lombardo Sci. Lett. Rend. Cl. Sci. Mat. Nat. (3) 16 (85) (1952), 293-313.


text:
# interval of convergence of the power series $\sum_{n=1}^\infty(1+\frac{1}{n})^{n^2}x^n$

Find the radius of convergence and the interval of convergence of the power series

$\sum_{n=1}^\infty(1+\frac{1}{n})^{n^2}x^n$

My attempt: The root test brings us to

$\lim_{n\rightarrow\infty}|(1+\frac{1}{n})^nx|$,

but I'm not sure where this brings me. Is the ratio test any help?

Any help appreciated!

• What is the limit for $e$? – Ahmed S. Attaalla Feb 11 '17 at 17:23
• $\lim (1+1/n)^n$ is one of the best known limits in the world. – zhw. Feb 11 '17 at 17:26

Note: Both tests, root test as well as ratio test can be used to analyze the convergence behavior. But, the first one is in this case considerably simpler to use.

We recall the validity of the limit \begin{align*} \lim_{n\rightarrow\infty}\left(1+\frac{1}{n}\right)^n=e \end{align*}

Root test:

We obtain \begin{align*} \lim_{n\rightarrow\infty}\left|\sqrt[n]{\left(1+\frac{1}{n}\right)^{n^2}x^n}\right| =|x|\lim_{n\rightarrow\infty}\left(1+\frac{1}{n}\right)^{n} =|x|e \end{align*}

and we conclude the series is convergent for \begin{align*} |x|<\frac{1}{e} \end{align*} and divergent for $|x|>\frac{1}{e}$.

Ratio test:

We obtain \begin{align*} \lim_{n\rightarrow\infty}\left|\frac{\left(1+\frac{1}{n+1}\right)^{(n+1)^2}x^{n+1}} {\left(1+\frac{1}{n}\right)^{n^2}x^n}\right| &=|x| \lim_{n\rightarrow\infty}\frac{\left(1+\frac{1}{n+1}\right)^{n^2+2n+1}} {\left(1+\frac{1}{n}\right)^{n^2}}\\ &=|x|\lim_{n\rightarrow\infty}\left(\frac{n(n+2)}{(n+1)(n+1)}\right)^{n^2} \left(1+\frac{1}{n+1}\right)^{2n+1}\\ &=|x|\lim_{n\rightarrow\infty} \underbrace{\frac{1}{\left(1+\frac{1}{n^2+2n}\right)^{n^2}}}_{\longrightarrow \ \ \frac{1}{e}} \underbrace{\left(1+\frac{1}{n+1}\right)^{2n}}_{\longrightarrow\ \ e^2} \underbrace{\left(1+\frac{1}{n+1}\right)^{1}}_{\longrightarrow \ \ 1}\\ &=|x|e \end{align*} and we conclude as above.

format: plain


text:
# Bernstein polynomials and non-linear public goods in tumours

By analogy, or maybe homage, to standard game theory, when we discuss the payoffs of an evolutionary game, we usually tell the story of two prototype agents representing their respective strategies meeting at random and interacting. For my stories of yarn, knitting needles, and clandestine meetings in the dark of night, I even give these players names like Alice and Bob. However, it is important to remember that these are merely stories, and plenty of other scenarios could take their place. In the case of replicator dynamics there is so much averaging going on that it is often just better to talk about the payoffs as feedback between same-strategy sub-populations of agents. The benefit of this abstraction — or vagueness, if you prefer — is that you don’t get overwhelmed by details — that you probably don’t have justification for, anyway — and focus on the essential differences between different types of dynamics. For example, the prisoner’s dilemma (PD) and public goods (PG) games tell very different stories, but in many cases the PD and linear PG are equivalent. Of course, ‘many’ is not ‘all’ and my inclusion of ‘linear’ should prompt you to ask about non-linear public goods. So, in this post I want to provide a general analysis of replicator dynamics for non-linear public goods games following the method of Bernstein polynomials recently used by Archetti (2013, 2014). At the end, I will quickly touch on the two applications to mathematical oncology that Archetti considers. SInce I am providing a more general analysis, I will use notation inspired by Archetti, but defined more precisely and at times slightly differently — some symbols will be the same in name but not in value, so if you’re following along with the paper then pay close attention.

### Public goods games

Let’s start with a story. In most biological contexts, we think of a public good as some sort of substance that is released into the ambient space that the cells inhabit and that diffuses out to some distance. This substance can be consumed by the agent that released it but also other agents in order to gain some sort of fitness effect, usually positive — hence public “good” and not “bad”. The effects need not be direct. For instance, when modeling oxygination the public good would be the oxygen that cells use for respiration while the relevant molecule that cells release is vascular endothelial growth factor (VEGF) that causes blood vessels to grow and thus deliver oxygen. In this example, the specific molecule released is only indirectly related to the public good that it causes. This level of indirect-ness is not atypical, because the physical molecules that cells release usually undergo at least some sort of transformation in the ambient environment before they are consumed.

For simplicity, we will assume that the strategy that causes an increase in the public-good — such as the cells making VEGF; we will call this strategy cooperators — pay some fixed cost c to create the good. This cost is usually not the exact cost of producing the mediating molecule, but some amortization over the whole population of producers that takes into account things like probability of producing the molecule. Since we want to keep the model inviscid, we incorporate the diffusion distance not as a physical distance but as a count n of agents other than the focal agent that partake in the good — if you want to get this n from some physical distance then just take the volume that the distance corresponds to and multiply by the density of cells. Now, we suppose that we have $n_c$ cooperators and $n_d$ defectors — defectors are agents that don’t cause an increase in the public-good — with $n_c + n_d = n$. To get these numbers of cooperators and defectors at each interaction, we sample from the overall strategy distribution. Hence, if the proportion of cooperators is x then our probability of sampling $(n_c,n_d)$ is ${n \choose n_c} x^{n_c} (1 - x)^{n - n_c}$. The resulting benefit of the public good is then $b(\frac{n_c + 1}{n})$ if the focal agent is a cooperator (+1 because the focal agent contributes to the public good) and $b(\frac{n_c}{n})$ if the focal agent is a defector. As an example, if you want a linear public good with multiplicative factor k then you would have $b(x) = kcx$.

The above results in the fitness functions:

\begin{aligned} U(C) & = \Bigg( \sum_{n_c = 0}^n {n \choose n_c} x^{n_c} (1 - x)^{(n - n_c)} b(\frac{n_c + 1}{n}) \Bigg) - c \\ U(D) & = \sum_{n_c = 0}^n {n \choose n_c} x^{n_c} (1 - x)^{(n - n_c)} b(\frac{n_c}{n}) \end{aligned}

As always, this gives us the replicator dynamics $\dot{x} = x(1 - x)(U(C) - U(D))$. We will be interested in knowing if the resulting equation has any non-trivial equilibria (the trivial ones are x = 0 and x = 1), and if so where they are and their stability.

### Bernstein polynomials

Even wihout the non-linearily of b, our equations look scary, with the ODE having degree n + 2. Thankfully, a little bit of mathematical analysis will help us greatly simplify our lives — at least in the limit of large n. This bit of analysis is Bernstein’s approximation theorem.

In 1885, Karl Weierstrass — the father of modern analysis — proved a now standard approximation theorem: for every continuous function f defined on a closed interval [0 1] and every $\epsilon > 0$ there exists a polynomial p such that $|f(x) - p(x)| < \epsilon$ for all $0 \leq x \leq 1$ (Pinkus, 2000). Weierstrass’s proof was not constructive, which motivated Sergei N. Bernstein to find a constructive proof. His proof was not the first constructive one, Borel had arrived at a much less elegant construction earlier (for the history, see Pinkus, 2000), but it is the one that will help our public goods game. In particular, Bernstein showed that:

$\lim_{n \rightarrow \infty} \sum_{k = 1}^n {n \choose k} x^k (1 - x)^{n - k} f(k/n) = f(x)$

where the convergence is uniform — just like for Weierstrass. The proof itself relies heavily on the Chebyshev inequality — see Levasseur (1984) for a modern version of this probabilistic treatment — and a careful unpacking of the proof can give us a good bound on the rate of convergence.

We can now use this theorem to simplify our public goods game. Let $\Delta_n b(x) = b(x + 1/n) - b(x)$ and notice that by the definition of derivative, we have that $\lim_{n \rightarrow \infty} \frac{\Delta_n b(x)}{1/n} = b'(x)$ where the derivative is taken with respect to x. Now, we have in the limit of large n:

\begin{aligned} U(C) - U(D) & = \Bigg( \sum_{n_c = 0}^n {n \choose n_c} x^{n_c} (1 - x)^{(n - n_c)} \Delta_n b(\frac{n_c}{n}) \Bigg) - c \\ & = \Bigg( \sum_{n_c = 0}^n {n \choose n_c} x^{n_c} (1 - x)^{(n - n_c)} \frac{1}{n} b'(\frac{n_c}{n}) \Bigg) - c \\ & = \frac{1}{n} b'(x) - c \end{aligned}

At this point, it is good to pause for a sanity check. If you plug in the linear public goods game then the equation simplifies to $c(\frac{k}{n} - 1)$. From this, we expect the game to have two regimes: selection towards all defectors when k < n, and toward all cooperators when k > n. This is in agreement with more traditional approaches. For example, it is the main mechanism on which the cooperation in Santos et al. (2008) hitchhikes.

### Non-linear public goods in tumours

Of course, we didn’t build all this mathematical machinery just to analyze the linear public goods game, we really care about more complicated functional forms for $b$ that are found in biology. For Archetti (2013) this is the sigmoid function associated with production of growth factors, and for the follow up paper (Archetti, 2014) it is the double-sigmoid of acid production due to glycolysis. Depending on how you set the parameters of these benefit functions — as always with EGT, there is no perscription given for how we would go about measuring such parameters in vivo — you get qualitatively different dynamics. Archetti (2013,2014) finds all the typical dynamics of linear games, like pressure toward all cooperation, all defection, and bifurcation around or attraction to a internal fixed point. However, he also finds surprising dynamics like dynamic C of figure 1 (2013; similar dynamics are seen in type 2 of figure 1 in 2014), where there are two internal fixed points (impossible in linear games) with one being a bifurcation and one being an attractor — depending on the initial conditions, the population will go either to all defectors or a coexistence of cooperators and defectors.

### References

Archetti, M. (2013). Evolutionary game theory of growth factor production: implications for tumour heterogeneity and resistance to therapies. British Journal of Cancer, 109(4): 1056-1062.

Archetti, M. (2014). Evolutionary dynamics of the Warburg effect: glycolysis as a collective action problem among cancer cells. Journal of theoretical biology, 341, 1-8 PMID: 24075895

Levasseur, K.M. (1984). A probabilistic proof of the Weierstrass approximation theorem. Amer. Math. Monthly, 91: 249-250.

Pinkus, A. (2000). Weierstrass and approximation theory. Journal of Approximation Theory, 107(1): 1-66.

Santos, F. C., Santos, M. D., & Pacheco, J. M. (2008). Social diversity promotes the emergence of cooperation in public goods games. Nature, 454(7201): 213-216.

From the Department of Computer Science at Oxford University and Department of Translational Hematology & Oncology Research at Cleveland Clinic, I marvel at the world through algorithmic lenses. My mind is drawn to evolutionary dynamics, theoretical computer science, mathematical oncology, computational learning theory, and philosophy of science. Previously I was at the Department of Integrated Mathematical Oncology at Moffitt Cancer Center, and the School of Computer Science and Department of Psychology at McGill University. In a past life, I worried about quantum queries at the Institute for Quantum Computing and Department of Combinatorics & Optimization at University of Waterloo and as a visitor to the Centre for Quantum Technologies at National University of Singapore. Meander with me on Google+ and Twitter.

### 14 Responses to Bernstein polynomials and non-linear public goods in tumours

1. I have concerns about the derivation carried out by Archetti that leads to the binomial coefficients. This derivation assumes that groups of size n are formed, and that the payoff per individual is the average across all possible group compositions. In other words, each individual takes part in many groups during its life span, and its reproductive success is taken to be the average payoff across all these groups.

These dynamics are in my opinion a poor reflection of what a cancer cell experiences. A cancer cell does not form groups of random composition with other cells, rather it interacts with its closest neighbours, which to a large extent are constant in time. I don’t think that migration within tumours has been quantified, but I sincerely doubt that cell within one cell cycle interacts with more than a tiny fraction of the entire population.

Given that many growth factors, such as VEGF, diffuse on the length scale of the entire tumour (otherwise they couldn’t attract blood vessels) it is much more sensible to consider the entire cancer cell population to be a single group.

What I tried to voice previously on Twitter (blog post still coming, I promise) is that one needs to have some idea of the applicability of mean-field models before applying them to real-world situations. For a given population size (i.e. spatial extent) what migration rate is required for the MF-equation to make sense?

Here’s a back of the envelope calculation:

The cell cycle of a tumour cell is often taken to be 24 hours, but this is probably an over-estimate for in vitro conditions. Let’s say 100 hours. The typical size of a tumour is roughly 10 cm. The mean displacement (i.e. square root of mean square displacement) after 100 hours is approximately 100 micrometer(*), i.e. 1/1000 of the assumed linear size. This simple calculation suggest that a tumour cell only visits a small fraction of the tumour before it divides, and hence that MF approaches should be used with caution.

*The migration data is taken from fig. 1F of “Three-dimensional cell migration does not follow a random walk” (http://www.pnas.org/content/111/11/3949) which used fibrosarcoma cells in 3d-matrix.

• You are offering a very pertinent critique that I (and most evolutionary game theorists) would agree with: this model does not include spatial structure. It would always be better to have a model with spatial structure, especially if that contributes something interesting to the dynamics and is still solvable. However, those ifs are very important. It is easy to go out and a demand a model with everything plus the kitchen sink, and it is sometimes not that hard to build such a model, especially if you go the route of simulation. But it is not always clear to me that understanding is achieved through such approaches.

I like to know exactly what features of my model cause something to happen. So even if I was to build a spatial non-linear public goods game, I would still want to know how it works without spatial structure to understand what it is that the spatial aspects contributed. Remember, we have no hope of actually simulating tumor dynamics, the biology and our mathematical/computational tools are nowhere near that, thinking otherwise is just fooling ourselves. Thus, as we work toward more understanding, we have to balance the two opposing forces: the urge for higher complexity that biologists put on us to throw in everything we can think of, and the urge for simplicity that models put on us to understand why certain models work in certain ways. Since I am not a biologist, and since I have no particular strong feelings for one domain of application over another, I prefer to understand why models work in the way they work, and so I tend to lean toward the route of simplicity. I find that this focus on simplicity also makes me a more useful modeler, since over time I start to develop an intuition for the ‘sort of features’ that a model must have in order to get certain results. I would never be able to develop the same intuitions for biology itself, since I am not trained in that field. I could thrust upon biology my intuitions from physics, but people have been doing that for decades now and I am not clear how transformative that has been.

On the technical aspects of your critique. Even if we did believe that the inviscid model is a ‘perfect’ or ‘good’ model (which again, nobody really believes in this case, it is just a model that we can have a hope to understand), we would not need sampling on the level of the whole tumour (as your arguments about the cells migration time try to make), we would just need the tumour to be relatively homogeneous (not too high of variance) on the length-scales of the cell’s lifetime interaction. The average fitness would then pop-out from averaging over the whole population. That is why I wrote in the opening paragraph:

In the case of replicator dynamics there is so much averaging going on that it is often just better to talk about the payoffs as feedback between same-strategy sub-populations of agents

Of course, I am not trying to suggest that I believe that the local variance is low enough to suppress the effects of slightly different growth rates in slightly different parts of the tumour. I have no belief on this, given that I am not a biologist. The biologists probably have intuitions with respect to this, but (I believe that) they also don’t have the proper tools to check their intuitions given that there aren’t good models in place to see if the local variations that are seen are ‘significant enough’ to alter the global dynamics. It is important to build such tools.

I look forward to your blog post on this. If you want to do an extended post (in the style of TheEGG) that critiques EGT then I would be happy to invite you as a contributor here. That way the discussion does not splinter across multiple blogs. I’ve extended the same invitation to Philipp Altrock based on some of his critiques in the twitter thread started by Jake’s reshare of this post.

2. Jorge Peña says:

For more on Bernstein polynomials and evolutionary multiplayer games (e.g., public goods games) you might also want to take a look at this paper by Peña, Lehmann, and Nöldeke (2014):

http://www.sciencedirect.com/science/article/pii/S0022519313005675

A previous version is also posted in the arXiv:

http://arxiv.org/abs/1310.0498


text:
en.wikipedia.org/wiki/Lieb-Robinson_bounds

The Lieb-Robinson bound is a theoretical upper limit on the speed at which information can ...... Jump up to: Haah, Jeongwan; Hastings, Matthew B.; Kothari, Robin; Low, Guang Hao (2018-01-11). "Quantum algorithm for simulating real time ...

View the profiles of people named Robin Bounds. Join Facebook to connect with Robin Bounds and others you may know. Facebook gives people the power to.

We consider the Laplacian with attractive Robin boundary conditions, \begin{ aligned} Q^\Omega _\alpha u=-\Delta u, \quad \dfrac{\partial u}{\partial n}=\alpha ... arxiv.org/abs/1904.08914 Apr 18, 2019 ... We lower-bound Laurent polynomial degree using two methods: a new " explosion argument" and a new ... From: Robin Kothari [view email] www.semanticscholar.org/paper/Bounds-and-monotonicity-for-the-generalized-Robin-Giorgi-Smits/0f4da774526e5985b396dc6a60709c87a913e297 Abstract.We consider the principal eigenvalue λ 1Ω(α) corresponding to Δu = λ (α ) u in\Omega, \frac{\partial u}{\partial v} = \alpha u  on ∂Ω, with α a fixed ...

arxiv.org/abs/1807.06256

Jul 17, 2018 ... We prove these lower bounds using a quantum query algorithm for the combinatorial group testing problem. ... From: Robin Kothari [view email]


text:
# 6.4.18. Custom compile-time errors¶

When designing embedded domain specific languages in Haskell, it is useful to have something like error at the type level. In this way, the EDSL designer may show a type error that is specific to the DSL, rather than the standard GHC type error.

For example, consider a type class that is not intended to be used with functions, but the user accidentally used it at a function type, perhaps because they missed an argument to some function. Then, instead of getting the standard GHC message about a missing instance, it would be nicer to emit a more friendly message specific to the EDSL. Similarly, the reduction of a type-level function may get stuck due to an error, at which point it would be nice to report an EDSL specific error, rather than a generic error about an ambiguous type.

To solve this, GHC provides a single type-level function,

type family TypeError (msg :: ErrorMessage) :: k

along with a small type-level language (via DataKinds) for constructing pretty-printed error messages,

-- ErrorMessage is intended to be used as a kind
data ErrorMessage =
Text Symbol                        -- Show this text as is
| forall t. ShowType t               -- Pretty print a type
| ErrorMessage :<>: ErrorMessage     -- Put two chunks of error message next to each other
| ErrorMessage :$$: ErrorMessage -- Put two chunks of error message above each other  in the GHC.TypeLits module. For instance, we might use this interface to provide a more useful error message for applications of show on unsaturated functions like this, {-# LANGUAGE DataKinds #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-} import GHC.TypeLits instance TypeError (Text "Cannot 'Show' functions." :$$:
Text "Perhaps there is a missing argument?")
=> Show (a -> b) where
showsPrec = error "unreachable"

main = print negate

Which will produce the following compile-time error,

Test.hs:12:8: error:
• Cannot 'Show' functions.
Perhaps there is a missing argument?
• In the expression: print negate
In an equation for ‘main’: main = print negate


text:
A wrapper for black adding new features

# Globality black

Tech talk

A wrapper for black, adding pre- and post-processing to better align with Globality conventions.

globality-black performs the following steps:

• pre-processing: to protect from black actions.
• black
• postprocessing: to revert / correct black actions.

Note: if you are not familiar with black (or need a refresh), please read our Black refresh.

## Installation

pip install globality-black

## Usage

There are two ways to use globality-black, via CLI, or importing the helpers in the library. Next, we show some typical use cases:

### CLI

Please see command line arguments running globality-black --help.

### Pycharm

To use globality-black in PyCharm, go to PyCharm -> Preferences... -> Tools -> External Tools -> Click + symbol to add new external tool.

Recommended configuration to format the current file:

• Program: path to globality-black, e.g. /Users/marty-mcfly/miniconda3/envs/gb/bin/globality-black
• Arguments: $FilePath$
• Working directory: $ProjectFileDir$

Recommended configuration to check the whole repo (but not formatting it it):

• Program: path to globality-black, e.g. /Users/marty-mcfly/miniconda3/envs/gb/bin/globality-black
• Arguments: . --check
• Working directory: $ProjectFileDir$

Next, configure a keymap, as in here.

### JupyterLab

We can leverage this extension, with a custom formatter. Here we explain how to get the following options:

There are two ways to apply globality-black, see left-hand-side, or by clicking on the button next to "Code". We will configure the extension to make it apply the isort + globality-black pipeline when clicking such button.

To do so, install the extension, generate the config for jupyter lab and edit it:

pip install jupyterlab_code_formatter
jupyter lab --generate-config
vim ~/.jupyter/jupyter_lab_config.py

You might already have some config in jupyter_lab_config. If so, you might want to omit the second command above, and edit it (vim) instead.

In any case, we will add the following code:

from jupyterlab_code_formatter.formatters import SERVER_FORMATTERS
from globality_black.jupyter_formatter import GlobalityBlackFormatter
SERVER_FORMATTERS['globality-black'] = GlobalityBlackFormatter(line_length=100)

Then, go to the extension preferences, and add:

{
"preferences": {
"default_formatter": {
"python": [
"isort",
"globality-black",
],
}
},
"isort": {
"combine_as_imports": true,
"force_grid_wrap": 4,
"force_to_top": "true",
"include_trailing_comma": true,
"known_third_party": ["wandb", "tqdm"],
"line_length": 100,
"lines_after_imports": 2,
"multi_line_output": 3,
}
}

Notes:

• The last step above translates into user settings saved in ~/.jupyter/lab/user-settings/@ryantam626/.
• The extension is applied to all cells in the notebook. It can be configured to be applied just to the current cell, if interested.
• The extension is applied to each cell in isolation. Hence, if multiple imports appear in different cells, they won't be merged together on top of the notebook.

### VScode

To use globality-black in VScode go to Preferences: Keyboard Shortcuts (JSON) from the Palette (command+shift+p)
It will open a file named keybindings.json, then add to this file :

[
{
"key": "the shortcut you want (ctrl+b for example)",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "globality-black \${file}"
}
}
]

This will allow you to run globality-black per file. To run globality-black to the folder opened in VSCode just replace file by workspaceFolder.
You can also add any arguments supported by the CLI (--check or --diff are recommended to avoid formatting the whole repo)

## Features

### Blank lines

Black would remove those blank lines after wandb and scikit-learn below:

graph.use(
"wandb",

"scikit-learn",

# we love pandas
"pandas",
)

globality-black protects those assuming the developer added them for readability.

### Dotted chains

In a similar fashion to the "blank lines" feature, "dotted chains" allows to keep the block:

return (
df_field[COLUMNS_PER_FIELD[name]]
.dropna(subset=["column"])
.reset_index(drop=True)
.assign(mapped_type=MAP_DICT[name])
)

LABELS = set(
df[df.labels.apply(len) > 0]
.flag.apply(curate)
.apply(normalize)
.unique()
)

the same. In this feature, we don't explode anything but rather protect code assuming it was written by this in purpose for readability.

### Length one tuples

This is a very simple and specific feature. Black (at least up to 21.9b0) has a bug so that tuples with one element are compressed as in

x = (
3,
)

becomes

x = (3,)

See https://github.com/psf/black/issues/1139#issuecomment-951014094. With globality-black, will protect these.

### Comprehensions

Explode comprehensions

• all dict comprehensions
• any comprehension with an if
• any comprehension with multiple for loops (see examples below)
• list / set comprehensions where the element:
• has a ternary operator (see examples below)
• has another comprehension

For everything else, we rely on black. Examples:

#### Before globality-black

[3 for _ in range(10)]

[3 for i in range(10) if i < 4]

{"a": 3 for _ in range(4)}

{"a": 3 for _ in range(4) if i < 4}

["odd" if i %% 2 == 0 else "even" for _ in range(10)]

double_comp1 = [3*i*j for i in range(10) for j in range(4)]

double_comp2 = [[i for i in range(7) if i < 5] for j in range(10)]

double_comp3 = {i: [i for i in range(7) if i < 5] for j in range(10) if i < 2}

#### After globality-black

[3 for _ in range(10)]

[
3
for i in range(10)
if i < 4
]

{
"a": 3
for _ in range(4)
}

{
"a": 3
for _ in range(4)
if i < 4
}

[
"odd" if i %% 2 == 0 else "even"
for _ in range(10)
]

double_comp1 = [
3 * i * j
for i in range(10)
for j in range(4)
]

double_comp2 = [
[i for i in range(7) if i < 5]
for j in range(10)
]

double_comp3 = {
i: [i for i in range(7) if i < 5]
for j in range(10)
if i < 2
}

Note that in the last two comprehensions, the nested comprehensions are not exploded even though having an if. This is a limitation of globality-black, but we believe not very frequent in everyday cases. If you really want to explode those and make globality-black respect it, please use the feature explained next.

### Partially disable globality-black

If you see some block where you don't want to apply globality-black, wrap it with # fmt.off and # fmt:on and it will be ignored. Note that this is the same syntax as for black. For example, for readability you might want to do something as:

# fmt: off
(f"{key1}_{key2}", key1, key2, key1 + key2)
for key1 in range(10)
]
# fmt: on

Note that as a default (same as black), globality-black will write the expression above as a one-liner.

## Pending / Future work

• Explode ternary operators under some criteria
• Nested comprehensions

Please give us feedback if you find any issues

## Black refresh

black is an opinionated Python formatter that tries to save as much vertical space as possible. In this regard, it compresses lines to the maximum character length that has been configured. black's default is 88, whereas in globality-black we use a default of 100 characters, as agreed for Globality repos globally. If you want to have a custom max character length, add a pyproject.toml file to the root of your repo. This works the same way as in black, and globality-black will take your config from there.

See how black works in their README. It is especially useful to review this section, where important recent features are explained.

### Magic comma

black added a feature at the end of 2020 that we used to call the "magic comma". It's one of the first examples where black is giving a bit of freedom to the developer on how the final code will look like (apart from fmt:off and fmt:on to ignore black entirely). Read more about it here.

## FAQ

Here we list a number of questions and solutions raised when presenting this project to other teams:

I like this project, but this would destroy all our git history and git blames

Our recommendation is:

1. Create a big PR for all your repo, and do the effort of reviewing the changes just once.
2. Add a .git-blame-ignore-revs file to your repo, ignoring the bulk commit where globality-black is applied. See here for more details.

I like most of the changes, but in some places I really prefer the way I write the code

No problem, for those specific cases where you like more your style, just wrap the block with fmt:off and fmt:on, see the Partially disable Globality Black section.

100 characters per line is too short / too long for me

Just add a pyproject.toml to the root of your repo (as the one in this very own project) and specify your preferred length, see the Black refresh section.

I want to know what will be changed before applying the changes

Please use the --diff option from the CLI, see the CLI section.

I want to explode list of arguments, but globality-black is compressing them into one line

Please use the magic comma feature, see Magic comma.

# =============== Globality black

• TODO

## Project details

Uploaded source


text:
MathSciDoc: An Archive for Mathematician ∫

Algebraic Geometrymathscidoc:1701.01008

Acta Mathematica, 216, (1), 1-125, 2014.7
Let$S$be a closed Shimura variety uniformized by the complex$n$-ball associated with a standard unitary group. The Hodge conjecture predicts that every Hodge class in $${H^{2k} (S, \mathbb{Q})}$$ , $${k=0,\dots, n}$$ , is algebraic. We show that this holds for all degrees$k$away from the neighborhood $${\bigl]\tfrac13n,\tfrac23n\bigr[}$$ of the middle degree. We also prove the Tate conjecture for the same degrees as the Hodge conjecture and the generalized form of the Hodge conjecture in degrees away from an interval (depending on the codimension$c$of the subvariety) centered at the middle dimension of S. These results are derived from a general theorem that applies to all Shimura varieties associated with standard unitary groups of any signature. The proofs make use of Arthur’s endoscopic classification of automorphic representations of classical groups. As such our results rely on the stabilization of the trace formula for the (disconnected) groups $${GL (N) \rtimes \langle \theta \rangle}$$ associated with base change.
@inproceedings{nicolas2014the,
title={The Hodge conjecture and arithmetic quotients of complex balls},
author={Nicolas Bergeron, John Millson, and Colette Moeglin},
url={http://archive.ymsc.tsinghua.edu.cn/pacm_paperurl/20170108203406168783812},
booktitle={Acta Mathematica},
volume={216},
number={1},
pages={1-125},
year={2014},
}

Nicolas Bergeron, John Millson, and Colette Moeglin. The Hodge conjecture and arithmetic quotients of complex balls. 2014. Vol. 216. In Acta Mathematica. pp.1-125. http://archive.ymsc.tsinghua.edu.cn/pacm_paperurl/20170108203406168783812.


text:
# Generating a strong unique Initialization Vector

How can I determine if I am generating a unique and strong Initialization Vector? If my mode is generating Keystream? Is there any scientific explanation in generating a unique and strong Initialization Vector?

-

"Unique" is relatively straight forward. It's something you haven't used before. Unique usually only applies to the individual party, you only need to verify that the IV is unique for your usage with the current key.

"Strong" relates to the requirements that your mode of operation has for the IV. Different modes require different constraints on the IV. Which ties in with...

The "scientific explanation" for a good IV comes from a security proof reduction. Researchers design a scheme (like a mode of operation, such as CBC) that uses a cryptographic primitive (like a block cipher, such as AES) that requires an IV, then they prove (or at least argue) that the scheme using the IV is as secure as the underlying primitive given certain constraints on the IV. In other words, if the scheme can be broken it isn't due to the IV as the IV's requirements makes the scheme no weaker. This principle applies to every form of IV, be it for a stream cipher or block cipher. Those constraints on the IV are the strong IV values you should use.

For example, CBC mode for block ciphers requires that the IV be unpredictable. So commonly it is either a) random or b) a unique value encrypted by a key. (The two most common IV requirements are that it be random or unique.) CBC has a proof of security that says that if one of those criteria for the IV are met, then the resulting scheme is as strong as the underlying block cipher.

How do you verify the IV is good? You should put your analysis into the process that does generate the IV, then you can test the IV after it is generated. The main focus should go on how the IV is generated and verifying it conforms to the specification's requirements.

• For example: the requirement you are satisfying may be that the IV be random. You might use the high-quality native random number generator from the operating system (/dev/random, CryptGenRandom, etc) to do so. You can do some tests on the output to verify that something obvious hasn't gone wrong, like the IV doesn't fail to all zeros. But you can't verify that the IV is actually random, only that it looks sufficiently random. Verifying that something random or indistinguishable from random is really hard to do in real-time.

• Another example: the requirement you satisfying may be that the IV be unique. You can use a counter that increments every time an IV is generated and ensure that the counter has a sufficient size that it won't roll over too soon. Or you can use a timestamp and take care to ensure you don't generate multiple IVs within the resolution period of the timestamp. If you want to be very careful, you can keep a list of all previously used IVs and check the list for each new one to ensure you aren't re-using it.

The summary is: Cryptography researchers say that certain schemes are secure given constraints on the IV. These constraints will be widely known and should be available for you to find.

-
Correction: for CBC mode, the real requirement is unpredictability. It is quite safe to use a unique value encrypted by the same key used to encrypt the rest of the message; in fact, that reduces the number of keys that an attacker may get an advantage from learning. After all, if he gets the encryption key, the fact that he can then predict IVs doesn't gain him any further advantage. –  poncho Jun 29 '12 at 18:56
"Unpredictable" is the requirement, yes. (I edited my post to emphasis that.) But a unique IV encrypted by the same key as the rest of the message isn't sufficient for CPA security. The attacker has a way to win the CPA game with probability 1 if he can choose unique IVs that are encrypted by the encryption key. I don't know if that leads to practical attacks, but it destroys the CPA security proof. –  B-Con Jun 29 '12 at 19:19
Allowing the attacker to control (or influence) the IV is not a part of the standard CPA assumption. And, if you assume that the IV is not under attacker control, then yes, a unique IV encrypted by the same key does have a CPA proof (as long as the unique IV is a plaintext xor'ed with a previous ciphertext is no more probable than expected). –  poncho Jun 29 '12 at 22:22
Hm, you're right. I believe I was thinking of the PRP distinguishing game (where the attacker provides the IV and plaintext and tries to guess if the black box is returning a random PRP or the block cipher). I think that the IV is under the attacker's power there. –  B-Con Jun 29 '12 at 22:53


text:
Opened 9 years ago

# Option to suppress CamelCase -> Wiki recognition in version control comments

Reported by: Owned by: Mike Cowperthwaite anybody normal Request-a-Hack normal 0.11

### Description

My codebase is primarily C++ and there are many identifiers that are named using CamelCase. We don't want a separate Wiki page for such identifiers; we don't want the links; and we don't the '!' included in checkin comments to suppress it because non-Trac svn clients will display the '!' -- and it's a pain to have to remember that anyway.

Similarly, being able to suppress the !#<number> recognition in checkin comments would be nice; frequently, #1, #2, etc are valid, even necessary strings in the checkin comments and the links are totally pointless and a distraction.

### comment:1 Changed 8 years ago by Ryan J Ollos

Resolution: → fixed new → closed

This is implemented in Trac 0.11. See the wiki_format_messages option in the [changeset] section. Documentation.

### comment:2 follow-ups:  3  8 Changed 8 years ago by Mike Cowperthwaite

Resolution: fixed closed → reopened 0.10 → 0.11

I do not find this solution satisfactory. I want some of the Wiki formatting -- in particular, linking to changeset IDs (recognized in brackets) is important.

But the CamelCase interpretation and #N recognition are problems.

For ticket-number recognition, wouldn't it make more sense to require a string that's not so common? Even just doubling the hashmark, as ##4, would be more useful. Auto recognition of something that is at least as likely to mean something that shouldn't be linked just isn't a good idea.

### comment:3 in reply to:  2 Changed 8 years ago by Ryan J Ollos

For ticket-number recognition, wouldn't it make more sense to require a string that's not so common? Even just doubling the hashmark, as ##4, would be more useful. Auto recognition of something that is at least as likely to mean something that shouldn't be linked just isn't a good idea.

That is an interesting idea. In fact, I could see the advantage to changing the entire wiki markup so that, for instance, [[1001]] and ##4 are used to link to changesets and tickets, respectively. However, I'd have them display as [1001] and #4. That would fix the problem of accidentally linking to things you don't want linked, particularly for users that aren't familiar with the wiki markup, and particularly in cases were you may not be thinking about how something might be interpreted as wiki markup and can't do a preview (such as log messages).

### comment:4 Changed 8 years ago by Mike Cowperthwaite

If revising so the markup for those doesn't introduce backwards-compatibility problems, I'm all for it. But the camelcase recognition needs to be handled separately -- that is, separately disabled -- unless you're willing to require extra markup on those strings as well.

### comment:5 Changed 8 years ago by Ryan J Ollos

I sounds like you want to require two separate options for the [changeset] section, such as wiki_format_messages_traclinks and wiki_format_messages_camelcase.

The current wiki_format_messages option was implemented in Changeset 8378.

### comment:6 Changed 8 years ago by Ryan J Ollos

Specifically, the relevant code is:

if ChangesetModule(self.env).wiki_format_messages:
return tag.div(format_to_html(self.env,
formatter.context('changeset', (reponame, changeset.rev)),
changeset.message, escape_newlines=True), class_='message')
else:
return tag.pre(changeset.message, class_='message')

### comment:7 in reply to:  description Changed 8 years ago by anonymous

My codebase is primarily C++ and there are many identifiers that are named using CamelCase. We don't want a separate Wiki page for such identifiers; we don't want the links; and we don't the '!' included in checkin comments to suppress it because non-Trac svn clients will display the '!' -- and it's a pain to have to remember that anyway.

If you are willing to disable auto-linking of CamelCase markup to missing wiki pages, then the following TracIni option might work for you: TracIni#wiki-section

[wiki]
ignore_missing_pages

I'm not sure if it takes a 0/1 or enable/disable value.

I'm thinking about submitting comment:5 as an enhancement request and maybe trying to work on it myself.

### comment:8 in reply to:  2 ; follow-up:  10 Changed 7 years ago by Ryan J Ollos

For ticket-number recognition, wouldn't it make more sense to require a string that's not so common? Even just doubling the hashmark, as ##4, would be more useful. Auto recognition of something that is at least as likely to mean something that shouldn't be linked just isn't a good idea.

I've recently wanted to do this same thing, and remembered this ticket. What I plan to do is write a script that processes the log message and prefixes ! to every camelcase entry. I'd prefer to retain TracLinks for the changeset and ticket number syntaxes, [] and #.

For your purposes, you can probably do something similar - prefix ! to #, except in the case of ##, in which case you strip away one #.

It looks like it would be fairly straightforward to modify the post-commit hook to process the changeset message before insertion into the ticket.

I'll post a link to the Trac-Hack when I have the script completed ... probably sometime this weekend.

### comment:10 in reply to:  8 Changed 7 years ago by Ryan J Ollos

For ticket-number recognition, wouldn't it make more sense to require a string that's not so common? Even just doubling the hashmark, as ##4, would be more useful. Auto recognition of something that is at least as likely to mean something that shouldn't be linked just isn't a good idea.

I decided to just go with:

[wiki]
ignore_missing_pages = true

### Modify Ticket

Change Properties


text:
If you find any mistakes, please make a comment! Thank you.

## Solution to Principles of Mathematical Analysis Chapter 9 Part A

### Chapter 9 Functions of Several Variables

#### Exercise 1

(By analambanomenos) Let $\mathbf x,\mathbf y$ be in the span of $S$ and let $c$ be a scalar; we need to show that $\mathbf x+\mathbf y$ and $c\mathbf x$ are in the span of $S$. We have
\begin{align*}
\mathbf x &= c_1\mathbf x_1+\cdots+c_m\mathbf x_m \\
\mathbf y &= d_1\mathbf y_1+\cdots+d_n\mathbf y_n
\end{align*} for some $\mathbf x_1,\ldots,\mathbf x_m,\mathbf y_1,\ldots,\mathbf y_n$ in $S$ and some scalars $c_1,\ldots,c_m,d_1,\ldots,d_n$. Hence
\begin{align*}
\mathbf x+\mathbf y &= c_1\mathbf x_1+\cdots+c_m\mathbf x_m+d_1\mathbf y_1+\cdots+d_n\mathbf y_n \\
c\mathbf x &= cc_1\mathbf x_1+\cdots+cc_m\mathbf x_m
\end{align*}shows that $\mathbf x+\mathbf y$ and $c\mathbf x$ are in the span of $S$.

#### Exercise 2

(By analambanomenos) Let $A\in L(X,Y)$ and $B\in L(Y,Z)$. Let $\mathbf x,\mathbf y\in X$ and let $c$ be a scalar. Then
\begin{align*}
(BA)(\mathbf x+\mathbf y) &= B\big(A(\mathbf x+\mathbf y)\big) \\
&= B\big(A(\mathbf x)+A(\mathbf y)\big) \\
&= B\big(A(\mathbf x)\big) + B\big(A(\mathbf y)\big) \\
&= (BA)(\mathbf x)+(BA)(\mathbf y) \\
(BA)(c\mathbf x) &= B\big(A(c\mathbf x)\big) \\
&= B\big(cA(\mathbf x)\big) \\
&= cB\big(A(\mathbf x)\big) \\
&= c(BA)(\mathbf x)
\end{align*}which shows that $BA$ is linear.

Let $A\in L(X)$ be invertible. Let $\mathbf x,\mathbf y\in X$ and let $c$ be a scalar. Then there are $\mathbf x’,\mathbf y’\in X$ such that
$A(\mathbf x’)=\mathbf x, \quad A(\mathbf y’)=\mathbf y, \quad A^{-1}(\mathbf x)=\mathbf x’, \quad A^{-1}(\mathbf y)=\mathbf y’$Then
\begin{align*}
A^{-1}(\mathbf x+\mathbf y) &= A^{-1}\big(A(\mathbf x’)+A(\mathbf y’)\big) \\
&= A^{-1}\big(A(\mathbf x’+\mathbf y’)\big) \\
&= \mathbf x’+\mathbf y’ \\
&= A^{-1}(\mathbf x)+A^{-1}(\mathbf y) \\
A^{-1}(c\mathbf x) &= A^{-1}\big(cA(\mathbf x’)\big) \\
&= A^{-1}\big(A(c\mathbf x’)\big) \\
&= c\mathbf x’ \\
&= cA^{-1}(\mathbf x)
\end{align*}which shows that $A^{-1}$ is linear. Since $A^{-1}$ is 1-1 and maps $X$ onto itself, it is also invertible.

#### Exercise 3

(By analambanomenos) Suppose $A(\mathbf x_1)=A(\mathbf x_2)$. Then $A(\mathbf x_1-\mathbf x_2)=A(\mathbf x_1)-A(\mathbf x_2)=\mathbf 0 \text{ implies that }\mathbf x_1-\mathbf x_2=\mathbf 0$ so that $\mathbf x_1=\mathbf x_2$. Hence $A$ is 1-1.

#### Exercise 4

(By analambanomenos) Let $\mathbf x,\mathbf y\in\mathscr N(A)$ and let $c$ be a scalar. Then
\begin{align*}
A(\mathbf x+\mathbf y) &= A(\mathbf x)+A(\mathbf y) = \mathbf 0+\mathbf 0 = \mathbf 0 \text{ so that }\mathbf x+\mathbf y\in\mathscr N(A) \\
A(c\mathbf x) &= cA(\mathbf x) = c\mathbf 0 = \mathbf 0 \text{ so that }c\mathbf x\in\mathscr N(A)
\end{align*} which shows that $\mathscr N(A)$ is a vector space.

Let $\mathbf x,\mathbf y\in\mathscr R(A)$, so that $\mathbf x=A(\mathbf x’)$ and $\mathbf y=A(\mathbf y’)$, and let $c$ be a scalar. Then
\begin{align*}
\mathbf x+\mathbf y &= A(\mathbf x’)+A(\mathbf y’) = A(\mathbf x’+\mathbf y’) \text{ so that }\mathbf x+\mathbf y\in\mathscr R(A) \\
c\mathbf x &= cA(\mathbf x’) = A(c\mathbf x’) \text{ so that }c\mathbf x\in\mathscr R(A)
\end{align*}which shows that $\mathscr R(A)$ is a vector space.

#### Exercise 5

(By analambanomenos) I’m going to show this by induction on $n$. For the case $n=1$, let $A\mathbf e_1=k$, and let $\mathbf y=k\mathbf e_1$. If $\mathbf x\in \R1$, then $\mathbf x=x\mathbf e_1$ for some scalar $x$, so $A\mathbf x=xA\mathbf e_1=ck=\mathbf x\cdot\mathbf y$.

Suppose the assertion is true for the case $n$ and let $A\in L(\R{n+1},\R1)$. Restricting $A$ to the subspace $\R n$ (spanned by $\mathbf e_1,\ldots,\mathbf e_n$) yields an element of $L(\R n,\R1)$, so by the induction assumption there is a $\mathbf y’\in\R n$ such that $A\mathbf x’=\mathbf x’\cdot\mathbf y’$ for all $\mathbf x’\in\R n$. If $A\mathbf e_{n_1}=k$, let $\mathbf y=\mathbf y’+k\mathbf e_{n+1}$. If $\mathbf x\in\R{n+1}$, then $\mathbf x=\mathbf x’+x\mathbf e_{n+1}$ for some $\mathbf x’\in\R n$ and some scalar $x$. Then, since the scalar product of $\mathbf e_{n+1}$ with every element of $\R n$ is 0, we have
\begin{align*}
A\mathbf x &= A\mathbf x’+xA\mathbf e_{n+1} \\
&= \mathbf x’\cdot \mathbf y’ + xk \\
&= (\mathbf x’+x\mathbf e_{n+1})\cdot\mathbf y’ + (\mathbf x’+x\mathbf e_{n+1})\cdot (k\mathbf e_{n+1}) \\
&= \mathbf x\cdot\mathbf y
\end{align*}If $|{\mathbf x}|\le1$, then $|{A\mathbf x}|=|{\mathbf x\cdot\mathbf y}|\le|{\mathbf x}|\,|{\mathbf y}|\le|{\mathbf y}|$, so that $\|{A}\|\le|{\mathbf y}|$. Let $\tilde{\mathbf y}=\mathbf y/|{\mathbf y}|$. Then $|{\tilde{\mathbf y}}|=1$ and
$|{A\tilde{\mathbf y}}|=\frac{|{\mathbf y\cdot\mathbf y}|}{|{\mathbf y}|}=\frac{|{\mathbf y}|^2}{|{\mathbf y}|}=|{\mathbf y}|.$Hence $\|{A}\|=|{\mathbf y}|$.

#### Exercise 6

(By analambanomenos) The usual rules of differentiaion show that the partial derivatives of $\R2$ at $(x,y)\ne(0,0)$ are$D_1f(x,y)=\frac{y(y^2-x^2)}{(x^2+y^2)^2} \qquad D_2f(x,y)=\frac{x(x^2-y^2)}{(x^2+y^2)^2}$And since $f$ is equal to 0 everywhere along the $x$ and $y$ axes, they also exist and are equal to 0 at $(0,0)$.

For $x\ne 0$, $f(x,x)=x^2/(x^2+x^2)=1/2$. Since $f(0,0)=0$, $f$ is not continuous along the line $y=x$ at $(0,0)$.

#### Exercise 7

(By analambanomenos) Suppose that $|D_jf|<M$ in $E$, for $j=1,\ldots,n$. Following the hint to mimic the proof of Theorem 8.21, fix $\mathbf x\in E$ and let $\varepsilon>0$. Since $E$ is open, there is an open ball $S\subset E$, with center at $\mathbf x$ and radius $r<(Mn)^{-1}$. Suppose $\mathbf h=\sum h_j\mathbf e_j$, $|\mathbf h|<r$, put $\mathbf v_0=\mathbf 0$, and $\mathbf v_k=h_1\mathbf e_1+\cdots+h_k\mathbf e_k$, for $1\le k\le n$. Then
$$\label{9.7.1}f(\mathbf x+\mathbf h)-f(\mathbf x)=\sum_{j=1}^n\big(f(\mathbf x+\mathbf v_j)-f(\mathbf x+\mathbf v_{j-1})\big).$$Since $| \mathbf v_k|<r$ for $1\le k\le n$ and since $S$ is convex, the segments with endpoints $\mathbf x+\mathbf v_{j-1}$ and $\mathbf x+\mathbf v_j$ lie in $S$. Since $\mathbf v_j=\mathbf v_{j-1}+h_j\mathbf e_j$, the mean value theorem, Theorem 5.10, shows that the $j$th summand in \eqref{9.7.1} is equal to
$h_j(D_jf)(\mathbf x+\mathbf v_{j-1}+\theta_jh_j\mathbf e_j)$ for some $\theta_j\in(0,1)$. By \eqref{9.7.1}, it follows that
\begin{align*}
\big|f(\mathbf x+\mathbf h)-f(\mathbf x)\big| &\le \sum_{j=1}^n\big|f(\mathbf x+\mathbf v_j)-f(\mathbf x+\mathbf v_{j-1})\big| \\
&= \sum_{j=1}^n\big|h_j(D_jf)(\mathbf x+\mathbf v_{j-1}+\theta_jh_j\mathbf e_j)\big| \\
&< \sum_{j=1}^n|h_j|M<(Mn)r<\varepsilon
\end{align*}which shows that $f$ is continuous at $\mathbf x$. Since $\mathbf x\in E$ was arbitrary, we have $f$ continuous on $E$.

#### Exercise 8

(By analambanomenos) You can use Theorem 9.17 to express $f’$ as a sum of the partial derivatives and easily reduce the problem to the the single-variable case, Theorem 5.8. However, I thought I’d use the new definition of derivative (commonly called a Fr\’echet derivative, by the way) instead.

By Exercise 5, there is a $\mathbf y\in\R n$ such that $f’(\mathbf x)=\mathbf y\cdot\mathbf x$. Let $\mathbf h=h\mathbf y/|\mathbf y|$, and take the limit in the definition of derivative as $h$ approaches 0 through positive numbers. Then we get
\begin{align*}
0 &= \lim_{\mathbf h\rightarrow \mathbf 0}\frac{\big|f(\mathbf x+\mathbf h)-f(\mathbf x)-f’(\mathbf x)\mathbf h\big|}{|\mathbf h|} \\
&= \lim_{h\rightarrow 0+}\frac{\big|f(\mathbf x+\mathbf h)-f(\mathbf x)-\mathbf y\cdot(h\mathbf y)/|\mathbf y|\big|}{h|\mathbf y|/|\mathbf y|} \\
&= \lim_{h\rightarrow 0+}\frac{\big|f(\mathbf x+\mathbf h)-f(\mathbf x)-h|\mathbf y|\big|}{h} & \hbox{(since $\mathbf y\cdot\mathbf y=|\mathbf y|^2$)} \\
&= \lim_{h\rightarrow 0+}\frac{f(\mathbf x)-f(\mathbf x+\mathbf h)+h|\mathbf y|}{h} & \hbox{(since $f(\mathbf x+\mathbf h)-f(\mathbf x)$ and $-h|\mathbf y|$ are $\le0$)} \\
&= |\mathbf y| + \lim_{h\rightarrow 0+}\frac{f(\mathbf x)-f(\mathbf x+\mathbf h)}{h}
\end{align*}Since the term in the limit is non-negative for small $h$, this forces $|\mathbf y|\le 0$, or $\mathbf y=\mathbf 0$. Hence $f’(\mathbf x)=0$.

#### Exercise 9

(By analambanomenos) Fix $\mathbf x\in E$. Since $E$ is open, there is a open ball $S\subset E$ containing $\mathbf x$. By the Corollary to Theorem 9.19, $\mathbf f$ is constant on $S$. Hence the set $E’$ of all points $\mathbf z\in E$ such that $\mathbf f(\mathbf z)=\mathbf f(\mathbf x)$ is an open subset of $E$. Similarly, the set $E-E’$ is also open in $E$ (being the union of open sets on which $\mathbf f$ has a constant value not equal to $\mathbf f(\mathbf x)$). By Exercise 2.19(b), $E’$ and $E-E’$ are two separated sets whose union is $E$. Since $E$ is connected, we must have $E’=E$, so $\mathbf f$ is constant on $E$.

#### Exercise 10

(By analambanomenos) Let $E$ satisfy the weaker condition: if $(x,x_2,\ldots,x_n)\in E$ and $(y,x_2,\ldots,x_n)\in E$, then for all $x<z<y$ we have $(z,x_2,\ldots,x_n)\in E$. For such points, define $f_{x_2,\ldots,x_n}(z)=f(z,x_2,\ldots,x_n)$, then $f_{x_2,\ldots,x_n}’(z)=(D_1f)(z,x_2,\ldots,x_n)=0$, so by the Mean Value Theorem $f_{x_2,\ldots,x_n}$ must be constant on $[x,y]$. Hence $f(z,x_2,\ldots,x_n)$ must equal this constant value for all $z$ such that $(z,x_2,\ldots,x_n)\in E$, so that $f(\mathbf x)$ depends only on $x_2,\ldots,x_n$.

To see a counterexample, let $E\subset\R2$ be the square $(x,y)$, $-1<x<1$, $-1<y<1$ less the positive $y$-axis, $(0,y)$, $0<y<1$. Define
$f(x,y)= \begin{cases} 0 & -1<x<1,\;-1<y<0 \\ -y & -1<x<0,\;0\le y<1 \\ y & 0<x<1,\;0\le y<1 \end{cases}$Then $f$ is continuous, $(D_1f)(x,y)=0$ for all $(x,y)\in E$, but the value of $f$ does not depend only on $y$.

#### Exercise 11

(By analambanomenos) We have \begin{align*}
\nabla(fg) &= \sum_{i=1}^n\big(D_i(fg)\big)\mathbf e_i \\
&= \sum_{i=1}^n\big(f(D_ig)+g(D_if)\big)\mathbf e_i \\
&= f\sum_{i=1}^n(D_ig)\mathbf e_i + g\sum_{i=1}^n(D_if)\mathbf e_i \\
&= f\nabla g+g\nabla f \3ex] 0 &= \nabla(1) \\ &= \nabla(f\cdot f^{-1}) \\ &= f\nabla(f^{-1}) + f^{-1}\nabla f \\ f\nabla(f^{-1}) &= -f^{-1}\nabla f \\ \nabla(f^{-1}) &= -f^{-2}\nabla f \end{align*} #### Exercise 12 (By analambanomenos) The range of \mathbf f is a torus with inner radius b-a and outer radius b+a, centered at the origin, whose plane is perpendicular to the z-axis. To see this, the central circle of such a torus is the set of points (b\cos t,b\sin t,0). Then the circle of radius a which intersects the half-plane that goes through the z-axis and the point (b\cos t,b\sin t,0) is the circle centered at that point and perpendicular to the x-y-plane, with radius vector a(\cos t,\sin t,0), which is described by \[(b\cos t,b\sin t,0)+a(\cos t,\sin t, 0)\cos s+ a(0,0,1)\sin s = \big(f_1(s,t),f_2(s,t),f_3(s,t)\big).Note that $\mathbf f$ is a one-to-one mapping of the square $S$ given by $(x,y)$, $0\le x<2\pi$, $0\le y<2\pi$ onto the torus.

(a) Taking the partial derivatives of $f_1$ with respect to $s$ and $t$ to get $\nabla f_1$, we want to solve$(\nabla f_1)(s,t)=\big(-a\sin s\cos t,-(b+a\cos s)\sin t\big)=(0,0).$Restricing ourselves to the square $S$, the first component equals 0 when either $s=0$, $s=\pi$, $t=\pi/2$, or $t=3\pi/2$. Since $b+a\cos s>0$ for all $s$, the second component equals 0 only when $t=0$ or $t=\pi$. Hence $\nabla f_1$ equals $\mathbf 0$ in $S$ only at the four points$(0,0),\quad(0,\pi),\quad(\pi,0),\quad(\pi,\pi),$which map onto the four points$(b+a,0,0),\quad(-b-a,0,0),\quad(b-a,0,0),\quad(a-b,0,0),$respectively.

(b) Taking the partial derivatives of $f_3$ with respect to $s$ and $t$ to get $\nabla f_3$, we want to solve$(\nabla f_3)(s,t)=(a\cos s,0)=(0,0).$which occurs in $S$ at the points $(s,t)$, where $s=\pi/2$ or $s=3\pi/2$, and $0\le t<2\pi$. The points $(\pi/2,t)$, $0\le t<2\pi$, are mapped by $\mathbf f$ to the circle $(b\cos t, b\sin t, a)$, and the points $(3\pi/2,t)$, $0\le t<2\pi$, are mapped to the circle $(b\cos t, b\sin t, -a)$.

(c) At $(b+a,0,0)$, corresponding to $(s,t)=(0,0)$, where $\cos s=\cos t=1$, $f_1$ attains its maximum value, $b+a$, and at $(-b-a,0,0)$, corresponding to $(s,t)=(0,\pi)$, where $\cos s=1$ and $\cos t=-1$, $f_1$ attains its minimum value, $-b-a$. At $(b-a,0,0)$, corresponding to $(s,t)=(\pi,0)$, where $\cos s=-1$ and $\cos t=1$, $f_1$ increases if you fix $t=0$ and vary $s$, and decreases if you fix $s=\pi$ and vary $t$. Similarly, at $(a-b,0,0$, corresponding to $(s,t)=(0,\pi)$, where $\cos s=1$ and $\cos t=-1$, $f_1$ decreases if you fix $t=\pi$ and vary $s$, and increases if you fix $s=\pi$ and vary $t$.

The points $(b\cos t,b\sin t,a)$, $0\le t<2\pi$, correspond to the points $(s,t)=(\pi/2,t)$ where $f_3$ attains its maximum value of $a$, and $(b\cos t,b\sin t,-a)$, $0\le t<2\pi$, correspond to the points $(s,t)=(3\pi/2,t)$ where $f_3$ attains its minimum value of $-a$.

(d) To show that the “irrational winding of the torus” (it even has its own Wikipedia page) is dense, I first show a general proposition about continuous functions. Suppose $F$ is a continuous mapping from $X$ to $Y$ (both metric, or even just topological spaces). Then if $D$ is a dense subset of $X$, then $F(D)$ is a dense subset of $F(Y)$. For if not, then there would be a nonempty open set $G$ in $F(Y)$ disjoint from $F(D)$. Then $F^{-1}(D)$ would be an open subset of $X$ disjoint from $D$, contradicting the density of $D$.

Hence, to show that the image of $\mathbf g$ is dense in the torus $K$, it suffices to show that its preimage under the mapping $\mathbf f$ is dense in $\R2$. Call this set $K’$, it is the set of points of the form$(s+m2\pi,\lambda s+n2\pi),\qquad\hbox{s real, m and n integers}.$First I want to show that the intersection of $K’$ with the $s$-axis is dense on the axis. If $(s,0)$ is a point in this set, then from the above, we that $\lambda s$ is a multiple of $2\pi$, so $s=(n\lambda^{-1}+m)2\pi$ for some integers $m$ and $n$. To see that this set is dense, I first show another general proposition.

If $\alpha$ is an irrational number, then the set of points $D$ in $[0,1]$ which are equivalent to integral multiples of $\alpha$ modulo 1 are dense in that interval. That is, let $n$ be an integer, then $n\alpha$ is in the interval $(m,m+1)$ for some integer $m$, so that $x_n=n\alpha-m$ is between 0 and 1. These points are all distinct, since if $x_{n_1}=n_1\alpha-m_1=x_{n_2}=n_2\alpha-m_2$, for some integers $n_1\ne n_2$, then $\alpha=(m_1-m_2)/(n_2-n_1)$ would be rational. Hence $D$ is an infinite set.

Another simple fact is that if $x_{n_1}<x_{n_2}$ are two points in $D$ then $0<x_{n_2}-x_{n_1}<1$, so that $x_{n_2}-x_{n_1} = (n_2-n_1)\alpha-(m_2-m_1)$ is also in $D$. Also, if $0<jx_n<1$ for some positive integer $j$, then $jx_{n}=jn\alpha-jm$ is also in $D$.

Let $\varepsilon>0$ and let $k$ be an integer large enough so that $k^{-1}<\varepsilon$. Divide $[0,1]$ into $k$ intervals $I_j=\big[jk^{-1},(j+1)k^{-1}\big]\qquad j=0,\ldots,(k-1)$(This isn’t strictly a partition, but I am ignoring the points on the boundaries, which are rational numbers which cannot be in $D$.) Since $D$ is infinite, one of these intervals contains at least two points in $D$, say $x_{n_1}<x_{n_2}$. Then $x_{n_2}-x_{n_1}$ is a point $x_n\in D$ such that $0<x_n<k^{-1}$. Hence each of the intervals $I_j$, $j=0,\ldots,(k-1)$, contains a point $jx_n$ of $D$. If $x\in[0,1]$, then $x$ is in one of the $I_j$, so there is a point $x_n\in D$ such that $|x-x_n|<k^{-1}<\varepsilon$. Hence $D$ is dense in $[0,1]$.

Going back to the intersection of $K’$ with the $s$-axis, it is not hard to see that the intersection of $K’$ with the interval $[0,2\pi]$ is the image of the set $D$ above, with $\alpha=\lambda^{-1}$, under the mapping $s\mapsto 2\pi s$, hence $K’$ is dense in the interval $[0,2\pi]$ in the $s$-axis. Since the other points of $K’$ on the $s$-axis are translates of this dense set by multiples of $2\pi$, we see that $K’$ is dense in the entire axis.

For other lines in $\R2$ parallel to the $s$-axis, $(s,t)\in K’$ if $(s-\lambda^{-1}t,0)\in K’$, that is, the intersection of $K’$ with this line is the image of the dense interesection of $K’$ with the $s$-axis under the translation $(s,0)\mapsto(s+\lambda^{-1}t,t)$. Hence $K’$ is also dense in this line, and so is dense in all of $\R2$.

If $\mathbf g(t_1)=\mathbf g(t_2)$, then $\mathbf f(t_1,\lambda t_1)=\mathbf f(t_2,\lambda t_2)$ which would only happen if $(t_1-t_2)=n2\pi$ and $\lambda(t_1-t_2)=m2\pi$ for some integers $m$ and $n$. But that would imply $\lambda=m/n$ which contradicts the irrationality of $\lambda$.

By Theorem 9.17 we have
\begin{align*}
\mathbf f’(s,t)\mathbf e_1 &= \big((D_1f_1)(s,t),(D_1f_2)(s,t),(D_1f_3)(s,t)\big) \\
&= \big(-a\sin s\cos t,-a\sin s\sin t,a\cos s\big) \\
\mathbf f’(s,t)\mathbf e_2 &= \big((D_2f_1)(s,t),(D_2f_2)(s,t),(D_2f_3)(s,t)\big) \\
&= \big(-(b+a\cos s)\sin t,(b+a\cos s)\cos t,0\big).
\end{align*} If we let ${\boldsymbol\gamma}(t)=(t,\lambda t)$, so that $\boldsymbol\gamma’(t)=\mathbf e_1+\lambda\mathbf e_2$, then we have by the chain rule
\begin{align*}
\mathbf g’(t) &= \mathbf f’\big(\boldsymbol\gamma(t)\big)\boldsymbol\gamma’(t) \\
&= \mathbf f’(t,\lambda t)(\mathbf e_1+\lambda\mathbf e_2) \\
&= \big(-a\sin t\cos\lambda-\lambda(b+a\cos t)\sin\lambda,-a\sin t\sin\lambda t+\lambda(b+a\cos t)\cos\lambda t,a\cos t\big) \\
\big|\mathbf g’(t)\big|^2 &= a^2\sin^2t\cos^2\lambda t+2\lambda a(b+a\cos t)\sin t\cos\lambda t\sin\lambda t+\lambda^2(b+a\cos t)^2\sin^2\lambda t\;+ \\
&\phantom{=}\;\; a^2\sin^2t\sin^2\lambda t-2\lambda a(b+a\cos t)\sin t\sin\lambda t\cos\lambda t+\lambda^2(b+a\cos t)^2\cos^2\lambda t\;+ \\
&\phantom{=}\;\; a^2\cos^2t \\
&= a^2+\lambda^2(b+a\cos t)^2.
\end{align*}

Baby Rudin 数学分析原理完整第九章习题解答


text:
# Factor Analysis¶

kxy.asset_management.factor_analysis.information_adjusted_beta(r, r_m)

Calculates the informmation-adjusted beta.

Note

The standard beta coefficient of an asset or a portfolio is defined by the CAPM model

$r = \alpha + r_f + \beta (r_m-r_f) + \epsilon$

where $$r_f$$ is a deterministic risk-free rate, $$r_m$$ represents market returns, and $$\epsilon$$ an idiosyncratic noise term. It follows that

$\beta = \text{Corr}\left(r, r_m\right) \sqrt{\frac{\mathbb{V}\text{ar}\left(r\right)}{\mathbb{V}\text{ar}\left(r_m\right)}},$

where $$\text{Corr}$$ is Pearson’s correlation coefficient.

The information-adjusted correlation generalizes the foregoing equations and reads

$\text{IA}\beta = \text{IACorr}\left(\{r\}, \{r_m\}\right) \sqrt{\frac{\mathbb{V}\text{ar}\left(r\right)}{\mathbb{V}\text{ar}\left(r_m\right)}}.$

While Pearson’s correlation (and therefore beta) only captures linear relationships between portfolio returns and market returns, the information-adjusted correlation fully captures nonlinear and temporal dependencies between portfolio returns and market returns.

Parameters: r ((n,) or (n,d) np.array) – The array of asset(s) or portfolio(s) returns. r_m ((n,) np.array) – The array of market returns. c – The information-adjusted of the asset or portfolio. float AssertionError – If any returns array is not one-dimensional.


text:
# What is the full list of all font families?

I'm having trouble finding a complete list of the FontFamily strings that Mathematica supports.

• does this How to find out available fonts from within Mathematica? answer your question? – kglr Feb 2 '13 at 3:21
• @kguler. The answer you link to reports all the fonts available to Mathematica on a particular system. That is has many more entries than the list of font families. A font family can contain many fonts. – m_goldberg Feb 2 '13 at 5:14
• @m_goldberg, the image in that answer definitely supports your observation. That image is posted by Szabolcs, and, most likely, it is what you get on a Mac system.) On Windows (Vista) I get a list that has only the font family (not family/slant/weight tuples). – kglr Feb 2 '13 at 5:42
• FontFamily help: "Mathematica will combine settings for FontFamily, FontWeight, FontSlant, FontTracking, and sometimes FontSize to construct a complete name for the font you want. It will then use this name, together with any settings you have specified for FontPostScriptName and FontNativeName to try to locate an appropriate font on your particular computer system." And then there's FontSubstitutions... – cormullion Feb 2 '13 at 9:29

On a Windows system, the solution suggested in this answer

fontlist = FEEvaluate[FEPrivateGetPopupList["MenuListFonts"]]

gives the FontFamilys in the form of rules:

fontlist[[;; 5]]

{"Agency FB" -> "Agency FB", "Aharoni" -> "Aharoni", "Algerian" -> "Algerian", "Amienne" -> "Amienne", "Andalus" -> "Andalus"}

and the list of font families can be obtained by taking the first Parts of the elements in fontlist:

fontlist[[;; 5]][[All,1]]

{"Agency FB", "Aharoni", "Algerian", "Amienne", "Andalus"}

As noted by @m_goldberg in the comments above, one gets tuples of FontFamily, FontWeight and FontSlant on a Mac system. The output is similar to what one gets on a Windows system from the following code:

fontlistMac = Thread[# -> #] &[Join @@ ({#, StringJoin[{#, " ", "Bold"}],
StringJoin[{#, " ", "Italic"}],
StringJoin[{#, " ", "Bold", " ", "Italic"}]} & /@
fontlist[[;; 5]][[All, 1]])];
Panel[%]

So, to get the list of FontFamilys without duplication, one needs to filter the result using something like

DeleteDuplicates[StringTrim@StringReplace[#, "Bold" | "Italic" :> ""] & /@
macFntLst[[All, 1]]]

{"Agency FB", "Aharoni", "Algerian", "Amienne", "Andalus"}

• Interesting, but aren't there lots of duplicates in there? – cormullion Feb 3 '13 at 8:23
• @cormullion, thank you.. updated with corrections. – kglr Feb 3 '13 at 10:01
• It's a good first pass for Mac users, so +1, but it would need many more tweaks and additions to do the job 100% accurately. I can see things like Light, Oblique, Black, Heavy, ExtraBlack, Semibold, Condensed, Regular, Demi, Narrow, Ultra - plus abbreviations of these... A mess... :) – cormullion Feb 3 '13 at 10:17

As of version 10.1 you can use $FontFamilies. From the documentation: $FontFamilies gives the list of the font families available to the Wolfram System.

For me \$FontFamilies yields an accurate representations on the fonts I have installed on my system (v10.3.1 on Win10).


text:
EN FR
• Legal notice
• Accessibility - non conforme
##### COATI - 2013

Research Program
Application Domains
Software and Platforms
Bilateral Contracts and Grants with Industry
Partnerships and Cooperations
Bibliography

## Section: New Results

### Graph Algorithms

Participants : Julio Araújo, Jean-Claude Bermond, David Coudert, Frédéric Havet, Frédéric Giroire, Bi Li, Fatima Zahra Moataz, Christelle Molle-Caillouet, Nicolas Nisse, Ronan Pardo Soares, Stéphane Pérennes.

Coati is also interested in the algorithmic aspects of Graph Theory. In general we try to find the most efficient algorithms to solve various problems of Graph Theory and telecommunication networks. More information on several results presented in this section may be found in R. Soares's thesis [14] .

#### Complexity and Computation of Graph Parameters

We use graph theory to model various network problems. In general we study their complexity and then we investigate the structural properties of graphs that make these problems hard or easy. In particular, we try to find the most efficient algorithms to solve the problems, sometimes focusing on specific graph classes from which the problems are polynomial-time solvable.

##### Parameterized Complexity

Parameterized complexity is a way to deal with intractable computational problems having some parameters that can be relatively small with respect to the input size. This area has been developed extensively during the last decade. More precisely, we consider problems that consist in deciding whether a graph $G$ satisfies some property (i.e., if $G$ belongs to some given family of graphs). For decision problems with input size $n$ and parameter $k$, the goal is to design an algorithm with running time $f\left(k\right).n$, where $f$ depends only on $k$. Problems for which we can find an optimal algorithm with such time complexity are said to be fixed-parameter tractable (FPT). Equivalently, the goal is to design a polynomial-time algorithm (in $k$ and $n$) that computes a pair $\left(H,{k}^{\text{'}}\right)$ where $H$ is a graph (the kernel) with size polynomial in $k$ and $P\left(G\right)\le k$ if and only if $P\left(H\right)\le {k}^{\text{'}}$.

We study the parameterized complexity of the edge-modification problems. Given a graph $G=\left(V,E\right)$ and a positive integer $k$, an edge modification problem for a graph property $\Pi$ consists in deciding whether there exists a set $F$ of pairs of $V$ of size at most $k$ such that the graph $H=\left(V,E\Delta F\right)$ satisfies the property $\Pi$. In [25] , it is proved that parameterized cograph edge-modification problems have cubic vertex kernels whereas polynomial kernels are unlikely to exist for the ${P}_{l}$-free edge-deletion and the ${C}_{l}$-free edge-deletion problems for $l\ge 7$ and $l\ge 4$ respectively.

We also design a unified parameterized algorithm for computing various widths of graphs (such as branched tree-width, branch-width, cut-width, etc.) [60] .

##### Convexity in Graphs

The geodesic convexity of graphs naturally extends the notion of convexity in euclidean metric spaces. A set $S$ of vertices of a graph $G=\left(V,E\right)$ is convex if any vertex on a shortest path between two vertices of $S$ also belongs to $S$. The convex hull of $S\subset V$ is the smallest convex set containing $S$. Finally, a hull set of a graph is a set of vertices whose convex hull is $V$. The hull number of a graph $G$ is the minimum size of a hull set in $G$. In [16] , we prove that computing the hull number is NP-complete in bipartite graphs. We also provide bounds and design various polynomial-time algorithms for this problem in different graph classes such as co-bipartite graphs, ${P}_{4}$-sparse graphs, etc. In [30] , we first show a polynomial-time algorithm to compute the hull number of any ${P}_{5}$-free triangle-free graph. Then, we present four reduction rules based on vertices with the same neighborhood. We use these reduction rules to propose a fixed-parameter tractable algorithm to compute the hull number of any graph $G$, where the parameter is the size of a vertex cover of $G$ or, more generally, its neighborhood diversity. We also use these reductions to characterize the hull number of the lexicographic product of any two graphs.

##### Hyperbolicity

The Gromov hyperbolicity is an important parameter for analyzing complex networks since it expresses how the metric structure of a network looks like a tree. In other words, it provides bounds on the stretch resulting from the embedding of a network topology into a weighted tree. It is therefore used to provide bounds on the expected stretch of greedy-routing algorithms in Internet-like graphs. However, the best known algorithm for computing this parameter has time complexity in $O\left({n}^{3.69}\right)$, which is prohibitive for large-scale graphs. In [36] , we proposed a novel algorithm for determining the hyperbolicity of a graph that is scalable for large graphs. The time complexity of this algorithm is output-sensitive and depends on the shortest-path distances distribution in the graph and on the computed value of the hyperbolicity. Although its worst case time complexity is in $O\left({n}^{4}\right)$, it is in practice much faster than previous proposals as it uses bounds to cut the search space. This algorithm allowed us for computing the hyperbolicity of all maps of the Internet provided by CAIDA and DIMES.

#### Graph searching and applications

Pursuit-evasion encompasses a wide variety of combinatorial problems related to the capture of a fugitive residing in a network by a team of searchers. The goal consists in minimizing the number of searchers required to capture the fugitive in a network and in computing the corresponding capture strategy. We investigated several variants of these games.

##### Variants of graph searching.

We study non-deterministic graph searching where the searchers have to capture an invisible fugitive but can see him a bounded number of times. This variant generalizes the notion of pathwidth and treewidth of graphs. In this setting, we provide a polynomial-time algorithm that approximates the minimum number of searchers needed in trees, up to a factor of two [56] .

In [34] , [61] , we define another variant of graph searching, where searchers have to capture an invisible fugitive with the constraint that no two searchers can occupy the same node simultaneously. This variant seems promising for designing approximation algorithms for computing the pathwidth of graphs. The main contribution in [34] , [61] is the characterization of trees where $k$ searchers are necessary and sufficient to win. Our characterization leads to a polynomial-time algorithm to compute the minimum number of searchers needed in trees.

We also study graph searching in directed graphs. We prove that the graph processing variant is monotone which allows us to show its equivalence with a particular digraph decomposition [47] .

##### Surveillance Game and Fractional Game.

A surprising application of some variant of pursuit-evasion games is the problem for a web-browser to download documents in advance while an internaut is surfing on the Web. In a previous work, we model this problem as a Pursuit-evasion game called Surveillance game. In [40] , [67] , we continue our study of the Surveillance game. We provide some bounds on the connected and online variants of this game. In particular, we show that, in the online variant (when the searchers discover the graph during the game), the best strategy is the trivial one that consists in downloading the document in the neighborhood of the position of the internaut.

In [69] , [48] , [52] , we define a framework generalizing and relaxing many games (including the Surveillance game) where Players use fractions of their token at each turn. We design an algorithm for solving the fractional games. In particular, our algorithm runs in polynomial-time when the length of the game is bounded by 2 (in contrast, computing the surveillance game is NP-hard even when the game is limited to two turns). For some games, we also prove that the fractional variant provides some good approximation. This direction of research seems promising for solving many open problems related to Pursuit-evasion games.

##### Robots in anonymous networks.

Motivated by the understanding of the limits of distributed computing, we consider a recent model of robot-based computing which makes use of identical, memoryless mobile robots placed on nodes of anonymous graphs. The robots operate in Look-Compute-Move cycles that are performed asynchronously for each robot. In particular, we consider various problems such as graph exploration, graph searching and gathering in various graph classes. We provide a new distributed approach which turns out to be very interesting as it neither completely falls into symmetry-breaking nor into symmetry-preserving techniques. We proposed a general approach [38] , [66] to solve the three problems in rings even in case of symmetric initial configurations.


text:
Expii

# Structural Formulas — Overview & Examples - Expii

A structural formula is a visual depiction of a compound or molecule. It shows all of the present atoms, their relative arrangement, and bonds.


text:
Formats
Format
BibTeX
MARC
MARCXML
DublinCore
EndNote
NLM
RefWorks
RIS

### Abstract

Australia is the sixth largest producer of beef and the second largest exporter of beef. Average beef exports from Australia are approximately 65 per cent of the total amount of beef produced, about 1.3 million tonnes. Australia is particularly vulnerable to diseases that are not endemic to the country and could close or disrupt its export markets for beef. In this study, we construct a bioeconomic optimisation model of the Australian beef industry that captures production and consumption decisions, domestically and internationally, and the impacts on the beef industry of a potentially catastrophic disease, foot-and-mouth disease (FMD). This study analyses localised to large-scale outbreaks and suggests that changes in economic surplus because of FMD range from a positive net gain of $57 million to a net loss of$1.7 billion, with impacts on producers and consumers varying depending on the location of the outbreak, control levels and the nature of any trade ban.


text:
IndependenceProblem-class {coin} R Documentation

## Class `"IndependenceProblem"`

### Description

Objects of class `"IndependenceProblem"` represent the data structure corresponding to an independence problem.

### Objects from the Class

Objects can be created by calls of the form

`     new("IndependenceProblem", x, y, block = NULL, weights = NULL, \dots)`

where `x` and `y` are data frames containing the variables X and Y respectively, `block` is an optional factor representing the block structure b and `weights` is an optional integer vector corresponding to the case weights w.

### Slots

`x`:

Object of class `"data.frame"`. The variables `x`.

`y`:

Object of class `"data.frame"`. The variables `y`.

`block`:

Object of class `"factor"`. The block structure.

`weights`:

Object of class `"numeric"`. The case weights.

### Known Subclasses

Class `"IndependenceTestProblem"`, directly.
Class `"SymmetryProblem"`, directly.
Class `"IndependenceLinearStatistic"`, by class `"IndependenceTestProblem"`, distance 2.
Class `"IndependenceTestStatistic"`, by class `"IndependenceTestProblem"`, distance 3.
Class `"MaxTypeIndependenceTestStatistic"`, by class `"IndependenceTestProblem"`, distance 4.
Class `"QuadTypeIndependenceTestStatistic"`, by class `"IndependenceTestProblem"`, distance 4.
Class `"ScalarIndependenceTestStatistic"`, by class `"IndependenceTestProblem"`, distance 4.

### Methods

initialize

`signature(.Object = "IndependenceProblem")`: See the documentation for `initialize` (in package methods) for details.

[Package coin version 1.4-1 Index]