0% found this document useful (0 votes)
41 views

TCS Important Questions

The document discusses a problem involving determining whether a number is divisible by 3 based on the sum of its digits. It proposes a machine that can convert any occurrence of the digits '010' in a number's representation to '101' to solve the problem. It then discusses applications of finite automata and regular expressions to model the machine's behavior and solve similar problems involving recurring patterns in numbers.

Uploaded by

hefomij886
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
41 views

TCS Important Questions

The document discusses a problem involving determining whether a number is divisible by 3 based on the sum of its digits. It proposes a machine that can convert any occurrence of the digits '010' in a number's representation to '101' to solve the problem. It then discusses applications of finite automata and regular expressions to model the machine's behavior and solve similar problems involving recurring patterns in numbers.

Uploaded by

hefomij886
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Sern \/~ (0

( ::r ,.n: , III :::) 12--e-p-,.,,se r1 H mo d..u) ~ VlD •

~ o ~: Pr\ \ ~ v.e ~ rt O'Yl s a -re f'i {;j .t •


~~ecJ -.,_ of: C-e,_mp~\-e.Y ~cienu
~ ! l n ~~C::::=3:1==t:=-=- _ r~
Mod:
JI[ □ t:.1'y:r~a.'tn C hom~:J Mierr-a.r-d-,
0 . ~~ ~
N n ~ f-Fe~ nu. 'oR..f-Vvee_n ? DA 4 NP DA ~~
~l'i n e 12<1..3 u.lC\ '>' 0-?-;e ~\ clYl 4- .3·1v€. ""..') u.l C\ ,- "- >< \'-,.,, ~ ,,.!<1h
Jl 0
fo-, 1) be\- oP ct.1-\ Sf¥1~S over {0,1) .-+-hci_r e_nd
W , 'et,, .1- y-, Q s no S.U fos ~,i'n <J O0

-:ID: rt 8<.ff ct t n +t q I t-inj f'o"D b'\.em


::r:n I},,,-..\j n a i=-.· n i t-e. S'to I-<' rn a U0 i r, e.
( de\:-€-"rrYJfn e. wV'l-eJ--herr te<rY1ct~ nurn'oeJY
(bnc;.e -3) to div-i~'ote_ S--

I'
'~Qm~ ~pe
o ~ q,ue ~Hon,~
rye pE'o.1-f cl),

~'Y
-- -+he. s rn "9_J , ' 'o t" o e ~, b to , ~-f'na\ -H,, e. f--o II ov,;f°"n-'t
, ) \.. e f--+-vn o.s \- d Q 'r , ve1. \-i 0y, • ._J

ii) ~j'fl+rnost-- de~"voHO'n


·,-,u PQ~-e.. m-€.
'iv)
t~ e_.,; r>S I">-<-! { !- I f'\1 C_'T u,, ,· "'J ()') d ti,, i"' ., ) tv C Cr, e cJc.
wellf'o)rn....,dn~~.s: (,,~r- pnr9t1rhP~rs • ~~

.Po I I ow j I I'") C F C,

'5-4ASA
A_,,
.B -) bl E. ,
~,·s loB

r
>--a ~ 00vk'~ l:- C C: + 1) \ 1t:>) * ( D + 1J
e__- n, ove-s 4- o b t"q_t h DP-A .
C On s-h-u c..t- f'n O O're 4 me cd 'j rn a c...,h'1 n -e
to c.onv€tt -eoLh OC'Ll..-Lttnc....e. e,p [DO to~ IO I
+- i n q · -:t,-1' n9 ov e 'o '{t>,IJ ~C 0Clv-en-1-1r to •e.qy, '(YH?o.l~m/c_
0 S-ho1r\- n ore ~ ( HetpKtl ~'Y sc. o-nnj + pCAs.~frij.)

lli O
C... I os u t t p'KU f€'r\--Je_(' o ~ CDn~X~ ITTe. Lei n~o~

~ .+ C!) A--p p-H c c::U--f cm .s.. o ~ µ_j 1.,d d I)' Q_ x- p'rf' £- ~ @ +


~ F-1ni t-e -A-ut-omC\ho-1 . "f>7r
~o ~cers 'Th-eo-rem , :f--¼
::t. Q
\YJ D-Oa-€. 4 fhe..0-tj rn a c_),'t h-E'

:11- • Uh ·1 \rerrs ct t tU'r-i~ mqtJ.i n~. *--t--


:cn l 9 iFfE: roe_ h t-i Q t--e. -D Pf\ 4- H~
*~
~a De Si3 h q '.D F--A to Cl t. e -€._f r .s tn'nj D '-S 4 I 's
..ehc:Lt.nj wi ~ ---t--he_ _g_f'il~ lOD
Whct~ a.')-('. R.ec_.u:r.siv-€. 4 Reu..t'lr.s.1~]
\:--n4 rn~ b l-e.. Ld..n~V-.al~~ £
G D(?~r, NF-A ,f--a-r "re" C O-.:\ h I 2-\. 'n _:) +v, e s r~---f 0 ~ ...s, -+ho_ r
:S:,. e..not i'n '"q_ a''
~~r ~ :::o ia. t b1 4-- Con~
ol....bov-e
t-n .PH\-·~

Cl o~~n rnooo-e. n-,qe_C0ine -for .f--ol\ow1-nj ;·


:r- If- i nfu.t-- ends in 'Io I' +h-e n o uJ--put shou le#
be.. A 1
, f- ·, t> pu r e.hd!:?. in '11 o' ow--pu f-
1
~ nau.to\ \oe.... B I o +--h E''r VVI ~ 0 ~0-.,\- ~OU. Id be
0 CJ btrt.rn
~ ehown k:> PI o vv
0

°'-
c:J f- --ru~'n__j
,:3l. Cl p~s~ a. +u ~·, ~ - n-, q _~ '. ~r": -\-h a \- c. o r-n Pu \---eA a
- -k1 \'") c_H <:f'r> f- Cn--i ,h ) =--- rn ,;-- n ,e a d d. i .\---f cm c> r +w o r
i '(") H'~~ -e ry
'{( d-'\"• ~ _!:€ o ,--, cl \cJ( o\al 'fl _I? U VY1 'f ('Y'_'.'.) \_ "- "" " " "' +'c,-,-
,..::.>"' , r .:i
C ont-E'x r f-'ree :3 ..-o mmq ,,-- .
- F-i '("'\ c\ CHJ.. t- vv \n e ~ elY ----H-, e L. C\ ~ LA Q ~ ct
L::: 1_ r;t!' ~'"' 2-n \ n ~ I J ,s C' on~\- -Po-€ e c:>'11' riD\-

~ t \ ovv\~ Lo.n~uoi-..~ '.,


tl Oe_s _,~.-J=V)
__ = =P=D
=A-
4 L (m) ~ 1 we w '~ I w "( a,. b r ~ J \N \,, ,E>/'o< w R j-5

1-- c , ..s Gl c._ o n .s t-eJ. n t-- , ,'


0 F- W

0 Gnv-eirt- -+-he fol/ow'1no, Gvqmm<>"'-' ,-\,c, -;-v-,e


<'\\ --J F)
Y"'° CC,.oY-Y,*j Y)O'lr0.0) fu~rn cc.N •

S--=t ~AO\ 161 \BB


A ~ c_
{6--'r sfA
C-=, 5\e
l
l

~ o,..\-
d
§ t> Pos \-
y,o+-e
(_o,-n-€ sr On d (> Yl "-"- Prob\<:' rY> -'A<--'¥-

~ • Ha \ r-1 r, j p...,.-o 61 e rn ,Jfc ** 0f- _J"":u ~ n~ m3 ~• N

~ e.~n h-tJ st- [¥'loo~ ~ fnea.l_j rn o.t..V>i r)e


C o rYl p CJJK
(11\.iP) 5t7f
C, N t R q_u• vctl-en t- to C. P~ ~

~=>-~ AB
A ,nA\bP>I~
Pi ~-, h

1il- S1,1K-' -(.. e-~plcii'h Pump·l~ \,.-emmq --\::\,-,eo'H' m


,fb¥ ~QOU levr L-c1ri3..uo.if..r . t, m~
d ~ IVi' ~e rn O Ore 4 f'n €_0,_ tj '(Y) CH.. ht ~ e Pn 'l"
J... , +½ e -F-o l I ow l ri ~ p ro c .(? ss: e_~ ~
-w,- Po-Y i () ?U \-~ ~ 0-, ( O + I J ..,., -, f- 'to PU I- e h dS tn IO I,
Ou f- pU f-- ~ ~ tF t n pu f- .e n d-S- ln Du t-p u t- ,j ~ ··

D
0 tt,-,~, ~ o u rp uJ- a z. .
r 1 {J I

~ L... e ~ ~ b-e... --+---t.-, e _3'r<:Hn l'Y1 a 'r , ~


~ t ( -1ctme. +upe ~
S--=i q B ~ 6 A _· 1 .
A ~ a\ o ~ \ 'o A-A q,_u~J.\c?;~p;cHf'~J
~--=, b\ bS \a_BB

I) Lef-+ rY1os+- de~hrctHCTYl


ii) '2--'t3 h 1- mo~ t derrJ v-ct H cm
,\\) Pcl y s e h-e- e.
' V) :}: e, ~ e.. ._5 m YYWf) G\,Y lA. n 0. Y"h b \3 u O V-S 1
~,y ~ e _.:j iv-e 'n .s-m(I_J o o I\ C \ c, I ,

E-"'><plaJn Non- d e. +e rn I n rs +-t


~ 11s' C PDA
. DF-A to oc..cept-
[1 0 bte.tn
. s hn n3 ~ 0 f. 0 s 1

:!- 4 t '..S e....ven 0 r.£


VV"\ ~ - V\b,of- ? .e. w. n \'I o ~ crt \ 's

0 e..~\J 'Y) a. 'Tu~ n_j


I ori3ua9 e. 5 Iv-en
0(0+1)~ \ l,

G PPA a cc .e. pH~ fu \I ow1'.n.:)


4
p
rl:, Cvns:h-uu- t .e ~+ t ,n~ci')r ..g... r~ht- \ h-,e CV1' 3 t-Omt'Y\a't

B, ')" In < r )- f' CJ c..t IC1 ~ .Q X" p'rP<:> ~ j an


(((c1+1o)~II ')~OD),._

f') e ~~t) n o.. 'YV\


c+ -+-he. .form

C '
Q (onW~\- --\-v,.e. f-o\\ow\'Y"l_J \2-.E. -to E:.-NF-f\ 4--
'D- -t\n e n c o "ve 'Y\- ·, t +-o b P-A
f2.. -=- ( ( o+ \ ) w \ b + (0 b ) ~ ( \ \ ) 't J~
tJ 0 ~ /4e -t-he !g ~ rn o/Y ~

~
y loe ~e__ -..-emrnCVY ~ ~ -frY>, lo,,,. qJA.e s rf rT'n
3 i .$ 'rE' pe cl. re ct •
~~ a.P-:.\ k,A

A-:::, ct\ aS\bAA

G ~ b I b-S I o,__r3B
Anc::l reF-.fLrr>o.sl- dC?'rivoH'cYn / ~ln+-rno.s+ ol.e ,{\rct.HO')t) 1

+ p a Y-.s e ,toef-o, €+-h e s mn J


'' k::> 6 a. a. d b b 0.. lo CA r,

.-r ur,·i'nj fYt O t.tin .e -\.--o ,-.,..-e c.


0
crv-/i -:u2.

l ~ t a~ 6 n+' In // I } •

me1. Un\n-e to c-e,-,ec...-k wln-e ~-ea


Rri'1 M= Q~+-e.
0
O.e~Vl d1v=tsi bl -e. ~ D• l")Of',
\o~
~ u...m o-en, I --5
v,
0.'r1~
--te.rrno~
' "r
Co~ TE'Src!Y'ldex• L.1Z..
f-n:, b le m I

t1 8<rf a_V)') Post-


'91 d~\
p.n:, v-e -ti, Cl r L ~ l w c_ w~ I w t: C Q + lo) ""' l ) is:
r,of- -r-e~u.la.'r,
C.
0
riv er\-
3
\ v--e n t2- e_:) LA-l °' -r f:-x p'r'€ s s.-i' CM , P. E -- o. CC\ + lo )'lf- b
t""U rn'tn\m\'2.!2d PF-A,

[1 PDA
~
Cly')') b i <;\ LI Cl V8 •
(J t .> - ? ~ ,. ~-
C\ '- ) rJ · )
I I
lo?
t:'
0 °1 .~
("' 1b

Cl C •C"' n V'(' f) t- t h C' fvl/ovv I Y'I j rz..b In h:,

~ ._5_ h~n(.Q c, 61 CLtl-'1 -,-h € DP-P.. •

P,f:, Co+ E'..) C 1 D) 'l!c (E + '),

A; C o ,-, Sf d <' 'Y -++, "'- F-o 11 o vv ( YIj .'.'J -re1 mm dv7

c,-'{v,l,1?,S'}, V= <S, X "J, T•{a,b) 4,


' S--"7 ctSlo\o..x
y ~l\0. ,~Cl 1~ 1

~ ~ f 1,;:, C1 t... h
r---1 o rt"'{) c>I I Fo ,-rn

-re C..-0<-.J V, ( '2.-e.


De ~~~~r) rn -e. ~ "' o ~ e,, {'() e t"t::>
co ~ve,a--.\- '
r'f°-:.,_ CD+ I)~ ( 0 0 + I\ ) 4 tt,
t:Lh 1--

tr'\ oao-e fn a C-h \ n .e .

+he fol Io win c,


--J
~ rctm movr :- *~-~
. I' 00"' Oj;v"--ti "
i...;
I
rn

S --4 ~ ( t' SI 1CC' S-e. S l q ~ ry<.-\?~(J\-eO. •


C ~ lo
Foo -+-+,e... 8 rr, n 3 "' i b t-a. ,eJ lo t-e '' ,, ,.(-n, cl t-V) e_

foltovvl.:J ~) LeF-t- most de-rtvqHO'h


ii) P-.,, 1d 1r~1...
-,.__..) 11 l'Y10 st- ~€rit var{(;)r)
,i , ) p c\ ,y- s -€. --h--e ,e_

iv) c_ h -e cJ<. '1 F -H-, -e 3 "rel m n-, OVv 's


amv,3\3uov~ O"a"' nor
Des-(5r, 'Tu?r-in_:j m cA c__t,,{n e
ct -t-ha-.t- C O (Y') PU it-e.,.!
0\ +-u.-ncJ-1lfY> -t C m , n ) ';;_ n,, + n . -rh..e °'dol.1H·m o ~
~ e... +w O 1"Y'I +-E' j ~~ '

a G, v-e. +ne.. cfu,yn, q_/ d e ~ n cd·-f (Tn O f:' pLl fY1 ,pfn _:) I €' 01 Y}, 0)

l~~°'-~ .:g. +-he.J) po0v--e. tt-,d t-


~ tn-Y 'd-e.~ l °'-f¥
~ C\ Yl 3 tJ.. a.3 ,e J .s 0 O r 'rt'
.._:j uJ. o,.rr t
-k--,Q fo II v v/~

I 1'.':-W I
I
I
'!l- i- ')l. 'f "' Oe c. i ~;on ?,-up ~,r H f'S o ~ r-P_:J u t~,,, I a 'Yi::] u.(kys
~ n (' +i ,.,, , ~ ~ , vv en tc. 1'Yl o r:- PPA
~ _.
t,

Con v Pr
C"Yl

s t cm
.., ~.

c, ~ m o o ;re
O ~ (Yl [email protected] ~ m 01 Ull In e
-SI- • A ( C ~' f'h""' u "".'::I "' p DA, , I
- f\ppl I' rad· i'cm ,.fuy P ·,ci I PD R f Tf'\11
C c-n~.-nuc p.. frl O o..-e vii n -e
fn C\ C.... t:o D u ~ u_t- '}---€ m OJ.. V'l d ,(1/lr

rv1odLl...lO ~ W 'Y 0. n ~ lo (),0-Jl a- Vl ~ Y'n 1o-€fr •

St-€ rs <:... F-6' ro c_ N F -F-o-,r-n ·

_ ,s__.=,f\-5B\e
A----=, a.AS\q
6 ~ 5b.5\A\'olo

Con v-e ~ \-- -+-h .e. fo tt o vv\ nj f2.-S h:> N F--A - '2: 4 t o n v-f/Y l--
\ t-- tu l'Y)\Y)·,m·,s.e d Pr-Pi Co~srondt'"rlj t:-o it--
( D + 11).,,..lto')c11 + ei )--¥-
CO n s mHJ· °' p DA -h:>'Y dC C .e.p+-d0 j L '2 1 QI"\ bm c..Vl ( n, /n??--\1

~ ~ ,f-v ')-(YI =-I P .e ~ 'Y' ~h O'Y> 0


\:-- Pu. m ip i "3 k rn rYl 0\
1
fur f?- .e ju lcvr L._ a n~ u. ct.~ • f7n:, ~ t-h cd- ~e fo 11 o vv\ n j
Lct'Yl~• 1s not- y--ejLtfarr L? l'IAn··Vvr }w~ [o/lo}~-r E.{c..},
lwl ✓ =I_}

0 fo-a fultovvt~ ,

-&: e 9_,L,U2.-V1 c....e. o F- D ~ l ~ ~ 'o·H n j



i1) bot f) or c0n t-eun 3 C on~1<_c.,0.J-f~ q

ov--VYi__a"to)
\ ,i) L ~ '{XE: t CJ, I}~\ ~ hos -equ.a.t nuVY\..bvi- c,f-

()'s 4' I'S J


~ote. -:afY'oclule wise so\vf~_j q_uRsH~
\N\ \ \ loe.. h'2.I F P-u, .
-a De s: ~ Mn.3 ~ t c, n sh-u t..f-i'\-"\(J o i:- al i F/:.
fY1 o u--, f n .es wi H,, ~; f-F- co nd {t1"o'Yl ~
\ 6 \mro~~+- 4" f¾-eq_,uer,1--l.J Cl~ ~-e_~,
0 the -are a~ .si-rriiJa ,y q vesriCNl.r
wi+-h cl i f-f.f ¥ ev,t- e ,cdmr l,es •

You might also like