ECOO 2012 Solutions & Materials
Author 
Message 
SamScott

Posted: Wed Dec 05, 2012 10:44 am Post subject: ECOO 2012 Solutions & Materials 


Hi Everyone,
I thought this might be useful for teams practicing for ECOO this year. It's a zip file with all the questions, scoring rules, and data sets from last year, including my notes on recommended solutions. I would be very interested in hearing about alternative strategies for any of the problems!
Sam Scott
ECOO Contest Question Writer
Description: 

Download 
Filename: 
ECOO 2012.zip 
Filesize: 
1.37 MB 
Downloaded: 
830 Time(s) 






Sponsor Sponsor



crossley7

Posted: Wed Dec 05, 2012 5:23 pm Post subject: Re: ECOO 2012 Solutions & Materials 


For round 1 Q3, you can also use vector addition instead of the trig based solution. It made the math much easier to implement. For reference here is my teams code from the contest. Unfortunately in the Ontario curriculum this math is only taught in Grade 12 Vectors which we had been lucky enough to be right in the middle of.
Python: 
from __future__ import print_function
import math
def Round(x,p):
x*=p
x = round(x)
x = (x*1.0)/p
return x
f = open('DATA31.txt')
for q in range (5):
num = f.readline().strip().split()
x = 0
y = 1
p = [int(num[x]),int(num[y])]
j = [0,0]
o = [0,0]
m=[p[x]/2.0,p[y]/2.0]
u = (p[x],p[y])
n = (p[y]*math.sqrt(3.0/4),p[x]*math.sqrt(3.0/4))
j = [m[x]+n[x], m[y]+n[y]]
v = (Round(j[x]p[x],10),Round(j[y]p[y],10))
vI = (Round(v[x],10),Round(v[y],10))
a = (Round(j[x]+u[x],10),Round(j[y]+u[y],10))
print (v, end = ' ')
print(vI ,end = ' ')
print(a, end = ' ')
print('')
f.close()







SamScott

Posted: Wed Dec 05, 2012 9:23 pm Post subject: Re: ECOO 2012 Solutions & Materials 


I`m embarrassed to say I didn`t even think of using vectors  probably because I never got to teach the calculus course, so I default to grade 10 analytic geometry for questions like this! But this is a much better solution if you know vectors. The tricky part is getting point j, but you nailed that using half of vector P plus the height vector for that triangle (the vector perpendicular to P scaled to the right length using the Pythagorean Theorem). Then you`re basically home free (as long as you`re comfortable thinking in vectors, which you clearly were). You also noticed that v and vI are reflections of one another which is great. I`m impressed! The code is really tight, too. The only extra stuff I can see is the use of the vector u (defined to be the same as p) and the initialization of o and j. But that doesn`t matter as long as the math is correct. Great work!
Sam.
crossley7 @ Wed Dec 05, 2012 5:23 pm wrote: For round 1 Q3, you can also use vector addition instead of the trig based solution. It made the math much easier to implement. For reference here is my teams code from the contest. Unfortunately in the Ontario curriculum this math is only taught in Grade 12 Vectors which we had been lucky enough to be right in the middle of.
Python: 
from __future__ import print_function
import math
def Round(x,p):
x*=p
x = round(x)
x = (x*1.0)/p
return x
f = open('DATA31.txt')
for q in range (5):
num = f.readline().strip().split()
x = 0
y = 1
p = [int(num[x]),int(num[y])]
j = [0,0]
o = [0,0]
m=[p[x]/2.0,p[y]/2.0]
u = (p[x],p[y])
n = (p[y]*math.sqrt(3.0/4),p[x]*math.sqrt(3.0/4))
j = [m[x]+n[x], m[y]+n[y]]
v = (Round(j[x]p[x],10),Round(j[y]p[y],10))
vI = (Round(v[x],10),Round(v[y],10))
a = (Round(j[x]+u[x],10),Round(j[y]+u[y],10))
print (v, end = ' ')
print(vI ,end = ' ')
print(a, end = ' ')
print('')
f.close()







crossley7

Posted: Thu Dec 06, 2012 12:56 am Post subject: RE:ECOO 2012 Solutions & Materials 


I actually haven't looked at the code in months but remembered we had an elegant solution. I believe we did for the graph type problem in round 2 as well (the airplane one) but not sure exactly.
since x and y are not the same, p and u are different. I believe most of the other initializations are leftover from earlier attempts at a solution that we found problems in. It took a while and a lot of paper to find the solution since we know a clean vector solution existed but it was slightly hidden. We also had a hatred of trig and so avoided it wherever possible during that contest season.
Beyond that I can't remember the details of the solution (I can read python but don't code it. That was the work of my teammates)







