
Archive for primary school
mentalité de petite instit’ bornée [bienvenue à l’Académie!]
Posted in Books, Kids with tags Académie française, Alain Fournier, Albert Camus, France Inter, hussards de la République, interview, Libé, linguistics, Louis Ferdinand Céline, Marcel Pagnol, misogyny, primary school, sexism, tribune on December 23, 2025 by xi'an
another viral math puzzle
Posted in Books, Kids, R, University life with tags data.frame, mathematical puzzle, permutation, primary school, Singapore, The Guardian, The New York Times, Vietnam on May 25, 2015 by xi'an
After the Singapore Maths Olympiad birthday problem that went viral, here is a Vietnamese primary school puzzle that made the frontline in The Guardian. The question is: Fill the empty slots with all integers from 1 to 9 for the equality to hold. In other words, find a,b,c,d,e,f,g,h,i such that
a+13xb:c+d+12xe–f-11+gxh:i-10=66.
With presumably the operation ordering corresponding to
a+(13xb:c)+d+(12xe)–f-11+(gxh:i)-10=66
although this is not specified in the question. Which amounts to
a+(13xb:c)+d+(12xe)–f+(gxh:i)=87
and implies that c divides b and i divides gxh. Rather than pursing this analytical quest further, I resorted to R coding, checking by brute force whether or not a given sequence was working.
[sourcecode language=”r” gutter=”false”]
baoloc=function(ord=sample(1:9)){
if (ord[1]+(13*ord[2]/ord[3])+ord[4]+
12*ord[5]-ord[6]-11+(ord[7]*ord[8]/
ord[9])-10==66) return(ord)}
[/sourcecode]
I then applied this function to all permutations of {1,…,9} [with the help of the perm(combinat) R function] and found the 128 distinct solutions. Including some for which b:c is not an integer. (Not of this obviously gives a hint as to how a 8-year old could solve the puzzle.)
As pointed out in a comment below, using the test == on scalars is a bad idea—once realising some fractions may be other than integers—and I should thus replace the equality with an alternative that bypasses divisions,
[sourcecode language=”r” gutter=”false”]
baoloc=function(ord=sample(1:9)){
return(((ord[1]+ord[4]+12*ord[5]-ord[6]-87)*
ord[3]*ord[9]+13*ord[2]*ord[9]+
ord[3]*ord[7]*ord[8]==0)*ord)}
[/sourcecode]
leading to the overall R code
[sourcecode language=”r” gutter=”false”]
sol=NULL
perms=as.matrix(data.frame(permutations(9)),ncol=9,byrow=TRUE)
for (t in 1:factorial(9)){
a=baoloc(perms[t,])
if (a[1]>0) sol=rbind(sol,a)}
sol=sol[do.call(order, as.data.frame(sol)),]
[/sourcecode]
and returning the 136 different solutions…