“Work = mad” may not be news to you. But did you know it is a physical fact and provable using Maths? It all started with a discussion about moments, torque, force, work, energy, power etc. We need to briefly talk about Force, and then Work. Force Sir Isaac Newton is probably the greatest scientist […]

The post Work = mad. Physics says so. Maths proves so. appeared first on *.

]]>“**Work = mad**” may not be news to you. But did you know it is a physical fact and provable using Maths? It all started with a discussion about moments, torque, force, work, energy, power etc. We need to briefly talk about Force, and then Work.

Sir Isaac Newton is probably the greatest scientist ever. I once stood in the same room as Newton, unfortunately I was 350 years late. One of the many contributions Newton made to Physics was in the ‘field of mechanics’ (*disambiguation*: not a pasture of grease-monkeys, rather the area of physics concerned with the study of bodies in motion).

Newton gave us 3 Laws of Motion, and Newtons 2nd Law of Motion states “*When a resultant external force acts on a body, the rate of change of velocity is proportional to and takes place in the direction of that force*“. In other words, when we apply a force, F, to an object/mass, m, the object/mass will accelerate, a, (rate of change of velocity) proportionately to the size of the applied force. Newtons 2nd Law of Motion is symbolized as:

\( F = ma \) Equation (1)

We can thank Gustave-Gaspard Coriolis for the notion of ‘Work’ in mechanics. ‘Work’ refers the distance (displacement) over which a Force is applied, and can be symbolized as:

\(Work = Force \times distance\)\( Work = Fd\) Equation (2)

If we now substitute Equation (1) into Equation (2), by substituting ‘ma’ for F, we can see that

\( Work = mad\)Q.E.D.

Note: The above derivation takes a simple non-relativistic case of a Force operating on a mass in a straight line.

The post Work = mad. Physics says so. Maths proves so. appeared first on *.

]]>The latest update to Chrome (Chrome 70) sneaks in yet another ‘convenience’ for you. When you use Chrome to login to and Google account (Gmail, YouTube, etc.), it will automatically also log you into Chrome. That could be handy – if you want to sync your Passwords, Payment handlers, bookmarks, browsing history, search history, etc. […]

The post Chrome 70 – Chrome sign-in is Automatic with any Google login appeared first on *.

]]>The latest update to Chrome (Chrome 70) sneaks in yet another ‘convenience’ for you. When you use Chrome to login to and Google account (Gmail, YouTube, etc.), it will automatically also log you into Chrome. That could be handy – if you want to sync your Passwords, Payment handlers, bookmarks, browsing history, search history, etc. But it could be a serious security and privacy breach if the machine you’re using is not your machine; whether that be in work, college, library, internet-cafe etc.

There is no pop-up warning you, or asking your permission, and you are opted in automatically when you update to Chrome 70. Fortunately you can disable it. It’s in the same location as the previous sneaky ‘convenience’ was added, as described in my previous blog post “Chrome 68 Payment Handler API – is it storing Payment Methods?“.

Thanks to issues raised by users as described in this Google Blog “Product updates based on your feedback” Google relented and included the option to turn off the auto Chrome sign-in. But why did the opt-out only come after a wave of negative feedback? Didn’t Google realise in their design meetings the opt-out was a necessity? Or did they prioritise the data they’d gather over your security and privacy?

The post Chrome 70 – Chrome sign-in is Automatic with any Google login appeared first on *.

]]>Chrome 68 Payment Methods – it’s on without you knowing it’s on Googles latest update of the worlds most popular browser just released is Chrome 68. There are several additions in Chrome 68 and the labelling of non-https websites as “Insecure” is rightly getting plenty of attention. But another important addition in this update is […]

The post Chrome 68 Payment Handler API – is it storing Payment Methods? appeared first on *.

]]>Googles latest update of the worlds most popular browser just released is Chrome 68. There are several additions in Chrome 68 and the labelling of non-https websites as “Insecure” is rightly getting plenty of attention. But another important addition in this update is the inclusion of Chrome 68 Payment Handler API, and notably the fact it is ENABLED by default. You may like that, or you may not.

If you don’t want Chrome giving permission to websites you visit to “check if you have payment methods saved” then head to your Chrome settings [see instructions below] now and DISABLE the option – because Google have already enabled it in the Chrome 68 update.

Payment Methods are all about making it easier to make online purchases. In principle that’s a good thing, however you may not like it due to the privacy, security or other considerations. The good thing is that you have a choice, and it’s up to you to make an informed choice. The bad thing is that Google have decided for you and you’re not informed, they could have at least given a pop-up to ask how you would like to configure the new option. If you don’t want the slightly more technical details – no problem, just skip the next section and jump to “How Do I Disable Payment Methods in Chrome?”.

The World Wide Web Consortium (W3C) describes itself as an “*international community where Member organizations, a full-time staff, and the public work together to develop Web standards.*“. There are two particular standards that relate to Payment Methods:

“This specification standardizes an API to allow merchants (i.e. web sites selling physical or digital goods) to utilize one or more payment methods with minimal integration. User agents (e.g., browsers) facilitate the payment flow between merchant and user.”

“This specification defines capabilities that enable Web applications to handle requests for payment.”

The two links above give the full specs, including further links to the repos on github for both Payment Request API source code, and Payment Handler API source code. That means you can contribute to the APIs – remember the W3C plus others “*and the public work together to develop Web standards.*“. That’s pretty cool. In addition, or alternatively, you could contribute to your favourite open source browser. If your favourite browser isn’t open source then you can’t contribute to it. That sucks. Of course you could make an open source browser your new favourite, or start your own open source browser…

If you’ve decided you don’t want to allow websites to view your saved payment methods then in Chrome it’s pretty simple to disable it in Chrome 68 Payment Methods.

- Go to Settings
- Link to chrome://settings [linking seems not to work], or
- In Chrome address bar navigate to:
**chrome://settings/**, or - Click the 3 vertical dots to the right of the address bar, then select
**Settings**

- Scroll to the bottom of the page and click
**Advanced**. - Go the the
**Privacy and Security**section. - Go to
**Allow sites to check if you have payment methods saved**and Disable. - That’s it you’re done!

You might be wondering how I noticed such a subtle addition to the Chrome settings. Well as it happens following writing my first 2 Chrome Extensions recently and blogging about them (Hacking Google Chrome – Custom Chrome New Tab Extension, and ReHacking Google Chrome – Customisable New Tab Extension ) I became quite familiar with the Chrome Settings and Extensions. So when the new update came out I noticed the new addition straight away.

It is a good idea to periodically go through the Settings of your Browser and other applications and check you’re happy with them, this is especially important after an update – as in the case of Chrome 68 Payments.

In reality nothing is “safe”, all you can really do is attempt to identify and minimise risk. The best way to do that by being informed – don’t click on links unless you know exactly where the link goes to – as opposed to where is says it goes; keep your software up to date and patched – OS, firewall, antivirus, browser, etc. Periodically review the settings on all the software you use. Only install software from reputable sources. Run regular scans with your preferred anti-malware software.

Any questions or comments use the section below. Now, I’m thinking about a blog for a robot I just finished building, and then there’s that AI thing I’m working on, and the IOT project …

The post Chrome 68 Payment Handler API – is it storing Payment Methods? appeared first on *.

]]>New Tab → Customisable New Tab 🙂 Take control of your web browsing experience with this customisable New Tab Custom Colour Blank Page Chrome Extension. It will allow you to pick a colour for your New Tabs in Chrome, because you can choose from a selection of popular colours (Black, White, Incognito, InPrivate, Red, Yellow, Blue, etc.) or […]

The post ReHacking Google Chrome – Customisable New Tab Extension appeared first on *.

]]>Take control of your web browsing experience with this customisable New Tab Custom Colour Blank Page Chrome Extension. It will allow you to pick a colour for your New Tabs in Chrome, because you can choose from a selection of popular colours (Black, White, Incognito, InPrivate, Red, Yellow, Blue, etc.) or similarly choose from a palette of 256 colours to suit your personal mood and taste. This will replace the default New Tab in Chrome which consists of 2554 lines of HTML and scripts, with a quick loading 10 lines of HTML. Gone will be the Search bar and the 8 Most Recently visited websites.

If you already installed my simpler “New Tab Blank Black Page” or read about it in the blog Hacking Google Chrome – Custom Chrome New Tab Extension then you may also like the extra features this new Extension offers. Or if you are happy with just Black then that simpler Extension is perfect for you.

Another advantage to using this New Tab extension is that you can set the Start Page in Chrome to open your New Tab page. So Chrome will launch even quicker, and it might avoid some awkward moments. Like when you open Chrome or a New Tab and your boss sees a list of recruitment websites in your Most Visited Sites. Or your partner sees you’ve been on dating websites :p . Or most frightening is if your nerd friends see you’ve visited uncool-tech sites <_< , now you can impress them with your customised New Tab. Of course a true nerd will write their own, hey wait a second!

Open Chrome and simply go to the New Tab Custom Colour Blank Page ( ← or click that link) in the Chrome Webstore and click the “*Add to Chrome*” button. That’s it! You will see the Extension icon appear to the right of the Chrome address bar. You can configure the extension by clicking the icon.

Enjoy using the extensions and other apps, feel free to rate them and leave a comment, feedback or suggestion.

The post ReHacking Google Chrome – Customisable New Tab Extension appeared first on *.

]]>Hacking the Chrome New Tab – Speed up your Browsing experience About two-thirds of us use Google Chrome for web surfing. And I’d say about two-thirds of us would like to change the Chrome New Tab page. Well I did anyway. You know the New Tab page with the Search bar and 8 most recently […]

The post Hacking Google Chrome – Custom Chrome New Tab Extension appeared first on *.

]]>About two-thirds of us use Google Chrome for web surfing. And I’d say about two-thirds of us would like to change the Chrome New Tab page. Well I did anyway. You know the New Tab page with the Search bar and 8 most recently opened websites [see picture below]. I don’t like it, it’s slower loading and gets replaced 90% of the time. So I went to the Settings to change it to a blank page (loads faster etc.) but I was surprised to find that there is no such option. Whaaaat! You can only change the New Tab to open a specific URL (or their New Tab page). Previously I would create a local file, e.g. blank.html, and load that. But this time I decided I’d see if I could hack Chrome to bend to my wishes. Well of course you can hack Chrome, in fact they encourage you do so, and even to publish and share your work. So I did just that.

According to the Chrome Developer website “*Extensions are small software programs that customize the browsing experience.*” Sounds perfect and just the ticket. It’s surprisingly easy to write an extension, all I needed was an .html file and a .json file. If you want to publish your Extension on the Chrome Web Store you will need a Chrome Developer account which requires a gmail and a once off $5 fee. But you don’t have to publish it to use it or even share it, you can distribute the extension yourself and people can use it directly however they will have to enable Developer Mode in Chrome in order to enable it initially – but once installed they can turn Developer Mode off again.

It doesn’t get any easier than human-readable tagged languages like HTML and JSON. Firstly you need an HTML file which will be what is displayed when the New Tab opens. This was super easy because I want a blank page – but you can use any valid HTML you like including text, images, links, videos, etc. So here it is below, I just give the page a title “New Tab” and set the colour to Black (#000000).

<!DOCTYPE html> <html> <head> <title>New Tab</title> </head> <body style="background-color:#000000"> <!-- Alan Cowap 2018 --> </body> </html>

All Chrome Extensions require a manifest file named manifest.json, this will be familiar to Android developers (as is the whole HTML + CSS + Javascript MVC pattern to devs of all flavours). The manifest tells the Browser, and the Web Store, about your Extension. The manifest (see code below) is fairly self-explanatory thanks to the fact it’s written in JSON (JavaScript Object Notation) which is human-readable. It uses key:value pairs, so for example the app “name” : “New Tab Blank Black Page”, it also includes the version number, author, icon details etc. And that’s it, the extension is done.

{ "manifest_version": 2, "name": "New Tab Blank Black Page", "version": "0.1", "description" : "New Tab opens with a blank black page", "author": "Alan Cowap", "icons": { "16": "images/NewTab_16x16.png" }, "chrome_url_overrides" : { "newtab": "Blank.html" } }

You have two options on how to use your Chrome Extension:

- Load it directly into your Chrome browser in Developer Mode.
- Publish the Extension on the Chrome Web Store.

The process to Publish in the Chrome Store is given in detail on their Developer website so I will look at option 1. You can view your extensions by typing the following into the address bar in Chrome.

chrome://extensions/

If you want a list of all Chrome URLs then navigate to:

chrome://about/

Note some of these are intended for developers so be advised!

Select the “*Developer mode*“, you will then get an option to “*LOAD UNPACKED*” which you can select and use the Dialog to navigate to the folder containing the HTML and JSON files of your Extension. Once loaded the Extension will be visible with all the other extensions. You should probably de-select “*Developer mode*” right away just to be safe. Just check the button is selected to enable the Extension; now open a New Tab and w00t you’ve got a fast loading privacy respecting blank black page. Congratulations!

You can also set the New Tab page to be the default page that opens whenever you open Chrome – which is a nice bonus. Just navigate to the settings or enter the following URL in Chrome:

chrome://settings/

Go to the “*On startup*” section and choose the option “*Open the New Tab page*“, and you’re all set. Chrome will now load faster and respect your privacy a little better. You can add my Extension to your Chrome here: New Tab Blank Black Page.

Is your inner hacker already thinking about tinkering with the extension? Why a black page, why not white, what about green, or orange, why can’t you pick whatever colour you want? The current extension hardcodes the colour in the HTML, so dynamically picking one will require some JavaScript and … another developer itch needs to be scratched.

[Update] Said itch has now been scratched. Read about it in this blog “ReHacking Google Chrome – Customisable New Tab Extension“. You can install the Chrome Extension “New Tab Custom Colour Blank Page” in the Chrome Webstore (open in Chrome).

The post Hacking Google Chrome – Custom Chrome New Tab Extension appeared first on *.

]]>The Rope of Dreams Recut – Cubic Equations Did you make the most of The Rope of Dreams in my previous post “The Rope of Dreams : Polynomials of the Second Order – Quadratic Equations“. I hope so. Well now you have a chance to take your 120 meter rope and enter another Dimension with Cubic […]

The post The Rope of Dreams Recut: Polynomials of the Third Order – Cubic Equations appeared first on *.

]]>Did you make the most of The Rope of Dreams in my previous post “The Rope of Dreams : Polynomials of the Second Order – Quadratic Equations“. I hope so. Well now you have a chance to take your 120 meter rope and enter another Dimension with Cubic Equations.

Once again you are given the Rope of Dreams, and a Golden Scissors which is the only thing that can cut the Rope of Dreams. You can cut the Rope of Dreams twice (cross section, no longitudinal cuts), which will give you 3 lengths. These lengths will be laid out one for each dimension X, Y, Z (i.e. left-right, backward-forward, up-down), and whatever volume you enclose anywhere on Earth is yours to keep, or do with whatever you wish. You can enclose only a single volume, a single time, and then must return the rope and the scissors. What would you do? You may not think of a Polynomial of the Third Order – a Cubic Equation, but you probably should. In this post we’re talking about cuboids, we’ll leave spherical shapes aside for now.

This time we’ll do the mathematics first and then apply our findings to determine how best to maximise the volume we enclose. In the previous post we derived and proved the following quadratic equation:

Previously: \({ x^2 = (x-n)(x+n) + n^2 }\)

Multiply by \(x\): \({ x^3 = x ((x-n)(x+n) + n^2)}\)

Multiplying this out: \(\boxed{ x^3 = (x-n) x (x+n) + xn^2}\)

And there we have it! The way to maximise volume is to have n=0. Why? Well may you ask. The equation is telling us that if we move n units from x, i.e. \((x-n)\), then the loss of volume will be \(xn^2\). If we don’t want to lose any volume then we should have \(n=0\) because then \(xn^2 = 0\).

With \(n=0\): \({ x^3 = (x-0) x (x+0) + x0^2}\)

Which gives: \({ x^3 = (x) x (x) + 0}\)

Let’s contrast that with moving 50 units from x:

With \(n=50\): \({ x^3 = (x-50) x (x+50) + x50^2}\)

Which gives: \({ x^3 = (x-50) x (x+50) + 2500x}\)

So by moving 50 units we lost a volume of \(2500x\). Ouch!

Let’s prove that: \({ x^3 = (x-n) x (x+n) + xn^2}\)

Moving x: \({ x^3 = (x( (x-n) \cdot (x+n) )) + xn^2}\)

Multiplying: \({ x^3 = (x( x^2 +nx -nx -n^2) ) + xn^2}\)

Simplifying: \({ x^3 = (x( x^2 -n^2) ) + xn^2}\)

Multiplying: \({ x^3 = x^3 -xn^2 + xn^2}\)

Simplifying: \({ x^3 = x^3}\)

Q.E.D.

A cube will give the greatest volume, any other rectangular cuboid will be sub-maximal. So you should cut the 120m rope into three sections of 40m each – this will give you the maximum volume of 40 x 40 x 40 = 64000 m^3. Let’s look at some sample choices:

Two 10 meter sections and a 100 meter section: \( 10 \cdot 10 \cdot 100 = 10000m^3\)

Two 20 meter sections and an 80 meter section: \( 20 \cdot 20 \cdot 80 = 32000m^3\)

Two 30 meter sections and an 60 meter section: \( 30 \cdot 30 \cdot 60 = 54000m^3\)

**Three 40 meter sections: \( 40 \cdot 40 \cdot 40 = 64000m^3\)**

Two 50 meter sections and a 20 meter section: \( 50 \cdot 50 \cdot 20 = 50000m^3\)

A cube is the ideal shape (for cuboids) to maximise volume. The further you move from a cube the greater the loss in volume. The equation is simple to derive and we’ve proved it mathematically, and used sample values for our Rope of Dreams. I hope you found somewhere nice to use it. Send us a postcard!

The Cube is King of the Cuboids: \(\boxed{ x^3 = (x-n) x (x+n) + xn^2}\)

Never one to shy away from a Star Trek connection I will point out that the stalwart of spacetravel for the BORG is their trusty BORG Cube, measuring 3km sides giving a total volume of 27 cubic km. Never one to miss out on an efficiency the BORG know their cubes and their cubic equations. (They also use Spheres – again an optimal shape for surface area to volume).

.

The post The Rope of Dreams Recut: Polynomials of the Third Order – Cubic Equations appeared first on *.

]]>The Rope of Dreams – Polynomial Imagine you are given a length of rope that is 120 meters long, and told that you can go to any place on Earth and whatever you enclose with the rope – is yours to keep, or do with whatever you wish. You can enclose only a single area, […]

The post The Rope of Dreams : Polynomials of the Second Order – Quadratic Equations appeared first on *.

]]>**The Rope of Dreams – Polynomial**

Imagine you are given a length of rope that is 120 meters long, and told that you can go to any place on Earth and whatever you enclose with the rope – is yours to keep, or do with whatever you wish. You can enclose only a single area, a single time, and then must return the rope. What would you do? You may not think of a Polynomial of the Second Order – a Quadratic Equation, but you probably should.

Say a big “Thanks”, take the rope, and start pondering the options. A likely plan is to think of where on Earth you want to go (a tropical island, a bustling city, a countryside retreat, maybe even Fort Knox – it’s your choice), and while en route to your destination figure out how to maximize the area the 120 meter rope can enclose. I’ll leave the destination to your own imagination (you can post in the Comments section below) and turn our attention for now to maximizing the area the rope can enclose once you get there. Did someone say Polynomial!

A likely first question you might have is to get an idea of just how long 120 meters is, so some reference examples might help, note that ‘m’ is short for ‘meter’. A soccer pitch is between 90m and 120m in length; A rugby pitch is 100m – the same as the 100m sprint in Athletics (Usain Bolt, Carl Lewis etc.); An American football pitch is 110m long; A CLG/GAA (Cumann Lúthchleas Gael / Gaelic Athletic Association) pitch is between 130m – 145m in length. For petrol heads, 120m is about 24 Nascars end-to-end, or 21 Formula1 cars end-to-end – that’s almost the entire grid – are you heading to Monaco with your rope?

A second question might be what shape to use, that is a great question and goes to the heart of this blog post. You might think of a **triangle** like the ancient Egyptians; or a **rectangle** shape like so many sports pitches and courts; an **oval** shape like running and race tracks; or a **square** shape like many public Parks. Or maybe you didn’t think about shape at all, maybe you thought shape doesn’t matter; but shape matters a whole lot and we’re about to find out why.

So a triangle could be a good shape to try, and let’s make it a long triangle because it seems logical that the longer it is the more area it will have. Let’s say we go with a triangle with sides of length 50m, 50m, and a base of 20m – that totals 120m. This type of triangle, with two sides of equal length is called an *isosceles triangle*. Now lets calculate the area of the triangle. using the formula below we get an area of \(490m^2\). That seems decent, for 120m length of rope we can cover an area of 490 sq.m.

For a Triangle: \( Area = \frac {base \cdot height} {2} \)

Herons Formula: \( Area = \sqrt {p(p-a)(p-b)(p-c)}\)

where p is half the perimeter i.e. \(p = \frac {a+b+c}{2}\)

Now let’s try another configuration of triangle, one that is more symmetric, in fact an *equilateral triangle* i.e. a triangle with 3 sides of equal length. The equilateral triangle will have sides of 40m, 40m, and 40m – all equal, and totalling 120m. Using Herons Formula above we see that we now have an area of \(693m^2\), that’s over 200 sq.m. more than the previous triangle. With a slight change in how we used our rope we’ve bagged ourselves a considerable area with an equilateral triangle of \(693m^2\).

Rectangle – Wrecked angle, broken square, get it. Heheheh. Ok, so if changing the shape of a triangle can bag us a bigger area, what about roping a rectangle! Once again we’ll go for a longer length and shorter width in the hope the longer dimension pays dividends. Let’s go with a rectangle of sides 50m and width 10m, that’s a total perimeter of 120m (50+10+50+10). This rectangle gives us an area of \(500m^2\). Hmm, that’s a bit better than our original isosceles triangle (490 sq.m.) but a lot less than our equilateral triangle (693 sqm.).

For a Rectangle: \( Area = length \cdot width \)

Now let’s try the same thing we did with the triangles i.e. go for a more symmetric shape, you can’t get a more symmetric rectangle than – a square. That’s right, a square is just a special case of a rectangle where the length and width are equal. A square will have 4 sides of 30m each, totaling 120m and using all our rope. The area of this square will be 30 times 30 i.e. \(900m^2\). That’s more like it, once again a reconfiguration of our shape has yielded a much greater area with a square yielding \(900m^2\).

Applying the lessons we learned from Triangles and Rectangles, it would seem that the more symmetric the shape the greater the area for a given circumference. So what shape is the most symmetric of all? Triangles, Squares, Pentagons, Hexagons, Heptagons, Octagons, and so on. But where does it end, what is the most sided shape you ca make?

Is the ultimate shape the humble Circle, as used in the World Heritage Site Brú na Bóinne in Ireland over 5200 years ago in the prehistoric passage tombs of Newgrange, Nowth and Dowth? Let us see. The perimeter i.e. circumference of the circle we can describe is 120 meters long, using the equations below we can determine the radius of the circle will be \( \frac {60} {\pi} \), we can use that to determine the area of the circle which is \(1146m^2\). Winner! Optimizing out shape by using a circle has yielded us a maximum area to enclose with our rope of \(1146m^2\).

For a Circle: \( Area = \pi r^2 = \pi {( \frac{d}{2} )}^2 \), and \( Perimeter = \pi d \)

Given circumference, C, \( Area = \frac {C^2} {4\pi} \)

Remember that all of these areas were obtained with the same 120 meter long rope, no magic, only mathematics!

\(490m^2\) – Isosceles triangle.

\(693m^2\) – Equilateral triangle.

\(500m^2\) – Long Rectangle.

\(900m^2\) – Square.

\(1146m^2\) – Circle.

I’m glad you asked. This all started when I was looking at numbers on a number line and squaring them and seeing how the values changed. Then I wondered, what is the difference between squaring a number (i.e. multiplying a number by itself); and multiplying the number to the left by the number on the right. So for example if I take the number 6, squaring it gives 36 (i.e. 6 * 6). Multiplying the number to the left by the number on the right is 5 * 7 = 35. 35 differs from 36 by 1. Interesting.

And what if I take the number 8, squaring gives 64; multiplying 7 * 9 = 63, once again this is one less. Interesting! Then I wondered if this relationship held for all numbers. Now multiplying an infinite amount of numbers is too much work, and that’s why we love Algebra because it saves us from all that extra work.

Let me call the number I pick, x. So the number to the left of x is one less i.e. x-1, and the number to the right of x is one more i.e. x+1. The examples above showed that:

My test cases showed: \( x^2 = (x-1)(x+1) + 1 \)

Multiplying this out: \( x^2 = x^2 + x -x -1 +1 \)

Simplifying: \( x^2 = x^2 \)

Q.E.D.

Next I wondered if there was a relationship between moving two spaces left and two spaces right. Taking 6 * 6 = 36, while 4 * 8 = 32; so a difference of 4. Interesting. Taking 8 * 8 = 64, while 6 * 10 = 60; again it is 4 less. Note that 4 is 2 squared i.e. 2 * 2 = 4.

Then I wondered about the relationship with moving 3 places. Since moving one space left a deficit of 1, moving 2 spaces left a deficit of 4, would moving 3 spaces leave a deficit of 9; or would it be 8? Let us see. Taking 6 * 6 = 36, while 3 * 9 = 27, so a deficit of 9. Interesting. Taking 8 * 8 = 64, while 5 * 11 = 55, again a deficit of 9. Note that 9 is 3 squared i.e. 3 * 3 = 9.

Once again, taking x as the initial number, and n as the number of places to move to the left and right, we can see the above results give us the generality:

\(\boxed{ x^2 = (x-n)(x+n) + n^2 }\)

Once again, we should prove the proposed equation.

Starting with \({ x^2 = (x-n)(x+n) + n^2 }\)

Multiplying out \({ x^2 = x^2 +nx -nx -n^2 +n^2 }\)

Simplifying: \( x^2 = x^2 \)

Q.E.D.

You can try the formula with your own values, please comment below if your calculations agree or disagree – and you can provide numbers used, calculations and results. You can confine your calculations to Integers i.e. positive and negative whole numbers including 0.

Great question, and the answer is Yes. The equation tells us algebraically and in a more general and proven way, what we found out empirically by choosing different types of shape. The ideal scenario is to choose a value of n = 0 i.e. not to wander away from the square condition. The further you wander, i.e. the greater n, then the greater \(n^2\) will become. If you move 2, the loss is the square (\(n^2\)) i.e. 4, if you move 3 the loss is 9, if you move 4 the loss is 16, if you move 5, the loss is 25 and so on. This is why the isosceles triangle of 50-50-20 was much worse than the equilateral triangle of 40-40-40. It is also why the rectangle of 50-10-50-10 was much worse than the square of 30-30-30-30.

Another great question. If you look carefully at the boxed equation above you may notice that it is very similar to the equation of a circle, and also very similar to Pythagoras Theorem. But really it boils down to symmetry, the way to get a maximum area with a given perimeter/circumference is to use a circle because it satisfies these equations and gives a maximum value. Corners are inefficient, curves are efficient.

Be mindful the opposite is true when it comes to packing and stacking i.e. corners are efficient and curves are inefficient. The Hexagon is a nice compromise between minimizing perimeter, maximizing area, and maximizing stacking and packing. Somehow bees seem to know this and build their nests accordingly.

Our equation: \(\boxed{ x^2 = (x-n)(x+n) + n^2 }\)

Eqn. of a Circle: \( r^2 = (x-h)^2 + (y-k)^2 \)

Pythagoras Theorem: \( c^2 = a^2 + b^2 \)

Take that Rope of Dreams, decide where you want to go, and if you want to maximize the area you cover – choose a circle. If you liked this post you will probably like the posts on the Monty Hall Problem – Can You Solve This Maths Puzzle? Enjoy!

UPDATE: You’ll definitely like the follow-up post to this which takes things to another Dimension (there’s even mention of the BORG), The Rope of Dreams Recut: Polynomials of the Third Order – Cubic Equations. Triple enjoy!

The post The Rope of Dreams : Polynomials of the Second Order – Quadratic Equations appeared first on *.

]]>Monty Hall Proof – The Formula is here. My two previous posts described the Monty Hall Problem – Can You Solve This Maths Puzzle? and Monty Hall Solution – Advanced! Well, this is the next installment of the trilogy, a simple mathematical proof. If you don’t like Maths (Mathematics, Math) then, well, you have serious problems […]

The post Monty Hall Proof – The Formula appeared first on *.

]]>**Monty Hall Proof – The Formula is here.** My two previous posts described the Monty Hall Problem – Can You Solve This Maths Puzzle? and Monty Hall Solution – Advanced! Well, this is the next installment of the trilogy, a simple mathematical proof.

If you don’t like Maths (Mathematics, Math) then, well, you have serious problems – get some help :^) This isn’t difficult at all, it’s just a bit of simple probability and algebra, yep ALGEBRA

The Probability that you will Win is the quotient of the Number of Cars, and (divided by) the Number of Doors. To represent that symbolically using algebra is simple:

\(P(W) = \frac{NC}{NDtot} \) … Equation (1)

The Probability that you will Lose is a little more interesting, it is the quotient of the Number of Doors less the Number of Cars, and (divided by) the Number of Doors, in symbolic notation this is:

\(P(L) = \frac {NDtot – NC}{NDtot} \) … Equation (2)

There’s one last equation we want, and it says the Probability that we either Win or Lose is 1 – since these are the only two possible events. In other words, we have to either win or lose – there are no other possible events (see my earlier post re the philosophical and physics debates on that general point). Anyway, to represent this symbolically:

\(P(W) + P(L) = 1 \) … Equation (3)

(Equation (3) is based on Kolmogorov’s second axiom i.e. \(P(\Omega) = 1\))

Those 3 Equations give us what we need to check the proof. If the Equations are correct then when we combine the equations the result should give us an equality – that’s why *equations* are also known as e*qualities*!

We start with Equation (3), into which we will substitute P(W) from Equation (1), and P(L) from Equation (2); as follows:

\(P(W) + P(L) = 1 \) … Equation (3)

\(\frac{NC}{NDtot} + \frac {NDtot – NC}{NDtot} = 1 \) … Substituting for P(W) and P(L) … Equation (4)

Now we want to simplify, an easy simplification is to combine the two terms of the left-hand-side of the equation since they have the same denominator (NDtot), which gives us:

\(\frac {NC + NDtot – NC}{NDtot} = 1 \) … Combining the left hand terms

Can you spot the next simplification? Take a look and see. Did you get it? That’s right, the ND and -ND will cancel each other out, giving us:

\(\frac {NDtot}{NDtot} = 1 \) … The NC terms cancel each other out

Can you finish the Monty Hall Proof? Yes, any term divided by itself equals 1, giving us:

\(\frac {1}{1} = 1 \) … we get 1 = 1 which is a proper equality, we did it!

**Q.E.D.**

So it seems we have this all wrapped up, but let’s try it with the actual numbers from the App. We have 3 doors, and 1 car, Recall Equation 4:

\(\frac{NC}{NDtot} + \frac {NDtot – NC}{NDtot} = 1 \)

Now let’s put in our values for total number of doors: NDtot =3, and number of cars NC = 1, giving us:

\(\frac{1}{3} + \frac {3 – 1}{3} = 1 \) … using our actual numbers from the App

\(\frac{1}{3} + \frac {2}{3} = 1 \) …do the math 🙂

\(\frac {3}{3} = 1 \) … great, it’s correct!

**Q.E.D.**

Go ahead and try with 2 cars and 3 doors; or try with 3 cars 3 doors, or 4 cars and 20 doors, it even works with 4 cars and 3 doors 😀

I hope you enjoyed the Monty Hall Proof, including the previous posts, and found them informative. Feel free to leave a comment, or if you see an error let me know, finally a nod to Andrey Kolmogorov and his pioneering work on Probability, he was born 115 years and 1 week ago.

Checkout the code on GitHub.

Get the free Monty Hall Game on Google Play.

The post Monty Hall Proof – The Formula appeared first on *.

]]>This post “Monty Hall Solution” continues on from my previous post Monty Hall Problem – Can You Solve This Maths Puzzle? If you haven’t read that post, then read it now before reading this. Because I will now show you even more Monty Hall Solution coolness! We saw that you could increase (double) your chances of winning a car […]

The post Monty Hall Solution – Advanced! appeared first on *.

]]>This post “Monty Hall Solution” continues on from my previous post Monty Hall Problem – Can You Solve This Maths Puzzle? If you haven’t read that post, then read it now before reading this. Because I will now show you even more Monty Hall Solution coolness! We saw that you could increase (double) your chances of winning a car by understanding some maths, so let’s delve further into it and who knows, you might win something big (then again you might not, but hey!).

So what happens, if there are 4 doors instead of 3 doors? And what happens if there are 5 doors, 6 doors, hmmm, more code required – cool!

Checkout the code on GitHub.

Get my free Monty Hall Game on Google Play.

For 4 doors we would expect that the odds would be 1/4 (**25%**) for not changing Vs 1.5/4 (**37.5%**) for changing. “*How did you get those figures?*” I hear you ask. Well, with 4 doors, each door has a 25% chance of being correct. Our 1st chosen door has a 25% chance – the other 3 doors have a combined 75% chance. When Monty removes one of those 3 doors by opening it -the remaining 2 doors still have a combined 75% chance – which is now divided by the 2 remaining doors i.e. 37.50% chance each. Once again the figures from the 70 million simulations are very precise.

Doors in Game: 4 Unchanged Wins: 2498993, Changed Wins: 3750566Unchanged Wins: 24.99%, Changed Wins: 37.51%Unchanged Wins: 2498720, Changed Wins: 3750419Unchanged Wins: 24.99%, Changed Wins: 37.50%Unchanged Wins: 2500812, Changed Wins: 3748980Unchanged Wins: 25.01%, Changed Wins: 37.49%Unchanged Wins: 2499171, Changed Wins: 3747829Unchanged Wins: 24.99%, Changed Wins: 37.48%Unchanged Wins: 2499602, Changed Wins: 3749207Unchanged Wins: 25.00%, Changed Wins: 37.49%Unchanged Wins: 2497548, Changed Wins: 3748332Unchanged Wins: 24.98%, Changed Wins: 37.48%Unchanged Wins: 2499206, Changed Wins: 3749860Unchanged Wins: 24.99%, Changed Wins: 37.50%

For 5 doors we would expect the odds to be 1/5 (**20%**) vs 1.33/5 (**26.66%**). These figures are derived as described above for 4 doors. So how does the simulation match up, well very precisely thank you:

Doors in Game: 5 Unchanged Wins: 1997315, Changed Wins: 2667064Unchanged Wins: 19.97%, Changed Wins: 26.67%Unchanged Wins: 1999994, Changed Wins: 2666099Unchanged Wins: 20.00%, Changed Wins: 26.66%Unchanged Wins: 2001180, Changed Wins: 2667386Unchanged Wins: 20.01%, Changed Wins: 26.67%Unchanged Wins: 1999664, Changed Wins: 2667039Unchanged Wins: 20.00%, Changed Wins: 26.67%Unchanged Wins: 2000629, Changed Wins: 2668808Unchanged Wins: 20.01%, Changed Wins: 26.69%Unchanged Wins: 1999954, Changed Wins: 2665963Unchanged Wins: 20.00%, Changed Wins: 26.66%Unchanged Wins: 1998652, Changed Wins: 2667357Unchanged Wins: 19.99%, Changed Wins: 26.67%

Odds are 1/6 (**16.66%**) for not changing door, vs 1.25/6 (**20.83%**) for changing door. And yes, the simulation agrees…

Doors in Game: 6 Unchanged Wins: 1663952, Changed Wins: 2083233Unchanged Wins: 16.64%, Changed Wins: 20.83%Unchanged Wins: 1667182, Changed Wins: 2083964Unchanged Wins: 16.67%, Changed Wins: 20.84%Unchanged Wins: 1666971, Changed Wins: 2083919Unchanged Wins: 16.67%, Changed Wins: 20.84%Unchanged Wins: 1666952, Changed Wins: 2083654Unchanged Wins: 16.67%, Changed Wins: 20.84%Unchanged Wins: 1666734, Changed Wins: 2083798Unchanged Wins: 16.67%, Changed Wins: 20.84%Unchanged Wins: 1666166, Changed Wins: 2082401Unchanged Wins: 16.66%, Changed Wins: 20.82%Unchanged Wins: 1667218, Changed Wins: 2086789Unchanged Wins: 16.67%, Changed Wins: 20.87%

And so on, as the number of doors increases we find that sticking or twisting becomes less important as 2 doors is an increasingly small fraction of the total number of doors i.e. 2/3, 2/4, 2/5, 2/6, 2/7 etc.

Just if you’re curious, here is a run of 10 million games for each number of doors (3-9), so a total of 70 million games. You can see the gap narrowing as the number of doors increases.

Doors in Game: 3 Unchanged Wins: 3332776, Changed Wins: 6667224Unchanged Wins: 33.33%, Changed Wins: 66.67%Doors in Game: 4 Unchanged Wins: 2500354, Changed Wins: 3749370Unchanged Wins: 25.00%, Changed Wins: 37.49%Doors in Game: 5 Unchanged Wins: 2000567, Changed Wins: 2665857Unchanged Wins: 20.01%, Changed Wins: 26.66%Doors in Game: 6 Unchanged Wins: 1665930, Changed Wins: 2083850Unchanged Wins: 16.66%, Changed Wins: 20.84%Doors in Game: 7 Unchanged Wins: 1430746, Changed Wins: 1713655Unchanged Wins: 14.31%, Changed Wins: 17.14%Doors in Game: 8 Unchanged Wins: 1250934, Changed Wins: 1458256Unchanged Wins: 12.51%, Changed Wins: 14.58%Doors in Game: 9 Unchanged Wins: 1111668, Changed Wins: 1271298Unchanged Wins: 11.12%, Changed Wins: 12.71%

Feel free to download/fork the code and test it yourself, modify the number of doors and play around with it and see how the numbers come out. There is still something I want to do with this Monty Hall Problem / Monty Hall Solution before I put it down. Hmm, more thinking and typing required, expect a final post on this topic …

Questions or comments welcome below, and contributions to the code are welcome too, it is available on here Github

P.S. Nod to Cepheus~commonswiki for the images.

The post Monty Hall Solution – Advanced! appeared first on *.

]]>The Monty Hall Problem is an interesting Maths Puzzle – with a hotly disputed answer. Monty Hall is a well known American TV Show presenter, and this particular maths puzzle gained some notoriety on his TV Show – hence the name “Monty Hall Problem”. The puzzle is quite simple to understand, but as is so often the […]

The post Monty Hall Problem – Can You Solve This Maths Puzzle? appeared first on *.

]]>The Monty Hall Problem is an interesting Maths Puzzle – with a hotly disputed answer. Monty Hall is a well known American TV Show presenter, and this particular maths puzzle gained some notoriety on his TV Show – hence the name “Monty Hall Problem”. The puzzle is quite simple to understand, but as is so often the case it is a little more tricky (and fun) to figure out the answer.

World famous mathematicians have gone to their grave disputing the answer. But I’ll explain it in easy to understand language, and demonstrate a proof using a computer simulation I wrote which played no less than 70 million games. The source code for the simulation is available on GitHub so you can review it yourself

Get the free Monty Hall Game on Google Play.

Monty shows you 3 doors which are closed. You are told that behind one of the doors is a car, behind the other 2 doors lies a Goat. If you choose the correct door you win the car. The doors are labelled 1, 2, and 3. Let’s say you choose Door 1. In an unexpected twist Monty opens say Door 3 – behind which stands a goat! Monty then asks you “Do you want to stick with Door 1, or do you want to choose Door 2 instead?”.

So do you stick or twist? You can stick with Door 1 or try your luck with Door 2. Monty is waiting. Your heart is racing. The crowd are shouting in equal measure “Door 1” and “Door 2”, some jokers are even shouting “Door 3” ]:>

Not so fast. The fun is figuring out the correct answer – if there is a correct answer. What I’m going to do is put forward an answer and explanation, then I’ll write a software program to simulate this scenario 70,000,000 (70 million) times and see if it agrees with my proposed answer. Is it better to stick or to twist – or does it make any difference? I’ll share the results (and the code) of this simulation with you. In the meantime, you can try to solve the puzzle by yourself. But before that, I’ll propose an answer – spoiler alert – don’t read the next paragraph if you don’t want to see the proposed answer.

Ok then, you’ve racked your brains and thought through all sorts of statistical slight-of-hand and complex combinations and permutations and convinced yourself you have the correct answer. Stick or twist? Well , it turns out you should have …

changed to Door 2 – by doing so you will have doubled your chances of winning the car. If you got it right well done, if not sorry it looks like you’re getting the bus home!

As odd or counter-intuitive as this may seem the explanation is relatively straightforward. Each door had a 1/3 chance of being the correct door. You chose Door 1 – which had a 1/3 chance of being correct; however, jointly Door 2 and Door 3 have a 2/3 chance of being correct.

Once you discover that Door 3 is incorrect (when Monty opens it and the Goat is there) the odds for Door 2 and Door 3 being correct still remains at 2/3. But since Door 3 is ruled out that means Door 2 alone retains that 2/3 chance of being correct. Door 1 also retains it’s 1/3 chance of being correct. Therefore, sticking with Door 1 gives you 1/3 chance, while changing to Door 2 gives you a 2/3 chance.

If you find that hard to believe, and you think it’s a 1/2 (50:50) chance I can understand that. And you’re in good company, some world class mathematicians are with you. But I’m going to demonstrate that you should have changed to double your chances of winning!

You might be thinking that Door 1 and Door 2 now have a 1/2 chance each, but that would be ignoring history (a perilous endeavour in any part of life). Statistical trends will tend to be correct over a larger sample (number of samples, time, etc.) but statistics don’t always apply well to individual cases. Let’s look at an example: if you sample 100 families and find between them they have a total of 240 children, then statistically the average family has 2.4 children. Clearly this statistic can’t be applied to an individual family because no-one will have 0.4 of a child! However, as you increase the sample size you will find the statistic is reasonably accurate.

Another hypothetical example of statistics “remembering history” is this. You walk into a room and someone is about to roll a die (note that *die* is singular of *dice*) and they ask you to guess what number will be rolled. You know that each number has a 1/6 chance of being rolled, right? But then the person tells you “I’ve already rolled the die 5 times, and I rolled, 1,2,4,5,6”. Will this change your thinking of which number to pick. Will you now pick 3? Has knowing the history or the roll changed what the die is going to do? Knowing previous behaviour can be a predictor for future behaviour.

Like any scientist I propose that it’s critical to test a thesis against empirical data, thus we can either validate or invalidate the thesis. After all, we’re interested in verifiable, reproducible knowledge. So will we see the 1/3 to 2/3 distribution?

Umm, yes! First time running the computer simulation and the numbers were uncannily as expected. After 10 million simulations of the game the ratio was pretty precise at 1/3 (**33.33%**) vs 2/3 (**66.66%**) in favour of changing door. I ran the 10 million simulations 7 times and here are the results of those 70 million simulated games.

Doors in Game: 3 Unchanged Wins: 3332705, Changed Wins: 6667295Unchanged Wins: 33.33%, Changed Wins: 66.67%Unchanged Wins: 3335814, Changed Wins: 6664186Unchanged Wins: 33.36%, Changed Wins: 66.64%Unchanged Wins: 3334332, Changed Wins: 6665668Unchanged Wins: 33.34%, Changed Wins: 66.66%Unchanged Wins: 3333829, Changed Wins: 6666171Unchanged Wins: 33.34%, Changed Wins: 66.66%Unchanged Wins: 3333535, Changed Wins: 6666465Unchanged Wins: 33.34%, Changed Wins: 66.66%Unchanged Wins: 3331383, Changed Wins: 6668617Unchanged Wins: 33.31%, Changed Wins: 66.69%Unchanged Wins: 3331153, Changed Wins: 6668847Unchanged Wins: 33.31%, Changed Wins: 66.69%

Whaaaat! Having written the program I can see how these results are kind of inevitable*, so I decided to see if the results held up for different numbers of doors. That required a bit more flexibility in the code so no problems there w00t! ¯\_(ツ)_/¯

* it’s not possible to programmatically do anything “randomly”, we can only do pseudo-random. Indeed t’s a longstanding philosophical argument (which also persists in Physics) about whether things can happen “randomly” or whether things are causal and even deterministic. Schrödinger’s Cat vs Copenhagen Interpretation anyone meoow!

If you want to see some more cool work I did on this puzzle check out the follow on post Monty Hall Solution – Advanced! including having more than 3 doors (actually up to 9 doors and more)!! So many doors, so few cars (so many goats).

Questions or comments welcome below, and contributions to the code are welcome too, it is available on Github

P.S. Nod to Cepheus~commonswiki for the images.

The post Monty Hall Problem – Can You Solve This Maths Puzzle? appeared first on *.

]]>