Or am I falling victim to the effect where everything I know how to do looks easy?
Or am I falling victim to the effect where everything I know how to do looks easy?
...am I falling victim to the effect where everything I
know how to do looks easy?
You could try it and find out. :-) I ended up using a third-party library which implements an algorithm I hadn't heard of before. (My response to the challenge is below, with the useful hints X'd out.) Hi, guys. This is not a gungho-serious job application, though I have
been sniffing around machine learning/coding jobs for a long time and
could be persuaded in the right circumstances. I saw justin_vanw
mention your Code Challenge on HN and decided to give it a go for fun.
Didn't realize when I started that the upload mechanism at Code Eval
assumes a single file, so I am mailing it to you for evaluation,
instead. I must admit, I don't have much formal algorithms training,
but after about an hour's thought I just googled "XXX," and the XXX
algorithm happened to be the top of the list. I have a PhD in Applied
Mathematics from MIT, and I have been focusing on Bayesian Data
Analysis in Computational Biology, so maybe it was just a lucky
search-engine hit. But in general, I am a reasonably quick study. My
solution is at <http://XXX>, and is tested on python 2.6.5 with scipy
0.7.0. Untar the download, go into the XXX directory, run "sudo make
pyinstall" (I had to add -fPIC to Makefile's CFLAGS assignment to make
this work), and then the solution program is in
milo-challenge/solution.py:
met% python solution.py < test-input.txt 2> /dev/null
XXX
XXX
BTW, XXX is a C implementation of the XXX algorithm from <http://XXX>,
and is the reason I couldn't easily go through the Code Eval framework.
It sends some garbage to stderr, which I haven't bothered to clean up.I hope that's not too much of a hint, but anyone who can figure it out from that was probably a good candidate, anyhow.
I should also mention that I did code a solution in Perl, or at least most of one, though I did not submit it. I have a grandmother to care for and that limits me on relocating, even though I would be interested in finding more interesting work.
Assuming I don't eventually go crazy in a futile attempt to explain to corporate that methods which turn a 9/2272 inch rounding error into a piece of glass that's half an inch too big do not qualify as "validation."
I wish you well in caring for your grandmother. That stuff is way more important than programming techniques.
I did have the fun of coding up the algorithm I saw on HN a while back, though, so it was fun.
Seems like I should have been doing it as an A problem, where you can just use the H algorithm. So I want to say thanks to the guys who posted the challenge: it was a good excuse to teach myself some combinatorial algorithms.
Lest anyone wonder, I'm using those weird abbreviations so as not to spoil the problem. Figuring out which algorithms to use is half the fun and I read about quite a few different types of problems before figuring out which was the most suitable. I'd hate to deny anyone else the same learning experience.
For example:
1. "Your task..." is not directly correlated to the outputs requested. 2. Item 3 in the SS ranking isn't clear. Specifically, "besides 1" could mean "besides 1" literally, or "besides 1" - where "1" means "one of the above," or even something else.
I was about to attempt to do it, just for fun, but then decided against it because the challenge itself had too much ambiguity in the requirements. That's very likely intentional - but since I'm not looking for a job, didn't need to waste my time playing "a game!" Maybe the successful answer rests in seeking/understanding the real requirements???
'3. If the number of letters in the product's name shares any common factors (besides 1) with the number of letters in the customer's name then the SS is multiplied by 1.5.'
To me, this says that if len(pname) is split into prime factors, and at least one of those is found in the list of prime factors for len(cname), then you multiply your SS by 1.5. The "besides 1" remark is obvious, because 1 is technically a factor for every number. I'm not quite sure how the math pedants come down on that, but this is just common sense.
Negative or positive shouldn't really affect this (I guess it could be construed as "-1" instead of "1" in the factor list, but.. you've really got to bend over backward to make that into a problem), and it's completely not ambiguous. The "besides 1" could not reasonably be taken to mean "besides the first statement", as the two statements deal with very different subject matter.
Am I crazy here? Did I miss something?
Oddly enough, I think that the algorithm you need here was also on HN a while back.
As we're entirely just discussing the spec, and not the secret hidden hardness of this problem, could you tell me what I missed? If you're concerned for their confidentiality, then email it to me at carss.w@gmail.com
Disclosure: I'm not planning to apply to this job or to complete this challenge, because I have other things to program for fun, and an internship / school to keep me busy. I'm strictly curious about our different interpretations of what seems (to me) like an unambiguous spec, and I'm prepared to be totally wrong on my reading of it.
And yes, even it was discussed on HN recently.
FWIW, I looked at the problem differently - I interpreted "factors" completely the wrong way. I'm humble enough to say that my bad interpretation is based on my own lack of education in mathematics. I have none! Zero, outside of what you get in high school. I'm definitely not the low-level algorithm guy. My lack of math skills has not held me back professionally, but I get healthy doses of humility, like this, on occasion. "One day" I want to go back and study math and see what I've been missing all these years.
I wanted to give you the respect of a reply since you took the time to comment.