venta: (Default)
[personal profile] venta
So, sums. I can, broadly speaking, do sums. I have a degree in maths.

However, interest rate calculations have always baffled me. Sure, if you ask me to calculate 3 months compound interest at a monthly rate of x% I know what to do. However, when it comes to real examples of mortgages and credit cards, I can't work out what the sum I need to do is. I'm still slightly baffled about the interest charged me when I was a day late paying my credit card off in full in March.

Today, the BBC carried a story about a loanshark. It includes the following statement about someone who borrowed £1000:

"...to pay £49 a week over 60 weeks, making the total amount he had to
repay £2,940 at 917% APR."

Now, if we approximate 60 weeks to a year, then surely that's an annual interest rate of no more than 294%. The quoted APR isn't even in vaguely the right ballpark.

So... have I completely failed to understand APR ? (Wikipedia's page on the subject didn't really help with the definition.) Or is the BBC publishing unmitigated wank in the name of investigative journalism ?

Edit It turns out I'd failed to understand APR, and the BBC is cleared in this instance.

Date: 2008-07-29 11:11 am (UTC)
From: [identity profile] drdoug.livejournal.com
I can, broadly speaking, do sums. I have a degree in maths.

You'll be aware, of course, that those two statements are orthogonal, or weakly correlated at best :-)

The people I know with the hugest disparity between expected and actual arithmetical prowess are mathematicians. In both directions - people who struggle to work out change for a fiver, and people who can factorise your telephone number as soon as you tell it to them.

Date: 2008-07-29 11:22 am (UTC)
From: [identity profile] venta.livejournal.com
They were intended to be orthogonal :) My mental arithmetic is reasonable, and I claim to have enough mathematical ability to work out what to add up in the first place...

However, I'm considering rescinding the latter statement. In working through formulae above, I've been alarmed at how little I seem to remember about maipulating indices and logs these days. Hopefully I can claim that that's just knowledge, and easily look-upable, and therefore doesn't count.

Date: 2008-07-29 12:13 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
It's like French, it comes back when you need it.

Date: 2008-07-29 12:18 pm (UTC)
From: [identity profile] venta.livejournal.com
Oh, crap. My French completely fails to come back when I need it!

Although I suspect you're broadly correct, and the problem is just that summation of geometric series or any form of differentiation don't feature in my life much at present.

Date: 2008-07-29 12:25 pm (UTC)
From: [identity profile] feanelwa.livejournal.com
It takes about a day of fail before it comes right IME.

Date: 2008-07-29 12:27 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Now I want to change my telephone number to be the product of two large primes.

Date: 2008-07-29 12:44 pm (UTC)
From: [identity profile] drdoug.livejournal.com
Public-key telephony FTW!

Date: 2008-07-29 01:01 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Maybe not quite that large - I do want to be able to remember it. Just enough to separate the really scary people from the ones who know their 17-times table.

Date: 2008-07-29 03:05 pm (UTC)
pm215: (Default)
From: [personal profile] pm215
My phone number is the product of two five-digit prime numbers and 2. Anybody do any better than that?

Date: 2008-07-29 03:22 pm (UTC)
pm215: (Default)
From: [personal profile] pm215
Five minutes idle scripting throws up six prime phone numbers from work's directory (which has 73 UK numbers in it). This includes the main reception number...

Date: 2008-07-29 03:53 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Sounds about right. Prime density is 1/log(n), isn't it?

Date: 2008-07-29 03:37 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Hmm.

My home number is 2 5-digit primes times 8, but with the country code is 24 times a prime.
My mobile number double a prime. It still is with the country code added.

Also: gosh, PCs are fast these days. I'm sure it used to take time to factor a 12-digit decimal number.

Date: 2008-07-29 03:57 pm (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
I'm sure it used to take time to factor a 12-digit decimal number.

Google for ways to do it and try some of the javascript methods. That will make it feel like the old days... (yeah, I tried that first and given the ones I found seemed to be saying "for i = 2 to testnumber/2" I'm not that surprised that it failed a lot. :)

Date: 2008-07-29 04:06 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Well, here's my Code of Awesomeness (Not). It doesn't take a measurable amount of time to factor a phone number - it's no visibly slower than the case where I leave out the argument:

#include "stdlib.h"
#include "stdio.h"

int main(int argc, char **argv) {
	if (argc < 2) {
		printf("oops\n");
		exit(1);
	}

	long long tofactor;
	sscanf(argv[1], "%lld", &tofactor);
	printf ("factor %lld\n", tofactor);

	while ((tofactor % 2) == 0) {
		tofactor = tofactor / 2;
		printf("2\n");
	}

	long long i = 3;
	while (i*i <= tofactor) {
		if ((tofactor % i) == 0) {
			tofactor = tofactor / i;
			printf("%lld\n", i);
			continue;
		}
		i+=2;
	}
	printf("%lld\n", tofactor);

	exit(0);
}


pm215 will almost certainly now point out a bug in it. Like the fact that it loops infinitely if you input 0.

Date: 2008-07-29 04:09 pm (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
Well, my final approach was even simpler than that:


chris@the:~$ factor 07775771223
7775771223: 3 11 19 37 571 587

Date: 2008-07-29 04:12 pm (UTC)
From: [identity profile] onebyone.livejournal.com
Well if you knew that was there (which I didn't), why did you go looking for javascript versions? ;-)

(no subject)

From: [personal profile] chrisvenus - Date: 2008-07-29 04:16 pm (UTC) - Expand

Date: 2008-07-29 04:16 pm (UTC)
From: [identity profile] venta.livejournal.com
Interesting to note (or not) that this Code of Awesomeness arrived in an email comment, and I really couldn't make head nor tail of it. Which worried me rather.

I'vev just seen it here - ie with the formatting correct - and it's easily readable.

I've never met a more convincing argument for nice, tidy indenting :)

Date: 2008-07-29 04:32 pm (UTC)
From: [identity profile] onebyone.livejournal.com
I also note that I now have an upper bound on how long a brace-formatting standard lasts before I revert to modified K&R.

(no subject)

From: [identity profile] venta.livejournal.com - Date: 2008-07-29 04:36 pm (UTC) - Expand

Date: 2008-07-29 04:39 pm (UTC)
pm215: (Default)
From: [personal profile] pm215
Since you asked:
* giving it the argument 0 makes it loop forever printing out '2's
* for powers of 2 it prints a spurious '1' factor
* non-numeric arguments are silently accepted and treated as 0
* it accepts negative arguments, which it probably shouldn't

:-)

Date: 2008-07-29 04:46 pm (UTC)
From: [identity profile] onebyone.livejournal.com
I refer you to the white-on-white text at the end of the post containing the code.

I do count the spurious 1 as a bug, actually.

(no subject)

From: [identity profile] onebyone.livejournal.com - Date: 2008-07-30 12:35 am (UTC) - Expand

Date: 2008-07-29 04:10 pm (UTC)
From: [identity profile] venta.livejournal.com
I think this is a rubbish game.

But really only because my phone number decomposes disappointingly into a largeish prime, a few smallish primes and some 2s.

Mind you, I did it the old-fashioned way rather than scripting it, so may well have messed it up.

Date: 2008-07-29 04:12 pm (UTC)
From: [identity profile] venta.livejournal.com
Ooh... mobile number. Two five-digit primes and 5. I'm not sure if that's better, though :)

Date: 2008-07-29 04:22 pm (UTC)
chrisvenus: (Default)
From: [personal profile] chrisvenus
apparently my old phone number (that is still phone number of friends) would do the trick as well as any:

chris@the:~$ factor 1865246869
1865246869: 5153 361973

and also 2468 69 is a really memorable nbumber (for me at least).

I'm also faintly impressed that if you internationalise it you get a pretty impressive 8 digit prime as one of the factors:

chris@the:~$ factor 441865246869
441865246869: 3 3 977 50251933


Man... this is so geeky, isn't it?

Date: 2008-07-29 04:31 pm (UTC)
From: [identity profile] venta.livejournal.com
and also 2468 69 is a really memorable nbumber (for me at least).

Given that it's probably seven years or so since I last rang you on it, and I can still remember it, I think it's quite memorable :)


Date: 2008-07-30 12:52 am (UTC)
fluffymark: (Default)
From: [personal profile] fluffymark
My internationalised home phone number has a 12 digit prime as one of the factors. The only other factor is 2. :)

Profile

venta: (Default)
venta

December 2025

S M T W T F S
 123456
78910111213
14151617181920
212223 24252627
28293031   

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Dec. 27th, 2025 09:21 am
Powered by Dreamwidth Studios