QUESTIONS FOR 5th ASSIGNMENT FROM 8TH UNIT IN AI
2)Write about linear vector quantization?
AI 4th ASSIGNMENT QUESTIONS
a)pattern storage network
b)the hopfield model
c)stochastic network's
d)simulated annealing
2)what is a state transition diagram?
how can we describe energy analysis of network using state transition diagram?
what is false energy minima problem?
3)EXPLAIN THE FOLLOWING:
a)pattern storage environment
b)architecture of boltzman machine
c)boltzman learning law.
RSA program of CN
#include
int phi,m,n,e,d,c,flag;
void check()
{
int i;
for(i=3;e%i==0 && phi%i==0;i=i+2)
{
flag=1;
return;
}
flag=0;
}
void encrypt()/*encrypts the plain text */
{
int i;
c=1;
for(i=0;i
c=c%n;
printf("\n\tEncryted keyword:%d",c);
}
void decrypt()/*decrypts the cipher text */
{
int i;
m=1;
for(i=0;i
m=m%n;
printf("\n\tDecrypted keyword:%d",m);
}
void main()
{
int p,q,s;
clrscr();
printf("\nEnter two relatively prime nos.\t:");
scanf("%d%d",&p,&q);
n=p*q;
phi=(p-1)*(q-1);
printf("\n\tF(n)\t=%d",phi);
do//chooses correct e value
{
printf("\nEnter e:");
scanf("%d",&e);
check();
}while(flag==1);
d=1;
do//generates exact d value
{
s=(d*e)%phi;
d++;
}while(s!=1);
d=d-1;
printf("\nPublic key\t:{%d,%d}",e,n);
printf("\nPrivate key\t:{%d,%d}",d,n);
printf("\nEnter the plain text\t");/*entered plain text has to be in the range 0<=p<=n*/
scanf("%d",&m);
encrypt();
printf("\nEnter the cipher text\t:");
scanf("%d",&c);
decrypt();
getch();
}
UML record dates for 2nd batch
18/01- Introduction to UML and other theory part
18/01- 1st project
22/02- 2nd project
11/03- 3rd project
15/03- 4th project 1-4 diagrams
29/03- 4th project 5-8 diagrams.
CD record dates for both the batches
19/01- Lexical Analyzer
09/02- Brute force
09/02- Recursive Descent parser
23/02- First function
23/02- LL(1) grammar
30/03- Predictive parser
13/04- Three address code
2nd batch:-
12/01- Lexical Analyzer
16/02- Brute force
16/02- Recursive Descent parser
02/03- First function
02/03- LL(1) grammar
23/03- Predictive parser
06/04- Three address code.
Write in the same order in Index.
Theory for CD program
FIRST FUNCTION
First Function is used in the construction of Predictive Parser. The construction of a predictive parser is aided by two functions associated with grammar G. Those functions are FIRST and FOLLOW. They allow to fill in the entries of a predictive parsing table for G, whenever possible.
The procedure for computing First function is as follows:
To compute first(X) for all grammar symbols X, apply the following rules until no more terminals or (-- (epsilon) can be added to any first set.
Step 1:- If X is a terminal then First(X) = {X}.
![]()
Step 2:- If X > C (epsilon) is a production then add (-- (epsilon) to First(X).
Step 3:- If X is a non- terminal and X > Y1Y2-------YK is a production then place ‘a’ in First(Yi) and (-- (epsilon) in all of First(Yi)--------First(Yi-1).











