Archive for summer

Avernian posts

Posted in Mountains, pictures, Running, Travel with tags , , , , , , , , , , on August 31, 2014 by xi'an

post3post2post1

Boston sunrise

Posted in pictures, Travel with tags , , , , , , on August 7, 2014 by xi'an

sommerville

impressions, soleil couchant (#2)

Posted in pictures, Travel with tags , , , , , , , on July 12, 2014 by xi'an

impression4impression9impressio11impression6

sunrise over Warwickshire (#2)

Posted in pictures, Running, Travel, University life with tags , , , , , on July 4, 2014 by xi'an

UWpond

back in Warwick

Posted in pictures, Running, Travel, University life with tags , , , on July 2, 2014 by xi'an

sunset

Posted in pictures with tags , , , , , on June 21, 2014 by xi'an

sunset1sunset2
sunset3sunset4

Le Monde puzzle [#825]

Posted in Books, Kids, R with tags , , , , , on July 21, 2013 by xi'an

The current puzzle is the last one before the summer break and not exciting enough to take along:

Take the first ten digits, create five pairs out of those, and for each pair (x,y) derive the quantity (min(x,y)+1.5max(x,y)). What is the collection of pairs that maximises the product of those quantities?

I wrote the following R code in the train back from Annecy:

res=0
bonus=1.5
for (t in 1:1000){
x=matrix(sample(1:10),ncol=2)
mix=apply(x,1,min);mox=apply(x,1,max)
rex=prod(mix+bonus*mox)
if (rex>res){
  print(x)
  res=rex}
}

and got:

     [,1] [,2]
[1,]    4    7
[2,]    5    6
[3,]    8    3
[4,]    2    9
[5,]    1   10

Thus the sum of the pairs is always equal to 11. And by changing bonus you can check this is true for all values of the coefficient that are larger than one (one included).

Follow

Get every new post delivered to your Inbox.

Join 634 other followers