-----------------------------------
SamScott
Wed Dec 05, 2012 10:44 am
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
-----------------------------------
crossley7
Wed Dec 05, 2012 5:23 pm
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.
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 =
-----------------------------------
SamScott
Wed Dec 05, 2012 9:23 pm
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.
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.
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 = :D
-----------------------------------
crossley7
Thu Dec 06, 2012 12:56 am
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)