Hacker News new | ask | show | jobs
by b0b0b0b 4534 days ago
I love project euler, but I've come to the realization that its purpose is to beat programmers soundly about the head and neck with a big math stick. At work last week, we were working on project euler at lunch, and had the one CS PhD in our midst not jumped up and explained the chinese remainder theorem to us, we wouldn't have had a chance.
5 comments

I feel the same way. It was presented to me as a great way to learn new programming languages. But really it's challenging your ability to design algorithms, and overwhelmingly mathematics-related algorithms. (I'm not saying the site itself claims anything different).

It doesn't heavily challenge you to advance past a most basic level of a programming language. For example, most Project Euler problems are solved in Java most efficiently by using the features of Java that map 1:1 to features in C. You could do pretty much the entire suite of problems without even understanding the motivation of a language like Java.

I did find it better as a tool for learning functional programming languages (like Haskell) however, perhaps unsurprisingly.

"most efficiently"

Stop doing that and its a lot more fun. It annoys me when a PE problem is specifically designed to make it impossible if you do it the "wrong" way. Most PE problems allow crazy solution strategies. The bad ones only have the one true way that is computationally feasible.

A few posts up someone liked problem 267. I would pick random numbers, run them, then keep the winner and make n-1 new random numbers for round 2 and keep running rounds of multiple threads until bored, remembering the best result so far. Yes, that is not a very smart way to solve the problem, but its a very fun way to exercise the heck out of your knowledge of threads in some new language. Or you could make an insane thousand thread pipeline and hope for convergence. Or a thousand processes on a parallel cluster pipelined together. Could I write my random processor using BASH to baby sit a bunch of octave instances? Newtons method at least at first glance would be too easy. Could I solve it graphically, literally, by graphing some results and doing image manipulation and analysis of the generated graphic file to obtain the numerical result and feeding back for more "zoom" detail? Totally ridiculous unless the whole point is some weird computer vision project. Given an emulator for a IBM1620 mini-mainframe from the 60s, could I write a perl script that output random Fortran-II test runs for the emulated mini-mainframe to compile and process and then another perl script to eat the virtual "printer" output of the mini-mainframe to get random run results? Problem 267 looks like a fun one to solve the wrong way.

This is the unfortunate part of PE becoming popular at interviews. First of all it surely has nothing remotely to do with almost all programming jobs, secondly, "having fun while doing crazy things" is probably not the ideal IT department mission statement or employee selection criteria (although it would explain some things I've seen over the years...)

The proper tool for 99% or so of PE problems isn't a programming language anyway, its octave/mathematica/parigp. So its not too far out of the spirit to try crazy stuff.

I've been using it to learn Python, and to your point, frequently thought "this would be much easier to do recursively"
What we need now is more focus towards females. Men are already sufficiently saturated in the maths/CS fields. What we need is to market the idea of maths as fun to more females.
And midgets. I'm really disappointed that Project Euler doesn't do more to motivate the vertically-challenged to excel in STEM fields.
As a woman, I would definitely use Project Euler more often if they came out with a pink version that was smaller and more ergonomic to suit my soft, feminine hands.
As a man with relatively small hands, I believe Project Euler should also have a smaller blue version that's more comfortable for me to use.
As a female math grad and CS postgrad, I would like to say firstly that you have successfully trolled me. I do hereby take your bait.

Now for the points I would like to make, primarily for the benefit of the few who actually think as you claim to think:

Women are actually similar to men in a number of novel ways.

We have eyes, and those eyes are intricately connected to very powerful and compact organic computers—capable of independent thought—called brains.

That's right, men and women can both have brains.

And those of us women fortunate enough to be blessed with brains are quite capable not only of independent thoughts, but even decision-making. And yet another way in which we women are similar to men is that each of us, as individuals, comes to have certain aptitudes, preferences and values.

Some of us, like myself, discover to their amazement that they can understand mathematics and even think mathematically about pretty much anything, and develop an interest in technology and computation because of the possibilities it opens up for mathematics and because of the ways mathematics can reflexively provide insights into computer science and programming.

Other women have an aptitude/preference for: polishing nails; answering telephones; designing cute little things that men can give to women at Christmas; and so on. Are women like myself a minority? Perhaps, but it isn't because we have to be shown things like maths and programming with striking adverts, responsive websites and pretty flyers.

I'm not going to pretend that society has been engineered into a patriarchy, over thousands of years, as part of a sinister plot by the Illuminati to preclude the success and independence of the children of the mother-goddess.

I'm likewise not going to pretend to think that there are men with power who purposefully keep women from rising up, or give preferential treatment to male candidates for scholarships/whatever without even realising it. Because ultimately I have no proof of such things and neither do I care about some male-dominant society, because in my experience, what matters is the talent; if you have it, if you have an original idea, a way how to implement it, or if you're simply the best at what you do, you will succeed if you want to, male or female. I do not care why my boss, my clients or my investors choose me, I just want the opportunity to do what I do best, what I like doing.

If you think women simply haven't been exposed to the magical and fun possibilities of mathematics and computers, think again. If women were ignorant to these fields and what they involve, they wouldn't laugh at you for being a "nerd" or date muscular/rich guys instead of you.

They know what maths is, and they know what programming is, and they'll never want to visit a forum and tell everyone how awesome it was when they elegantly solved some mathematical problems or came up with a new proof for some random theorem. They will on the contrary yearn to talk about shoes, interior design, literature, art, perfume, TV shows, movies, diets and so on.

The select few women who prefer mathematics/compsci and find it genuinely fun and inspiring were already posting on newsgroups, were already on IRC, were already subscribed to ars technica and slashdot on google reader, were already here; and they are already here; or they will be here in the future, or wherever else that such subjects can be discussed in the future.

It is not a case of marketing the idea to a mass of women who have no idea what makes their iPhone so useful, or how their cars' brakes are engineered. Women do not go to fashion forums and tell everyone about how much I wish I could expose men to the glories of haute couture. Women do not tell their nutritionists how much they wish they could entice their male friends with raw food diets and veganism.

There are the lost, unwashed masses who will never amount to anything, who will become a carbon copy of their parents and aspire to nothing beyond some repetition-of-basic-tasks job in an office or in retail, and the members of these masses are of both genders. You will fail to "market" math/compsci to these people, regardless of gender, because they cannot do it. Women who aspire to something and want to succeed do not generally want to do it with math and programming.

So, to all of you who think women need to have math/compsci marketed to them: kindly stop talking crap and just ignore the gender issue. It doesn't do you any credit. Women are here. We don't typically scream that we're women because why should we? We're just professionals or students trying to succeed and learn, no different to you gents.

If you want to encourage women to get into math/compsci, have a daughter and buy her a cheap laptop and "The C Programming Language" when she's young. If she takes to it, bang, she had an aptitude that would have gone unnoticed and you saved her from a life of instagram and film studies.

If she deletes some system folders she doesn't think she needs, watches make-up tutorials on youtube and checks facebook every 2 hours, you know you've got yourself a typical woman.

Protip: I don't think the statistics of how many women study math/compsci will be much different in the aforementioned compsci-introduced generation of daughters.

Seems like you're promoting some myths as well.

Kids don't magically decide that math or science or computer programming is fun. They're heavily influenced by what they're exposed to and what they see other people they respect doing. Yes, that's "marketing" or perhaps better call it education.

And no, giving a kid the "C programming language" isn't going to cut it unless they've previously had enough exposure to math or engineering to understand why it's interesting. (Based on what I've heard, Minecraft seems to be working a lot better.)

Okay, perhaps I am being subjective. I got into this stuff on my own, maybe exposure makes a difference for some. But let's face it, there's no objective reason why math/compsci/engineering should be interesting even after you understand it. It's not like you can just explain it x many times and suddenly a girl will be like "wow it's so amazing and deep and clever." You and I may appreciate it, but can you say why? Can you give me the fundamental reason why it should be interesting as a matter of fact? Besides, we're in the 21st century. Girls can expose themselves to whatever they want. I don't think programming and calculus are terribly obscure.
I'm not sure calculus is a great example for your argument. How many kids do you think would actually learn calculus on their own? It's something that most kids think is way beyond them and they don't even know what it is (other than a kind of math) until they actually study it in school.

And that's a standard subject taught in high school. I think if instead you look at why kids learn music or art or dance or drama or sports or a foreign language or religion, you'll find that the parents and relatives and friends often (not always) have a lot to do with it. And even with parental support, often the kids decide it's not for them. And that's fine; at least they got the chance.

I don't see computer programming as being all that different; not every kid is going to be into any given activity, but if they're not exposed to it in a way that makes it seem interesting, that's going to drastically reduce the number of kids who even try it. And that exposure is going to vary pretty dramatically depending on where you grew up.

>Kids don't magically decide that math or science or computer programming is fun

Yeah, they do. That's why it is so important to expose kids to lots of things. You never know what is going to capture their imagination.

Hey, wanda, you got quenlinlom's remark totally wrong. He doesn't really want to saturate female's lives with more math and CS. He wants his math/CS life saturated with more females.
He's hanging out with the wrong mathematicians. Or the ladies have, um, made a judgment, and don't want to intimidate him by their superior STEM achievements.

CS is a sausage fest as we all know here on HN. What most HN readers don't know is around 46% to 48% of all math undergrad degrees in the USA have gone to women since the early 80s.

You can read some hilarious articles online about the "crisis" that women have declined to a mere 45% in some years. I make fun of it because my EE classes had zero female grads, everyone knows CS is a sausagefest, why I remember a decade ago in an advanced C++ class I got to work with "the" girl in the class, all true stories, but if there's one thing not to fret about, its that an office staffed by recent math grads (McDonalds? Applebees?) would have either 10 of each or at worst 11 men to 9 women, hardly a staggering imbalance like you see in CS/IT.

The disconnect may be a result of what schools people are familiar with. At (Carnegie Classification) Research I universities men make up 64% of math and stats majors, whereas at Masters I there is almost parity. These university types are #1 (~8000) and #2 (~6000).

Still even 64% is hardly EE at Research I (85% male), so your overall point stands.

Indeed. I'm a math major, and the ratio of men to women is quite healthy.
Given that you've got some emotional disposition against "feminists" and "liberals" [1], I don't think I'm going to buy your implicit effort to try to represent women. There are plenty of women who believe gender is an issue worth thinking about, whereas you seem to have no problem telling people to just "ignore" it because you're personally comfortable ignoring it.

I don't think marketing tech to women or girls is "the solution" either, but I don't make every effort to steer other men away from thinking about it and slur people for trying. That's intellectually malicious.

A part of me doesn't actually believe you're a woman, given how many men put effort into anonymously impersonating women in political debates, but I lean toward believing you

[1] https://news.ycombinator.com/item?id=7041037

  there are plenty of women who think gender is an issue
Women being paid less for the same job is an issue. Sexual harassment is an issue. Women treated as secondary when it comes to promotions/scholarships is an issue. Gender is not an issue and I just dislike the implication that women cannot find their way into tech if they want to. Are we concerned that the infantry isn't 50:50 men:women? Not bloody likely.

If you think me bitter, you're wrong. I am just tired of the trend to think of women as people with "special needs". I am perhaps concerned with gender more, after all.

Holy shit, that was fucking incredible. This comment made my day. Incredibly humorous and well written response.
I like that Project Euler encourages me to learn more math.
I remember doing the Heighway Dragon one (somewhere in the 200s). Took me quite a while to write code efficient enough to finish in well under a minute. Then I get to the forums, and it's a simple combinatorics question you can solve instantly. It certainly inspires me to learn more maths.
I have to agree that the math is a bit too much. If you feel like doing algorithms / data structures work, though, perhaps leetcode will appeal to you: http://oj.leetcode.com/
I liked the sound of leetcode, but I see the way to answer is with code (C++/Java) instead of a value answer. That ruins it for me.

I want to play with new programming languages, and see if the output is correct while I'm at it.

That's true. Another one mentioned in this thread is hackerrank: https://www.hackerrank.com/ - this one offers way more languages, except for rust, the one I'm actually learning :(
I saw that and just registered/tried.

Although it has Clojure (my target language), you still send code instead of an answer, and you get problems like not knowing what's available in terms of libs and whatnot.

This link may be helpful: https://www.hackerrank.com/environment

Also, you can usually find information about that kind of stuff in their IRC or even e-mail. They are usually pretty responsive.

> had the one CS PhD in our midst not jumped up and explained the chinese remainder theorem to us, we wouldn't have had a chance.

I never had a PhD near by to get help from, but many problems involved doing research online about a theorem, sequence or some sort of mathematical concept.