SlideShare a Scribd company logo
1 of 22
Download to read offline
Mathematics
of
blocks
Author:
lrcvs / Xkrouhn
01.06.2015
Acknowledgements
A's friends: http://www.freebasic.net/forum
In alphabetical order:
dodicat
fxm
Richard
For the interest and development of the program with FreeBasic.
The math block is child's play
As shown in the figure, the blocks are composed of elements, which are
the work unit with blocks.
1 element = 1 unit
With the elements, we can create rows or columns.
The row is a set of horizontally grouped elements.
The column is a set of grouped elements vertically.
Grouping rows or columns, formed surfaces or levels.
If we combine various levels, we get a block.
The Dimensions
Some science fiction movies with space matters, almost always tend to
say this in one or another dimension
We define the dimensions 1D, 2D, 3D, 4D, 5D and 6D ....
1D is formed by rows or columns of elements.
2D: this consists of rows and columns of elements.
3D: This consists of rows and columns, grouped into levels or layers.
4D: consists of several blocks, 3D grouped in rows.
5D: consists of several blocks, 3D grouped in rows and columns.
6D: consists of several blocks, 3D grouped in rows and columns, and
levels.
Linking blocks would form on 7D, 8D, 9D, etc, etc ..
These three figures are equivalent, all have 27 elements. Can transform
the various ways (dimensions, blocks, 1D, 2D, 3D ...) different, but still
have the same elements, they are all equivalent, keep the same number
of elements.
The concepts
In this work, the positions of the elements, rows, columns, and levels,
will count as follows:
Rows, columns, or blocks Levels and Dimensions
1 = Rows, always up and down.
2 = Columns, always from left to right
3 = Levels, always from top to bottom.
4 = Blocks or dimensions, from left to right and top to bottom.
A very important observation:
"The number of rows <= the number of columns."
Were it otherwise, these calculations would be wrong
Calculation of positions
Data released:
Block data unit:
FU = Number of rows of the block unit
CU = Number of columns of the block unit
NU = Number of block unit levels
BU = number of identical blocks to the block unit
The data of the position of the item to search:
PF = Position row
PC = Position Column
PN = Position Level
PB = Number of Block
General formula for calculating the position of the item to search =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
This formula is the result of combining the different levels of calculation
of the position of an element, depending on the arrangement of the unit
blocks.
2D
Using the general formula we can calculate the position of an element in
a table or standard 2D
Unit block data Example:
FU = 5 CU = 6 S = 1 BU = 1 elements = 5 * 6 * 1 * 1 = 30
Item data to search:
PF = 4 PC = 5 PN = 1 PB = 1
Position the element =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
((4-1) * 6) + 5 + ((5 * 6 * (1-1))) + ((5 * 6 * 1) * (1-1)) = 23
We can also be calculated as follows:
2D position = ((PF - 1) * CU) + PC
Substituting values for the variables, we obtain also the position in a 2D
system:
((4-1) * 6) + 5 = 23
3D
Using the general formula we can calculate the position of an element
on a level table or 3D
Unit block data Example:
FU = 3 CU = 3 NU = 3 BU = 1 Items = 3 * 3 * 3 * 1 = 27
Item data to search:
PF = 3 PC = 3 PN = 3 PB = 1
Position the element =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
((3-1) * 3) + 3 + ((3 * 3 * (3-1))) + ((3 * 3 * 3) * (1-1)) = 27
We can also calculate the position as follows:
3D = position ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1)))
Replacing the variables by their values, also we get the position in a 3D
system:
((3-1) * 3) + 3 + ((3 * 3 * (3-1))) = 27
4D
Using the general formula we can calculate the position of an element in
a table or level 4D
Unit block data Example:
FU = 3 CU = 3 NU = 3 BU = 3 elements = 3 * 3 * 3 * 3 = 81
Item data to search:
PF = 2 PC = 2 PN = 2 PB = 3
Position the element =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
((2-1) * 3) + 2 + ((3 * 3 * (2-1))) + ((3 * 3 * 3) * (3-1)) = 68
From 3D, we will always use general formula, simply must know the
number of blocks we have in the system.
5D
Unit block data Example:
FU = 3 CU = 3 NU = 3 BU = 9 elements = 3 * 3 * 3 * 9 = 243
Item data to search:
PF = 1 PC = 1 PN = 1 PB = 9
Position the element =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
((1 - 1) * 3) + 1 + ((3 * 3 * (1 - 1))) + ((3 * 3 * 3) * (9 - 1)) = 217
6D
Unit block data Example:
FU = 3 CU = 3 NU = 3 BU = 27 elements = 3 * 3 * 3 * 9 = 729
Item data to search:
PF = 3 PC = 3 PN = 2 PB = 27
Position the element =
((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1))
((3-1) * 3) + 3 + ((3 * 3 * (2-1))) + ((3 * 3 * 3) * (27-1)) = 720
Round the problem
In this chapter, we turn to the problem, we know the composition (rows,
columns, levels) of the block unit and the position of the element.
Now we look for the row, column, and block level indicated where the
item is located.
Psudocodes will use to calculate each stage of the process, at the end
of all processes, there is a program in Basic, which includes various
stages, to calculate the row of the item you seek.
If we make the stages sequentially, we can not calculate the partial data.
Using pseudocode, it is because they are very simple and everyone can
play her the way, as simple as possible.
These processes are general, they serve for all cases.
We will use this more complex example:
Data we need in this example:
F = Number of rows of the block unit = 3
C = Number of columns of the block unit = 3
N = Number of unit block levels = 3
B = Number of block search
P = Position the item to search = 683
INT = Part entire Mod = Division remainder
The block
Here we calculate the block where the search item.
1D calculation rule, by common sense .
2D, the level is = 1.
CALCULATE BLOCK
F = 3
C = 3
N = 3
P = 683
If P MOD (F * C * N) <> 0 Then
B = INT (P / (F * C * N)) + 1
Else
B = INT (P / (F * C * N))
End if
Write "BLOCK =" B
End
BLOCK = 26
Comment:
By common sense, if the position of the element to find, the divide
between the elements of the block unit (F * C * N), we obtain the blocks
drive that contains the element to look or in other words the position
where the item is located to search.
We note that if the remainder is "0" means that the search positions, is
on the last item in a block.
Otherwise, it is in any position other block or unit block (the first), so
the ratio we add a "1".
Level
CALCULATE LEVEL
F = 3
C = 3
N = 3
B = 26
P = 683
Level = INT (P / (F * C)) + 1
If P MOD (F * C) = 0 Then
Level = Level -1
Else
Level = Level
End If
K = Level - ((B-1) * N)
Write "LEVEL =" K
End
LEVEL = 1
Comment:
A level consists of rows and columns = F * C = Level.
If we divide the position we're in, between the number of elements in a
level, "P / (F * C)", we get that level we find, however, this calculation
would be as if our example was a block of 3F * 3C * 81N, if at all levels of
our system, we subtract the level where we are, "Level - ((B-1) * N)", we
get the level of a single block.
The column
CALCULATE COLUMN
C = 3
P = 683
If P <C then
CO = P
Else
CO = P MOD C
End If
If P MOD C = 0 Then
CO = C
Else
CO = CO
End If
Write "COLUMN =" CO
End
COLUMN = 2
Comment:
We see that if the position to seek, is less than the number of columns
of the block unit, the position of the spine to look for, is equal to the
position where we are.
If P < C then CO = P
The rest of the process is equal to the level.
The Row
CALCULATE ROW
F = 3
C = 3
N = 3
B = 26
P = 683
Level = INT (P / (F * C)) + 1
If P MOD (F * C) = 0 Then
Level = Level -1
Else
Level = Level
End If
N = Level <<< see comment on the level
F = INT (((P-CO-((F * C) * (N-1))) / C) +1) <<< Formula to calculate the row
Write "ROW =" F
ROW = 3
After this sequence of calculation, we get all the data, the element to
look is in:
BLOCK = 26
LEVEL = 1
COLUMN = 2
ROW = 3
Epilogue
You keep thinking that math block is child's play?
Which you find applications to these formulas?
Possible applications:
Informatics, Robotics, 3D Automated Storage, Cryptography, 3D
Graphics integers.
In computing, it is shown that all vector / Dim 2D, 3D, 4D ..., can be
converted into a Vector / Dim 1D.
3D storage, knowing the number of rows, columns and store levels, you
simply need to indicate the position and the program breaks down in
row number, column number and level number where the object is to
find.
3D graphics, may indicate a 3D point by a value, for example point 3 * 3
* 3, its position is 27, then decompose and get X, Y, Z (Row, Column,
Level).
In cryptography and coding coordinates, etc, etc.
For more information and to see the beginning of this work:
http://www.freebasic.net/forum/viewtopic.php?f=3&t=19820
Repository:
http://es.slideshare.net/ZkrouhnZyx/matematicas-con-bloques
To write comments
lrcvs@yahoo.es
Dedicated to all people who are curious.
Basic programs
Program to calculate the position of the element to find.
:::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::
cls
input "unit block rows ="; ro
input "unit block columns ="; co
input "unit levels block ="; it
print
input "Row Position ="; a
input "Column = Position" b
input "Position Level =" c
input "block number ="; d
P = ((a - 1) * co) + b + ((ro * co * (c - 1))) + ((* co ro * le) * (d-1))
print "position ="; p
end
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Program to find the row, column, and block level where there is an
element for.
Data required:
Rows of the block unit
Columns of the unit block
Block unit levels
Position to search
:::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::::::::
cls
input "Number of rows of the block unit (rows <= columns) ="; r
input "Number of columns of the block unit (columns> = rows) =" c
input "Number of levels block unit ="; l
input "Position to seek ="; p
h = l
'Calculating block
if p mod (r * c * l) <> 0 then
d = int (p / (r * c * l)) + 1
else
d = int (p / (r * c * l))
end if
'Calculated level
l = int (p / (r * c)) + 1
if p mod (r * c) = 0 then l = l-1
'Calculated column
if p <c then a co = p
if p> = c then a co = p mod c
if mod p c = 0 then co = c
'Calculate row
f = ((p-co - ((r * c) * (l-1))) / c) +1
':::::::::::::::::::::::::::::::::
print
color 12
print "blo =" d, "fil =" f; "Col ="; co; "Lev ="; l - ((d-1) * h)
end
END

More Related Content

What's hot

1.4 review on log exp-functions
1.4 review on log exp-functions1.4 review on log exp-functions
1.4 review on log exp-functions
math265
 
7th pre alg -l51
7th pre alg -l517th pre alg -l51
7th pre alg -l51
jdurst65
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functions
math123c
 

What's hot (20)

5 algebra of functions
5 algebra of functions5 algebra of functions
5 algebra of functions
 
Leip103
Leip103Leip103
Leip103
 
4.1 inverse functions t
4.1 inverse functions t4.1 inverse functions t
4.1 inverse functions t
 
2.1 the basic language of functions t
2.1 the basic language of functions  t2.1 the basic language of functions  t
2.1 the basic language of functions t
 
Dr graphically worked
Dr graphically workedDr graphically worked
Dr graphically worked
 
10.5 more on language of functions x
10.5 more on language of functions x10.5 more on language of functions x
10.5 more on language of functions x
 
Algo>Arrays
Algo>ArraysAlgo>Arrays
Algo>Arrays
 
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCEDATA STRUCTURE CLASS 12 COMPUTER SCIENCE
DATA STRUCTURE CLASS 12 COMPUTER SCIENCE
 
1.4 review on log exp-functions
1.4 review on log exp-functions1.4 review on log exp-functions
1.4 review on log exp-functions
 
Matlab Overviiew 2
Matlab Overviiew 2Matlab Overviiew 2
Matlab Overviiew 2
 
Python PCEP Creating Simple Functions
Python PCEP Creating Simple FunctionsPython PCEP Creating Simple Functions
Python PCEP Creating Simple Functions
 
Paper id 71201914
Paper id 71201914Paper id 71201914
Paper id 71201914
 
7th pre alg -l51
7th pre alg -l517th pre alg -l51
7th pre alg -l51
 
1.5 notation and algebra of functions
1.5 notation and algebra of functions1.5 notation and algebra of functions
1.5 notation and algebra of functions
 
Digital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERSDigital textbook -EXPONENTS AND POWERS
Digital textbook -EXPONENTS AND POWERS
 
BazzucchiCampolmi
BazzucchiCampolmiBazzucchiCampolmi
BazzucchiCampolmi
 
Higher Order Procedures (in Ruby)
Higher Order Procedures (in Ruby)Higher Order Procedures (in Ruby)
Higher Order Procedures (in Ruby)
 
Exercicios de integrais
Exercicios de integraisExercicios de integrais
Exercicios de integrais
 
Difference quotient algebra
Difference quotient algebraDifference quotient algebra
Difference quotient algebra
 
Functions
FunctionsFunctions
Functions
 

Similar to Math blocks

data structure and algorithm Array.pptx btech 2nd year
data structure and algorithm  Array.pptx btech 2nd yeardata structure and algorithm  Array.pptx btech 2nd year
data structure and algorithm Array.pptx btech 2nd year
palhimanshi999
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
Kumar
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
Eelco Visser
 

Similar to Math blocks (20)

Python cheatsheat.pdf
Python cheatsheat.pdfPython cheatsheat.pdf
Python cheatsheat.pdf
 
1st lecture.ppt
1st lecture.ppt1st lecture.ppt
1st lecture.ppt
 
Bcsl 033 solve assignment
Bcsl 033 solve assignmentBcsl 033 solve assignment
Bcsl 033 solve assignment
 
Coin Changing, Binary Search , Linear Search - Algorithm
Coin Changing, Binary Search , Linear Search - AlgorithmCoin Changing, Binary Search , Linear Search - Algorithm
Coin Changing, Binary Search , Linear Search - Algorithm
 
data structure and algorithm Array.pptx btech 2nd year
data structure and algorithm  Array.pptx btech 2nd yeardata structure and algorithm  Array.pptx btech 2nd year
data structure and algorithm Array.pptx btech 2nd year
 
Data structure lecture 4
Data structure lecture 4Data structure lecture 4
Data structure lecture 4
 
Chap05alg
Chap05algChap05alg
Chap05alg
 
Chap05alg
Chap05algChap05alg
Chap05alg
 
1D Array
1D Array1D Array
1D Array
 
10. Getting Spatial
10. Getting Spatial10. Getting Spatial
10. Getting Spatial
 
Sorting
SortingSorting
Sorting
 
Lecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structureLecture 02: Preliminaries of Data structure
Lecture 02: Preliminaries of Data structure
 
Darkonoid
DarkonoidDarkonoid
Darkonoid
 
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericosKristhyan kurtlazartezubia evidencia1-metodosnumericos
Kristhyan kurtlazartezubia evidencia1-metodosnumericos
 
03-Lists.ppt
03-Lists.ppt03-Lists.ppt
03-Lists.ppt
 
Data structure using c module 1
Data structure using c module 1Data structure using c module 1
Data structure using c module 1
 
10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues10 Linked Lists Sacks and Queues
10 Linked Lists Sacks and Queues
 
Data structure 8.pptx
Data structure 8.pptxData structure 8.pptx
Data structure 8.pptx
 
Linked list Output tracing
Linked list Output tracingLinked list Output tracing
Linked list Output tracing
 
Declarative Type System Specification with Statix
Declarative Type System Specification with StatixDeclarative Type System Specification with Statix
Declarative Type System Specification with Statix
 

Recently uploaded

Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
PirithiRaju
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Sérgio Sacani
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Sérgio Sacani
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
seri bangash
 

Recently uploaded (20)

Introduction to Viruses
Introduction to VirusesIntroduction to Viruses
Introduction to Viruses
 
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
Human & Veterinary Respiratory Physilogy_DR.E.Muralinath_Associate Professor....
 
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
High Profile 🔝 8250077686 📞 Call Girls Service in GTB Nagar🍑
 
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 22 (Delhi) Call Girl Service
 
Pests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdfPests of mustard_Identification_Management_Dr.UPR.pdf
Pests of mustard_Identification_Management_Dr.UPR.pdf
 
Factory Acceptance Test( FAT).pptx .
Factory Acceptance Test( FAT).pptx       .Factory Acceptance Test( FAT).pptx       .
Factory Acceptance Test( FAT).pptx .
 
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptxPSYCHOSOCIAL NEEDS. in nursing II sem pptx
PSYCHOSOCIAL NEEDS. in nursing II sem pptx
 
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptxCOST ESTIMATION FOR A RESEARCH PROJECT.pptx
COST ESTIMATION FOR A RESEARCH PROJECT.pptx
 
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 60009654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
9654467111 Call Girls In Raj Nagar Delhi Short 1500 Night 6000
 
Site Acceptance Test .
Site Acceptance Test                    .Site Acceptance Test                    .
Site Acceptance Test .
 
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
High Class Escorts in Hyderabad ₹7.5k Pick Up & Drop With Cash Payment 969456...
 
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 bAsymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
Asymmetry in the atmosphere of the ultra-hot Jupiter WASP-76 b
 
FAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical ScienceFAIRSpectra - Enabling the FAIRification of Analytical Science
FAIRSpectra - Enabling the FAIRification of Analytical Science
 
Clean In Place(CIP).pptx .
Clean In Place(CIP).pptx                 .Clean In Place(CIP).pptx                 .
Clean In Place(CIP).pptx .
 
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune WaterworldsBiogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
Biogenic Sulfur Gases as Biosignatures on Temperate Sub-Neptune Waterworlds
 
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate ProfessorThyroid Physiology_Dr.E. Muralinath_ Associate Professor
Thyroid Physiology_Dr.E. Muralinath_ Associate Professor
 
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts ServiceJustdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
Justdial Call Girls In Indirapuram, Ghaziabad, 8800357707 Escorts Service
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
 
Grade 7 - Lesson 1 - Microscope and Its Functions
Grade 7 - Lesson 1 - Microscope and Its FunctionsGrade 7 - Lesson 1 - Microscope and Its Functions
Grade 7 - Lesson 1 - Microscope and Its Functions
 
Call Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort ServiceCall Girls Ahmedabad +917728919243 call me Independent Escort Service
Call Girls Ahmedabad +917728919243 call me Independent Escort Service
 

Math blocks

  • 2. Acknowledgements A's friends: http://www.freebasic.net/forum In alphabetical order: dodicat fxm Richard For the interest and development of the program with FreeBasic.
  • 3. The math block is child's play As shown in the figure, the blocks are composed of elements, which are the work unit with blocks. 1 element = 1 unit With the elements, we can create rows or columns. The row is a set of horizontally grouped elements. The column is a set of grouped elements vertically. Grouping rows or columns, formed surfaces or levels. If we combine various levels, we get a block. The Dimensions Some science fiction movies with space matters, almost always tend to say this in one or another dimension We define the dimensions 1D, 2D, 3D, 4D, 5D and 6D .... 1D is formed by rows or columns of elements. 2D: this consists of rows and columns of elements. 3D: This consists of rows and columns, grouped into levels or layers.
  • 4. 4D: consists of several blocks, 3D grouped in rows. 5D: consists of several blocks, 3D grouped in rows and columns. 6D: consists of several blocks, 3D grouped in rows and columns, and levels.
  • 5. Linking blocks would form on 7D, 8D, 9D, etc, etc .. These three figures are equivalent, all have 27 elements. Can transform the various ways (dimensions, blocks, 1D, 2D, 3D ...) different, but still have the same elements, they are all equivalent, keep the same number of elements.
  • 6. The concepts In this work, the positions of the elements, rows, columns, and levels, will count as follows: Rows, columns, or blocks Levels and Dimensions 1 = Rows, always up and down. 2 = Columns, always from left to right 3 = Levels, always from top to bottom. 4 = Blocks or dimensions, from left to right and top to bottom. A very important observation: "The number of rows <= the number of columns." Were it otherwise, these calculations would be wrong
  • 7. Calculation of positions Data released: Block data unit: FU = Number of rows of the block unit CU = Number of columns of the block unit NU = Number of block unit levels BU = number of identical blocks to the block unit The data of the position of the item to search: PF = Position row PC = Position Column PN = Position Level PB = Number of Block General formula for calculating the position of the item to search = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) This formula is the result of combining the different levels of calculation of the position of an element, depending on the arrangement of the unit blocks.
  • 8. 2D Using the general formula we can calculate the position of an element in a table or standard 2D Unit block data Example: FU = 5 CU = 6 S = 1 BU = 1 elements = 5 * 6 * 1 * 1 = 30 Item data to search: PF = 4 PC = 5 PN = 1 PB = 1 Position the element = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) ((4-1) * 6) + 5 + ((5 * 6 * (1-1))) + ((5 * 6 * 1) * (1-1)) = 23 We can also be calculated as follows: 2D position = ((PF - 1) * CU) + PC Substituting values for the variables, we obtain also the position in a 2D system: ((4-1) * 6) + 5 = 23
  • 9. 3D Using the general formula we can calculate the position of an element on a level table or 3D Unit block data Example: FU = 3 CU = 3 NU = 3 BU = 1 Items = 3 * 3 * 3 * 1 = 27 Item data to search: PF = 3 PC = 3 PN = 3 PB = 1 Position the element = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) ((3-1) * 3) + 3 + ((3 * 3 * (3-1))) + ((3 * 3 * 3) * (1-1)) = 27 We can also calculate the position as follows: 3D = position ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) Replacing the variables by their values, also we get the position in a 3D system: ((3-1) * 3) + 3 + ((3 * 3 * (3-1))) = 27
  • 10. 4D Using the general formula we can calculate the position of an element in a table or level 4D Unit block data Example: FU = 3 CU = 3 NU = 3 BU = 3 elements = 3 * 3 * 3 * 3 = 81 Item data to search: PF = 2 PC = 2 PN = 2 PB = 3 Position the element = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) ((2-1) * 3) + 2 + ((3 * 3 * (2-1))) + ((3 * 3 * 3) * (3-1)) = 68 From 3D, we will always use general formula, simply must know the number of blocks we have in the system.
  • 11. 5D Unit block data Example: FU = 3 CU = 3 NU = 3 BU = 9 elements = 3 * 3 * 3 * 9 = 243 Item data to search: PF = 1 PC = 1 PN = 1 PB = 9 Position the element = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) ((1 - 1) * 3) + 1 + ((3 * 3 * (1 - 1))) + ((3 * 3 * 3) * (9 - 1)) = 217
  • 12. 6D Unit block data Example: FU = 3 CU = 3 NU = 3 BU = 27 elements = 3 * 3 * 3 * 9 = 729 Item data to search: PF = 3 PC = 3 PN = 2 PB = 27 Position the element = ((PF - 1) * CU) + PC + ((FU * CU * (NP - 1))) + ((FU * CU * NU) * (PB - 1)) ((3-1) * 3) + 3 + ((3 * 3 * (2-1))) + ((3 * 3 * 3) * (27-1)) = 720
  • 13. Round the problem In this chapter, we turn to the problem, we know the composition (rows, columns, levels) of the block unit and the position of the element. Now we look for the row, column, and block level indicated where the item is located. Psudocodes will use to calculate each stage of the process, at the end of all processes, there is a program in Basic, which includes various stages, to calculate the row of the item you seek. If we make the stages sequentially, we can not calculate the partial data. Using pseudocode, it is because they are very simple and everyone can play her the way, as simple as possible. These processes are general, they serve for all cases.
  • 14. We will use this more complex example: Data we need in this example: F = Number of rows of the block unit = 3 C = Number of columns of the block unit = 3 N = Number of unit block levels = 3 B = Number of block search P = Position the item to search = 683 INT = Part entire Mod = Division remainder
  • 15. The block Here we calculate the block where the search item. 1D calculation rule, by common sense . 2D, the level is = 1. CALCULATE BLOCK F = 3 C = 3 N = 3 P = 683 If P MOD (F * C * N) <> 0 Then B = INT (P / (F * C * N)) + 1 Else B = INT (P / (F * C * N)) End if Write "BLOCK =" B End BLOCK = 26 Comment: By common sense, if the position of the element to find, the divide between the elements of the block unit (F * C * N), we obtain the blocks drive that contains the element to look or in other words the position where the item is located to search. We note that if the remainder is "0" means that the search positions, is on the last item in a block. Otherwise, it is in any position other block or unit block (the first), so the ratio we add a "1".
  • 16. Level CALCULATE LEVEL F = 3 C = 3 N = 3 B = 26 P = 683 Level = INT (P / (F * C)) + 1 If P MOD (F * C) = 0 Then Level = Level -1 Else Level = Level End If K = Level - ((B-1) * N) Write "LEVEL =" K End LEVEL = 1 Comment: A level consists of rows and columns = F * C = Level. If we divide the position we're in, between the number of elements in a level, "P / (F * C)", we get that level we find, however, this calculation would be as if our example was a block of 3F * 3C * 81N, if at all levels of our system, we subtract the level where we are, "Level - ((B-1) * N)", we get the level of a single block.
  • 17. The column CALCULATE COLUMN C = 3 P = 683 If P <C then CO = P Else CO = P MOD C End If If P MOD C = 0 Then CO = C Else CO = CO End If Write "COLUMN =" CO End COLUMN = 2 Comment: We see that if the position to seek, is less than the number of columns of the block unit, the position of the spine to look for, is equal to the position where we are. If P < C then CO = P The rest of the process is equal to the level.
  • 18. The Row CALCULATE ROW F = 3 C = 3 N = 3 B = 26 P = 683 Level = INT (P / (F * C)) + 1 If P MOD (F * C) = 0 Then Level = Level -1 Else Level = Level End If N = Level <<< see comment on the level F = INT (((P-CO-((F * C) * (N-1))) / C) +1) <<< Formula to calculate the row Write "ROW =" F ROW = 3 After this sequence of calculation, we get all the data, the element to look is in: BLOCK = 26 LEVEL = 1 COLUMN = 2 ROW = 3
  • 19. Epilogue You keep thinking that math block is child's play? Which you find applications to these formulas? Possible applications: Informatics, Robotics, 3D Automated Storage, Cryptography, 3D Graphics integers. In computing, it is shown that all vector / Dim 2D, 3D, 4D ..., can be converted into a Vector / Dim 1D. 3D storage, knowing the number of rows, columns and store levels, you simply need to indicate the position and the program breaks down in row number, column number and level number where the object is to find. 3D graphics, may indicate a 3D point by a value, for example point 3 * 3 * 3, its position is 27, then decompose and get X, Y, Z (Row, Column, Level). In cryptography and coding coordinates, etc, etc. For more information and to see the beginning of this work: http://www.freebasic.net/forum/viewtopic.php?f=3&t=19820 Repository: http://es.slideshare.net/ZkrouhnZyx/matematicas-con-bloques To write comments lrcvs@yahoo.es Dedicated to all people who are curious.
  • 20. Basic programs Program to calculate the position of the element to find. :::::::::::::::::::::::::::::::::::::::::::::::::: :::::::::::::::::::::::::::::::::::: cls input "unit block rows ="; ro input "unit block columns ="; co input "unit levels block ="; it print input "Row Position ="; a input "Column = Position" b input "Position Level =" c input "block number ="; d P = ((a - 1) * co) + b + ((ro * co * (c - 1))) + ((* co ro * le) * (d-1)) print "position ="; p end ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
  • 21. Program to find the row, column, and block level where there is an element for. Data required: Rows of the block unit Columns of the unit block Block unit levels Position to search :::::::::::::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::::: cls input "Number of rows of the block unit (rows <= columns) ="; r input "Number of columns of the block unit (columns> = rows) =" c input "Number of levels block unit ="; l input "Position to seek ="; p h = l 'Calculating block if p mod (r * c * l) <> 0 then d = int (p / (r * c * l)) + 1 else d = int (p / (r * c * l)) end if 'Calculated level l = int (p / (r * c)) + 1 if p mod (r * c) = 0 then l = l-1 'Calculated column if p <c then a co = p if p> = c then a co = p mod c if mod p c = 0 then co = c 'Calculate row f = ((p-co - ((r * c) * (l-1))) / c) +1 '::::::::::::::::::::::::::::::::: print color 12 print "blo =" d, "fil =" f; "Col ="; co; "Lev ="; l - ((d-1) * h) end
  • 22. END