15
On the complexity of nonuniform wavelength-based machine Sama Goliaei Mohammad-Hadi Foroughmand-Araabi Received: 9 January 2013 / Accepted: 17 January 2014 Ó Springer Science+Business Media Dordrecht 2014 Abstract The wavelength-based machine, or simply w- machine, is an optical computational model, which is designed based on simultaneous movement of several wavelengths in a single light ray, and simultaneous effect of simple optical devices on them. In this paper, we investigate nonuniform complexity classes of w-machine, based on three complexity measures, namely, size, time, and word length. We show that the class of languages which can be generated by constant size nonuniform w- machines contain infinitely many Turing undecidable lan- guages. Also, we show that polynomial size nonuniform w- machines generate all NP languages, and every NP-hard language requires at least polynomial time and polynomial size nonuniform w-machines to be generated. We prove that the class of languages which can be generated by polynomial size nonuniform w-machines is equal to NP/ poly, and almost all languages require exponential size and polynomial time nonuniform w-machines to be generated. Keywords Unconventional computing Optical computing Wavelength-based machine Complexity Complexity classes Nonuniform complexity Nondeterministic boolean circuits Turing machine with advice 1 Introduction The aim of optical computing is to provide new computing methods, based on physical properties of light. The main research works on optical computing can be categorized in three categories, namely, optical data transmission (Maier 2008, p. 52), optical memories (Meinders et al. 2006, p. 4), and optical problem solving. Optical problem solving, as a sub-branch of optical computing, tries to find methods that outperform traditional algorithms. Almost every research in this area provide specific methods for specific problems (Goliaei and Fo- roughmand-Araabi 2012; Goliaei 2013; Haist and Osten 2007; Oltean and Muntean 2008). Some works generalize these specific methods for similar problems (Dolev and Fitoussi 2010), and there are only a few researches that provide general methods in the form of computing para- digms (Reif and Tyagi 1990; Woods and Naughton 2009). We previously provided the idea of the wavelength based computing for the 3-SAT problem (Goliaei and Jalili 2009, 2012). This idea is also used for the string matching problem (Oltean 2009). We previously generalized the idea of using wavelengths and provided a computing machine named w-machine (Goliaei and Foroughmand-Araabi 2012, 2013). This machine benefits from parallel nature of light, and uses this phenomenon to perform computing by passing lights, which may contain different wavelengths, through optical devices. We also provided lower bounds on complexity of languages on a simplified version of w- machine (Goliaei and Foroughmand-Araabi 2012). The purpose of this paper is to clearly specify the computational power of nonuniform w-machine families. For example, in this paper we define complexity classes for w-machine and compare these complexity classes to Turing machine complexity classes. S. Goliaei (&) M.-H. Foroughmand-Araabi University of Tehran, Tehran, Iran e-mail: [email protected] M.-H. Foroughmand-Araabi e-mail: [email protected] 123 Nat Comput DOI 10.1007/s11047-014-9412-2

On the complexity of nonuniform wavelength-based machine

Embed Size (px)

Citation preview

Page 1: On the complexity of nonuniform wavelength-based machine

On the complexity of nonuniform wavelength-based machine

Sama Goliaei • Mohammad-Hadi Foroughmand-Araabi

Received: 9 January 2013 / Accepted: 17 January 2014

� Springer Science+Business Media Dordrecht 2014

Abstract The wavelength-based machine, or simply w-

machine, is an optical computational model, which is

designed based on simultaneous movement of several

wavelengths in a single light ray, and simultaneous effect

of simple optical devices on them. In this paper, we

investigate nonuniform complexity classes of w-machine,

based on three complexity measures, namely, size, time,

and word length. We show that the class of languages

which can be generated by constant size nonuniform w-

machines contain infinitely many Turing undecidable lan-

guages. Also, we show that polynomial size nonuniform w-

machines generate all NP languages, and every NP-hard

language requires at least polynomial time and polynomial

size nonuniform w-machines to be generated. We prove

that the class of languages which can be generated by

polynomial size nonuniform w-machines is equal to NP/

poly, and almost all languages require exponential size and

polynomial time nonuniform w-machines to be generated.

Keywords Unconventional computing � Optical

computing � Wavelength-based machine � Complexity �Complexity classes � Nonuniform complexity �Nondeterministic boolean circuits � Turing machine with

advice

1 Introduction

The aim of optical computing is to provide new computing

methods, based on physical properties of light. The main

research works on optical computing can be categorized in

three categories, namely, optical data transmission (Maier

2008, p. 52), optical memories (Meinders et al. 2006, p. 4),

and optical problem solving.

Optical problem solving, as a sub-branch of optical

computing, tries to find methods that outperform traditional

algorithms. Almost every research in this area provide

specific methods for specific problems (Goliaei and Fo-

roughmand-Araabi 2012; Goliaei 2013; Haist and Osten

2007; Oltean and Muntean 2008). Some works generalize

these specific methods for similar problems (Dolev and

Fitoussi 2010), and there are only a few researches that

provide general methods in the form of computing para-

digms (Reif and Tyagi 1990; Woods and Naughton 2009).

We previously provided the idea of the wavelength

based computing for the 3-SAT problem (Goliaei and Jalili

2009, 2012). This idea is also used for the string matching

problem (Oltean 2009). We previously generalized the idea

of using wavelengths and provided a computing machine

named w-machine (Goliaei and Foroughmand-Araabi

2012, 2013). This machine benefits from parallel nature of

light, and uses this phenomenon to perform computing by

passing lights, which may contain different wavelengths,

through optical devices. We also provided lower bounds on

complexity of languages on a simplified version of w-

machine (Goliaei and Foroughmand-Araabi 2012).

The purpose of this paper is to clearly specify the

computational power of nonuniform w-machine families.

For example, in this paper we define complexity classes for

w-machine and compare these complexity classes to Turing

machine complexity classes.

S. Goliaei (&) � M.-H. Foroughmand-Araabi

University of Tehran, Tehran, Iran

e-mail: [email protected]

M.-H. Foroughmand-Araabi

e-mail: [email protected]

123

Nat Comput

DOI 10.1007/s11047-014-9412-2

Page 2: On the complexity of nonuniform wavelength-based machine

In this paper, first we review previous related works in

Sect. 2, and the background on w-machine in Sect. 3.

Section 4 contains some general theorems about w-

machine complexity hierarchy. Sections 5, 6, and 7 contain

theorems about constant and logarithmic size, polynomial

size, and exponential size w-machines, respectively. We

present the summary of our results and possible future

works in Sect. 8.

2 Related works

Different optics-based methods are provided for solving

computational problems. For example, the optical convo-

lution technique is used for computing matrix multiplica-

tion and number multiplication (Yu et al. 2001, p. 475). In

another method, a graph-like structure made up of optical

devices and fibers are constructed, and then, the light is

sent through this structure. The result could be found by

checking the presence of light in a specific time on a

specific vertex. This method is provided for the Hamilto-

nian path and subset sum problems (Haist and Osten 2007;

Muntean and Oltean 2009; Oltean and Muntean 2008,

2009). This method is based on the assumption that the

speed of light is limited. It is also proved that, in general,

this method requires exponential amount of time and

optical devices (Oltean 2008), unless P = NP.

Another approach is to create optical masks which

restrict the light transmission path in 3-dimensional space.

The result of the problem, in this method, can be found by

checking the presence of light in a specific time on a

specific position. This method is applied for various NP-

complete problems, such as 3-SAT and Hamiltonian path

problems (Dolev and Fitoussi 2010). In the inverse of this

problem, which is called the ray tracing problem, a set of

reflective and refractive objects and their placements are

given, and the question is ‘‘does a zero width light ray

reaches to some specific points?’’ The ray tracing problem,

in most of the cases, is proved to be undecidable (Reif et al.

1994).

For the string matching problem, an optical wavelength-

based approach with color glasses, is provided (Oltean

2009). Also, in our previous works, we considered different

wavelengths as different solutions for a 3-SAT problem,

and we used masks to find proper solutions of the 3-SAT

problem (Goliaei and Jalili 2009, 2012).

The VLSIO model, is a generalized version of the VLSI

model in 3-dimensions (Barakat et al. 1987). The VLSIO

model is defined as a set of optical devices with optical

images as inputs and outputs. The VLSIO model is an

abstract model, and this model does not make any assump-

tions about the optical devices. Lower bounds and upper

bounds on the amount of energy required for a VLSIO model

to compute any Boolean function are provided (Barakat et al.

1987; Reif and Tyagi 1990). From these lower bounds, more

lower bounds are derived for some specific problems, such as

convolution, discrete Fourier transformation, multiplication

or division, any input transitive problems, and multiplication

and inversion of binary matrices (Barakat et al. 1987).

The continuous space machine (CSM), is a general

computing machine (Woods and Naughton 2005, 2009).

This machine performs computation by applying optical

operations on optical images. In this model, optical images

and optical devices are assumed to have infinite resolution.

It is shown that CSM can simulate the Turing machine

sequentially (Woods and Naughton 2008). Some restricted

versions of CSM are investigated for its computational

power lower bounds (Woods and Naughton 2009). It is

proved that some restricted versions of CSM satisfy the

parallel thesis, and thus, those CSM models, compute just

the PSPACE languages in polynomial time (Woods and

Gibson 2008).

3 Background on the wavelength-based machine

The basic idea of the wavelength-based machine, or shortly

w-machine, is to encode information by wavelengths at

some spatial positions (inside a light ribbon). Several

photons simultaneously exists in a single light ray, and

optical devices such as beam-splitters and mirrors are

applied on photons simultaneously. Also, photons with

different wavelengths can be separated from each other

easily, by prisms. Wavelengths and spatial position of light

rays are also used in computation in other related works,

but in w-machine, these two features are combined and a

novel set of pure optical operations, based on simple

optical devices, are provided.

3.1 Light ribbons and w-sets

To use wavelengths and spatial position of photons, w-

machine works with light ribbons instead of light rays. A

light ribbon is a set of parallel light rays traversing in a

same direction, in a single geometrical plane in the space.

For example, after passing a light ray through two prisms,

as it is shown in Fig. 1, the obtained spectrum is a light

ribbon.

Consider the continuous spectrum light ribbon obtained

by passing a continuous spectrum light ray (in visible range)

through two prisms. Let D be the width of this light ribbon. In

an n-bit w-machine, we divide this spectrum into 2n wave-

length intervals each having width D=2n, and assign the

wavelengths in intervals to n-bit binary strings, in ascending

order. For example, in Fig. 2a, the wavelengths are assigned

to 22-bit binary strings, in a 2-bit w-machine.

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 3: On the complexity of nonuniform wavelength-based machine

We also consider the spatial positions, and divide the

width of the light ribbon into 2n positions (sections), and

assign positions to n-bit binary strings, in ascending order.

Here, we use a and b characters instead of 0 and 1 in

representation of binary string of positions, and call these

strings ‘‘ab-binary strings’’ to be easily distinguishable

form binary strings assigned to wavelengths. Figure 2b

shows an example of assigning positions to ab-binary

strings, in a 2-bit w-machine. Note that, according to the

number of bits in w-machine, n, we divide the wavelength

range, and widths of ribbons to 2n sections. Each section in

a wavelength range corresponds to a section in the ribbon,

and vice versa. We use this correspondence in normal light

ribbons.

In w-machine there are operations that divide a light

ribbon to two smaller ribbons. These operations divide the

width of the ribbon by two. These operations may be

applied over each other, thus there may be light ribbons of

width D=2d. Note that, the value n - d, which we call it the

degree of the light ribbon, indicates the number of times

which the width of the light ribbon is divided by two. Note

that, the light ribbon with width D=2d contains 2n-d posi-

tions (the width of each position is always D=2n), and the

positions are assigned to (n - d)-bit ab-binary strings.

Now we define w-tuple to model a wavelength which is

placed in a position, and w-set to model a light ribbon.

Examples of w-tuples and light ribbons which are modeled

as w-sets are presented in Figs. 3, and 4, respectively.

Definition 1 An n-bit w-tuple, is a tuple (p, q) such that

p [ {0,1}n and q [ {a, b}d (0 B d B n). Elements p and

q are called the wavelength element and the position

element, respectively, and d is the degree of w-tuple.

Definition 2 An n-bit w-set of degree d, is a set of n-bit

w-tuples of degree d.

Considering the defined machine, special form of tuples

have importance: when any wavelength is placed in its

corresponding position. These w-tuples are called normal

and are defined as follows:

Definition 3 A w-tuple (p, q) is normal if and only if p is

obtained from q by replacing a and b by 0 and 1, respec-

tively. A w-set is normal if and only if it contains only

normal w-tuples.

3.2 w-Machine operations

An n-bit w-machine w, performs operations on n-bit w-sets,

and generates a light ribbon (modeled as a w-set) as output.

The basic operations of w-machine are defined as follows:

– Complete normal set generation (G): Generates an n-bit

w-set containing all 2n possible normal w-tuples by

passing a continuous spectrum light ray through two

prisms (see Fig. 5a).

– Duplication (Dup): Duplicates a given w-set, by

passing the given light ribbon through a cubic beam-

splitter (see Fig. 5b).

– Union (U): Creates a w-set which is the union of two

given w-sets. The operation is implemented by super-

posing a light ribbon on another one, by passing two

light ribbons through a cubic beam-splitter (see

Fig. 5c). The operation is defined only when the degree

of two given w-sets are equal.

– Disjoin (DJ ): Creates two new light ribbons by

disjoining the first half of a given light ribbon from

the second half, using flat mirrors (see Fig. 5d). Note

that, a w-tuple is in the first (second) half of the

resulting ribbon if and only if the left-most bit of its

position element is a (b). Thus, the operation separates

w-tuples in a given w-set according to the left-most bit

of the position element, and creates two new w-sets,

one for a and one for b. The operation is defined only

when the degree of the given w-set is at least 1.

– Join (J ): Joins two given light ribbons to obtain a new

light ribbon with twice width as the width of the given

light ribbons, using flat mirrors (see Fig. 5e). Since the

w-tuples of the first light ribbon are placed on the first

half of the new obtained light ribbon, the operation

Fig. 1 A light ribbon obtained by passing a light ray through two

prisms

(a) (b)

Fig. 2 Assignment of wavelengths and light ribbon sections to binary

strings

(a) (b)

Fig. 3 Examples of w-tuples

Complexity of nonuniform of the w-machine

123

Page 4: On the complexity of nonuniform wavelength-based machine

adds an a (b) character to the left of the position

element of the w-tuples in the first (second) given w-set

(see Fig. 6b for example). Note that, the operation is

defined only when two given w-sets have equal

degrees. If only one input is given to the join operation,

the non-presented input is considered as an empty w-

set.

– Normalization (N ): Takes a w-set with degree n and

creates a new light ribbon containing normal w-tuples.

The operation is obtained by passing the given light

ribbon from two prisms, in opposite direction (see

Fig. 5f). Now, the normal wavelengths, come out on a

single light ray. We block the other light rays with

opaque sheets, and pass the normal wavelengths again

from two prisms, to obtain a light ribbon containing all

normal wavelengths.

Note that, each operation requires constant number of

physical devices, and takes constant time to be applied.

We represent each w-machine by a directed acyclic

graph, such that the graph edges are light ribbons, and

graph vertices are basic operation or opaque sheets. Opa-

que sheets are used to block light ribbons which are not

used in the rest of the computation. We represent operation

vertices by circles, and blocking vertices by black squares.

We also represent the output light ribbon of the machine by

a vertex, labeled as output. We suppose that the graph of w-

machine is always connected.

Note that, the w-machine is an optical machine and does

not contain electro-optical devices. Also, according to the

construction of w-machine light rays could only be gen-

erated as a continuous spectrum, i.e. a complete w-set, and

during the computation, they may traverse through optical

devices or may be blocked. Thus, we can not compute

negation of intermediate w-sets.

In order to make distinction between two outputs of the

disjoin operations, we write a and b characters on the

outgoing edges. Also, we write an a and a b character on

incoming edges to the join operation to indicate that which

of input light rays will be placed on the first half and which

one is placed on the second half of the resulting light rib-

bon. Note that, two operations can be performed simulta-

neously if and only if there is no directed path between

them. Figure 7 provides an example of a w-machine, and

w-sets corresponding to edges are represented on the edges.

3.3 The language and complexity measures of w-

machine

In order to analyze complexity issues of w-machine, we

define languages and complexity measures of w-machine.

In an n-bit w-machine w, we name n as the wordlen of

w. Note that, since wordlen(w) indicates the logarithm of

the required number of different wavelengths in w, it can

be considered as a complexity measure.

Definition 4 For an n-bit w-machine w, wordlen(w) is

defined as n.

We define two other complexity measures size and time

of w as the number of circle vertices and the length of the

longest path in the graph representing w, respectively.

Definition 5 For a w-machine w, the time of w, denoted

by time(w), is the length of the longest chain of operations

in w, and the size of w, denoted by size(w), is the number of

operations in w.

(a) (b)

Fig. 4 Examples of w-sets

(a) (b) (c)

(d) (e) (f)

Fig. 5 Operations of w-

machine. a Creating a complete

normal w-set. b Duplication

operation. c Union operation.

d Disjoin operation. e Join

operation. f Normalization

operation

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 5: On the complexity of nonuniform wavelength-based machine

As an example, in w-machine w represented in Fig. 7,

wordlen(w) = 2, time(w) = 4, and size(w) = 5.

The output of an n-bit w-machine is a w-set or equiva-

lently, a light ribbon containing some wavelengths in some

positions. In order to define the language of w-machines,

we ignore the position element of the output w-tuples. We

say that the w-machine generates the set of binary strings

specified by wavelengths in the output light ribbon. Also,

for any m-bit binary language, we say that a w-machine

generates the m-bit binary language which is specified by

left m-bit prefixes of wavelength elements. Note that, this

definition is obtained by considering the reference wave-

length interval as 2m sections, instead of 2n original

sections. This definition lets the n-bit w-machine to gen-

erate m-bit binary languages. In this case, the remaining

n - m bits are used as auxiliary bits for computation.

Definition 6 Let L � f0; 1gmbe an m-bit binary lan-

guages, and w be an n-bit w-machine (m B n). w generates

L if and only if L is equal to the set of m-bit prefixes of

wavelength elements of the output set of w. In the other

words, we say that w generates L, if and only if for every

binary string p [ {0,1}m, p [ L if and only if

(pp0, q) [ output (for some p0 [ {0,1}n-m and q [ {a, b}*).

According to this definition a w-machine generates an

m-bit language for some fixed m, thus, we use a family of

w-machines to generate a binary language, each w-machine

for one of the string lengths. We also define the concept of

uniformity on the families of w-machines, to specify if a

family of w-machines is computable by Turing machines.

Definition 7 Let L � f0; 1g� be a language. A family of

w-machines fwgm2N0generates L if and only if wm gener-

ates the subset of m-bit binary strings of L.

Definition 8 A family of w-machines {w}m is uniform if

and only if there exists a Turing machine T that produces

the description of the graph that represents wm when 1m is

given as input.

3.4 Structural modules of w-machine

To simplify representation of w-machines in the rest of the

paper, we define five modules, which can be used in the

structure of w-machines, as follows:

– Drop (Dropi): This module applies i times the disjoin

operation on a given w-set, and removes the i left-most

bits from the position element. This module can be

used when we want to read the (i ? 1)-th left-most bit

of the position elements. The structure of the module is

presented in Fig. 8. Time and size measures of this

module are O(i).

– Branch (Branchi): This module is the extension of the

disjoin operation. Branchi uses 2i-1 disjoin operations a

to form binary tree structure and generates 2i w-sets

Sa…a, …, Sb…b, where Sp contains w-tuples of the

given w-set having position element with prefix p. In

the other words, the module classifies the w-tuples of a

given w-set according to i-bit left prefix of their

position elements. The structure of the module is shown

in Fig. 9. Time and size measures of this module are

O(i).

– Add (Addi): This module is the extension of the join

operation. The module generates a new w-set from a

given w-set, by adding all possible i-bit ab-binary

strings a. . .a; . . .; b. . .b, to the position elements (from

left side) of all w-tuples in the given w-set. The

structure of the module is represented in Fig. 10. An

example of the applications of the module, is when we

have a normal set, and we drop the i left-most bits of

the position elements via the Branchi, then we can use

the Addi module and a normalization operation, to

obtain the initial w-set. Time and size measures of this

module are O(i).

– Normal select (Selecti): The module reads the i-th left-

most bit of w-tuples from a given normal w-set, and

classifies the w-tuples in two new w-sets, according to

the value of the i-th left-most bit of the position

elements. The structure of the module is shown in

Fig. 11. First, a Dropi-1 is used to delete i - 1 left-

most bits of the position elements. Then, a disjoin

operation is used to read the next left-most bit of the

position elements and classify the w-tuples according to

(a) (b)

Fig. 6 a Examples of the disjoin operation. b Example of the join

operation

Fig. 7 Example of a 2-bit w-machine

Complexity of nonuniform of the w-machine

123

Page 6: On the complexity of nonuniform wavelength-based machine

the value of this bit. Then, an Addi adds the deleted bits

to the position elements of the w-tuples and a normal-

ization operation is used to find w-tuples which belong

to the initial w-set. Time and size measures of the

module are O(i).

– Equal (Eqtf,s,i): Creates a w-set containing all w-tuples

of a given w-set for which two i-bit substrings starting

form the f-th and the s-th bits of the position element

are equal. Input and output w-sets of this module are

normal. This module can be used for example in

simulating the Turing machine by w-machine. The

structure of the module is shown in Fig. 12. Time and

size measures of the module are polynomial.

3.5 Implementation

A small prototype of w-machine is previously implemented

(Goliaei 2012). This implementation does not cover all the

features of w-machine, but implements a small 3-bit w-

machine which is presented in Fig. 13a. The output light

ribbon of the considered w-machine is shown in Fig. 13b.

Some difficulties arise in implementation of w-machine

for large values of n. Although, there are light sources that

emit continuous spectrum, such as hot solid bodies, with a

continuous intensity function I(k) for wavelength k(Demtrder 2011, p. 377), however, the difficulty is to place

optical devices very precisely on light ribbons (for example

in the join and disjoin operations) for narrow light ribbons.

Note that, the number of photons of each wavelength

interval is reduced in each machine operation at most by

some constant factors, depending on the physical properties

of optical devices. Thus, the intensity of light sources may

need to be exponential according to the length of the lon-

gest chain of operations (time of w-machine). Also, the

number of required photons with different wavelengths is

exponential according to n.

4 w-Machine hierarchy theorems

In this section, we prove useful theorems about the com-

plexity of w-machines. The first theorem indicates that the

maximum wordlen required by a w-machine to generate a

language, is the maximum of its time and the length of

binary strings of the language. The second theorem

Fig. 8 The structure of Dropi. It contains i pairs of a disjoin and a

union operations

Fig. 9 The structure of Branchi. The Branchi operation forms a

binary tree structure and consists of i levels of disjoin operations

Fig. 10 The structure of Addi. It contains i pairs of a duplication and

a join operations

Fig. 11 The structure of Selecti

Fig. 12 The structure of Eqtf,s,i. It consists of i blocks, each contains

three select modules and one union operations

(a)

(b)

Fig. 13 Implementation of a small w-machine. a The structure of the

machine. b The output light ray which represents

{001, 011, 100, 101, 111}, from right to left

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 7: On the complexity of nonuniform wavelength-based machine

indicates that the time of a w-machine is at least the log-

arithm of its size, and the third theorem, indicates that

increasing the size of w-machines leads to ability of gen-

erating more languages.

Theorem 1 Let L � f0; 1gmbe a set of m-bit binary

strings, and w be a w-machine generating L. There is a w-

machine w0 generating L, where

sizeðw0Þ ¼ sizeðwÞ; timeðw0Þ ¼ timeðwÞ;wordlenðw0Þ � maxðm; timeðw0ÞÞ

Proof Let n = max(m, time(w)). If wordlen(w) B n,

w0 = w satisfies the mentioned conditions.

Now, suppose that n \ wordlen(w), and let w0 be an n-

bit w-machine with the same structure (graph) as w. Since

time(w) B n and the longest chain of operations in w has at

most n operations, hence, w-tuples traverse along the edges

of w according to the value of at most n left-most bits of

their position and wavelength elements. Thus, each w-tuple

in each edge of w appears on the corresponding edge of w0

by deleting wordlen(w) - n right-most bits of its wave-

length and position elements. More formally, each w-tuple

(pp0, qq0) (p [ {0, 1}n, p0 [ {0, 1}wordlen(w)-n, q [ {a, b}*,

q0 [ {a, b}wordlen(w)-n) in each edge of w, appears as

(p, q) on the corresponding edge of w0. Since L is

specified by the m-bit left-prefixes of the wavelength

element of the output w-set of w, and m B n, hence, w0

generates L. Note that, the graph of w0 has the same

structure as the graph of w, thus, time(w0) = time(w),

size(w0) = size(w), and w0 satisfies the mentioned condi-

tions in the theorem. h

Theorem 2 For all w-machines w,

time(w) B size(w) \ 2time(w).

Proof For each operation vertex v of the graph of w, let

depth(v) be the length of the longest directed path from v to

the output vertex. Note that, by the definition of time,

depth(v) B time(w), for all vertices v. Now, we partition

the vertices in time(w) ? 1 layers according to their depth,

where the i-th layer (0 B i B time(w)) contains all vertices

v with depth(v) = i. The first layer, i.e. the layer with depth

0, contains only the output vertex. Since every vertices in

w has at most two input edges, hence, the number of ver-

tices in the i-th layer (0 \ i B time(w)) is at most two

times as many as the number of vertices in the (i - 1)-th

layer. Thus, the graph has at most 2time(w) - 1 vertices, and

time(w) B size(w) \ 2time(w). h

Theorem 3 Let Wm,n,s be the number of m-bit languages

which can be generated by w-machines with size at most

s and wordlen at most n. There exists some constants c,

f [ 1 such that for n [ 1, s B 2m/m we have

f 9 Wm,n,s B Wm,n,s?cn.

The idea of the proof is similar to the proof presented in

(Chow 2011). In order to prove the theorem, first we

present three lemmas.

Lemma 1 Let L � f0; 1gmbe a language, w be an n-bit

w-machine generating L, and p [ L be a binary string.

Then, there is an n-bit w-machine w0 such that w0 generates

L - {p}, and size(w0) B size(w) ? 2n ? 5m.

Proof Let Sout be the output w-set of w. First, we build

another w-set Sout which contains normal w-tuples with

wavelength elements equal to wavelength elements of the

Sout. We generate Sout by first dropping degðSoutÞ bits of the

position element of Sout w-tuples. Then we add all possible

wordlen(w) bit ab-binary strings to the position elements.

Finally, after a N operation, we have Sout.

To exclude the binary string p from the Sout, we put

m DJ operations such that one of the outputs of the last

DJ operation contains p. We ignore that output edge and

find the union of other outputs of all DJ operations. We

put a J operations before each union operation to make

degree of w-tuples compatible. The structure of w0 is

presented in Fig. 14.

There are 2degðSoutÞ� 2n operations in the drop mod-

ule, 2m operations in the add module, m disjoin operations,

m - 1 join, m - 1 union operations, and size(w) operations

in the w-machine w0. Thus size(w0) B size(w) ?

2n ? 5m. h

Lemma 2 Let L � f0; 1gmbe a language, w be an n-bit

w-machine generating L, and p 62 L be a binary string.

Then, there is an n-bit w-machine w0 such that w0 generates

L[{p}, and size(w0) B size(w) ? 2n ? 2.

Proof The structure of w0 is shown in Fig. 15. Let Sout be

the output w-set of w. In order to construct w0, we add a

new G operation, and then, pass its output through n DJoperations to obtain a w-set containing only w-tuples that

their wavelength elements are in the form of pp0, for some

binary strings p0 [ {0,1}*. Then, we need to add some Joperations in order to add the dropped bits to the position

elements to make the degree of the obtained w-tuple equal

to the Sout. Finally, we obtain the union of Sout and newly

generated w-set as the output of w0.

Fig. 14 The structure of a w-machine which excludes a given binary

string from a language

Complexity of nonuniform of the w-machine

123

Page 8: On the complexity of nonuniform wavelength-based machine

There are one generate operation, n disjoin operations,

degðSoutÞ� n join operations, one union operation, and

size(w) other operations in w0. Thus size(w0) B si-

ze(w) ? 2n ? 2. h

Lemma 3 Let Wn,s be the number of n-bit languages

which can be generated with w-machines having size at

most s, then, Wn, s B ts ss for some constant t.

Proof As Wn,s, we compute number of different n-bit w-

machine graphs with s vertices. Note that, every comput-

able language by w-machine of the size less than s is also a

computable language by w-machines of the size s. Since

there are 7 different operations (including the output ver-

tex), hence, there are at most 7s different vertex labelings.

Since every vertex has at most 2 different inputs and at

most 2 different outputs, hence, there are at most (2s)2s

different conformations for the graph edges. But, we have

counted every permutation of vertices as a new function,

we should divide the obtained number by s!. So,

Wn;s� 7sð2sÞ2s=s!

Since s! C (s/3)s, we have

Wn;s� 3s7sð2sÞ2s=ss ¼ ð3� 7� 4Þsss

h

Proof of the Theorem 3 is as follows.

Proof Let H be the set of all languages which can be

generated with w-machines of size at most s. The boundary

KðHÞ is the set of languages B 62 H such that it differs from

at least one element of H in one binary string, i.e.,

KðHÞ ¼ fBjB 62 H; jADBj ¼ 1;A 2 Hg. We want to show

that with 7n more operations we can add KðHÞ languages,

which are not computable with s operations, to the com-

putable languages.

We use a proposition from (Chow 2011). The proposi-

tion states that for a set of m-bit languages H such that

logðjHjÞ ¼ Oð2mÞ, we have �jHj � jKðHÞj, for some

positive �.

According to Lemma 3, jHj � tsss for some constant

t. Thus, logðjHjÞ � t0s2 log s, and by letting s B 2m/m we

have logðjHjÞ � t00ð4=ffiffiffiffi

mpÞm which is asymptotically less

than or equal to 2m, for some constants t0 and t00. Thus,

according to the proposition, there is a constant � for which

we have �jHj � jKðHÞj.

According to Lemma 2, by adding at most 2n ? 2

operations, we can add one specific binary string to a

language. Also, according to Lemma 1 and by adding

2n ? 5m operations we can exclude a binary string from a

language.

Thus, by at most 7n more operation, we can generate

KðHÞ more languages by w-machines. Thus, we can

generate ð1þ �ÞjHj languages with w-machines of size at

most s ? 7n that proves the theorem, for constants c = 7,

and f ¼ 1þ �. h

5 Constant and logarithmic size w-machines

To investigate the complexity classes of w-machine, we

investigate three complexity measures wordlen, time, and

size of families of w-machines.

Definition 9 CSIZE is the set of all languages

L � f0; 1g�, such that there exists a (not necessarily uni-

form) family of w-machines fwgm2N0generating L, with

size(wm) = O(1).

To understand how big CSIZE is, we prove that for every

Turing undecidable language L, there is a Turing unde-

cidable language WðLÞ, where WðLÞ 2 CSIZE.

Definition 10 Let L be a binary language. WðLÞ is a

binary language, where for each q [ {0,1}*, 1q 2 WðLÞ if

and only if for some p [ L (p [ {0,1}*), 1p is the binary

representation of |q| (the length of q), and 0q 2 WðLÞ if and

only if for some p 62 L (p [ {0,1}*), 1p is the binary rep-

resentation of |q|. Note that, W : 2f0;1g� ! 2f0;1g

�is an

injective function.

Lemma 4 For each binary language L � f0; 1g�,WðLÞ 2 CSIZE.

Proof We design a constant size series of w-machines

fwgm2N0computing WðLÞ as follows. For each m (1 B m),

wm generates all m-bit members of WðLÞ. Let 1p be the

binary representation of m. If p [ L, then, wm generates all

binary strings of length m with value 1 as the left-most bit.

Otherwise, p 62 L, and then, wm generates all m-bit binary

strings with value 0 as the left-most. The structure of wm is

shown in Fig. 16. Note that, in this figure, b (a) is b (a) if

p [ L, and a (b) otherwise. Since the number of operations

in wm is constant, hence, size(wm) = O(1) and

WðLÞ 2 CSIZE. h

Theorem 4 CSIZE contains infinitely many Turing

undecidable languages.

Proof Let L be a Turing undecidable language. It can be

easily seen that WðLÞ is also Turing undecidable, because if

WðLÞ is Turing decidable, a Turing machine can decide if a

Fig. 15 The structure of a w-machine which adds a given binary

string to a language

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 9: On the complexity of nonuniform wavelength-based machine

given string belongs to L or not by creating a proper input

string and simulating the Turing machine computing WðLÞ.On the other hand, according to Lemma 4, WðLÞ 2 CSIZE.

Since there are infinite number of Turing undecidable

languages and W : 2f0;1g� ! 2f0;1g

�is injective, hence,

there are infinite number of Turing undecidable languages

in CSIZE. h

Definition 11 CTIME is the set of all languages

L � f0; 1g�, such that there exists a (not necessarily uni-

form) family of w-machines fwgm2N0generating L, with

time(wm) = O(1).

Theorem 5 CTIME ¼ CSIZE.

Proof Let Ls 2 CSIZE be a language. By the definition of

CSIZE, there is a family of w-machines fwgm2N0generating

Ls, where size(wm) = O(1). By the definition of size and

time, time(wm) B size(wm) and time(wm) = O(1). Thus,

Ls 2 CTIME and CSIZE � CTIME.

Let Lt 2 CTIME be a language. By the definition of

CTIME, there is a family of w-machines fw0gm2N0gener-

ating Lt, where time(w0m) = O(1). According to Theorem

2, sizeðw0mÞ� 2timeðw0mÞ, hence, size(w0m) = O(1) and

Lt 2 CSIZE. Thus, CTIME ¼ CSIZE. h

Definition 12 LSIZE is the set of all languages

L � f0; 1g�, such that there exists a (not necessarily uni-

form) family of w-machines fwgm2N0generating L, with

size(wm) = O(l(m)), for some logarithmic function l(m).

Definition 13 LTIME is the set of all languages

L � f0; 1g�, such that there exists a (not necessarily uni-

form) family of w-machines fwgm2N0generating L, with

time(wm) = O(l(m)), for some logarithmic function l(m).

Theorem 6 CSIZE ( LSIZE

Proof Let L0 be the language containing all binary strings

p [ {0,1}*, where p is in the form of p01p00, for k ¼dlogðjpjÞe and some binary strings p0 = {0,1}k-1 and

p00 = {0,1}|p|-k. In the other words, p [ L0 if and only if the

k-th bit of p is 1. Since k disjoin operations are sufficient to

reach the k-th left-most bit of the position elements and

classify w-tuples according to the value of the k-th left-

most bit, thus, L0 2 LSIZE,

Now, let fwgm2N0be a family of w-machines generating

L0. We want to show that sizeðwmÞ� dlogðmÞe. That is

because, if sizeðwmÞ\dlogðmÞe, the output w-set generated

by wm does not depend on the dlogðmÞe left-most bit of the

w-tuples. This conclusion is in contradiction with the

definition of L0. Thus, sizeðwmÞ� dlogðmÞe and

L0 62 CSIZE. Thus, CSIZE(LSIZE. h

6 Polynomial size w-machines

Definition 14 PSIZE is the set of all languages

L � f0; 1g�, such that there exists a (not necessarily uni-

form) family of w-machines fwgm2N0generating L, with

size(wm) = O(p(m)), for some polynomial function p(m).

Theorem 7 LTIME ( PSIZE.

Proof Let Ll 2 LTIME be a language, and fwgm2N0be a

family of logarithmic time w-machines generating Ll.

According to Theorem 2, sizeðLlÞ\2timeðwmÞ, which implies

that size(Ll) is polynomial. Thus, LTIME � PSIZE.

Now let Lp be the language containing all binary strings

in the form of p1 (for some p [ {0,1}*). Note that,

Lp 2 PSIZE, because, there is a polynomial size family

fw0gm2N0of w-machines generating Lp, where w0m uses just

a Selectm module to find all w-tuples with value 1 as the

m-th left-most bit. Now let fw}gm2N0be a family of

w-machines generating Lp. w00m requires a chain of at least

m disjoin operations to reach the m-th left-most bit of the

position elements of w-tuples, otherwise, the output w-set

generated by w00m does not depend on the value of the m-th

left-most bit of wavelength or position elements, which

implies that the language of w00m does not depend on the

value of the m-th left-most bit. This result is in contradic-

tion with the definition of Lp. Thus, time(w00m) C m and

Lp 62 LTIME. Thus, LTIME ( PSIZE. h

Now, we prove that PSIZE specifies exactly the lan-

guages of NP/poly. NP/poly is the class of computable

languages by polynomial time nondeterministic Turing

machines, which are given polynomial length advises (the

advises only depend on the length of the entries) (Wegener

2005, p. 212). It is known that NP/poly is equivalently the

class of computable languages by polynomial size nonde-

terministic (not necessarily uniform) Boolean circuits

(Wegener 2005, p. 212). A nondeterministic circuit is a

circuit C(x, y) whose input variables are partitioned into

normal inputs x1; . . .; xn and nondeterministic inputs

y1; . . .; ym. The circuit computes a Boolean function f(x) in

a natural way, which means that f(x) = 1 if and only if

C(x,y) = 1 for at least one y [ {0,1}m. Note that, according

Fig. 16 The structure of constant size w-machine wm, where fwgm2N0

generates WðLÞ for a given language L

Complexity of nonuniform of the w-machine

123

Page 10: On the complexity of nonuniform wavelength-based machine

to the definition of Boolean circuits each gate in circuits

contains at most two inputs, and its output may by used as

the input of several other gates.

Theorem 8 PSIZE = NP/poly.

Proof Let Lpsize 2 PSIZE be a language and fwgm2N0be a

polynomial size (not necessarily uniform) family of w-

machines generating Lpsize. By definition of time, time

(wm) B size(wm), and by Theorem 1, we can assume that

wordlen(wm) B max(m, time(wm)). This implies that

time(wm) and wordlen(wm) are polynomial functions.

Let fagm2N0be a family of binary string advises, where

am is the description of wm, given in the form of the

description of the graph corresponds to wm. Note that, since

each vertex has at most two outgoing edges, hence,

|am| = O(size(wm)) is a polynomial function.

Now, let Nw be a nondeterministic Turing machine

which takes fagm2N0as advice strings, and computes Lpsize

by simulating fwgm2N0as follows: For a given m-bit input

string s, Nw starts from a complete set creation operation in

wm (a G vertex is selected among all G vertices of wm

nondeterministically), and creates a possible normal word-

len(wm)-bit w-tuple (p, q), nondeterministically. Then, Nw

continues along edges of wm to reach the output vertex.

Note that, at each vertex with two output edges, one output

edge is selected nondeterministically. At each operation

vertex, the proper changes are applied on (p, q). When a

computation branch reaches the output vertex, if the m-bit

left-most prefix of the wavelength element of p is equal to

s, the computation in the current branch is terminated and

Nw accepts s. Otherwise, the current computation branch is

terminated and non-accepting. Also, if the computation

reaches a black square vertex, it means that the corre-

sponding light ribbon is not used any more, and the current

computation branch is terminated and non-accepting. Since

|am| = O(size(wm)), and Nw decides Lpsize in O(size(wm)2),

hence, Lpsize 2 NP=poly and PSIZE � NP=poly. Now, let

Lnpp 2 NP=poly be a language, and Nnpp be a nondeter-

ministic Turing machine which computes Lt in polynomial

time, by taking polynomial length advice family fa0gm2N0:

Let tm be the maximum required steps for Nnpp to halt, over

m-bit input strings. We design a polynomial size (not

necessarily uniform) family fw0gm2N0of w-machines

computing Lnpp. The idea is similar to the proof of the

upper bound we have previously provided for simulating

nondeterministic Turing machine by uniform families of w-

machines (Goliaei and Jalili 2013), but here, we deal with

not necessarily uniform w-machines, and we have to embed

the string advises in the structure of w-machines. For more

simplicity, suppose that the position elements of w-tuples

contain 0 and 1, instead of a and b, respectively. The bits in

position element of w-tuples in w0m are reserved as follows:

the first m bit indicates the input string of Turing machine.

Then, for each step in computation of Nnpp, constant

number of bits are reserved to indicate the current state of

Nnpp, the logarithmic number of bits are reserved to

indicate the place of the normal head, and also the place of

the advice head. Then, tn (polynomial) number of bits are

reserved to represent the tape in the current step of the

computation. Since the total number of steps in Nnpp is

polynomial and we have reserved polynomial number of

bits for each step, hence, wordlen(w0m) is polynomial.

At the first step, we find all normal w-tuples which

represent the valid initial configuration of Nnpp, by using

polynomial number of operations. It is sufficient to

represent the start state, and zero places for normal and

advice heads, and also the input string should be written on

the tape. Now, we use polynomial number of operations for

each step i (1 \ i B tm) to find Si, which contains all w-

tuples representing a valid chain of computation for Nnpp,

from first to the i-th steps.

We use a drop module to drop the bits in the position

element to reach the bits representing the state and head

places for the (i - 1)-th configuration, then we use a branch

module to classify w-tuples, according to the state, normal

head place, and advice head place in the (i - 1)-th

configuration. Note that, since the number of states of Nnpp

is constant, and the length of normal and advice tapes are

polynomial, the total number of branches and also the

required number of operations for these classifications are

polynomial. Then, in each branch, we drop next bits of w-

tuples to reach the bit representing the value of the normal

tape, under the normal head. We use a disjoin operation to

separate w-tuples according to the character written under

the normal head in the (i - 1)-th step. Then, we continue in

the same way for the bits representing the i-th configuration

of Nnpp. Now, we ignore those branches which are not a valid

computation step of Nnpp (we bloc the obtained w-set in these

branches by a black square), according to transition function

of Nnpp. Note that, the valid branches are hard coded in the

structure of w0m. Now, since there are polynomial number of

branches, we can find the union of all w-sets of different

branches, using polynomial number of the union operations.

By adding required number of bits by join operations, and

applying a normalization operation, we find all normal w-

tuples representing a valid chain of computation for the first

i steps.

Although, tm is the maximum number of required steps

for Nnpp to accept an input m-bit string, but, some strings

may be accepted or rejected before tm steps. Hence, we

drop bits to reach the bits representing the state of the i-th

step, separating rejected w-tuples in the i-th step to a new

w-set Ri, and accepted w-tuples in the i-th step to a new w-

set Ai. Again, we add required bits to remaining w-tuples,

and use an N operation to find the w-set for the next step.

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 11: On the complexity of nonuniform wavelength-based machine

Continuing this way, after tm steps, we have all w-tuples

representing a chain of tm valid computation steps for Nnpp.

Now, after polynomial number of the union operations, we

obtainS

1� i� tmAi, which contains all normal w-tuples

representing an input string of length m, which is accepted

by Nnpp. Then, the output vertex is placed to specify the

obtained w-set as the output of w0m. Since we have used

polynomial number of operations in w0m, hence, size(w0m)

is a polynomial function of m, and L 2 PSIZE. Thus,

PSIZE ¼ NP=poly. h

We provide another proof for Theorem 8, by simulating

polynomial size nondeterministic Boolean circuits by

polynomial size w-machines.

Proof Let Lpsize 2 PSIZE be a language, and fwgm2N0be

a polynomial size family of w-machines generating Lpsize.

We provide a polynomial size family of nondeterministic

Boolean circuits fCgm2N0computing Lpsize as follows.

Let wm be an n-bit w-machine. Since the wavelength

element of w-tuples does not change by operations of w-

machine, each string of Lpsize appears as the left-prefix of

the wavelength element in at least one w-tuple in some Gvertex in wm. The idea of the structure of Cm is that, for

each m-bit input string s, Cm creates all possible n-bit

normal w-tuples with s as prefix (since the w-tuple is

normal, s is a prefix of both wavelength and position

elements), and trace them through all possible paths from a

complete set creation operation to the output vertex. If at

least one of these w-tuples reaches the output vertex, the

output of Cm is 1, otherwise it is 0. The structure of Cm

depends only on length of the S, which is equal to m.

Let E ¼ fe1; . . .; ejEjg be the set of edges in the graph

which represents wm, such that for every two edges ei; ej 2 E,

if there is a directed path from ei to ej, then i \ j. Also, if ei

and ej be the input edges of a join operation vertex, or output

edges for a disjoin operation vertex, then, i \ j if and only if

the label of ei is a and the label of ej is b. Note that, since each

operation has at most two output edges, hence, |E| = O(si-

ze(wn)). The nondeterministic Boolean circuit Cm has

m deterministic variables and n mþ dlg sizeðwmÞeþsizeðwmÞ nondeterministic variables, reserved as follow:

– m deterministic Boolean variables x1; . . .; xm are

reserved for the given input string.

– n - m nondeterministic variables xmþ1; . . .; xn are

reserved to produce the next bits of the wavelength

element of a possible starting w-tuple.

– dlg sizeðwmÞe nondeterministic variables g1; . . .;

gdlg sizeðwmÞe are reserved to specify the index of the

starting vertex. These bit are required to specify exactly

one starting vertex, among all G vertices.

– size(wm) nondeterministic variables d1; . . .; dsizeðwnÞ are

reserved to specify the path. The path in the graph is

specified by these variables in such a way that, if the

path reaches some vertex vk, and vk has two output

edge, the smaller index edge is selected in the path if

and only if dviis 0.

Cm computes three Boolean functions for each edge of

the graph, which are defined as follows:

– P : f1; � � � ; jEjg ! f0; 1g, where Pi = 1 (1 B i B |E|)

if and only if ei is in the considered path and the

considered w-tuple reaches ei.

– Q : f1; � � � ; jEjg � f1; . . .; ng ! f0; 1g, where Qi;j

(1 B i B |E|, 1 B j B n) is the value of the j-th left-

most bit of the position element in the considered w-

tuple at edge ei. In the other words, the wavelength

element and the position element of the considered w-

tuple appear in ei as x1. . .xn and Qi;1. . .Qi;n, respec-

tively (0 for a and 1 for b).

The value of the functions are computed starting from

e1. Suppose that we have computed the functions over

fe1; . . .; ei1g (0 \ i B size(wn)). Let vk be the previous

vertex of edge ei. According to operation specified by vk,

the functions are computed over ei as follows:

– The complete normal set creation operation (G): Let ju

(1� u�dlg sizeðwmÞe) be the u-th left-most bit of the

binary representation of k. Note that, ju does not

dependent on the input string. The considered w-tuple

appears in ei if and only if vk is the starting vertex of the

path, or equally, ju ¼ gu (1� u�dlg sizeðwmÞe). Note

that, w-tuple is normal, which means that the wavelength

element is equal to the position element. Thus, the

functions are computed via Eq. 1 and Eq. 2, which

requires Oðlg sizeðwmÞÞ gates and depth

Oðlg lg sizeðwmÞÞ (see Fig. 17).

Pi ¼^

dlg sizeðwmÞe

u¼1

ðgu juÞ ð1Þ

Qi;u ¼ xu 1� u� n ð2Þ

– The union operation (U): Let er1and er2

be two input

edges of vk. The edge ei is in the path if and only if er1

or er2are in the path and the considered w-tuple appears

in ei if and only if it appears in the previous edge. The

U operation does not change the position element of the

w-tuple. Thus, the functions are computed via Eq. 3

and Eq. 4. This requires O(n) gates and depth O(1) (see

Fig. 18a, b).

Pi ¼ Pr1_ Pr2

ð3Þ

Complexity of nonuniform of the w-machine

123

Page 12: On the complexity of nonuniform wavelength-based machine

Qi;u ¼ ðPr1^ Qr1;uÞ _ ðPr2

^ Qr2;uÞ 1� u� n ð4Þ

– The duplication operation (Dup) : Let er be the input

edge of vk, and ei and ej be the output edges of vk. ei is

on the path if and only if er is on the path, and ei is

selected rather than ej, according to dk. The w-tuple

appears in ei if and only if it appears in the previous

edge and the Dup operation does not change the

position element of the w-tuple. Thus, the functions are

computed via Eqs. 5 and 6, which require O(1) logic

gates (see Fig. 18c).

Pi ¼ Pr ^ ðdk � ði\jÞÞ ð5ÞQi;u ¼ Qr;u 1� u� n ð6Þ

– The join operation (J ): Let er1and er2

be two input

edges of vk with labels a and b, respectively. Let d be

the degree of the w-set on ei (d does not dependent on

the given input variables). In the other words, the

position element of each w-tuple on ei has d bits. Thus,

the (n - d ? 1)-th bit of the position element of the

considered w-tuple, is specified by the join operation,

which is equal to 1 if and only if the considered w-

tuples have been traversed from er2to ei. Thus, Qi;ndþ1

is equal to Pr2. The other bits of the position element

does not change. Thus, the functions are computed via

Eq. 7 to Eq. 8. This requires O(n) logic gates in depth

O(1) (similar to Fig. 18a, b).

Pi ¼ Pr1_ Pr2

ð7Þ

Qi;u ¼ ðPr1^ Qr1;uÞ _ ðPr2

^ Qr2;uÞ1� u� n; u 6¼ n dþ 1

ð8Þ

– The disjoin operation (DJ ): Let er be the incoming

edge to vk, ei and ej be the output edges of vk, and d be

the degree of w-set on ei. The considered w-tuple from

the previous edge will transfer to the next edge

according to the (n - d)-th bit of the position

element, but the remaining bits of the position

element do not be changed. Hence, the functions are

computed via Eqs. (9) and (10), which requires O(1)

logic gates (see Fig. 18d).

Pi ¼ Pr ^ ðQr;nd � ði\jÞÞ ð9Þ

Qi;u ¼ Qr;u 1� u� n ð10Þ

– The normalization operation (N ): Let er be the input

edge of vk. The w-tuple appears in ei if and only if it is a

normal w-tuple and appears in the previous edge. The

position element does not changed in normalization

operation, and the function are computed via Eqs. (11)

and (12), which requires O(n) logic gates and depth

O(lg n) (see Fig. 19).

Pi ¼ Pr ^n

u¼1

ðQr;u xuÞ ð11Þ

Qi;u ¼ Qr;u 1� u� n ð12Þ

If the considering w-tuple reaches the output vertex of

wm, the given input string belongs to the language

generated by wm. Hence,

Cðx1; . . .; xn; g1; . . .; gdlg sizeðwmÞe; dv1; . . .; dvsizeðwmÞ Þ ¼ PjEj

ð13Þ

Since the number of edges in wm is polynomial and for

each edge, polynomial number of logic gates are used in

the constructed circuit, hence, size(Cm) is polynomial and

Lpsize is computable by polynomial size circuits. Thus,

PSIZE � NP=poly. Now, let Lnpp 2 NP=poly be a lan-

guage, and fC0gm2N0be a polynomial size family of

nondeterministic Boolean circuits computing Lnpp. We

want to show that there is a polynomial size family

fw0gm2N0of w-machines generating Lnpp.

Suppose that C0m have m deterministic inputs x1; . . .; xm;

and k nondeterministic inputs y1; . . .; yk: Let g1; . . .; gsizeðC0mÞbe the gates of C0m, in topological sort order. w0m is a

n = m ? k ? size(C0m) bit w-machine, where the bits in

the position elements are reserved as follows:

– m bits for the deterministic input bits x1; . . .; xm of C0m.

– k bits for the nondeterministic input bits y1; . . .; yk for

C0m.

– size(C0m) bits for representing the output of gates

g1; . . .; gsizeðC0mÞ:

For each gate gi (1 B i B size(C0m)), w0m generates

Sm?k?i as the set of all normal w-tuples representing

correct outputs of gates g1; . . .; gi; according to the given

input. Note that, Sm?k is obtained by a complete normal set

creation operation. For 1 \ i, Sm?k?i is generated accord-

ing to the type of gate gi as follows:

Fig. 17 Computing required functions for the complete normal set

creation operation

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 13: On the complexity of nonuniform wavelength-based machine

– gi is a : gate: Let gj be the previous gate of gi. Each w-

tuple t 2 Smþkþi1 presents the correct value for gate gi,

if and only if the (m ? k ? i)-th bit is not equal to the

(m ? k ? j)-th bit in the position element of t, which

can be checked by linear number of disjoin operations.

Then, linear number of the join operations are used to

add the dropped bits, and a normalization operation is

used to find normal w-tuples.

– gi is a ^ gate: Let gu and gj be the previous gates of gi.

Each w-tuple t 2 Smþkþi1 represents the correct value

for gate gi, if and only if the m ? k ? i-th bit is

conjunction of (m ? k ? j)-th and (m ? k ? u)-th bits

in the position element of t. This can be checked by

linear number of disjoin operations. Then, linear

number of join operations are used to add the dropped

bits, and a normalization operation is used to find

normal w-tuples.

– gi is a _ gate: This case is similar to the previous case,

except that the conjunction is replaced by disjunction.

Since size(C0m) is polynomial and w0m uses polynomial

number of operations for each gate of C0m, hence, size(w0m)

is polynomial and Lnpp 2 PSIZE:

Thus, PSIZE ¼ NP=poly: h

As a corollary for Theorem 8, PSIZE contains all

languages which are computable by a polynomial time

nondeterministic Turing machine, and as a corollary for

Theorem 4, PSIZE contains infinite number of Turing

undecidable languages. It has been shown previously that if

coNP � NP=poly: then polynomial hierarchy collapses to

the third level (Woods and Naughton 2008). Thus, we can

write two corollary for Theorem 8 as follows.

Corollary 1 NP ( PSIZE:

Corollary 2 coNP* PSIZE; unless polynomial hierarchy

collapses to the third level.

Theorem 9 Let L 2 NP hard be a language, and

fwgm2N0be any (not necessarily uniform) family of w-

machines generating L, then, time(wm) C m, and

size(wm) C m, unless P ¼ NP:

Proof Let fwgm2N0be a family of w-machines generating

L, where time(wm) \ m. Also let D ¼ m timeðwmÞ: Since

time(wm) \ m, hence, the longest chain of disjoin opera-

tions in wm has less than m DJ operations, and the output

of wm does not depend on the D-th right most bits of each

string. Thus, for each string s1 2 f0; 1gm; by knowing

whether s1 is in L or not, we can decide weather 2D other

strings s2; . . .; sD are in L or not, where the first time(wm)

bits are same in s1; . . .; sD:

This implies that L is not a super-terse set (Beigel et al.

1985). Since it is known that every NP-hard language is

p-super-terse unless P ¼ NP (Beigel et al. 1985), hence,

time(wm) C m and consequently size(wm) C m, unless

P ¼ NP: h

7 Exponential size w-machines

Definition 15 ExpSize is the set of all languages L �f0; 1g�; such that there exists a (not necessarily uniform)

family of w-machines fwgm2N0generating L, with size(w-

m) = O(e(m)), for some exponential function e(m).

Theorem 10 Let Wn,s be the number of n-bit languages

which can be generated with w-machines having size at

most s, and Ln be the number of all n-bit languages, then, if

s B 2n/n we have limn!1Wn;s=Ln ¼ 0:

This theorem for w-machine is similar to the Shannon’s

theorem for Boolean circuits (Muller 1956; Shannon 1949).

Proof There are 2n different n-bit binary strings, and thus,

22n

different n-bit binary languages, which is Ln.

(a) (b) (c) (d)

Fig. 18 Computing required

functions by Boolean circuits

a union, b union, c duplication,

d disjoin operation

Fig. 19 Computing required functions for the normalization

operation

Complexity of nonuniform of the w-machine

123

Page 14: On the complexity of nonuniform wavelength-based machine

According to Lemma 3, Wn,s B cs ss for some constant

c. Thus, for s B 2n/n, Wn;s=Ln� c2n=n=n2n=n ¼ ðc=nÞ2n=n

for

some constant c. Thus, limn!1Wn;s=Ln ¼ 0; which is the

desired result. h

Definition 16 PTIME is the set of all languages L �f0; 1g�; such that there exists a (not necessarily

uniform) family of w-machines fwgm2N0generating L, with

time(wm) = O(p(m)), for some polynomial function p(m).

Definition 17 PWORDLEN is the set of all languages L �f0; 1g�; such that there exists a (not necessarily uniform)

family of w-machines fwgm2N0generating L, with word-

len(wm) = O(p(m)), for some polynomial function p(m).

Theorem 11 ExpSize ¼ PTIME ¼ PWORDLEN ¼ 2f0;1g�:

Proof For every language L � f0; 1g�; there is a (not

necessarily uniform) family of w-machines fwgm2N0gen-

erating L, where wm is an m-bit w-machine. wm starts by a

complete normal creation operation G; classifies w-tuples

by a binary tree structure of at most 2m disjoin operations

according to the position elements of w-tuples, and finds

the union of w-tuples in the branches for which the

position element belongs to L, using at most 2m union

operations. Thus, size(wm) = O(2m). Since each w-tuple

passes through at most m disjoin operations and

m union operations, hence, time(wm) = O(m). Thus,

L 2 PWORDLEN; L 2 PTIME; and L 2 ExpSize: Thus,

ExpSize ¼ PTIME ¼ PWORDLEN ¼ 2f0;1g�. h

Corollary 3 PSIZE ( ExpSize:

Corollary 4 CTIME¼ CSIZE( LSIZE( LTIME( PSIZE

( PTIME¼ PWORDLEN¼ ExpSize¼ 2f0;1g�:

Considering Corollary 3, Theorem 11, Corollary 1, and

Theorem 2, the subset relation between PSIZE; PTIME; NP,

coNP and PSPACE is shown in Fig. 20.

8 Conclusion and future works

In this paper, we have investigated the nonuniform com-

plexity classes of an optical computational model, w-

machine. w-Machine takes into account the parallelism in

computation in two ways, namely, parallelism in the effect

of each operation on all members of a set, and parallelism

in execution of operations. However, access to the bits of

binary strings in w-machine is sequential. A family of w-

machines are used to generate a language of binary strings,

one for each input size.

Three complexity measures are defined for w-machine.

Size is the total number of operations, or physically, total

number of optical devices. Time is the number of operations

in the longest chain of operations, which indicates the time

which is required for passing light through a w-machine.

Wordlen represents the length of binary strings used in

machine operations, which is physically related to the log-

arithm of the number of different required wavelengths.

We have proved following theorems about complexity

of nonuniform w-machines:

– CSIZE, the class of all languages which can be

generated by constant size (not necessarily uniform)

families of w-machines, contains infinitely many

Turing undecidable languages.

– CSIZE generates the same languages as CTIME, the

class of all languages which can be generated by

constant time (not necessarily uniform) families of w-

machines.

– PSIZE, the class of all languages which can be

generated by polynomial size (not necessarily uniform)

families of w-machines contains NP. Every NP-hard

language requires at least polynomial size and time (not

necessarily uniform) families of w-machines to be

generated.

– PSIZE contains the same languages as NP/poly. Thus,

coNP and PSPACE are not contained in PSIZE; unless

polynomial hierarchy collapses.

– Almost all languages require at least exponential size

and polynomial time (not necessarily uniform) families

of w-machines to be generated.

– ExpSize; the class of all languages which can be

generated by exponential size (not necessarily uniform)

families of w-machines, contains all binary languages,

and is equal to the class of all languages which can be

generated by polynomial time (not necessarily uniform)

families of w-machines.

– Polynomial wordlen is sufficient for every binary

languages to be generated by (not necessarily uniform)

families of w-machines.

Fig. 20 The diagram of PSIZE and PTIME in comparison with known

complexity classes NP, coNP and PSPACE

S. Goliaei, M.-H. Foroughmand-Araabi

123

Page 15: On the complexity of nonuniform wavelength-based machine

– The number of m-bit languages which can be generated

by n-bit w-machines of size at most s ? O(n), is f times

as much as the number of languages which can be

generated by w-machines of size s, for 1 \ n, s B 2m/

m, and some constant f [ 1.

From the information point of view, wavelengths in w-

machines represent information and elements of the lan-

guage. w-Machine operations do not modify wavelengths,

however, they may pass or filter a wavelength. On the other

hand, positions give us the ability to modify w-tuples.

Thus, position elements while not present in the output, are

used for selecting and categorizing wavelengths for further

operations.

In the future works, would like to obtain more results

about similarities and differences between complexity

classes of w-machines and nondeterministic Boolean cir-

cuits. Also, we try to investigate the complexity of uniform

w-machines. Another research approach is to investigate

the advantages of using w-machines as oracles for con-

ventional Turing machines, to achieve the theoretical

advantages of combining physical implementation of w-

machines with conventional electronic computers. We also

try to take into account new pure optical operations, to

obtain more efficiency and more computational power.

References

Barakat R, Reif JH (1987) Lower bounds on the computational

efficiency of optical computing systems. Appl Opt

26(6):1015–1018

Beigel R, Kummer M, Stephan F (1995) Approximable sets. Inf

Comput 120(2):304–314

Chow TY (2011) Almost-natural proofs. J Comput Syst Sci

77(4):728–737

Demtrder W (2011) Atoms, molecules and photons: an introduction to

atomic- molecular- and quantum physics, 2nd edn. Springer,

Berlin

Dolev S, Fitoussi H (2010) Masking traveling beams:optical solutions

for np-complete problems, trading space for time. Theor Comput

Sci 411:837–853

Goliaei S (2012) Unconventional computing, an optical approach.

Ph.D. Thesis, Tarbiat Modares University

Goliaei S, Foroughmand-Araabi MH (2012) Lower bounds on the

complexity of the wavelength-based machine. In: Durand-Lose

J, Jonoska N. (eds) Lecture notes in computer science, vol 7445.

Springer, Berlin, Heidelberg 94–105

Goliaei S, Jalili S (2009) An optical wavelength-based solution to the

3-SAT problem. In: Dolev S, Oltean M, (eds) Lecture Notes in

Computer Science. Volume 5882. Springer-Verlag Berlin Hei-

delberg, pp 77–85

Goliaei S, Jalili S (2012) An optical solution to the 3-SAT problem

using wavelength based selectors. J Supercomput 62:663–672

Goliaei S, Jalili S (2013) An optical wavelength-based computational

machine. Int J Unconv Comput 9:97–123

Goliaei S, Jalili S, Salimi J (2012) Light-based solution for the

dominating set problem. Appl Opt 51(29):6979–6983

Haist T, Osten W (2007) An optical solution for the traveling

salesman problem. Opt Express 15(16):10473–10482

Maier M (2008) Optical switching networks, 1st edn. Cambridge

University Press, Cambridge

Meinders ER, Mijiritskii AV, van Pieterson L, Wuttig M (2006)

Optical data storage: Phase-change media and recording, 1st edn.

Springer, Berlin

Muller DE (1956) Complexity in electronic switching circuits. IRE

Trans Electron Comput 5(1):15–19

Muntean O, Oltean M (2009) Deciding whether a linear diophantine

equation has solutions by using a light-based device. J Optoelec-

tron Adv Mater 11(11):1728–1734

Oltean M (2008) Solving the hamiltonian path problem with a light-

based computer. Nat Comput 6(1):57–70

Oltean M (2009) Light-based string matching. Nat Comput

8(1):121–132

Oltean M, Muntean O (2008) Exact cover with light. New Gener

Comput 26(4):329–346

Oltean M, Muntean O (2009) Solving the subset-sum problem with a

light-based device. Nat Comput 8(2):321–331

Reif JH, Tyagi A (1990) Energy complexity of optical computations.

In: Proceedings of the 2nd IEEE symposium on parallel and

distributed processing, pp 14–21

Reif JH, Tygar D, Yoshida A (1994) The computability and

complexity of ray tracing. Discret Comput Geom 11:265–287

Shannon C (1949) The synthesis of two-terminal switching circuits.

Bell Syst Tech J 28(1):59–98

Wegener I (2005) Complexity theory: exploring the limit of efficient

algorithms, 1st edn. Springer, Berlin

Woods D, Gibson J (2008) Lower bounds on the computational power

of an optical model of computation. Nat Comput 7(1):95–108

Woods D, Naughton TJ (2005) An optical model of computation.

Theor Comput Sci 334(1–3):227–258

Woods D, Naughton TJ (2008) Parallel and sequential optical

computing. In: Dolev S, Haist T, Oltean M (eds) Lecture notes

in computer science, vol 5172. Springer, Berlin, Heidelberg,

pp 70–86

Woods D, Naughton TJ (2009) Optical computing. Appl Math

Comput 215(4):1417–1430

Yu FTS, Jutamulia S, Yin S (eds) (2001) Introduction to information

optics, 1st edn. Academic Press, Boston

Complexity of nonuniform of the w-machine

123