Collected here are ideas and concepts we will make use of in various projects.

(Some of the items formed part of training courses)

#### The puzzle – Version 1

Although its presented as a mathematics problem, the same concept can be applied more widely, which is how we will use it later.**Puzzle:****Using only positive non 0 Integers is it possible to create a negative number using only the operation of: + (add) or * (multiply)?**

ie. Is there is a way to create a “negative Integer” using only “positive Integers” without using a – (minus).

The answer appears (even without a formal proof) to be NO.

Attempting to verify the above using only pencil and paper (lots of them) supports our conclusion no matter how hard we try.

But what happens if we perform the above verification using software?

Firstly, computers cannot store and manipulate infinitely large numbers.

Secondly, negative numbers must also be represented in some “standard” form within the limitations of the computer.

Without going into all the details, if you attempt to “prove” the above on a computer using numerical (not symbolic) techniques some odd things might happen….

A positive number can overflow and become negative, with other permutations also possible.

Hence a correct (abstract) theory when poorly implemented on a computer can produce incorrect results.

We already knew this, but its worth pointing it out…

Lets now broaden the concept to something more general.

What we had was a set of items (positive Integers) and some tools (operations: +, *) we could use on them and no matter what we did we still ended up with positive Integers.

It means that the you are “stuck” with positive Integers and cannot create other number types (reals, complex, negative, etc).

This property can be very useful when securing communications.

Example:

Lets assume the command to turn something “on” is the value 1 and to turn it off is the value 2.

It rejects all other values (including negative).

At some point you decide to allow remote access.

You could simply allow the external systems to send 1 and 2 to achieve control.

Alternatively you could modify the protocol to require all external commands to be the negative of the desired command.

ie. -1 and -2.

This enables the external system to clearly signal its requirements, but without any “translation” it cannot actually achieve the result.

We will make use of this technique and extend it in later projects.

Notes:

1. The verification technique above cannot be considered a “formal proof” as it is insufficiently rigorous.

2. Representing negative numbers:

Its worth understanding a few bits about negative numbers to avoid the pitfalls explained above.

One’s Compliment:

https://en.wikipedia.org/wiki/Ones%27_complement.

Not that useful due to the limitations.

Two’s Compliment:

https://en.wikipedia.org/wiki/Two%27s_complement

Useful and common.

Setting the High Bit to 1:

Ok for very low level and simple systems.

Very poor for arithmetic (without a lot of work).

#### The puzzle – Version 2

We can turn the above puzzle into a challenge and examine some of its aspects.

**The Challenge:***Using only the words: letterbox, giraffe, coffee, brick and potato describe a fire truck.*

Our first effort might go something like:

Its not made of **potato**, is as long as a **giraffe** is high, is no use with **bricks**…etc

But that’s breaking the rules because we added lots of extra words (**its**, **not**, **made**, **of**, **is)** and the rule is: we must only use the **five words specified**.

So lets try a few options just using them, a few (nearly) sensible combinations are:

brick potato

letterbox potato

giraffe potato

brick letterbox

potato letterbox

giraffe letterbox

potato letterbox

brick giraffe

potato brick

Some nearly make sense but none are getting close to describing a fire truck (no real surprise!)

You can continue to mess about with various arrangements, some are quite entertaining, but none get close to a fire truck.

And the reason (obviously) is that the words (tools) are simply not up to the job.

Q: Can we make use of this?

A: Yes! One way to increase security of externally facing computers is to only expose commands/protocols that are incapable of directly controlling the internal target.

An internal system must be used to authenticate, reformat, translate and construct the required commands/protocols for the target.

This does not prevent external interference, but can greatly restrict its capability.

#### Another challenge

This was used in a course to illustrate just how difficult it is to reliably store data.

**Challenge:***You must store one (1) BIT of information for the time specified.The BIT could be: bit yes/no, on/off, existence/non-existence, horizontal/vertical or any other binary method.When the time limit expires your “BIT” must still be readable (whatever that means!)*

Now the interesting part.*Your opponent(s) will attempt to find any way to prevent the BIT being “read”, they win if they can do this.*

The best way to see how it works is to play it to see and see what happens.

The trick is to extend the time longer and longer….that’s when things get very tricky.

To survive an hour is easy, a week is a bit harder, 100 years slows most people down, 5 billion years…if they have stuck with it…they can see the point.

Storing data reliably is not that easy as time extends .