Showing posts with label Mathematics. Show all posts
Showing posts with label Mathematics. Show all posts

Thursday, August 29, 2013

Weights without scales

I have a 1kg box of moss killer I need to mix it at 120g per 10 litres. I have no scales.

1. Assume the box is full. It measures 6x13x21 cm or 1638 cm3
2. I need 0.12 of a box or 196.56 cm3
3. I have a roughly cylindrical jug of diameter 12.5 cm
4. The bottom of the jug therefore has an area of 122.71 cm2
5. I therefore need to fill the jug to the 1.6 cm line

Or I could just go and buy some scales, but where's the fun in that?

Friday, April 19, 2013

Why you need to look at your electricity bills

Another vacated property means another electricity bill. The trick on their part is that as we're out of contract they can bill us the massive out-of-contract rates until it gets finalised. In this instance being charged 20p per kWh for both night and day rates.

The first bill arrives post contract. It's been estimated that this empty unit used 100 night units @20p and 400 day units @20p as well as 50 night units at the new contract price of 10p and 400 day units at the new price of 15p.

Nuh-uh we used 50 night units and 300 day units. A new invoice is sent and we're credited out 100 night units @10p and 500 day units @15p. Can you see the flaw?

We were charged for the 50 night units we used at 20p (£10)* and then an additional 50@20p and 50@10p (£15 total) and credited 100@10p (£10)

We were charged for the 100 day units we used at 20p (£20) and then an additional 300@20p and 400@15p (£120) and credited 700@15p (£105)

Or £30 over

At least when I pointed this out they instantly saw it and another new invoice is on its way. Given the way Electricity Suppliers change prices mid-invoice I do wonder how many in the same situation would  just note the credit and think it okay.

*although some of those might have fallen into the new period

Monday, March 18, 2013

Mathematical puzzles

Some of dreams still follow logic in this case I was present at a quiz evening in which the following questions were asked and I was roped into answering them, which I did so while still dreaming. Upon awakening I jotted them all down.

I have no idea where the first question and answer came from; the second is a variant on a different puzzle and the third from a magic book I read aged 12.

Problem 1: An airport owner has 7 airports, each offers a direct flight to the other and the owner wishes a diagram that shows this. Show all the direct flights using only four lines. Oh and drawing a line from airport 1 to airport 3 that passes through airport 2 is not 'one line' it's two, because it doesn't show the direct flight from 1-3.

Problem 2: Take a cube (six sides, square faces) and a tetrahedron (4 sides, triangular faces) and connect a face of the former to the latter so all sides and corners of the faces meet.

Problem 3: Make a hole in an A4 sheet of paper large enough for an adult human to pass through.

Solutions to follow; have fun.

Wednesday, February 27, 2013

The missing money - hotel room problem

I'm re-reading The Infinite Book by John D Barrow at the moment; a little dry in places; a bit too much theology and some badly placed diagrams in relation to the accompanying text, but still an interesting read. One of the quotes used is a famous puzzle paradox involving people staying in a room. I'll paraphrase here, but you can check Scopes for a full set of details.

3 people stay in one room at a hotel. It costs $30 so they each pay $10. The hotel accidentally forgot to take a discount into account - the room should only have cost $25. The manager hands $5 to a bellhop to return to the guests. The bellhop, who hasn't been tipped, decides to take $2 out of the $5 and returns $1 each to the guests.

Each guest has paid $9 for the room totalling $27; the bellhop has $2 so where's the remaining $1?

Monday, January 28, 2013

Mathematics - bases taught in schools?

After my post regarding the new methods of multiplication and division I recalled an incident with the Bratii over the holiday period. As is often the case the entire family were discussing various topics one of which was Imperial vs. Metric measurements. My father was complaining regarding news and quiz questions that used the 'new' methods on the grounds that "no-one can understand them" this was quickly dismissed by presenting the point that it was not everyone merely himself and that this generation and the next would have no difficulty in imaging a "plume of dust 3km high". Also that this was far better for school work due to the reliance on base10 which was also used for basic mathematics. A point reinforced when I asked ho many feet there were in a mile and he came back with 1760 (which is yards) and then had to multiply by 3 in his head to provide an answer.

Friday, January 25, 2013

Gridding and Chunking the new maths multiplication and division

Either it's a slow news day or a producer at the BBC has finally come across the new method of multiplication and division now being taught in schools. Either way in a feat of sheer brilliance they decided to explain it to parents by cramming in a short session before the local news at 8:30; you know when parents are out dropping their kids off at school. Due to the short session they also did a poor job of explaining it; or to be precise why these new methods are being taught and why they might be better in the long run.

Thursday, January 24, 2013

The difference between deficit, debt, and borrowing

I was amused last night by the Conservative Party Political broadcast; there they were happily citing figures of much better they've made the economy. Unemployment is down, more jobs have been created etc. I'll deal with that in another entry. For this post I'll deal with their claim that they've reduced the deficit, for the record it's perfectly true, but I think there are some out there who don't quite grasp what the deficit actually is particular those shown in the broadcast. I also think it's in the best interests of all the political parties that people don't understand it either. To hopefully remedy that here's a simple explanation.

Friday, December 14, 2012

The joy of property rates

I've mentioned in the past how much councils charge business in rates (for services they don't receive) how this can be lowered thanks to Small Business Rate Relief which was set to be cancelled next year. What I can't seem to find is remarks regarding empty properties. I'll rectify that now.

Keeping it simple empty industrial properties were exempt from paying council tax rates. Some thought this unfair and some thought that it allowed landlords to keep rents high as they lacked incentive to rent out the building (such people being idiots as landlords are still required to pay utility bills from a zero-income building) as such the Labour government introduced a cap. If the Rateable value of your building was over £15,000 rates would need to be paid; the next year they raised the threshold to £18,000. In 2011 the Conservatives lowered it to £2,600.

Currently the council tax multiplier is set to 45.8p that means a property valued at £12,000 RV that stands empty and paid nothing now accrues a charge of £5,496 a year just as if someone was renting it. Recall that this is on something that is generating zero income. How would that translate to domestic property?

Take a property worth £100,000 rent per month is set to 1% or £1,000 which is an RV of £12,000 per annum. If it were a business it would pay that £5,496. In Stourport it's a Band E property and thus is charged £1,848.22 or almost a third the amount; oh and they'd have their bins emptied too.

Logic says that companies make more money. Except companies also have to pay tax - company, NI etc. which a household doesn't. So why are businesses charged in a different way to domestic premises? Isn't doing so a disincentive to all these home-start businesses?

I'm being serious if you start a business at home then you're supposed to notify the council as the room you call your 'office' is now subject to business levels of rates if used primarily for that function. So that's the full whack of domestic council tax plus the RV of that room multiplied by 45.8p. Assuming, of course, that you have permission anyway as your work may constitute a change of use and require planning permission.

It's a bit of a joke, but this distinction is not helping the economy.

Thursday, December 13, 2012

Guido's tax claims

What's this Ed's claiming that the Conservatives are hurting the poor. Not according to Guido who has published a handy chart showing Income Tax rates from 2009-2010 and 2012-2013. Un-huh let's try this in full.

First off that's not all the tax, National Insurance has to be calculated too. So take an annual salary of £10,000 in 2009-2010 and subtract income tax of £705 and NI of £471.35 leaving £8,823.65. Let's do the same for 2012-2013 Income Tax of £379 and NI of £333 leaves £9,288. OMG Guido is right under the Conservatives the poor are better off. Um no because these are using absolute figures and there's the little matter of inflation to deal with.

Let me convert everything into Oct 2013 money (the latest CPI figures available) the calculation is quite simple take the CPI figure for the period you want to convert to subtract the CPI rate from the period you're converting from divide the lot by that last CPI figure and out pops inflation. Within a formula add 1 and then multiply. IOW:

(("CPI of Oct 2012" - "CPI of Mar 2010")/"CPI of Mar 2010")+1
(124.2 - 113.5) / 113.5) +1

So our 2009-2010 figure becomes £9,655.48 in Oct2012 money. Which is more than our 2012 figure of £9,288. So yes in absolute terms the poor have more money, but because that money now buys less than it did in 2010 they're worse off in relative terms.

Tuesday, November 27, 2012

Consequences of the Living Wage

I posted a entry about how the people who determined the current minimum wage really didn't know what they were doing, however at the last district council meeting an agenda item was raised regarding the "living wage" currently set to £7.44 an hour. Disregarding at the moment the full breakdown of exactly how this is determined what the definitions of "reasonable" are etc. I'll approach this as I did before.

Tuesday, November 13, 2012

Will the planned rise in fuel duty be scrapped?

With a planned rise in fuel duty of 3p set to come in the vote against it has been defeated after heavy hints that the government will cancel it. What I'm sure won't be cancelled though is the government's spin about 'thinking of the people' and all the hard work they're doing for us.

Yep once again I'm sure they'll be expecting us to thank them for not deciding to take more money of us. Once again they're the guys holding the big club and stating "Well we could have beaten you over the head and taken your wallet, but we've decided not to; isn't that nice of us!"

As an aside this wouldn't be a 3p rise. Taking my local's unleaded price of 135.9p what would the price be if fuel duty was increased by 3p? If you answered 138.9p congratulations you're wrong; VAT needs to be added too. That would be 3p in fuel duty and 0.6p in VAT so the price would be...? If you answered 139.5p congratulations you're still wrong; when was the last time you saw a price that didn't end in 0.9p? The price would have become 139.9p with the government making an extra 3.6p per litre and the petrol companies an extra 0.4p.

Thursday, November 01, 2012

The EU budget

With the news just in of a government rebellion over the proposed increase to our contribution to the EU budget perhaps a summation of the current budget situation as derived from the information contained within the "EU budget at glance" [sic].

Contained here is the contribution of each member and how much is essentially returned to the country. Plugging the fields into a spreadsheet what's the outcome.

The country that gets the most back is... Lithuania. They contribute 257.4m Euros and receives 1,652.8m Euros; that's 642%. They are closely followed by Hungary who contributes 836.4m Euros and receives 5,330.9m Euros; 637%

The country that gets the least back is... The Netherlands who contribute 3,933.3m Euros and receives 2,064.3m Euros or 52%. In second place is the UK contributing 11,273.4m Euros and receiving 6,570m Euros or 58%.

But we get a rebate; if we didn't we'd be contributing 14,869.3m Euros which would mean a return of 44% putting us in last place.

If that wasn't enough if all the contributions and spends are added up the EU has a 14% overspend equal to 14,120.1m Euros. So how much more is being spent on the EU functions themselves?

And they want a 5% increase.

Also of interest is the report regarding this from the BBC that states we are "one of 12 EU members which makes a net contribution to the EU budget" except using the EU's own figures we're one of 9 and that the "UK's net contribution was 7.25bn euros" except, again using their own figures, it's 4.7034bn Euros.

So whose figures do we believe; the EU's or the EU's?

Friday, October 26, 2012

Wyre Forest Car-parking profits

Heated exchanges at the Shuttle over the revelation that the council is making a profit of £429,875 on its car-parks and the excuse given as to why it needs to make a profit:

The surplus made from car parking is used to help deliver services. To not make a surplus, would mean services elsewhere would have to be cut.
Normally I wouldn't have a problem with that as this is pretty much how government works, however given the slow growth and recession we've had price-increases and an entire car-park that was formerly free being made pay-and-display. As a result this smacks to me of raising prices on one service simply to fund other services. That's where I have a problem.

On another note let's add up the figures:

£   72,613 Parking fines
£   94,726 Enforcement fines
£   72,420 Staff passes
£    9,067 Senior concession
£  120,853 Season passes
£      600 Rents
£  117,605 Management fees
£  947,591 Parking meters

£1,435,475 Total


Remove the profit and that's an operating cost of  £1,005,600.

Now where this gets interesting is that I have to guess that the Staff passes, Management fees, Rents, and Senior concessions are being paid for by Wyre Forest District Council to... Wyre Forest District Council. So that's simply taking money out of the bucket and putting it back in the bucket.

Strip out the dosey-do'ing and they're really pulling in £1,235,783; remove the operating cost and the profit gained from car-park patrons is really £230,183 a year.

So if this were removed, exactly which other services would need to be cut?

Thursday, October 25, 2012

GDP when growth isn't growth

The latest GDP figures are expected to be announced soon and it's expected to show growth. Whoo hoo we're out of recession - happy times are hear again. Let's spend lots of money (to paraphrase the Pet Shop Boys). Except what all the experts are whittering on about are percentage changes month on month (or quarter on quarter) and that makes a large difference in two connected ways.

Firstly let's say a person makes £100 a day and their salary is cut by 10%. 10% of 100 is 10 so it drops to £90. Now let's raise their salary by 10%. 10% of 90 is 9 so it increases to £99; they're still a pound worse off.

Secondly consider that £100. On Monday it's £10 less; on Tuesday it's only £5; on Wednesday it's £2.50 less; on Thursday nothing is removed and on Friday that person gains £2.50 and the boss tells them "Hey now you can afford to splurge". Um no I'm still £15 down on the week

It's still good that we have growth, but don't release the cheerleaders quite yet.

Friday, October 12, 2012

Unforeseen consequences of the new Minimum Wage

I mentioned how the new minimum wage was devised by people who obviously didn't understand how it would be used, but what other effects does it have?

The previous wage per hour was set at £6.08. Assume a person is on a salaried income working 9-5 with a half hour lunch break. That's 37.5 hours per week and exactly £228 per week in wages. Assuming a standard 810L tax code that breaks down as follows:

£228 Gross Salary
£9.84 NI
£14.40 PAYE.

Except the employer also has to pay NI and that comes to £11.60. The government gets £35.84, the employee gets £203.76 and the employer has to pay out £239.60 total.

With the increase to £6.19 an hour at 37.5 hours the employee gets £232.125 (because it's stupid). To keep it simple let's round that to £233 (can't round down or it's below the limit).

£233 Gross Salary
£10.44 NI
£15.40 PAYE.

Again the employer pays NI this time it's £12.29. The government gets £38.13, the employee gets £207.16 and the employer has to pay out £245.29 total.

So the government gains £2.29 a week or £119.08 a year, the employee gains £3.40 a week or £176.80 a year and the employer loses £5.69 a week or £295.88 a year.

Given that in 2007 the number of workers on minimum wage was 1.7m and assuming they all work a 37.5 week that's an extra £202,436,000 a year going straight to the government and an extra £502,996,000 a year out of businesses.

I'm not saying the minimum wage shouldn't increase only that it should be done in line with tax threshold changes too.

Wednesday, October 03, 2012

Why the minimum wage increase is wrong

As of the 1st October the minimum wage per hour increased, I have no problem with that what I do have a problem with is what they've raised it to.

From October last year the minimum hourly wages were £6.08, £4.98, £3.68,  and £2.60 for the various different age-groups etc. They've increased to £6.19, £4.98, £3.68, and £2.65 i.e. only two have really altered, the £6.19 and £2.65. So what do I find a problem?

Those are hourly rates, but at the minimum wage level 'hours' can be determined by the half or even quarter hour. Divide £6.19 and £2.65 by two or four. They don't divide into whole pennies. So someone who works shifts and work a week resulting in 10.25 hours should receive a minimum of £63.44 and ¾ of a penny so that should be rounded up to £63.45. Seems easy, but both of these figures are exactly one penny away from a number that divides evenly by both two and four. £6.20 becomes £3.10 or £1.55; £2.64 becomes £1.32 or £0.66.

This doesn't even make sense if they're increasing by a fixed percentage of 2% as £6.08 *1.02 = £6.2016. So someone seems to have specifically chosen these figures. It seems, big surprise, that the department calculating them have absolutely no idea how they're applied.

Monday, October 01, 2012

Misleading percentages again this time for Income

Following the LibDem conference and the call for "fairer taxes" the Conservatives and the wealthy have tried to fight back the quote I'm seeing bandied about is how 'the higher earners have 10% [or 13% depending on the source] of the income, but pay 28% of the tax' and how this isn't fair. On the face of it this seems right how could anyone argue that they're paying more than others already?

To put this in perspective though requires a different prefix to the sentence. Instead of "higher earners" I'll return it to the original "1% of tax-payers". While we still have the latter part the former would now read "1% of tax-payers earn 10% of the income". Why the change? Well the quoters want to highlight how unfair it is that 10% of income attracts 28% of tax; and that's a little difficult to do if you start by pointing out that said income goes only to 1% of the earners.

It gets even better if anyone decided to check out the report from the excellent FactCheck regarding total tax as a percentage of total income. Add in NI and VAT etc. and it seems everyone is paying around the 30% mark just mixed up in different ways.

So wouldn't that make this a call to keep things as they are? If everyone is paying the same amount of tax total that seems to be fair. No need to raise the tax levels for the rich or lower them for the poor. Well that's why in the case the quoters love percentages, start talking in absolute terms and suddenly the disparity shows up.

Take someone earning £200 a week (minimum wage) who pays a total of 30% tax in different ways; that leaves them with £140 a week. Switch to a high earner of £1,000 (£50k a year) and they'd be left with £700. Think about that in terms of purchasing power - someone earning £200 losing £60 might mean not being able to purchase clothes, food etc. Someone earning £1,000 losing £300 means foregoing the gold-plated taps in their new kitchen.

Thursday, September 20, 2012

XKCD - Click and Drag

The latest XKCD comic requires you to do as the title says "click and drag" the statement made regarding the world is "I just didn't expect it be so big". So how big is this world?

Stepping behind the 'magic' each scene is made of a tile 2048x2048 pixels; a person appears to be about 30 pixels in height. I'll assume that's equal to 6ft to make things easier.

There appears to be 8 tiles up and 19 tiles down; 48 East of the start and 33 West; there is no zero tile. Add Up&Down and E&W then multiply by 2048; divide by 30 and multiply by 6 to get feet and the world extends about half a mile up; one and a half miles down and is about six miles long.

Hardly any distance at all, but scroll through it and you'll probably be sharing the sentiments of the two westmost characters.

Wednesday, July 04, 2012

Unintuitive probability: PIN selection

I was thinking about PIN digits the other day, because I'm weird like that and started working out probabilities for a standard 4-digit length code (nnnn) from a selection of 10 digits (0-9).

Calculating how many combinations is simple: the first digit can be any from 0-9 as can the second, the third and the fourth resulting in 10x10x10x10 or 10,000 combinations; but are there really this many? I decided to delve a little deeper. The obvious point to me was that there would only be this number if duplications were allowed; if in the interests of making your PIN 'harder' you ensured there were no duplications i.e. 1234 rather than 1123 you would in fact have the opposite affect and make it easier.

Again the first digit can be any from 0-9, but the second can't be a duplicate and thus only 9 choices remain; the same for the third leaving only 8 and the fourth leaves 7. 10x9x8x7 = 5040; if someone trying to guess your PIN knows you won't use duplicates you've halved the options they have to try.

Let's try another tack. Consider a door lock with a numbered keypad and a 4-length PIN. You want to gain illicit entry, but don't know the code - how to get it. Simply spray some UV liquid onto the keypad; wait until a legitimate users types in the code and then shine a UV light on to it and see which numbers are smudged. In this case let's say 1, 2, 3 and 4.

Knowing it's a four length code what's the maximum number of attempts you would need to make?

As before the first code can be any of the digits 1-4, but the second can't be a repeat nor the third and fourth because we're using all the digits shown. This means we have 4x3x2x1 or 24 possibilities. An easy way to show this is by drawing a probability tree. For all possibilities of the PIN code starting with a 1 it would look like the following:

Count the end points and there are six of them. substitute the number 2 for 1 and 1 for 2, then repeat for all four starting numbers and there are 4x6 or 24 possibilities.
 
Okay you've broken in and stolen their top-secret files. They now change the code and you try again; this time the numbers that appear are only 1, 2 and 3 what would be the maximum number of attempts needed now?

This is a little more tricky to work out. Again the first digit can be any of the three, but then so can the second, but the third can also be one of three unless it's already been duplicated. We have to use all three digits, but can only repeat one a single time. A tree is more helpful here:

Counting the end results gives us 12; substituting for the other two starting numbers gives us a total number of 3x12 or 36. That's twelve more than using four digits.

It gets better if all we knew was that only three digits were in use for a four-length PIN the number of combinations possible is 10x10x9x8 or 7200 rather than the 5400 for using four digits.

So by using one less digit than is called for the number of possibilities an attacker has to try actually increases.

One even sneakier trick involves mobile phones particularly the Android. By default if you lock the phone  you tap in a number and then hit the OK button. The important bit is that the phone won't unlock automatically as soon as the correct number is entered. This is important as despite common conviction a PIN on a mobile does not have to be four digits long; it can be five (or even more or less).

Use  three digits in a 3-length PIN and anyone who knows those numbers and tries to use them in the 36 different ways of a 4-length PIN will never unlock your phone, use four digits on a 5-length PIN and they can try all 24 combinations without success;.

So even if they know this trick and that you're 'limiting' yourself to 3 or 4 digits of a 4 or 5-length PIN it's still safer than using four different digits for a 4-length PIN.

What an odd world probabilities can be.

Oh and on one final note for the truly paranoid out there one of the most potent defences is in using the delete key. Have three digits in a 4-length PIN and type in 4 numbers but delete the false one and even though an attacker may be able to see you used the delete key they won't know when or even how many times it was used.. In other words with a PIN of 1233 type 1234 DEL 3. The 36 possible combination has now jumped to 120.

For the truly, truly paranoid type in a four digits that don't match to your PIN then delete them all and type in the real one. An attacker now has a full eight numbers to try, without any indication if duplications are allowed that's 4096 combinations.

Thursday, May 10, 2012

BBC's Great British Menu - Johnnie Mountain

I haven't been watching series 7 of BBC2's "Great British Menu" despite having seen most of the previous six series - why? Well the previous six were all shown at 18:30; an ideal time for me - get home; eat while watching Eggheads (I know how uncouth to eat and watch TV at the same time) then settle back for the Great British Menu.

This series they decided to show at 19:30.