Skip to main content

Posts

Showing posts from November, 2013

Maths: Finding the Shortest Grid Paths Possibilities

This is a brain teaser. The rule is we are only allowed to use the the grid line (the border of each box) to reach the destination . Shortest Path Let's find the shortest path to reach the destination. If we start from the top left, to go diagonally to the bottom right, we will have two options to move, those are: down — right . Other than those, we won't be going on the shortest path. If we start from the bottom left, and we have to reach the top right, then we'll have two options, those are up — right . I put different colours, green and red, so you can see them. In that example, we have 6 steps as our shortest path. How to Actually Get the Shortest Route (Steps)? By counting along the side borders of the grid. Or Adding the total rows and columns. Let's generalise the method. For example 3 by 3 (3 rows, 3 columns) grid above, the minimum steps from top left corner to bottom right corner will be: ${Total Rows} + {Total Col...

How to Convert Binary to Decimal?

This is a bread. The numeral system we always use is the Decimal System , which consists of ten different numbers: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 The Binary System is the base in computational world, to represent the bit encoded data. This numeral system only consists of 2 numbers: 0 and 1 Binary to Decimal Conversion It's easier if I just put an example of this. But before we start, to indicate the different system, usually the number has a subscript thingy so we won't be confused between those two. Like so: 1001 2 or 11001 2 ➡️ binary . 1024 10 or 2357 10 ➡️ decimal . That "subscript thingy" is called the radix subscript . It's not a mathematical operator — just a positional label for which base you're dealing with. Binary to Decimal Conversion Examples 101 2 = ( 1 x 2 2 ) + ( 0 x 2 1 ) + ( 1 x 2 0 ) 101 2 = ( 4 + 0 + 1 ) 10 101 2 = 5 10 ...
Monkey Raptor uses cookies for analytics, advertisements, and functionality. More info on Privacy Policy