0247: "Factoring the Time"

This forum is for the individual discussion thread that goes with each new comic.

Moderators: Moderators General, Prelates, Magistrates

Andrew
Posts: 619
Joined: Tue Jan 02, 2007 9:59 pm UTC
Location: Manchester, UK
Contact:

Anoria
Posts: 32
Joined: Tue Jan 02, 2007 8:18 am UTC
Location: so close, yet so far
All I have to say is that I'm never going to look at prime-time TV listings the same way again.

"You idiots, that show's on at 6:30, that's not prime! Maybe if you show commercials in between so that it actually starts at 6:31, then I'll forgive you."

Shrewd
Posts: 1
Joined: Thu Apr 12, 2007 3:53 pm UTC
I always try to divide every license plate I see by 7. I have no idea why it's 7, probably because it's the only single digit number I don't have a divisibility test for.

alexk
Posts: 1
Joined: Thu Apr 12, 2007 4:30 pm UTC
Delurking to say that this is what I do instead of counting sheep. It works if I'm trying to get to sleep between 10:00 and 12:59 (my clock is set to 12-hour time).

Tricks for "is X factorable by P" are all based off modulo arithmetic. I find the breaking-the-units-digit-off tricks most accessible while lying awake at night. They are all of the form,
"XXXXU is divisible by P iff XXXX + F_P * U is divisible by P."

F_7 is -2, so 1453 is divisible by 7 iff (145 - 2*3 = 139) is.

For two-digit primes, applying this trick to P itself lets you figure out F_P pretty quickly; usually quickly enough to then use the trick and factor the time in under a minute. You need to regenerate P or some multiple of it:

13: 1+4*3=13, so F_13 = 4
17: 1-5*7 = -34; F_17 = -5
19: 1+2*9 = 19; F_19 = 2
similarly, F_23 = 7, F_29 = 3, F_31 = -3, F_37 = -11, and so on

SNAFU
Posts: 25
Joined: Wed Jan 17, 2007 7:56 am UTC
\$ ar x God
ar: God does not exist

sfwarlock
Posts: 4
Joined: Thu Apr 12, 2007 8:04 pm UTC
I actually got bored enough to code this one up:

/* This code will take every number that can be displayed
on a 24-hour digital clock and find its prime factors. Output
to file recommended.

Implementation of void factor(int) left as an
exercise & to keep from spamming the board. */

Code: Select all

`int main(int argc, char *argv[]){  int x = 0;  for (x; x != 2401; ++x){    if (x%100 == 60) {      x += 40;    }    printf("%d:%02d -", x/100, x%100) ;      factor(x);  }return 0;}`

jasticE
Posts: 17
Joined: Fri Apr 06, 2007 2:15 pm UTC
For whom it might interest (as if you couldn't do it yourself , my Mathematica line for finding the prime times:
Select[Select[Range@2359, Mod[#, 100] < 60 &], PrimeQ]

Or if you wish to factor all valid times:
FactorInteger /@ Select[Range@2359, Mod[#, 100] < 60 &]

This is for people like me who can't do arithmetic in their head but want to feel nerdy anyway.

Daniel
Posts: 58
Joined: Wed Jan 24, 2007 7:55 pm UTC
This comic had me going through the files on my computer and trying to see whether I could get the sizes to be prime numbers of kilobytes, then people started asking me what I was doing... then someone thought it was funny, and started doing it too, and it all snowballed from there...

twic
Posts: 4
Joined: Thu Apr 12, 2007 9:49 pm UTC
Splarka wrote:After that, this was naturally called for: factor clock javascript (see if you can do it faster)

And of course factor clock extreme! (can you still do it faster? haha)

Bugger, you beat me to it:

Tom's factor clock

My code's cleaner, than yours, though! And it might even be faster, depending on how javascript implements array extension ...

-- tom

rodbod
Posts: 3
Joined: Fri Apr 13, 2007 12:17 am UTC
When I'm doing my exercises I try to work out what fraction of the total I have done with each repetition. By the time I've got all the fractions off by heart for a given number of reps it's usually time to add a rep.

nikolasco
Posts: 2
Joined: Fri Apr 13, 2007 1:47 am UTC
My own factor clock. I wrote it earlier, before I thought to check the forums. Anywho, it has a few options and I think it displays more nicely than the others (but of course I'm biased).

Vaniver
Posts: 9422
Joined: Fri Oct 13, 2006 2:12 am UTC
Anywho, it has a few options and I think it displays more nicely than the others (but of course I'm biased).
It is nicer.

What's the largest number of factors that a time can have? What if you allow seconds as well?
I mostly post over at LessWrong now.

Avatar from My Little Pony: Friendship is Magic, owned by Hasbro.

Aaron Haynes
Posts: 7
Joined: Tue Dec 19, 2006 2:38 am UTC
I've been counting the number of footsteps between different places on campus lately. If had a stopwatch, I'd be timing the walks, dividing by the number of steps, finding the average for a series of tests, and using that to determine exactly how fast I can get from place to place, so that I can consistently only be two minutes late instead of five.

OmenPigeon
Peddler of Gossamer Lies
Posts: 673
Joined: Mon Sep 25, 2006 6:08 am UTC
Contact:
Aaron Haynes wrote:I've been counting the number of footsteps between different places on campus lately. If had a stopwatch, I'd be timing the walks, dividing by the number of steps, finding the average for a series of tests, and using that to determine exactly how fast I can get from place to place, so that I can consistently only be two minutes late instead of five.

No, if you had a stopwatch, you'd use it to to figure out when to leave so that you could get places on time. Because that's what watches are for. Also what time is for.

Sorry, but I really dislike lateness, both in myself and others. Most of the time I would rather not show up to something than to show up late. And there are few things more annoying than some jackass wandering in late to class and knocking over everyone's desks while they walk all the way to the back.
As long as I am alive and well I will continue to feel strongly about prose style, to love the surface of the earth, and to take pleasure in scraps of useless information.
~ George Orwell

Ronfar
Posts: 132
Joined: Mon Dec 04, 2006 6:04 am UTC
OmenPigeon wrote:And there are few things more annoying than some jackass wandering in late to class and knocking over everyone's desks while they walk all the way to the back.

We must have gone to school together. I never got anywhere on time.
- Doug

nikolasco
Posts: 2
Joined: Fri Apr 13, 2007 1:47 am UTC
Vaniver wrote:What's the largest number of factors that a time can have? What if you allow seconds as well?

I updated the clock to also answer this question.

Aaron Haynes
Posts: 7
Joined: Tue Dec 19, 2006 2:38 am UTC
OmenPigeon wrote:No, if you had a stopwatch, you'd use it to to figure out when to leave so that you could get places on time. Because that's what watches are for. Also what time is for.

Mom? Is that you?

Kin
Posts: 143
Joined: Thu Jan 04, 2007 11:54 am UTC
nikolasco wrote:My own factor clock. I wrote it earlier, before I thought to check the forums. Anywho, it has a few options and I think it displays more nicely than the others (but of course I'm biased).

Hehe, I just stumbled upon that. Wanted to see if you reported it yet.

me_lkjhgfdsa
Posts: 7
Joined: Tue Apr 10, 2007 11:22 am UTC
Contact:
Our maths teacher would never let the class start untill we had found some patern in the date, I haded 2006 because there weren't any prime number days (23/7/05 for example) and she always got excetiedn and ina very good mood on such days, to the extent of geting maried on one (23/7/05 if memory serves).
Brigadier Terence Hugh Clarke, CBE (17 February 1904 â€“ 26 May 1992) was a British army officer and politician.

gnutun
Posts: 1
Joined: Sun Apr 15, 2007 10:02 pm UTC
I once wrote a C program which determined (a) whether my phone number is prime, and if it is, (b) which prime it is. It took a couple hours to write, and about 20 minutes on my 1.8GHz laptop to finish. It turns out that my phone number is the 338,319,598th prime. Sw33t.

Last edited by gnutun on Sun Apr 15, 2007 11:29 pm UTC, edited 1 time in total.

themuffinking
Posts: 52
Joined: Sat Mar 10, 2007 4:42 am UTC
I like to do the four 4's game.

You take four 4's and can use any operation (or common function or uncommon function, whatever) to try and get whatever number.

i.e.
0 = 44 - 44
1 = 44/44
2 = 4/4 + 4/4
3 = (4+4+4)/4
4 = sqrt(4) + sqrt(4) - 4 + 4
5 = sqrt(4) + sqrt(4) + 4/4
6 = (4!/4) - 4 + 4
7 = 4 + (4!/4)/sqrt(4)
8 = 4 + 4 + 4 - 4
9 = 4 + 4 + 4/4
10 = 4 + 4 + 4 - sqrt(4)
etc.

warriorness
Huge Fucking-Lazer
Posts: 1610
Joined: Thu Dec 28, 2006 10:33 am UTC
Location: CMU, Pittsburgh, PA, USA
Contact:
themuffinking wrote:I like to do the four 4's game.

You take four 4's and can use any operation (or common function or uncommon function, whatever) to try and get whatever number.

<examples>

Any uncommon function, you say?

So let's say I wanted to find a way to make the number 1337. I could say, okay, let's have f(x) = 1337. So then we can use four 4's and get: f(4444)=1337. Win?
Iluvatar wrote:Love: Gimme the frickin' API.
yy2bggggs, on Fischer Random chess wrote:Hmmm.... I wonder how how a hypermodern approach would work

Fieari
Posts: 101
Joined: Mon Jan 29, 2007 2:16 am UTC
Location: Okayama, Japan
I'd say, looking at the rules of that game, that you'd need to define the function as part of the thingy, and you're only allowed four 4s still. So you could have f(x)=4x+4, f(4)/4, but not f(x)=3, f(4444), because that's using a digit other than 4.
Surely it is as ridiculous to consider sqrt(-1) "imaginary" because you can't use it to count pieces of chalk as to consider the number 200 imaginary because by itself it cannot express the location of one point with reference to another. -Isaac Asimov

EugeneStyles
Posts: 38
Joined: Fri Apr 27, 2007 2:59 am UTC
nikolasco wrote:My own factor clock. I wrote it earlier, before I thought to check the forums. Anywho, it has a few options and I think it displays more nicely than the others (but of course I'm biased).

Your clock is better. Of course, it has to be. If you posted it after and it was worse, it'd be a huge letdown.

One thing though - the whole reason I found this forum was to complain that the comic treated the time as a decimal number instead of sexagesimal. I like that you have that option on there, however you only go halfway. You treat the time as sexagesimal, but not the factors. That's why I had to go and register...

I think the point is: you can't (or rather shouldn't, for some value of "should") factor time as decimal because it's not a number in a vacuum. It has units. When you multiply 23 x 11 and get 253, if you want to express that as a time, it's 253 seconds, which is 4:13. Conversely, when you factor 4:13 into prime factors, you shouldn't be factoring it into numbers in a vacuum but into other times, i.e. 00:23 x 00:11. Which I would assume is fine if you just render it as 23 x 11.

But when you factor, say, 23:21, it shouldn't render as 11 x 211, it should be 11 x 3:31. Where 3:31 is a prime time. Or even 00:11 x 3:31. I don't know, I think I just like the aesthetics of showing a clock time as a product of other times, specifically as a product of prime times. It's got kind of a cyclical quality to it.

Of course, don't think that the point is lost on me, here. I know the sheer worthlessness of factoring into primes, and more so the inanity of arguing over how to do it and how to render the results, but, you know, what the hey...

Oh, and incidentally... you know what would be the sweetest thing? If your factor clock actually had the output fields inside the comic... assuming that wouldn't be infringement.

Posts: 98
Joined: Sat Apr 28, 2007 2:35 am UTC
I was bored and coded it in perl... and then had the incredible urge to obfuscate it, so i did just that.

Code: Select all

`\$_=\$ARGV[0];while(\$_!=1){for(\$__=2;\$__<\$_+2;\$__+=2){if(\$__==4){\$__--;}if(\$_%\$__==0){\$___=\$___.\$__." x ";\$_/=\$__;last;}if(\$__>=\$_**0.5){\$___=\$___.\$_;\$_=1;}}}\$___=~s/x \$//;print STDOUT \$ARGV[0]," = ",\$___,"\n";`

the number it factors is the number that's given as the first argumant

ulnevets
Posts: 186
Joined: Wed Aug 09, 2006 1:45 am UTC
Contact:
trick: to factor n, you only need to test primes up to sqrt(n)

AndreGiant
Posts: 10
Joined: Mon Apr 30, 2007 1:02 am UTC
Location: A Pale Blue Dot
Contact:
We were reading Heart of Darkness in English class, ...I noticed the page numbers, and remembered the comic, and put two and two together.

My teacher must have been thinking, Wow, he's taking really good notes.

When I picked up my notebook at the end of class, every square inch of the desk had long division on it.

So, being the nerd I am, I soon had a handmade prime-factoring program on their TI-84.

Oh, and thanks alot muffinking, Im gonna be up til 3:00 am tonight mashing fours together in my brain.
That, in precise historical terms, sucks. - Bill Sutton

hendusoone
Mr. Dreambeard butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts butts. Butts.
Posts: 1570
Joined: Fri Jun 29, 2007 5:30 pm UTC
Location: Spaceship
Contact:
Apologies for posting to such an old thread, but I felt a dying need to share this (and I registered for the forums just to do it, too!).

Currently, if you type "prime factors" into a google search box that gives suggestions (firefox or google toolbar), the top suggestion will be "prime factors of 1453." I'm not sure if I should be embarrassed for performing the search, or amazed that so many others have done it to get it the top suggestion spot...

Joshua
Posts: 33
Joined: Sun Jan 07, 2007 4:12 am UTC
Location: Champaign, IL
Contact:
hendusoone wrote:Currently, if you type "prime factors" into a google search box that gives suggestions (firefox or google toolbar), the top suggestion will be "prime factors of 1453." I'm not sure if I should be embarrassed for performing the search, or amazed that so many others have done it to get it the top suggestion spot...

Fantastic!
We'll call it the xkcd effect.
err....

Ansain
Posts: 207
Joined: Sun Apr 15, 2007 1:15 am UTC
Location: Here

0247: "Factoring the Time"

heres the link to the comic http://xkcd.com/c247.html . sorry if its allready been posted I couldnt find it. I've been rereading through the comics and i have to know was 2:53 picked on purpose because its military time 14:53 is prime? when i first read that comic i laughed because of how difficult he had made it for the guy factoring. this time i laughed harder because the first number was prime.

DuSTman
Posts: 192
Joined: Sat Nov 04, 2006 7:11 am UTC
Location: Lancaster, UK
Contact:

Ansain
Posts: 207
Joined: Sun Apr 15, 2007 1:15 am UTC
Location: Here
sorry for reposting it then

Hipeter1987
Posts: 1
Joined: Mon Nov 03, 2008 8:16 am UTC

Re: "Factoring the time" Discussion

Well, I definitely used to do exactly that when looking at the clock, so this comic really hit home for me in a hilarious, dorky way (gotta love being a dork!). I totally understand where you're coming from hendusoone, this is a topic that's definitely worth coming back to (I guess a great deal of the xkcd comics bring up awesome dorky and interesting discussion like this)!

And also, if I may put in a word for primes (as if they need any), they are sooo awesome! One example I use a lot when I get amped up about primes is to think about the ring Z/pZ where p is prime. These are integral domains, as opposed to Z/nZ for all nonprime n, and things that are not integral domains are quite scary. 2*3 should never equal 0 (as in Z/6Z). And of course Z/pZ are also building blocks for finite fields, which are mad cool and trickier to think about than, say, Q or R or C (although C is even cooler - C + the point at infinity is isomorphic to a sphere!)...

OK, one more thing and I'll shut up and actually sleep before morning class, hehe! The algebraic closure of a finite field of characteristic p is the countably infinite field which contains a copy of the field of order p^n for each positive integer n (and is in fact the union of these copies) (according to Wikipedia). I had to show that no finite field is algebraically closed on my algebra exam, and I got curious, and this is a pretty sweet answer (even if only God knows what the above field looks like aside from the given description...) so sue me! Hehe...

TomSwirly
Posts: 1
Joined: Wed Nov 05, 2008 9:59 pm UTC

Re: "Factoring the time" Discussion

What alexk said. I'd already decided that it was going to be prime, so I had a minute to verify that. That's easier than actually factoring the number...

First, you use the usual rules for 2, 3, 5, and 11 (add the digits alternately and see if it's zero).

If 1453 were divisible by 7, so would 1460. Add 140 to get to 1600 which isn't divisible by 7. If 1453 were divisible by 13, so would 1440, which it clearly isn't.

You use similar arguments for each prime, adding multiples till you get to a number that's clearly not divisible. And you're helped once you get near the square root of the number because you know the possible candidate primes that would have to be the other divisor, so you can eliminate them fast (if one's under 40, the other one's over 40...)

Voila, well under a minute. Course, I do this sort of thing a lot.

tricky77puzzle
Will take "No Tresspassing Signs" for 500
Posts: 488
Joined: Thu Feb 28, 2008 11:02 pm UTC

Re: "Factoring the time" Discussion

We should try prime-factorizing Graham's number.

...wait, shit.

gormster
Posts: 233
Joined: Mon Jul 23, 2007 6:43 am UTC
Location: Sydney

Re: "Factoring the time" Discussion

HOW HAS NO-ONE BROUGHT UP THAT THE NUMBER GETS BIGGER EVERY MINUTE, NOT EVERY HOUR
Eddie Izzard wrote:And poetry! Poetry is a lot like music, only less notes and more words.

embernator
Posts: 33
Joined: Wed Oct 22, 2008 9:43 pm UTC

Re: "Factoring the time" Discussion

I don't know if anyone's said this yet or not, but on igoogle there's actually an app you can put on your page that factors the time. It's 100% based on this strip

Posts: 90
Joined: Wed Apr 01, 2009 6:11 pm UTC

Re: "Factoring the time" Discussion

Wow.

You all think the same way *I do*!

Tass
Posts: 1909
Joined: Tue Nov 11, 2008 2:21 pm UTC
Location: Niels Bohr Institute, Copenhagen.

Re: 0247: "Factoring the Time"

My and some friends (all physicists) did this a lot on a skiing trip. On the way home at night we tried to do 22:09 as a team effort.

Of course when factorizing numbers of this size you usually get a lot of small factors and maybe one or two in the teens or twenties. Or a prime.

We worked our way up confirming that none of the primes were factors of 2209. After 43 turned out not to divide it and since the next prime would be up at 47, one said: "I think we are past the square root now", so we concluded that 2209 is prime. All agreed.

We were quite embarrassed to learn that 2209 equals 47 squared.

PsiSquared
Posts: 126
Joined: Wed May 09, 2012 6:02 pm UTC

Re: "Factoring the time" Discussion

tricky77puzzle wrote:We should try prime-factorizing Graham's number.

...wait, shit.

Since Graham's number is a power of three, factoring it would be trivially easy:

3 times 3 times 3 times 3 times 3 times 3....

The only tricky part is knowing when to stop. But given that you'll need to repeat the "3 times" waaaaaaay beyond the heat-death of the universe, I wouldn't worry about that too much.