My Evil Boy Outthinks me. [brag thread]

Page 1 of 2 [ 18 posts ]  Go to page 1, 2  Next

EvilTeach
Pileated woodpecker
Pileated woodpecker

User avatar

Joined: 14 Mar 2007
Gender: Male
Posts: 196

17 Dec 2008, 6:32 pm

EvilBoy and I have been doing a tiny bit of programming. We have been attacking the problems at
http://projecteuler.net/

It's a cool geeky kind of site, that presents math challenges, which can often be solved by programming.

We print out one of the challenges, and talk about it, discussion various approaches to finding a solution. I have loaded up Code::Blocks on his machine, as it is a very reasonable c++ ide, at a very low cost.

Anyway Monday was the band concert at school, and we all had to go, including my boy. Loud noises, and a lot of people is not a good recipe for success, so as a preemptive measure, I brought along our current challenge.
http://projecteuler.net/index.php?section=problems&id=5

That was just the ticket as we were there early to get good seats.

Digging into the issue, I asked him how he might code a solution, and he pointed out that writing a loop from 1 to 20!, and using the modulus operator to see if it was evenly divisible by each of the numbers would work.

That was what I was looking for, so I asked another question. Can we do anything to speed it up? He responded, that really you don't need to divide by all of the numbers from 1 to 20. I grinned to myself as this was exactly what I was hoping he would see. I chimed in... oh yes. you can eliminate 20 from the tests, as if it is divisible by 2 and 10, then it must be divisible by 20. He didn't like that view point, and we started to butt heads a bit about it. Then he explained it to me....

If a number is divisible by 20, then you don't have to check 2 and 10. That is less work to be done. In fact, you don't have to check 4 and 5 then. That is even less work.

I wrote down the numbers 1 .. 20, and we started crossing stuff out.

20 -> 2, 10, 4, 5
19 -> prime
18 -> 3, 6, 2, 9
17 -> prime
16 -> 2,4,8
15 -> 3,5
14 -> 2,7
13 -> prime
12 -> 2,6, 3, 4
11 -> prime

so checking 11 to 20 would do the job correctly.
But wait there is more.

He observed that the number had to include all the primes, so

19*17*13*11 is the smallest number it could be, but the other numbers had to be taken into account. He told me to prime factor the non prime ones.

20 -> 2, 2, 5
18 -> 2, 3, 3
16 -> 2, 2, 2, 2
15 -> 3, 5
14 -> 2, 7
12 -> 2, 2, 3

next he asked me which of those had the largest group of 2s. (16 has 4 of them)
3s? (18 has 2)
5s? (20 has 1)
7s? (14 has 1)

so he claimed that

19 * 17 * 13 * 11 * 2*2*2*2 * 3*3 * 5 * 7 is the answer.
that works out to 232,792,560.

At home he popped the value into the web page, and we have one more problem solved.
He did it analytically, without a program.

The next one has to do with prime numbers. It should be easy.
http://projecteuler.net/index.php?section=problems&id=7


The music was very loud, so I popped open my box of ear plugs, and he and I and Mom sat through it ok.
Afterward we went out for ice cream and coffee and pie.

It was a very nice night all in all.



lelia
Veteran
Veteran

User avatar

Joined: 11 Apr 2007
Age: 71
Gender: Female
Posts: 2,897
Location: Vancouver not BC, Washington not DC

17 Dec 2008, 8:01 pm

What a great story!



Mage
Veteran
Veteran

User avatar

Joined: 10 Oct 2006
Age: 44
Gender: Female
Posts: 1,054

18 Dec 2008, 11:17 am

Yep, I'll have a joyful tear in my eye the day my boy beats me at tower defense.



MomofTom
Veteran
Veteran

User avatar

Joined: 5 Aug 2006
Age: 48
Gender: Female
Posts: 621
Location: Where normalcy and bad puns collide

18 Dec 2008, 12:38 pm

Mage wrote:
Yep, I'll have a joyful tear in my eye the day my boy beats me at tower defense.


OMG, that's my husband and our son. :lol:


_________________
Apathy is a dominant gene. Mutate.


release_the_bats
Veteran
Veteran

User avatar

Joined: 13 Jul 2008
Gender: Female
Posts: 1,033

18 Dec 2008, 12:42 pm

That sounds like fun!



DW_a_mom
Veteran
Veteran

User avatar

Joined: 22 Feb 2008
Gender: Female
Posts: 13,687
Location: Northern California

18 Dec 2008, 1:47 pm

I have no idea what you are talking about with the programming (OK, I COULD figure it out, I suppose, but it just isn't up my alley) BUT I am so glad that you and your son are having fun together.

Kids out think us all the time, I've noticed. They are still living in the intellectual world more than the practical one, like I have to. All that practical thinking constricts the brain or something ;)


_________________
Mom to an amazing young adult AS son, plus an also amazing non-AS daughter. Most likely part of the "Broader Autism Phenotype" (some traits).


EvilTeach
Pileated woodpecker
Pileated woodpecker

User avatar

Joined: 14 Mar 2007
Gender: Male
Posts: 196

18 Dec 2008, 3:14 pm

Mage wrote:
Yep, I'll have a joyful tear in my eye the day my boy beats me at tower defense.


For me and the boy it was the other way around.
Now we only play cooperative games.

Warcraft 3.
I'm a power towers addict.



DwightF
Sea Gull
Sea Gull

User avatar

Joined: 7 Dec 2008
Age: 56
Gender: Male
Posts: 224

18 Dec 2008, 5:25 pm

EvilTeach wrote:
so he claimed that

19 * 17 * 13 * 11 * 2*2*2*2 * 3*3 * 5 * 7 is the answer.
that works out to 232,792,560.

At home he popped the value into the web page, and we have one more problem solved.
He did it analytically, without a program.

Nice reasoning (on his part ;) ). Excellent work on your part encouraging him to push further. How old is he?

It would be interesting to see how he'd approach you raising the bar from "1 through 20" to say "1 through 1000" like you did with raising the bar with "Can we do anything to speed it up?"


_________________
Please be kind and patient with the tourist. He comes in peace and with good intentions.


ImMelody
Veteran
Veteran

User avatar

Joined: 9 Jun 2008
Age: 41
Gender: Female
Posts: 788
Location: DFW, TX

18 Dec 2008, 6:33 pm

DwightF wrote:
EvilTeach wrote:
so he claimed that

19 * 17 * 13 * 11 * 2*2*2*2 * 3*3 * 5 * 7 is the answer.
that works out to 232,792,560.

At home he popped the value into the web page, and we have one more problem solved.
He did it analytically, without a program.

Nice reasoning (on his part ;) ). Excellent work on your part encouraging him to push further. How old is he?

It would be interesting to see how he'd approach you raising the bar from "1 through 20" to say "1 through 1000" like you did with raising the bar with "Can we do anything to speed it up?"


That would just be mean. Then they would have to write the program. Pen and paper really sucks for somethings.

I have to say this was cool for me to read. I realized at an older age that I had far surpassed my parents with regards to education. I'm waiting for my youngest to surpass me. He soaks things up like I do.

DW wrote:
Kids out think us all the time, I've noticed. They are still living in the intellectual world more than the practical one, like I have to. All that practical thinking constricts the brain or something


Come now. You can live in the intellectual world while still doing enough practical thinking to be viewed as living in the practical one. Of course, every so often, you blurt out a question that everyone thinks came out of no where.


_________________
For parents with an Autism Spectrum Disorder: www.asparenting.com


DwightF
Sea Gull
Sea Gull

User avatar

Joined: 7 Dec 2008
Age: 56
Gender: Male
Posts: 224

18 Dec 2008, 6:57 pm

ImMelody wrote:
That would just be mean. Then they would have to write the program. Pen and paper really sucks for somethings.

Needing to write a program is expected for most of the Euler questions. There are some learning advantages to explicitly coding the algorithm, and for scaling up the problem domain (in way that is what EvilTeach did pressing for a faster method). It forces you to deconstruct and therefore better understand the process for the solution.


_________________
Please be kind and patient with the tourist. He comes in peace and with good intentions.


EvilTeach
Pileated woodpecker
Pileated woodpecker

User avatar

Joined: 14 Mar 2007
Gender: Male
Posts: 196

18 Dec 2008, 9:49 pm

Nice reasoning (on his part ;) ). Excellent work on your part encouraging him to push further. How old is he?

14. diagnosed, typical aspie behavior.

It would be interesting to see how he'd approach you raising the bar from "1 through 20" to say "1 through 1000" like you did with raising the bar with "Can we do anything to speed it up?"

lol, I will ask him about how he would approach that problem.



release_the_bats
Veteran
Veteran

User avatar

Joined: 13 Jul 2008
Gender: Female
Posts: 1,033

19 Dec 2008, 12:52 am

I'd like to see more brag threads like this one.

The threads about the problems associated with raising an ASD kid serve a very important purpose, but it's nice to see threads about how parents appreciate their kids special talents too. And it's probably encouraging to those parents who are going through a difficult time.



DwightF
Sea Gull
Sea Gull

User avatar

Joined: 7 Dec 2008
Age: 56
Gender: Male
Posts: 224

19 Dec 2008, 10:10 am

EvilTeach wrote:
Quote:
It would be interesting to see how he'd approach you raising the bar from "1 through 20" to say "1 through 1000" like you did with raising the bar with "Can we do anything to speed it up?"


lol, I will ask him about how he would approach that problem.

At a cursory glance my instincts said do some coding to get the number, basically implement in code what he did by hand. Prime factoring + determining the union set of all the prime factors should be some interesting code for him to work on. If he comes up with something even better I'd love to hear about it (I think there is a faster solution, both in implementation and maybe even calculation, but I haven't looked at it that hard ... it might follow from him thinking about how to efficiently combine the above two). Good luck.


_________________
Please be kind and patient with the tourist. He comes in peace and with good intentions.


Last edited by DwightF on 19 Dec 2008, 12:28 pm, edited 1 time in total.

DwightF
Sea Gull
Sea Gull

User avatar

Joined: 7 Dec 2008
Age: 56
Gender: Male
Posts: 224

19 Dec 2008, 10:44 am

release_the_bats wrote:
I'd like to see more brag threads like this one.

The threads about the problems associated with raising an ASD kid serve a very important purpose, but it's nice to see threads about how parents appreciate their kids special talents too. And it's probably encouraging to those parents who are going through a difficult time.

Hehe, well I'll toss on a:

My son can spell faster verbally than me. Both calling it out as well as determining from letters spoken to him. My wife (she's better than me) and I (spelling is not my strong suit) can take turns alternating pre-thinking the words and call them out and he still keeps up. The ones he figures out from phonetics, or what appears to be a compound word but the combination is pronounced a little different, do get pronounced a little funny sometimes. If they are really oddball pronunciations he's never encountered them before those will cause a bit of a hickup as we correct him. But that wasn't that common last year when he was still 5.

So much for spelling in front of the kids as secret communication. :roll: We've resorted to very odd associations that involve a lot more cultural knowledge and laying on a bit of body language, we don't think he's getting them yet. But just because he doesn't say anything isn't assurance of that. ASC kids, and some ASC adults really, can be hard to read that way because they often don't give the same level of verbal or body language feedback clues that they heard and understood.

P.S. These days if he asks me how to spell something it is more than likely because he is testing me. I don't have much pride invested in my spelling abilities but that's just rubbing salt in the wound. :P


_________________
Please be kind and patient with the tourist. He comes in peace and with good intentions.


ImMelody
Veteran
Veteran

User avatar

Joined: 9 Jun 2008
Age: 41
Gender: Female
Posts: 788
Location: DFW, TX

19 Dec 2008, 11:47 am

DwightF wrote:
ImMelody wrote:
That would just be mean. Then they would have to write the program. Pen and paper really sucks for somethings.

Needing to write a program is expected for most of the Euler questions. There are some learning advantages to explicitly coding the algorithm, and for scaling up the problem domain (in way that is what EvilTeach did pressing for a faster method). It forces you to deconstruct and therefore better understand the process for the solution.


I guess me thinking it would be mean is coming from my math. I've never really liked programming, but math, I love. I love things that I can figure out in my head. Doing something like that by hand would be torturous, and programming it would be far too (for lack of a better word) boring for me.

Glad to see he's going to use the idea though.


As for telling more stories that are good, I tend to stay away from doing that because I overly brag my children up.


_________________
For parents with an Autism Spectrum Disorder: www.asparenting.com


DwightF
Sea Gull
Sea Gull

User avatar

Joined: 7 Dec 2008
Age: 56
Gender: Male
Posts: 224

19 Dec 2008, 12:20 pm

ImMelody wrote:
As for telling more stories that are good, I tend to stay away from doing that because I overly brag my children up.

Yeah, I know that feeling. But this is a "[brag]" thread. So it's OK here! :)


_________________
Please be kind and patient with the tourist. He comes in peace and with good intentions.