Regular
Triangle
Generation
on
Two-Dimensional
Cellular Automata
渡辺識 大川知
Satoru Watanabe
Satoshi
Okawa
会津大学
The
University of Aizu
1
Introduction
In a dotmatrixmethod,as a pattem or a figure areobtained by dotsonlattices offixedsize,
several dot pattems for eachpattem should be prepared depending
on
thescreen
size. Inrecent
years,
as a method which is independent fromscreen
size, several methodsto drawsome
pattemson
ascreen
which consists of two dimensional cellular automata have beenproposed[4][6][9][10]. Komatsu has
proposed
methods todrawa
square
anda
rectangle of maximum size in the center of thescreen.
Watanabe and Okawa have proposed another methodtodrawasquare
andadiamond[6],andamethod to drawacircleofradius$r$ atthecenterof thescreen[9][10].
In this
paper,
wereviewthedefinitions ofpatternandpatterngeneration, andweinves-tigatean algorithm to drawa regular triangle of maximum size at the center of the
screen.
First,
we
define two dimensionalpatterns as equivalenceclasses whichare obtained by thesimilarity relation definedby movings andscaling ontwo dimensionalplane. Foran $m\cross n$
screen, we definea pattern generation to displaywithappropriatesize (andposition) in the
screen, and we definea pattem generationon the discretizedscreen. Next,westudy a cor-respondence between the discretizedscreenandcellularautomata,andwestudythepattern generationonthe cellularautomata. Furthermore,wereviewabasicsignal propagation anda methodtoobtainamidpointof
one
dimentional cellulararray,
andwe
investigateamethod to drawa linesegment betweenany
twopoints and alinethrough a
given point andparal-lel to
a
givenlineas
fundamentaltechniquesfor geometorical drawings. Inthe lastpart,we
showan algorithmto drawaregulartriangleofmaximumsizeatthecenterofthe
screen.
2
Pattem
Generation
Let$\mathbb{R}$ be a set ofreal numbers, and a two dimensional
plane is denoted by $\mathbb{R}\cross \mathbb{R}$
.
Aset $F\subseteq \mathbb{R}\cross \mathbb{R}$iscalledatwodimensionalfigure, asetof all two dimensionalfiguresis denotedby$\mathcal{F}$,that is$\mathcal{F}=\{F|F\subseteq \mathbb{R}\cross \mathbb{R}\}$. Afigurewhichisobtained withmoving$P$by$d\in \mathbb{R}\cross \mathbb{R}$
is denotedby $F+d=\{p+d|p\in F\}$, and a figurewhich is obtained with extending$F$by $a(a>0)$times is denotedby$a\cdot F=\{a\cdot p|p\in F\}$
.
We definemappings$S_{d}$ and$Z_{a}$ asfollowsrespectively,
$S_{d}(F)=F+d, Z_{a}(F)=a\cdot F.$
We definea similarityrelation $\sim on\mathcal{F}$using$S_{d}$and$Z_{a}$
as
follows. For$F_{1},$ $F_{2}\in \mathcal{F},$The relation$\sim$isanequivalencerelationontwodimensionalfigures. Wedefine apattem
as aequivalence class using this relation
as
follows. Definition 1Fora figure$F$,a pattern $[F]$ containing$F$isdefined by
$[F]=\{F’|F’\sim F\},$
andasetof pattern$\mathcal{P}$is defined
by
$\mathcal{P}=\mathcal{F}/\sim=\{P|P=[F], F\in \mathcal{F}\}.$
For
any
$m,n>0,$ $[0, m]\cross[0, n]\subseteq \mathbb{R}\cross \mathbb{R}$is calledascreen
ofsize$m\cross n$, anditdenotedby$C_{mxn}$,where $[a, b]$is an interval$\{x|a\leq x\leq b\}.$ Definition2
For
a
pattern$P\in \mathcal{P}$assuming$P=[F]$,generationof$P$on
$C_{m\cross n}$is toobtaina
set$D\subseteq C_{m\cross n}$which satisfies
following
conditions.1. $\exists a,d$ $D=S_{d}Z_{a}(F)$,
2. $\forall e,e’>0$ $S_{d+e}Z_{a+e’}(F)\not\subset C_{m\cross n}.$
Followingdiscussion, we assumethat$m$ and $n$
are
integers forsimplicity. Whenwedis-playa figure
on
ascreen,thescreenhastobediscretized, sowediscretize$C_{mxn}$bydividingthewidthby$m-1$ anddividingthelength by$n-1$
.
In thisprocess,
for each latticepoint$p,$a
copy
of smallscreen
is seton
it. The smallscreen
at theleftmost and the bottompositionofthe discretized screenis$c_{0,0}$,and ascreenwhichispositioned inthe ithpositionfromthe left side of the
array
andjth position from thebottomofthearray
isdescribedby$c_{i,j}$, that is$c_{i,j}=C_{[i-0.5,i+0.5]\cross\triangleright-0.5,j+0.5]}.$
Wedefinethescreen$C_{m,n}$whichisobtainedbydiscretizing$C_{m\cross n}$
as
follows,$C_{m,n}=\{c_{i,j}|0\leq i\leq m,0\leq j\leq n, i,j\in N\}.$
We define a pattern generationonthe discretized
screen
asfollows. Definition3Forapattern$P=[F]\in \mathcal{P}$,generation of$P$
on
$C_{m,n}$istoobtain thefollowingset$D’\subseteq C_{m,n},$$D’=\{c_{i,j}|c_{i,j}\cap D\neq\phi\}.$
3
Implementation
with
Cellular
Automata
Two dimensional cellular automata consist of copies of a finite automaton (cell) which are positioned such
as
lattices. Each cell changes itsown
stateto the state which is determined according toits ownstate and the adjacent cells’ states. Wecall the own andadjacent cells neighbors, the function to determine thenext stateaccordingto neighbors’ states is calleda
localmapping. Each cellisexpressedby$a_{i},i$’whichmeansithrowand the jth column from the
leftmost lowestcell.Theintervalof updatingstateiscalleda step. Formally,atwodimensional
cellular automaton$\mathcal{M}$is definedasfollows,
$\mathcal{M}=(M, Q,\sigma, N)$,
$Q$:
a
setofstates,$\sigma$: alocalmappingfrom$Q\cross Q^{|N|-1}$ to$Q,$ $N$:a
setofneighbors.Inthispa-per, we
investigate the automata whichareplaced$m$cellswidthwaysand$n$ cellslengthways,wecall them$m\cross n$cellularautomata,andwe
assume
$N$asNeumannneighborhood, namelyconsistingof theown,
upper,
lower,rightand left cells. Inaninitialconfigurationof$\mathcal{M},$$a_{0,0}$
isactive,andthe all other cells
are
inquiescent.
Byregardingeach cell$a_{i,j}$
as
$c_{i,j}$in thediscretizedscreen
$C_{m,n}$,the set$M$can
beregardedas
thediscretized
screen
$C_{m,n}$,andthen,an
$m\cross n$cellular automatoncanbe denotedas
follows,$\mathcal{M}=(C_{m,n\prime}Q,\sigma,N)$
.
Therefore,for pattern$P$,
we
regarda problemtogenerate$P$on
$C_{m,n}$as
a problemtogenerate$P$ona cellularautomaton$\mathcal{M}$,thatis,a problem
to construct$\mathcal{M}$ whichgenerates$P.$
To constructsuch$\mathcal{M}$ isto
provide$\sigma$whichspecifies $D’\subseteq C_{m,n}$ ata certain timestarting
from the initial configuration. Here, $D’$ is specified by letting $a_{i,j}$ be in a special state $s$ if
$a_{i,j}\in D’.$
$M$
Figure1: GenerationofA LineSegment
4
Fundamental Techniques for
Geometorical Drawings
Weexplain sometechniques for geometorical drawings whichare usedin a generationofa regular triangleintwo dimensional cellular automata.
4.1
Basic Signal Propagation
When anext cell of a cell in state $s$ changes its
own
state to $s$ at $k$ steps, we callthe signalspecified by$s$ propagates at speed $1/k$
.
Acell cansend signalsupper,
lower, right, and leftdirections.
We
can
obtainacell atthe midpoint ofone
dimentionalcellulararray
by usingdefferent speedofsignals. Acell $A$which isan
end pointof thearray
sendsa signal
$s$withspeed
1/1anda signal$t$withspeed1/3totherightdirectionsimultaneously. Acell$B$which is another
endpointof the
array
receives thesignal$s$,and then the cell$B$sendsa signal$\overline{s}$withspeed1/1totheleft direction. Thesignal$\overline{s}$and the
signal$t$meet atacell$M$,themidpointof the
array.
4.2
Generation
of
A Line
Segment
For
any
cells $P$ and $Q$, we explainhow todrawa linesegmentbetween them inFigure 1 asfollows. $P$sends a signal rightdirectionand $Q$ sends lowerdirection respectively, andthen
obtain the midpoints$M$and$N$of$PH$and$QH$respectively The cell$M$sends
a
signalupper
direction,and the cell$N$sendsa signalleftdirection,and then the twosignalshit each otherin
cell$R$which is the mid point of the linesegment$PQ$
.
Repeatingthe above methodrecursively,weobtain the line segment$PQ.$
4.3
Genaration of
A
Parallel
Line
For
any
cell$P$andaline$l$,we
explainhow to drawalinethrough$P$andparallelto$l$as
shownin Figure2. The cell $P$sends a signal$s$
upper
direction and sends a signal $t$ right direction.The signal$s$hitsacell$P’$ onthe line$l$,andthen$P’$sendsa signal$s’$ right direction. Thesignal $s’$ hitsacertaincell $Q$
which is putbeforehand, and then $Q$sendsa signal$u$
upper
direction,anda signal$v$lower directionsimultaineously.
$P_{\bullet\frac{S\mathcal{V}\downarrow^{Q}}{tV}}s|$
’
Figure 2: Generation ofAParallel Line
$P_{\bullet\frac{.\cdot\cdot\cdot 1_{v’}}{tV}}$
Figure3: Generation ofAParallelLine
Thesignal$u$hitsacell$U$
on
the line$l$and the cell$U$returnsa signal$u’$lowerdirecton. Thesignal$v$hitsacell $V$onthetraceof signal $t$,and the cell $V$returns a signal$v’$
upper
directon.The signal $u’$ and the signal $v’$ meet atacell $R$each other asshown inFigure 3. Drawinga
linebetween the cells$P$and$R$by the method explainedinSec.4.2,weobtain aprallelline$l’.$
5
Regular Triangle
Generation
on
Cellular automata
We investigate a method to generate a regular triangle of maximum size at thecenter ofa given $m\cross n$ cellular automaton. In thefollowing example, we
assume
that for $m>n$, themaximum
square
$A,$ $B,$ $C$ and $D$ at the center of the screen, the arc, $BD$, quarter of a circle withradius$AB$andcenter$A$areobtainedbeforehand[6]asshowninFigure4.Figure4: settingthe
square
andan arc on
thescreen
5.1
A
Method to Generate
a
Regular Triangl
We explain thegenerationofa regulartriangleatthecenterof the
screen
stepby step.(1)Top Vertices of TheRegularTriangles
The cell $A$ sends
signals
toright directionandwe
obtain cell$M$which isa
midpoint of$AB$
.
The midpointcell$M$ of$AB$can
be obtainedby the methodexplainedinSec.4.1. Then, a signalwhich is sentupwardfrom$M$passes
the cell$T$onarc
$BD$andreaches cell$T’$on
line$CD$
.
Here, $T$isatop vertexofa regulartriangle$ABT$and $T’$ isthe top vertex of theregulartriangle
we
will draw.Figure 5:Top Vertex of The Regular Triangle
(2) SidesofThe Regular Triangle
For$A,$$B$,and$T$,linesegments$AT$and$BT$
can
be obtainedbythemethodexplainedSec.4.2andaregulartriangle$ABT$is obtained.
$\langle$3)Expansionof The
Figure 6: Sides ofThe Regular Triangle
Figure7: Expansion of TheRegularTriangle
To obtain the regular triangle of maximumsize,
we
should expand the triangle$ABT$toa trianglewithatopvertex $T’$.
Bythemethod explained inSec.4.3,Parallellinesto$TA$ and$TB$whichstart at$T’$canbe obtained(Figure7). Andweobtain theregular triangle$A’B’T’$atthe
centerof the
screen.
6
Conclusion
Inthis
paper,
wereview the definitionofa pattem and a pattern generation, andapattem generation on the discretizedscreen.
Next, we studied a correspondencebetween the dis-cretizedscreen
and cellularautomata, andwe
studied thepattern generationon
the cellularautomata.Furthermore,we investigate amethodtodrawalinesegmentandaparallellineto
acertainlineas techniquesfor geometoricaldrawings. Inthe last part,weshowanalgorithm
todrawa regular triangleof maximum size at the centerof the
screen.
Drawing a circle
or
an arcon
two dimensional cellular automata is equal to drawing a circleor
an arcon
apaper
by using acompass.
Similarly, drawing a line segment on two dimensional cellular automata isequaltodrawing alinesegmenton
apaper
byusing aruler.compass
anda
rulercan
be drawn alsoon
twodimensional cellualrautomata. AcknowledgementsTheauthorsare gratefultotheparticipantsofthesymposiu$m’Logics\cdot Algebras\cdot$Languages
on Computer$Science”for$their commentstoimprove the research anditsapplications. reference
[1]Y.Mizuno,ANewSolution of the Firing SquadSynchronizationProblem forTwo
Dimen-sionalRectangle Arrays, University
of
Aizu, Grad.Thesis.,March,2005.[2]M.Teraoka,etal. ADesign of Generalized
Optimum-Time
Firing SquadSynchronization
Algorithm for Two-Dimensional Cellular Arrays,The 18thAnnual
Conf.ofJapanese
Socictyfor
Artificial
Intelligence,3Hl-04,2004.[3]A.Settle andJ.Simon,Smaller solutions for the firingsquad,Theoretical ComputerScience,
276,
pp.83-109,
2002.[4]T.Komatsu, PatternGeneration inTwo DimensionPlane, University
of
Aizu, Grad.Thesis.,March,2008.
[5] S.Wolfram, Two-Dimensional Cellular Automata,
Journal
of
Statistical Physics, vo138,p901-946,March1985.
[6] S.Watanabe and S.Okawa,PatternGeneration
on
Two Dimensional CellularAutomata,Forumon
Information
Technology2009,A-023.[7]
J.
Mazoyer,A sixstateminimaltime solutiontothefiring squad synchronization problem, TheoreticalComputerScience, vol.50,pp.183-238,1987.
[8] Y.Nishitani,FiringSynchronizationProblemsfor Patternsspecified bytheSub-General
Position,CellularAutomaton Seminarin UniversityofAizu,$2010.$
[9] S.Watanabe and S.Okawa, Circle Generation
on
Two-Dimensional Cellular Automata,AlgebraicSystems and Theoretical ComputerScience,RIMS1809,ppl6l-l68, 2012.
[10] S.Watanabe and S.Okawa,Rapid Circle Generation on Two-DimensionalCellular
Au-tomataby $O(r^{2})$ TimeAlgorithm, AlgebraandComputer Science, RIMS 1873,ppl63-l69,
2014.
[11] A.Waksman,Anoptimum solutiontothefiring squad synchronization problem,