Tuesday 26 February 2019

Artificial intelligence MCQs

who introduced lisp -john mc carthy
IPL is first AI programming language
human intelligence investigates in cognitive science
multiple word meanings, unclear antecedent, syntactic ambiguity are the causes of ambiguity
iterative process is repeated, evaluated and refined
Bacon is A series of AI systems
reading is the primary interactive method of communication
software development tools are debuggers, editors and interpreters, assemblers and compilers
intellicorpnc is product of KEE
5th generation computers is associated with AI
alan turing is father of AI
answering questions, manipulating robotics devices, recognizing objects are goals of AI systems
rationalist uses the knowledge of mathematics and engineering
AI is putting your intelligence into computer
AI approaches are weak, applied and strong AI
Heuristic critical is used for describing the judgmental or common sense part of problem solving in AI
Algorithmic and heuristic are subfields of NLP
speaking is the method used for communicatin between human

BFS takes less memory
state space is representing your problem with variable and parameter

web crawler is simple reflex agent.

informed search strategy also called heuristic search

zero sum game has multi player

an agent is composed of Architecture and program
learning improves the performance of agent
Performance is external action of agent   
Robot, human and autonomous space craft are examples of intelligent agents.
there are 4 types of agents in AI

values of alpha beta search get updated along the path of search

calculate the feasibility of whole game tree used evaluation function

Lower order calculus or quantification theory or first order predicate calculus is also called first order logic

single propositional symbol created by atomic sentences

validity, satisfiability, logical equivalence is used to compute the logical inference algorithm

Single inference rule also called resolution

Factoring means removal of redundant variable

Thursday 14 February 2019

print the elements of linked list in reverse order and reversing single linked list

To print the elements of linked list in reverse order
void printLL(struct node * head)
{
    if(head == NULL)
        return;
    printLL(head->next);
    printf("%d->",head->data);
}

To print the elements of linked list in normal order

void printLL(struct node * head)
{
    if(head == NULL)
        return;
    printf("%d->",head->data);
    printLL(head->next);
  
}


Reversing a single linked list
void reverse()
{
    struct node *p,*c,*n;
    c=head
    p=NULL;
    while(c != NULL)
    {
        n=c->next; //stores address of next node
        c->next =p;
        p=c;
        c=n;
    }
    head=p;
} 

Friday 8 February 2019

Simple example to learn backtracking produced by Tail Recursion

Tail Recursion allow you to do backtracking.

Below is a simple program that prints 3 2 1 1 2 3 when n=3.

f(3) will print 3 and will call f(2) but after the call to f(2) there is print statement.
Since there are statements after recursive call such recursion is called Tail Recursion.

#include <stdio.h>
void f(int n)
{
    if(n == 0)
        return;
    printf("%3d",n);
    f(n-1);
    printf("%3d",n);
}
main()
{
    int n;
    scanf("%d",&n);
    f(n);
}

Another example that makes use of backtracking

Generate k bit binary strings without consecutive ones 
#include <stdio.h>
void rec(int a[],int l,int prev,int k)
{
    if(l == k)
    {
        int i;
        for(i=0;i<k;i++)
            printf("%d",a[i]);
        printf("\n");
        return;
    }
    if(prev == 0)
    {
        a[l]=0;
        rec(a,l+1,0,k);
        a[l]=1;
        rec(a,l+1,1,k);
    }
    else{
        a[l]=0;
        rec(a,l+1,0,k);
    }
       
}
main()
{
    int k;
    scanf("%d",&k);
    int a[k];
    rec(a,0,0,k);
}

Monday 4 February 2019

How to send Whats App Messages Automatically Using the data in Excel

To Send What's App messages automatically to contact numbers provided in excel.

1. First export the contacts in excel to your gmail account.
you can watch the video in the below link or follow the instructions below

https://www.youtube.com/watch?v=rDbXq-EemdM

You can go to google contacts and download the contacts.csv file and copy the contacts in excel
and paste it in contacts.csv file.

2. Once all the contacts are exported to gmail. Sync those contacts in your mobile

3. You will get those contacts added automatically and will show as contacts in your mobile.

4. You can now broad cast messages to your contacts by selecting new Broadcast.
In Whatsapp account, click on 3 dots and from drop down menu select New Broadcast. When you select New Broadcast in your mobile, you can same message to 256 contacts with out forming a group.


5. Or you can also download the vb script in the below link
https://drive.google.com/file/d/1qx9nPX9r9GcukAj3Nb7AkmhrnBIDu49x/view?usp=sharing

and follow the instructions in the below video
https://www.youtube.com/watch?v=vhcgZDKVQT8