SlideShare a Scribd company logo
Chromatic Numbers and Ternary Algebra
Kavosh Havaledarnejad Icarus.2012@yahoo.com
Iran Tehran
Abstract:
This paper reviews a new format for representing 2-dimentioanal complex numbers (
complex numbers with one imaginary number ) based on 3 different colors red, blue and
green and review doing calculation in these type of coding directly. Approach can uses
straightly for complex numbers with more dimensions. For example a complex numbers with
2 imaginary number and can show using 4 colors. Then using this numbers we introduce
Ternary Algebra. One application of this Ternary Algebra is in dealing with NP-Complete
problems. Because some ( simplest forms of ) NP-Complete problems deal with number 3
like 3-Coloring, 3-SAT and 3-RSS ( the problem that we will propose here ) thus Ternary
Algebra has some benefits for computer science that Boolean Algebra has not. We will prove
the soundness and completeness of resolution systems on Ternary Algebraic CNF formulas
that author wish that him or others develop algorithms based on Ternary Resolution Systems.
Keywords: Complex Numbers, Calculation, Boolean Algebra, NP-Complete problems,
Resolution Theorem
Introduction
Beauty of Chromatic Numbers is that: they don’t use positive and negative signs and colors
are sign of these numbers. In this paper we show how we can write complex numbers as
chromatic numbers and do calculation on them directly. It is clear that doing calculation on
chromatic numbers is at least as easy as doing calculation on simple complex number. In the
rest of paper we first defines chromatic numbers and their standard form and then show how
we can do summation, subtraction, multiplication, inverse and division on them directly.
Finally we close the discussion by power and root. However calculating a real power
operation on chromatic numbers is hard but however it is hard for simple complex number
when we write them based on summation of a number and an imaginary number. Calculating
power 2 for green and blue numbers and calculating root 3 for red numbers in this coding is
easy but doing more calculation didn’t review in this paper.
At the second part of this paper we will extend the Ternary Algebra based on Chromatic
Numbers. We will show their application in formulation of some NP-Complete problems. We
can easily show a 3-SAT problem using Boolean Algebra in CNF and also we can show a 3-
SAT problem in the space of hyper-graphs. We can also show 3-Coloring and 3-RSS
problems respectively using graphs and multi-partite graphs but one may ask that how we can
show 3-Coloring or 3-RSS as mathematical formulas this paper is a respond to this question.
At the end of paper we will show all types of resolutions on Ternary Variable Clauses and
prove the Resolution Theorem in Ternary Algebra space consists of Soundness and
Completeness of resolution on ternary algebraic CNF formulas ( TCNF ) that can use in
designing algorithms for 3-RSS and 3-Colorability problems or some other applications in
Artificial Intelligence.
1. Chromatic Numbers
A chromatic number is simply a positive weighted combination of 3 colors r, g and b. Note
that this combination has not sign because colors are sign of these numbers.
Definition 1. A chromatic number is a number in the form:
Where:
And:
It is obvious that:
And:
Also:
( )( )
And:
( )( ) ( )( )
From symmetry we have:
( )( ) ( )
Also with a simple calculation:
( )( ) ( ) ( )( ) ( )
( )( ) ( ) ( )( ) ( )
( )( ) ( ) ( )( ) ( )
1.2
1.1
( )( ) ( )( )
( )( ) ( )( )
We can show in a diagram like (Fig. 1). From this diagram we can
show that:
( )
√ √
And from symmetry:
√ √
As a further check:
( )
√ √ √ √
(Fig. 1)
Also we can calculate from :
√ √
( )
Also:
Using this formulas we can convert every complex number to a chromatic number and wise
versa.
1.3
2. Chromatic Number in standard form
A chromatic number in standard form can be only combination of only 2 colors like red and
green, red and blue or green and blue
Definition 2. Every chromatic number in standard form can be only combination of 2 colors
if not we can convert it to standard form.
Proof. Assume we have a chromatic number including 3 different colors arbitrary. It will be
in the form:
But always one of this numbers are minimum without loss of generality we can
assume that is minimum thus we have:
( )
( ) ( ) ( )
But based on formula 1.2. we have thus:
Only two of them. Proving the theorem.
3. Calculations:
In this session we show how we can do calculation in chromatic numbers.
3.1. Summation and Subtraction
Summation and subtraction of chromatic numbers can handle directly by summation and
subtraction of colors separately from each other.
( ) ( ) ( )
And:
( ) ( ) ( )
After summation or subtraction some values may be negative based on 1.2 we have
Thus we can transform it to positive case easily. Then we must convert the number to
standard form by the method which used for proof of definition 2.
3.2. Multiplication
Based on equation 1.1 we have and also
thus we can calculate multiplication on chromatic
numbers easily:
( ) ( )
( ) ( )
Also for multiplication of two chromatic number we have:
( ) ( )
( ) ( ) ( ) ( ) ( )
( ) ( ) ( ) ( )
( ) ( ) ( ) ( ) ( ) ( )
( ) ( ) ( )
( ) ( )
( )
After multiplication we have not negative number but maybe we have a combination of 3
different colors thus we can transform the number to standard form arbitrary.
3.3. Division
We can calculate division of 2 chromatic numbers using multiplication on first number and
inverse of second number. For calculating inverse of a chromatic number we must find
coupled of a chromatic number.
3.3.1. Coupled of a chromatic number
Based on Fig. 1 coupled of a chromatic number in form:
is:
̅
We can calculate multiplication of them easily that is:
̅ ( )
3.3.2. Inverse of a chromatic number
Consider inverse of a chromatic number in the form:
With multiplication by coupled we have:
( ) ( ) ( )
Thus we can find division of two chromatic numbers by multiplication of first with inverse of
second.
4. Power and Root of a chromatic number
Based on extension on equation 1.1. we have:
{
( )
( )
( )
{
( )
( )
( )
It is obvious that a number in the form:
( )
Also:
{
( )
( )
( )
It is obvious that a number in the form:
( ) ( )
Also based on equation 1.1. We have:
√
√
√
Also:
√ ( )
Because:
( )
And:
√ ( )
Because:
( )
And:
√ ( )
Also:
√
√
( )
√
( ) √
√
( )
√
( )
Because:
{
√
( )} ( )
Also based on 1.3:
√
( ) √ √
√
( ) and
√
( )
And:
√ √ ( )
And:
√√ √
√
( )
And there is an estimation that:
√
√
( )
Also:
( )
(
√
)
√ √
√
And from symmetry we have:
√
Also we can calculate:
√ ( ) √
And from symmetry we have:
√ ( ) √ √
It is obvious that:
5. 3-RSS problem
In this session we will introduce a new NP-Complete problem namely 3-RSS by reduction
from 3-SAT and whereas this problem is in NP thus this problems is also NP-Complete ( both
NP and NP-Hard). It is a well-known fact that whole problems in NP can reduce to 3-SAT problem.
It is known as Cook-Levin theorem ( see [1] ). We here introduce a reduction from 3-SAT to a new
problem namely 3-RSS and it proves that whole problems in NP can reduces to 3-RSS.
Fig 1 Reducing from 3-SAT to RSS ( Lines show conflicts )
There exists a famous reduction from 3-SAT to Maximum Clique instance ( see [2] ) but a
special case of maximum clique as all nodes of graph stand in separate Independent Sets of size 3.
Tues if we consider these independent sets are rules with 3 states we have a RSS instance. Two nodes
are connected by an edge if (1) they correspond to literals in the same clause, or (2) they correspond
to a variable and its inverse for example this Formula is transformed into the graph of (Fig. 1).
( ) ( ̅ ̅) (̅ ) ( ̅ ̅)
Theorem 2.3.1. Whole problems in NP can reduces to 3-RSS
Proof Based on Cook-Levin theorem every problem ρ in NP can reduces to 3-SAT and we explained
how 3-SAT can reduces to 3-RSS thus ρ can reformulates as a 3-RSS.
Please note that structure of this problems can show by a multipartite graph of size n. where n
is number of variables ( rules ) in this problem.
6. Ternary Algebra and 3-RSS problem
In Boolean algebra all variables have only two states zero and one. Here we use a new
algebra system that variables have three states Red, Blue and Green we will show that by r, g
and b and then we will formulate 3-RSS problem based on these types of variables.
6.1. [ ] [ ] [ ] ̅[ ] ̅[ ] ̅[ ]
Here we introduce six new operators [ ] [ ] [ ] ̅[ ] ̅[ ] ̅[ ] this operators
easily use to assess that a variable x has either a special color or not for example an operator
in form [ ] has Boolean output One iff variable has the color and an operator in form
̅[ ] has Boolean output One iff variable has not the color . We can also write these
functions using calculi using figure 1 and this fact that ⁄ ⁄ we have:
[ ] ( { } )
[ ] { }
Also we have:
[ ] [ ] [ ] [ ]
In these formulas are rotator operators for example converts to , to
and . Also we have:
̅[ ] [ ]̅̅̅̅̅̅ ̅[ ] [ ]̅̅̅̅̅̅ ̅[ ] [ ]̅̅̅̅̅̅
6.2. A formulation for 3-RSS problem
Now we are present to introduce a formulation system for 3-RSS problem. Aim is we will be
able to write a 3-RSS problem like a 2-SAT problem based on binary clauses but using
ternary variables.
Consider a 3-RSS problem instance that have variables we can easily show this problem
with a multi-partite graph consists of independent sets. We wish to show this problem also
by Ternary Algebra. For a disconnection that is in one independent set ( one variables ) it is
clear that it is not important to write because a Ternary Variable never stand in more than two
of its states ( colors ). Thus we only deal with disconnections that stand between two states (
colors ) of two different variables. Consider we have a disconnection between variable and
consider for a moment that without loss of generality this disconnection be between color
Red of and Green of then we can write a clause for this disconnection in form:
( ̅[ ] ̅[ ])
Thus we can write whole disconnections ( between two different variables ) as binary clauses
but with ternary variables and using disjunction between them we have a Ternary Formula for
3-RSS problem. Thus we can show a 3-RSS problem with variables set instance with a
Ternary Formula with:
⋀
̅̅̅[ ] ̅̅̅[ ] { }
For example:
( ̅[ ] ̅[ ]) ( ̅[ ] ̅[ ]) ( ̅[ ] ̅[ ])
We can call such a formula also as Ternary-CNF or TCNF formula. In the next chapters we
will discuss resolution rules and the ternary version of theory of resolution and will prove this
theorem.
7. Ternary Algebra and 3-Colorability problem
3-Colorability is the question of testing whether a graph is colorable using 3 colors or not as
any two adjacent nodes have the same color ( see [4] ). Whereas 3-Colorability is
immediately a 3-RSS problem thus we can write a 3-Colorability instance using Ternary-
Algebra but we use here a new operator namely Ternary XOR ( TXOR ) and write 3-
Coloring using TXOR operators.
7.1. TXOR and TEQUAL
If we multiply a ternary variable two time with a ternary variable the results will be red if
and only if color of and color of be the same and will be a different color if and only if
color of and color of be different.
We will establish an operator namely TEQUAL and show it by ̇ . And define:
̇ [ ] [ ]
And also opposite of this operator will be TXOR that we define:
̇ ̅[ ] ̅[ ]
7.2. A Ternary Formula for 3-Colorability
Consider a 3-Colorability instance defined on vertex of a graph. Some of them are
connected and some are disconnected. We can define a set of variables corresponding
vertices ( nodes ) of graph. The only restriction is that, two vertices ( nodes ) that are
connected to each other must not have the same colors. We can show this situation using
TXOR operator. Consider vertices and are connected. We can write a clause in form:
( ̇ )
Using disjunction between these clauses we have a Ternary Formula for 3-Colorability. Thus
we can show a 3-Colorability problem with variables set with a Ternary Formula with:
⋀
̇
For example:
( ̇ ) ( ̇ ) ( ̇ )
8. Ternary Resolution Rules
In Boolean algebra in a CNF formula, Resolution is a rule that produces a new clause using
old clauses ( See [5] [10] [11] ). For example if we have two clause of form ( ) and
( ̅) where and are conjunction statements and is a variable we can conclude that
( ) is also a clause. In fact we have:
( ) ( ̅) ( )
This rule is known as resolution rule. And is the base of many algorithms for solving 2-SAT
in polynomial time and some heuristics for 3-SAT like DPLL ( see [9] ).
Here we introduce Ternary Resolution Rules as some theorems and prove them.
Theorem 8.1. ( ̅[ ]) ( ̅[ ]) ( ̅[ ]) ( )
Proof. Consider whole be false statements, then whole ̅[ ] and ̅[ ] and
̅[ ] must be true statements. But it means that must not be Red must not be Green and
must not be Blue and whereas every variable like has one of these colors it never happen.
Thus at least one of must be true proving the theorem.
Theorem 8.2. Without loss of generality ( ̅[ ]) ( ̅[ ]) ( [ ])
Proof. Consider both be false statements, then both ̅[ ] and ̅[ ] must be true
statements. But it means that must not be Red and must not be Green and whereas every
variable like has three colors this variable must be blue. Thus one of must be true
or must be blue. That completes the proof.
Theorem 8.3. Without loss of generality ( ̅[ ]) ( [ ]) ( )
Proof. Consider both be false statements, then both ̅[ ] and [ ] must be true
statements. But it means that must not be Red and must be Red that they have contrary.
Thus one of must be true. That completes the proof.
Theorem 8.4. Without loss of generality ( [ ]) ( [ ]) ( )
Proof. Consider both be false statements, then both [ ] and [ ] must be true
statements. But it means that must be Red and must be Green and it is a contradiction thus
one of must be true that completes the proof.
In Boolean algebra the resolvent of two clauses containing two literals is a clause also
containing two literals and it explain why 2-SAT problem is solvable in polynomial time
complexity. But in ternary algebra the resolvent of two clauses containing two literals can be
a clause containing three literals.
9. The Resolution Theorem in Ternary Algebra
It is proved that in Boolean algebra if continue a sequence of resolution on clauses leads to an
empty clause then formula is unsatisfiable and if formula be unsatisfiable then always
continue resolution leads to empty clause ( J.A. Robinson 1965 ). It is known as Resolution
Theorem. Here we will prove such theorem for Ternary Algebra. We consider a more general
form of clauses that we used for formulating 3-RSS problem. We let every literal be a color
like [ ] [ ] [ ] or negation of a color like ̅[ ] ̅[ ] ̅[ ] and prove the
theorem in general case.
9.1. The Resolution Operator
Resolution Operator is the function Res that, when applied to a set of clauses, returns the
set ( ) of clauses, where ( ) { }.
( ) is the result of applying Res repeatedly. More formally,
( )
( ) ( ( ))
( ) ⋃ ( )
It is obvious that always there exist a number that:
( ) ( )
9.2. Resolution Derivation
Definition 9.2.1. Let be a set of clauses. A resolution derivation from is a finite sequence
of clauses such that: each is a member of or is a resolvent of two earlier
clauses in the sequence.
Definition 9.2.2. A resolution derivation of a clause from is a resolution derivation
from such that .
It is obvious that when ( ) then there is a resolution derivation of from .
9.3. Resolution Theorem in Ternary Algebra
Lemma 9.3.1. Let be a set of clauses and let be a propositional variable occurring in .
Let
( )
( )
( )
For example ( ) means:
 Keeping all clauses in F in which any of literals consists of occurs.
 Removing all clauses in F containing : [ ] ̅[ ] ̅[ ].
 Removing [ ] [ ] ̅[ ] from each clause of F that contains
[ ] [ ] ̅[ ].
Then the following statements are equivalent:
1. is unsatisfiable
2. All ( ) and ( ) and ( ) are unsatisfiable.
Proof. Consider there exist a satisfying assignment for one of ( ) ( ) (
) then using that color for it will be immediately a satisfying assignment for . In the
other hand consider there exist a satisfying assignment for then it will be immediately a
satisfying assignment for ( ) ( ) ( ).
Theorem 9.3.1. Resolution Theorem
Let be a set of clauses then the followings are equivalent:
1- is unsatisfiable
2- { } ( )
Proof.
Let ́ be the set of added clauses by resolution operator we have ́. If { } ́ then ́ is a
false statement. Thus must be false by well-known facts of Boolean algebra.
Proof.
By strong induction on the number of literals in . Assume has literals and that the result
holds for all finite unsatisfiable sets of clauses with fewer than literals. Take a propositional
variable in . By the Lemma 9.3.1, all ( ) ( ) ( ) are unsatisfiable
and have fewer than literals. By induction hypothesis,
{ } ( ( )) { } ( ( )) { } ( ( ))
So, we have that:
There is a resolution derivation of { } from ( )
There is a resolution derivation of { } from ( )
There is a resolution derivation of { } from ( )
If each is a clause of or if each is a clause of or if each is a clause of then we
have a derivation of { } from . Otherwise, If is a clause in the resolution derivation
of { } from ( ) such that is not in F, then replace by ̅[ ] or
[ ] or [ ]. This way we obtain a resolution derivation of one of ̅[ ] or [ ] or
[ ] from . By a similar argument we can prove that we have resolution derivations of one
of ̅[ ] or [ ] or [ ] from F and one of ̅[ ] or [ ] or [ ] from F. Operating
Resolution Rules one these three clauses leads to { }. That completes the proof.
10. Conclusion
In this paper we showed that we can write complex number in a chromatic coding and do
some calculation on them directly. However more researches regarding chromatic number
and their property are essential. We used Ternary CNF formula for coding 3-RSS problem
and showed 3-Colorablity problem by TXor clauses. We proved the resolution theorem in
Ternary Algebra literature. Author wishes that results uses by him or others to extending
algorithms for NP-Complete problems like 3-RSS.
11. References
1- The Complexity of Theorem-Proving Procedures, Stephen A. Cook, University of Toronto 1971
2- 21 NP-Hard problems, Jeff Erikson, 2009
3- Reducibility among Combinatorial Problems, Richard M. Karp, University of California at Berkley
1972
4- Improved Algorithms for 3-Coloring, 3-Edge-Coloring, and Constraint Satisfaction, David
Eppstein
5- Logic and Computation, Phokion G. Kolaitis, University of California Santa Cruz & IBM
Research – Almaden
6- Many facets of complexity in logic, Antonina Kolokolova, Memorial University of Newfoundland
7- A LINEAR-TIME ALGORITHM FOR TESTING THE TRUTH OF CERTAIN BOOLEAN
FORMULAS, Bengt ASPVALL, Michael F. PLASS and Robert Endre TARJAN, Computer Science
Department, Stanford University, Stanford, CA 94305, U.S.A.
8- An On-Line Satisfiability Algorithm for Conjunctive Normal Form Expressions with Two Literals,
John F. Kolen, Institute of Human and Machine Cognition, University of West Florida
9- Directional Resolution: The Davis-Putnam Procedure, Revisited Rina Dechter and Irina Rish ,
Information and Computer Science University of California, Irvine
10- M. Alekhnovich,Mutilated chessboard problem is exponentially hard for resolution, Theoretical
Computer Science 310 (1–3) (2004) 513–525.
11- Resolution for Max-SAT, María Luisa Bonet a , Jordi Levy b, , Felip Manyà b, Elsevier
Artificial Intelligence

More Related Content

PPTX
Application of graph theory in drug design
PDF
A class of a stable order four and six linear multistep methods for stiff ini...
PPTX
Graph theory and life
PDF
Diploma_Semester-II_Advanced Mathematics_Complex number
PPTX
Applications of boolean algebra minterm and maxterm expansions
PDF
Discrete Mathematics and Its Applications 7th Edition Rose Solutions Manual
PDF
9.1 Systems of Linear Equations
DOCX
Chapter 03-group-theory (1)
Application of graph theory in drug design
A class of a stable order four and six linear multistep methods for stiff ini...
Graph theory and life
Diploma_Semester-II_Advanced Mathematics_Complex number
Applications of boolean algebra minterm and maxterm expansions
Discrete Mathematics and Its Applications 7th Edition Rose Solutions Manual
9.1 Systems of Linear Equations
Chapter 03-group-theory (1)

What's hot (19)

PDF
Two very short proofs of combinatorial identity - Integers 5 A18 (2005)
PDF
Geometry Section 2-10
PPTX
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
PPTX
2 5literal equations
PDF
Ch01 se
PPT
Solving systems of equations in 3 variables
PPTX
Systems of 3 Equations in 3 Variables
PPTX
Ppt materi spltv pembelajaran 1 kelas x
PPTX
Marh algebra lesson
PPT
System of linear equations and their solution
PPTX
Simultaneous equations
PPTX
Roots and Radicals
PDF
Diploma_Semester-II_Advanced Mathematics_Indefinite integration
PPTX
System of linear equations
PPT
Systems of Linear Equations
PPT
Systems Of Equations
PPTX
Systems of Linear Algebra
DOCX
BSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICS
PPT
Systemsof3 equations
Two very short proofs of combinatorial identity - Integers 5 A18 (2005)
Geometry Section 2-10
Discrete Math Chapter 2: Basic Structures: Sets, Functions, Sequences, Sums, ...
2 5literal equations
Ch01 se
Solving systems of equations in 3 variables
Systems of 3 Equations in 3 Variables
Ppt materi spltv pembelajaran 1 kelas x
Marh algebra lesson
System of linear equations and their solution
Simultaneous equations
Roots and Radicals
Diploma_Semester-II_Advanced Mathematics_Indefinite integration
System of linear equations
Systems of Linear Equations
Systems Of Equations
Systems of Linear Algebra
BSC_COMPUTER _SCIENCE_UNIT-5_DISCRETE MATHEMATICS
Systemsof3 equations
Ad

Viewers also liked (20)

PDF
OIT_ Profile
PPTX
Plan de negocios
PPTX
HR presentation on Pakistan Oil Field Limited
PPTX
Strategic Marketing Lecture.6
PDF
NP-Completes
DOCX
PSYCHOPHARM PRESENTATION revised newest
PDF
sesion 5
PDF
PDF
CV Boosting Brochure_for_web
PDF
الگوریتم ژنتیک
PDF
NAB Lessons Learned Paper Greig 2015
PDF
China kmr bearing manufacturer
DOCX
Tesina Master in E-Commerce Management Paolo Selce
DOC
Medlegalres
PPTX
Genetic Algoritm
PDF
Inzo Profile Small
PPTX
"Introducción a algoritmos"
PDF
Hecht Pedestrian Bridge
PPTX
Tecnología e informática tafur
PPTX
Equipa tecnica Achada Futebol Clube
OIT_ Profile
Plan de negocios
HR presentation on Pakistan Oil Field Limited
Strategic Marketing Lecture.6
NP-Completes
PSYCHOPHARM PRESENTATION revised newest
sesion 5
CV Boosting Brochure_for_web
الگوریتم ژنتیک
NAB Lessons Learned Paper Greig 2015
China kmr bearing manufacturer
Tesina Master in E-Commerce Management Paolo Selce
Medlegalres
Genetic Algoritm
Inzo Profile Small
"Introducción a algoritmos"
Hecht Pedestrian Bridge
Tecnología e informática tafur
Equipa tecnica Achada Futebol Clube
Ad

Similar to Coding (20)

PDF
SATISFIABILITY METHODS FOR COLOURING GRAPHS
PDF
MATLAB
DOCX
1  Part 2 Systems of Equations Which Do Not Have A Uni.docx
DOCX
Math ia analysis
PDF
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
PDF
PDF
RETOOLING OF COLOR IMAGING IN THE QUATERNION ALGEBRA
PDF
Retooling of Color Imaging in ihe Quaternion Algebra
PPTX
Complex Analysis 1.pptxComplex Analysis 1.pptx
DOCX
The geometry of three planes in space
PPT
Gauss Jordan
PPTX
Data structure algorithm
PDF
Existence the pair of lines1
PPTX
Determinant
PDF
Exhaustive Combinatorial Enumeration
PDF
Chapter_4 (Advanced counting methods) (1).pdf
PPTX
Week 2 Rational Function, Equation and Inequality -Autosaved-.pptx
PPTX
Mathematical Statistics Assignment Help
PPT
Chap 03 02
PDF
jhhjjjhjhjjbb3-Steady Diffusionhhhh problems.pdf
SATISFIABILITY METHODS FOR COLOURING GRAPHS
MATLAB
1  Part 2 Systems of Equations Which Do Not Have A Uni.docx
Math ia analysis
27-Equivalent under modulo-27-Oct-2020Material_I_27-Oct-2020_Cryptography_.pdf
RETOOLING OF COLOR IMAGING IN THE QUATERNION ALGEBRA
Retooling of Color Imaging in ihe Quaternion Algebra
Complex Analysis 1.pptxComplex Analysis 1.pptx
The geometry of three planes in space
Gauss Jordan
Data structure algorithm
Existence the pair of lines1
Determinant
Exhaustive Combinatorial Enumeration
Chapter_4 (Advanced counting methods) (1).pdf
Week 2 Rational Function, Equation and Inequality -Autosaved-.pptx
Mathematical Statistics Assignment Help
Chap 03 02
jhhjjjhjhjjbb3-Steady Diffusionhhhh problems.pdf

Coding

  • 1. Chromatic Numbers and Ternary Algebra Kavosh Havaledarnejad Icarus.2012@yahoo.com Iran Tehran Abstract: This paper reviews a new format for representing 2-dimentioanal complex numbers ( complex numbers with one imaginary number ) based on 3 different colors red, blue and green and review doing calculation in these type of coding directly. Approach can uses straightly for complex numbers with more dimensions. For example a complex numbers with 2 imaginary number and can show using 4 colors. Then using this numbers we introduce Ternary Algebra. One application of this Ternary Algebra is in dealing with NP-Complete problems. Because some ( simplest forms of ) NP-Complete problems deal with number 3 like 3-Coloring, 3-SAT and 3-RSS ( the problem that we will propose here ) thus Ternary Algebra has some benefits for computer science that Boolean Algebra has not. We will prove the soundness and completeness of resolution systems on Ternary Algebraic CNF formulas that author wish that him or others develop algorithms based on Ternary Resolution Systems. Keywords: Complex Numbers, Calculation, Boolean Algebra, NP-Complete problems, Resolution Theorem Introduction Beauty of Chromatic Numbers is that: they don’t use positive and negative signs and colors are sign of these numbers. In this paper we show how we can write complex numbers as chromatic numbers and do calculation on them directly. It is clear that doing calculation on chromatic numbers is at least as easy as doing calculation on simple complex number. In the rest of paper we first defines chromatic numbers and their standard form and then show how we can do summation, subtraction, multiplication, inverse and division on them directly. Finally we close the discussion by power and root. However calculating a real power operation on chromatic numbers is hard but however it is hard for simple complex number when we write them based on summation of a number and an imaginary number. Calculating power 2 for green and blue numbers and calculating root 3 for red numbers in this coding is easy but doing more calculation didn’t review in this paper. At the second part of this paper we will extend the Ternary Algebra based on Chromatic Numbers. We will show their application in formulation of some NP-Complete problems. We can easily show a 3-SAT problem using Boolean Algebra in CNF and also we can show a 3- SAT problem in the space of hyper-graphs. We can also show 3-Coloring and 3-RSS problems respectively using graphs and multi-partite graphs but one may ask that how we can show 3-Coloring or 3-RSS as mathematical formulas this paper is a respond to this question. At the end of paper we will show all types of resolutions on Ternary Variable Clauses and prove the Resolution Theorem in Ternary Algebra space consists of Soundness and Completeness of resolution on ternary algebraic CNF formulas ( TCNF ) that can use in
  • 2. designing algorithms for 3-RSS and 3-Colorability problems or some other applications in Artificial Intelligence. 1. Chromatic Numbers A chromatic number is simply a positive weighted combination of 3 colors r, g and b. Note that this combination has not sign because colors are sign of these numbers. Definition 1. A chromatic number is a number in the form: Where: And: It is obvious that: And: Also: ( )( ) And: ( )( ) ( )( ) From symmetry we have: ( )( ) ( ) Also with a simple calculation: ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) ( )( ) ( ) 1.2 1.1
  • 3. ( )( ) ( )( ) ( )( ) ( )( ) We can show in a diagram like (Fig. 1). From this diagram we can show that: ( ) √ √ And from symmetry: √ √ As a further check: ( ) √ √ √ √ (Fig. 1) Also we can calculate from : √ √ ( ) Also: Using this formulas we can convert every complex number to a chromatic number and wise versa. 1.3
  • 4. 2. Chromatic Number in standard form A chromatic number in standard form can be only combination of only 2 colors like red and green, red and blue or green and blue Definition 2. Every chromatic number in standard form can be only combination of 2 colors if not we can convert it to standard form. Proof. Assume we have a chromatic number including 3 different colors arbitrary. It will be in the form: But always one of this numbers are minimum without loss of generality we can assume that is minimum thus we have: ( ) ( ) ( ) ( ) But based on formula 1.2. we have thus: Only two of them. Proving the theorem. 3. Calculations: In this session we show how we can do calculation in chromatic numbers. 3.1. Summation and Subtraction Summation and subtraction of chromatic numbers can handle directly by summation and subtraction of colors separately from each other. ( ) ( ) ( ) And: ( ) ( ) ( ) After summation or subtraction some values may be negative based on 1.2 we have
  • 5. Thus we can transform it to positive case easily. Then we must convert the number to standard form by the method which used for proof of definition 2. 3.2. Multiplication Based on equation 1.1 we have and also thus we can calculate multiplication on chromatic numbers easily: ( ) ( ) ( ) ( ) Also for multiplication of two chromatic number we have: ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) ( ) After multiplication we have not negative number but maybe we have a combination of 3 different colors thus we can transform the number to standard form arbitrary. 3.3. Division We can calculate division of 2 chromatic numbers using multiplication on first number and inverse of second number. For calculating inverse of a chromatic number we must find coupled of a chromatic number. 3.3.1. Coupled of a chromatic number Based on Fig. 1 coupled of a chromatic number in form: is: ̅ We can calculate multiplication of them easily that is: ̅ ( ) 3.3.2. Inverse of a chromatic number Consider inverse of a chromatic number in the form:
  • 6. With multiplication by coupled we have: ( ) ( ) ( ) Thus we can find division of two chromatic numbers by multiplication of first with inverse of second. 4. Power and Root of a chromatic number Based on extension on equation 1.1. we have: { ( ) ( ) ( ) { ( ) ( ) ( ) It is obvious that a number in the form: ( ) Also: { ( ) ( ) ( ) It is obvious that a number in the form: ( ) ( ) Also based on equation 1.1. We have: √ √ √ Also:
  • 7. √ ( ) Because: ( ) And: √ ( ) Because: ( ) And: √ ( ) Also: √ √ ( ) √ ( ) √ √ ( ) √ ( ) Because: { √ ( )} ( ) Also based on 1.3: √ ( ) √ √ √ ( ) and √ ( ) And: √ √ ( ) And: √√ √ √ ( ) And there is an estimation that: √ √ ( ) Also:
  • 8. ( ) ( √ ) √ √ √ And from symmetry we have: √ Also we can calculate: √ ( ) √ And from symmetry we have: √ ( ) √ √ It is obvious that: 5. 3-RSS problem In this session we will introduce a new NP-Complete problem namely 3-RSS by reduction from 3-SAT and whereas this problem is in NP thus this problems is also NP-Complete ( both NP and NP-Hard). It is a well-known fact that whole problems in NP can reduce to 3-SAT problem. It is known as Cook-Levin theorem ( see [1] ). We here introduce a reduction from 3-SAT to a new problem namely 3-RSS and it proves that whole problems in NP can reduces to 3-RSS. Fig 1 Reducing from 3-SAT to RSS ( Lines show conflicts ) There exists a famous reduction from 3-SAT to Maximum Clique instance ( see [2] ) but a special case of maximum clique as all nodes of graph stand in separate Independent Sets of size 3. Tues if we consider these independent sets are rules with 3 states we have a RSS instance. Two nodes are connected by an edge if (1) they correspond to literals in the same clause, or (2) they correspond to a variable and its inverse for example this Formula is transformed into the graph of (Fig. 1).
  • 9. ( ) ( ̅ ̅) (̅ ) ( ̅ ̅) Theorem 2.3.1. Whole problems in NP can reduces to 3-RSS Proof Based on Cook-Levin theorem every problem ρ in NP can reduces to 3-SAT and we explained how 3-SAT can reduces to 3-RSS thus ρ can reformulates as a 3-RSS. Please note that structure of this problems can show by a multipartite graph of size n. where n is number of variables ( rules ) in this problem. 6. Ternary Algebra and 3-RSS problem In Boolean algebra all variables have only two states zero and one. Here we use a new algebra system that variables have three states Red, Blue and Green we will show that by r, g and b and then we will formulate 3-RSS problem based on these types of variables. 6.1. [ ] [ ] [ ] ̅[ ] ̅[ ] ̅[ ] Here we introduce six new operators [ ] [ ] [ ] ̅[ ] ̅[ ] ̅[ ] this operators easily use to assess that a variable x has either a special color or not for example an operator in form [ ] has Boolean output One iff variable has the color and an operator in form ̅[ ] has Boolean output One iff variable has not the color . We can also write these functions using calculi using figure 1 and this fact that ⁄ ⁄ we have: [ ] ( { } ) [ ] { } Also we have: [ ] [ ] [ ] [ ] In these formulas are rotator operators for example converts to , to and . Also we have: ̅[ ] [ ]̅̅̅̅̅̅ ̅[ ] [ ]̅̅̅̅̅̅ ̅[ ] [ ]̅̅̅̅̅̅ 6.2. A formulation for 3-RSS problem Now we are present to introduce a formulation system for 3-RSS problem. Aim is we will be able to write a 3-RSS problem like a 2-SAT problem based on binary clauses but using ternary variables. Consider a 3-RSS problem instance that have variables we can easily show this problem with a multi-partite graph consists of independent sets. We wish to show this problem also by Ternary Algebra. For a disconnection that is in one independent set ( one variables ) it is clear that it is not important to write because a Ternary Variable never stand in more than two of its states ( colors ). Thus we only deal with disconnections that stand between two states (
  • 10. colors ) of two different variables. Consider we have a disconnection between variable and consider for a moment that without loss of generality this disconnection be between color Red of and Green of then we can write a clause for this disconnection in form: ( ̅[ ] ̅[ ]) Thus we can write whole disconnections ( between two different variables ) as binary clauses but with ternary variables and using disjunction between them we have a Ternary Formula for 3-RSS problem. Thus we can show a 3-RSS problem with variables set instance with a Ternary Formula with: ⋀ ̅̅̅[ ] ̅̅̅[ ] { } For example: ( ̅[ ] ̅[ ]) ( ̅[ ] ̅[ ]) ( ̅[ ] ̅[ ]) We can call such a formula also as Ternary-CNF or TCNF formula. In the next chapters we will discuss resolution rules and the ternary version of theory of resolution and will prove this theorem. 7. Ternary Algebra and 3-Colorability problem 3-Colorability is the question of testing whether a graph is colorable using 3 colors or not as any two adjacent nodes have the same color ( see [4] ). Whereas 3-Colorability is immediately a 3-RSS problem thus we can write a 3-Colorability instance using Ternary- Algebra but we use here a new operator namely Ternary XOR ( TXOR ) and write 3- Coloring using TXOR operators. 7.1. TXOR and TEQUAL If we multiply a ternary variable two time with a ternary variable the results will be red if and only if color of and color of be the same and will be a different color if and only if color of and color of be different. We will establish an operator namely TEQUAL and show it by ̇ . And define: ̇ [ ] [ ] And also opposite of this operator will be TXOR that we define: ̇ ̅[ ] ̅[ ] 7.2. A Ternary Formula for 3-Colorability
  • 11. Consider a 3-Colorability instance defined on vertex of a graph. Some of them are connected and some are disconnected. We can define a set of variables corresponding vertices ( nodes ) of graph. The only restriction is that, two vertices ( nodes ) that are connected to each other must not have the same colors. We can show this situation using TXOR operator. Consider vertices and are connected. We can write a clause in form: ( ̇ ) Using disjunction between these clauses we have a Ternary Formula for 3-Colorability. Thus we can show a 3-Colorability problem with variables set with a Ternary Formula with: ⋀ ̇ For example: ( ̇ ) ( ̇ ) ( ̇ ) 8. Ternary Resolution Rules In Boolean algebra in a CNF formula, Resolution is a rule that produces a new clause using old clauses ( See [5] [10] [11] ). For example if we have two clause of form ( ) and ( ̅) where and are conjunction statements and is a variable we can conclude that ( ) is also a clause. In fact we have: ( ) ( ̅) ( ) This rule is known as resolution rule. And is the base of many algorithms for solving 2-SAT in polynomial time and some heuristics for 3-SAT like DPLL ( see [9] ). Here we introduce Ternary Resolution Rules as some theorems and prove them. Theorem 8.1. ( ̅[ ]) ( ̅[ ]) ( ̅[ ]) ( ) Proof. Consider whole be false statements, then whole ̅[ ] and ̅[ ] and ̅[ ] must be true statements. But it means that must not be Red must not be Green and must not be Blue and whereas every variable like has one of these colors it never happen. Thus at least one of must be true proving the theorem. Theorem 8.2. Without loss of generality ( ̅[ ]) ( ̅[ ]) ( [ ]) Proof. Consider both be false statements, then both ̅[ ] and ̅[ ] must be true statements. But it means that must not be Red and must not be Green and whereas every variable like has three colors this variable must be blue. Thus one of must be true or must be blue. That completes the proof.
  • 12. Theorem 8.3. Without loss of generality ( ̅[ ]) ( [ ]) ( ) Proof. Consider both be false statements, then both ̅[ ] and [ ] must be true statements. But it means that must not be Red and must be Red that they have contrary. Thus one of must be true. That completes the proof. Theorem 8.4. Without loss of generality ( [ ]) ( [ ]) ( ) Proof. Consider both be false statements, then both [ ] and [ ] must be true statements. But it means that must be Red and must be Green and it is a contradiction thus one of must be true that completes the proof. In Boolean algebra the resolvent of two clauses containing two literals is a clause also containing two literals and it explain why 2-SAT problem is solvable in polynomial time complexity. But in ternary algebra the resolvent of two clauses containing two literals can be a clause containing three literals. 9. The Resolution Theorem in Ternary Algebra It is proved that in Boolean algebra if continue a sequence of resolution on clauses leads to an empty clause then formula is unsatisfiable and if formula be unsatisfiable then always continue resolution leads to empty clause ( J.A. Robinson 1965 ). It is known as Resolution Theorem. Here we will prove such theorem for Ternary Algebra. We consider a more general form of clauses that we used for formulating 3-RSS problem. We let every literal be a color like [ ] [ ] [ ] or negation of a color like ̅[ ] ̅[ ] ̅[ ] and prove the theorem in general case. 9.1. The Resolution Operator Resolution Operator is the function Res that, when applied to a set of clauses, returns the set ( ) of clauses, where ( ) { }. ( ) is the result of applying Res repeatedly. More formally, ( ) ( ) ( ( )) ( ) ⋃ ( ) It is obvious that always there exist a number that: ( ) ( ) 9.2. Resolution Derivation Definition 9.2.1. Let be a set of clauses. A resolution derivation from is a finite sequence of clauses such that: each is a member of or is a resolvent of two earlier clauses in the sequence.
  • 13. Definition 9.2.2. A resolution derivation of a clause from is a resolution derivation from such that . It is obvious that when ( ) then there is a resolution derivation of from . 9.3. Resolution Theorem in Ternary Algebra Lemma 9.3.1. Let be a set of clauses and let be a propositional variable occurring in . Let ( ) ( ) ( ) For example ( ) means:  Keeping all clauses in F in which any of literals consists of occurs.  Removing all clauses in F containing : [ ] ̅[ ] ̅[ ].  Removing [ ] [ ] ̅[ ] from each clause of F that contains [ ] [ ] ̅[ ]. Then the following statements are equivalent: 1. is unsatisfiable 2. All ( ) and ( ) and ( ) are unsatisfiable. Proof. Consider there exist a satisfying assignment for one of ( ) ( ) ( ) then using that color for it will be immediately a satisfying assignment for . In the other hand consider there exist a satisfying assignment for then it will be immediately a satisfying assignment for ( ) ( ) ( ). Theorem 9.3.1. Resolution Theorem Let be a set of clauses then the followings are equivalent: 1- is unsatisfiable 2- { } ( ) Proof. Let ́ be the set of added clauses by resolution operator we have ́. If { } ́ then ́ is a false statement. Thus must be false by well-known facts of Boolean algebra. Proof.
  • 14. By strong induction on the number of literals in . Assume has literals and that the result holds for all finite unsatisfiable sets of clauses with fewer than literals. Take a propositional variable in . By the Lemma 9.3.1, all ( ) ( ) ( ) are unsatisfiable and have fewer than literals. By induction hypothesis, { } ( ( )) { } ( ( )) { } ( ( )) So, we have that: There is a resolution derivation of { } from ( ) There is a resolution derivation of { } from ( ) There is a resolution derivation of { } from ( ) If each is a clause of or if each is a clause of or if each is a clause of then we have a derivation of { } from . Otherwise, If is a clause in the resolution derivation of { } from ( ) such that is not in F, then replace by ̅[ ] or [ ] or [ ]. This way we obtain a resolution derivation of one of ̅[ ] or [ ] or [ ] from . By a similar argument we can prove that we have resolution derivations of one of ̅[ ] or [ ] or [ ] from F and one of ̅[ ] or [ ] or [ ] from F. Operating Resolution Rules one these three clauses leads to { }. That completes the proof. 10. Conclusion In this paper we showed that we can write complex number in a chromatic coding and do some calculation on them directly. However more researches regarding chromatic number and their property are essential. We used Ternary CNF formula for coding 3-RSS problem and showed 3-Colorablity problem by TXor clauses. We proved the resolution theorem in Ternary Algebra literature. Author wishes that results uses by him or others to extending algorithms for NP-Complete problems like 3-RSS. 11. References 1- The Complexity of Theorem-Proving Procedures, Stephen A. Cook, University of Toronto 1971 2- 21 NP-Hard problems, Jeff Erikson, 2009 3- Reducibility among Combinatorial Problems, Richard M. Karp, University of California at Berkley 1972 4- Improved Algorithms for 3-Coloring, 3-Edge-Coloring, and Constraint Satisfaction, David Eppstein 5- Logic and Computation, Phokion G. Kolaitis, University of California Santa Cruz & IBM Research – Almaden 6- Many facets of complexity in logic, Antonina Kolokolova, Memorial University of Newfoundland 7- A LINEAR-TIME ALGORITHM FOR TESTING THE TRUTH OF CERTAIN BOOLEAN FORMULAS, Bengt ASPVALL, Michael F. PLASS and Robert Endre TARJAN, Computer Science Department, Stanford University, Stanford, CA 94305, U.S.A.
  • 15. 8- An On-Line Satisfiability Algorithm for Conjunctive Normal Form Expressions with Two Literals, John F. Kolen, Institute of Human and Machine Cognition, University of West Florida 9- Directional Resolution: The Davis-Putnam Procedure, Revisited Rina Dechter and Irina Rish , Information and Computer Science University of California, Irvine 10- M. Alekhnovich,Mutilated chessboard problem is exponentially hard for resolution, Theoretical Computer Science 310 (1–3) (2004) 513–525. 11- Resolution for Max-SAT, María Luisa Bonet a , Jordi Levy b, , Felip Manyà b, Elsevier Artificial Intelligence