Archive for Paris

Wagram, morne plaine!

Posted in Books, Kids, pictures, Running with tags , , , , , , , , on November 20, 2020 by xi'an

Avenue de Wagram is one of the avenues leaving from Arc de Triomphe in Paris, named after a (bloody) Napoléonic battle (1809). This is also where I locked my bike today before joining my son for a quick lunch and where I found my back wheel completely dismantled when I came back!  Not only the wheel had been removed from the frame, but the axle had been taken away, damaging the ball bearing… After much cursing, I looked around for the different pieces and remounted the wheel on the bike. The return home to the local repair shop was slower than usual as the wheel was acting as a constant brake. I am somewhat bemused at this happening in the middle of the day, on a rather busy street and at the motivation for it. Disgruntled third year student furious with the mid-term exam? Unhappy author after a Biometrika rejection?

Not a great week for biking since I also crashed last weekend on my way back from the farmers’ market when my pannier full of vegetables got caught in between the spokes. Nothing broken, apart from a few scratches and my cell phone screen… [Note: the title is stolen from Hugo’s Waterloo! Morne plaine!, a terrible and endless poem about the ultimate battle of Napoléon in 1815. With a tenth of the deaths at Wagram… Unsurprisingly, no Avenue de Waterloo leaves from Arc de Triomphe! ]

Le Monde puzzle [#1164]

Posted in Books, Kids, R with tags , , , , , , , , , , , , , on November 16, 2020 by xi'an

The weekly puzzle from Le Monde is quite similar to older Diophantine episodes (I find myself impossible to point out):

Give the maximum integer that cannot be written as 105x+30y+14z. Same question for 105x+70y+42z+30w.

These are indeed Diophantine equations and the existence of a solution is linked with Bézout’s Lemma. Take the first equation. Since 105 and 30 have a greatest common divisor equal to 3×5=15, there exists a pair (x⁰,y⁰) such that

105 x⁰ + 30 y⁰ = 15

hence a solution to every equation of the form

105 x + 30 y = 15 a

for any relative integer a. Similarly, since 14 and 15 are co-prime,

there exists a pair (a⁰,b⁰) such that

15 a⁰ + 14 b⁰ = 1

hence a solution to every equation of the form

15 a⁰ + 14 b⁰ = c

for every relative integer c. Meaning 105x+30y+14z=c can be solved in all cases. The same result applies to the second equation. Since algorithms for Bézout’s decomposition are readily available, there is little point in writing an R code..! However, the original question must impose the coefficients to be positive, which of course kills the Bézout’s identity argument. Stack Exchange provides the answer as the linear Diophantine problem of Frobenius! While there is no universal solution for three and more base integers, Mathematica enjoys a FrobeniusNumber solver. Producing 271 and 383 as the largest non-representable integers. Also found by my R code

o=function(i,e,x){
  if((a<-sum(!!i))==sum(!!e))sol=(sum(i*e)==x) else{sol=0
    for(j in 0:(x/e[a+1]))sol=max(sol,o(c(i,j),e,x))}
  sol}
a=(min(e)-1)*(max(e)-1)#upper bound
M=b=((l<-length(e)-1)*prod(e))^(1/l)-sum(e)#lower bound
for(x in a:b){sol=0
for(i in 0:(x/e[1]))sol=max(sol,o(i,e,x))
M=max(M,x*!sol)}

(And this led me to recover the earlier ‘Og entry on the coin problem! As of last November.) The published solution does not bring any useful light as to why 383 is the solution, except for demonstrating that 383 is non-representable and any larger integer is representable.

maison Poincaré

Posted in Travel, University life with tags , , , , , , , , on November 15, 2020 by xi'an

in memoriam

Posted in Kids, pictures, Travel, Wines with tags , , on November 13, 2020 by xi'an

Le Monde puzzle [#1158]

Posted in Books, Kids, R with tags , , , , , on November 10, 2020 by xi'an

A weekly puzzle from Le Monde on umbrella sharing:

Four friends, Antsa, Cyprien, Domoina and Fy, are leaving school to return to their common housing. It is raining and they only have one umbrella with only room for two. Given walking times, x¹, x², x³ and x⁴, find the fastest time by which all of the four will be home, assuming they all agree to come back with the umbrella if need be.

A recursive R function produces the solution

bez=function(starz=rexp(4),finiz=rep(0,4),rtrn=F){
  if((!rtrn)&(sum(starz>0)==2)){return(max(starz))
    }else{
      tim=1e6
      if(rtrn){
        for(i in (1:4)[finiz>0]){
          nstart=starz;nstart[i]=finiz[i]
          nfini=finiz;nfini[i]=0
          targ=finiz[i]+bez(nstart,nfini,FALSE)
          if(targ<tim){tim=targ}} 
          }else{
          for(i in (1:4)[starz>0])
          for(j in (1:4)[starz>0]){
            if(i!=j){
              nstar=starz;nstar[i]=nstar[j]=0
              nfini=finiz;nfini[i]=starz[i];nfini[j]=starz[j]
              targ=max(starz[i],starz[j])+bez(nstar,nfini,TRUE)
              if (targ<tim){tim=targ}
            }}}
      return(tim)}

which gives for instance

> bez()
[1] 3.297975
> bez(1:4)
[1] 11
> bez(rep(3,4))
[1] 15