Showing posts with label Unit 3. Show all posts
Showing posts with label Unit 3. Show all posts

Friday, December 26, 2014

Subnetting - two Marks

1. What is virtual circuit? 
In computer networks, a virtual circuit (VC), synonymous with virtual connection and communication service that is delivered by means of packet mode communication. After a connection or virtual circuit is established between two nodes or application processes, a bit stream may be delivered between the nodes; a virtual circuit protocol allows higher level protocols to avoid dealing with the division of data into segments, packets, or frames. Virtual circuit communication resembles circuit switching, since both are connection oriented.

2. What is a datagram?
 A datagram is a basic transfer unit associated with a packet-switched network in which the delivery, arrival time, and order of arrival are not guaranteed by the network service. A datagram has the following characteristics: Data is transmitted from source to destination without guarantee of delivery Data is frequently divided into smaller pieces and transmitted without a defined route or guaranteed order of delivery

3. What is the use of TTL packet in IP header? 
The time-to-live (TTL) is the number of hops that a packet is permitted to travel before being discarded by a router. Originally TTL was set to a specific number of seconds that the packet would be allowed to live. The TTL is set in an eight binary digit field in the packet header by the sending host and is used to prevent packets from endlessly circulating on the Internet or other network. When forwarding an IP packet, routers are required to decrease the TTL by at least one. If a packet's TTL field reached zero, the router detecting it discards the packet and sends an ICMP (Internet control message protocol) message back to the originating host.

4. What is DHCP? 
DHCP - Dynamic Host Configuration Protocol DHCP is a network protocol that enables a server to automatically assign an IP address to a computer from a defined range of IP addresses configured for a given network so that it can communicate on that network using the Internet Protocol (IP). The protocol is implemented in a client-server model, in which DHCP clients request configuration data, such as an IP address, a default route, and one or more DNS server addresses from a DHCP server.

5. What are salient features of IPv6?
Major Features of IPv6: New Packet Format and Header Expanded Addressing (Large address space) Address Autoconfiguration and Neighbor Discovery Header Format Simplification Improved Support for IP Header Options Multicasting Built in Integrated Internet Protocol Security (IPSec)

Sunday, August 17, 2014

CS2305 - PROGRAMMING PARADIGM - Unit 3

14 .What is the major difference between LinkedList and ArrayList? 

 LinkedList are meant for sequential accessing. ArrayList are meant for random accessing. 

15. What is nested class? 
If all the methods of a inner class is static then it is a nested class. 

 16. What is inner class? 
If the methods of the inner class can only be accessed via the instance of the inner class, then it is called inner class. 


 17. What is composition? 
 Holding the reference of the other class within some other class is known as composition. 

18. What is aggregation? 
It is a special type of composition. If you expose all the methods of a composite class and route the method call to the composite method through its reference, then it is called aggregation. 

19. What are the methods in Object? 
clone, equals, wait, finalize, getClass, hashCode, notify, notifyAll, toString 

21. Can you instantiate the Math class? 
You can’t instantiate the math class. All the methods in this class are static. And the constructor is not public. 

Saturday, August 16, 2014

CS 2305 PROGRAMMING PARADIGM - Unit 3

1.What is the byte range? & What is the implementation of destroy method in java.. 
is it native or java code? 
128 to 127 .This method is not implemented. 

2.What is a package? 
To group set of classes into a single unit is known as packaging. Packages provides wide namespace ability. 
  
3.What are the approaches that you will follow for making a program very efficient? 
 By avoiding too much of static methods avoiding the excessive and unnecessary use of synchronized methods Selection of related classes based on the application (meaning synchronized classes for multiuser and non-synchronized classes for single user) Usage of appropriate design patterns Using cache methodologies for remote invocations Avoiding creation of variables within a loop and lot more. 

4. What is Locale? 
 A Locale object represents a specific geographical, political, or cultural region 

5. How will you load a specific locale? 
 Using ResourceBundle.getBundle(…); 

6. What is JIT and its use? 
Really, just a very fast compiler… In this incarnation, pretty much a one-pass compiler — no offline computations. So you can’t look at the whole method, rank the expressions according to which ones are re-used the most, and then generate code. In theory terms, it’s an on-line problem. 

Saturday, March 22, 2014

Operating System

51.Define logical address and physical address. 
An address generated by the CPU is referred as logical address. An address seen by the memory unit that is the one loaded into the memory address register of the memory is commonly referred to as physical address.

52.What is logical address space and physical address space? 
The set of all logical addresses generated by a program is called a logical address space; the set of all physical addresses corresponding to these logical addresses is a physical address space.

53.What is the main function of the memory-management unit? 
The runtime mapping from virtual to physical addresses is done by a hardware device called a memory management unit (MMU).

54.Define dynamic loading. 
To obtain better memory-space utilization dynamic loading is used. With dynamic loading, a routine is not loaded until it is called. All routines are kept on disk in a relocatable load format. The main program is loaded into memory and executed. If the routine needs another routine, the calling routine checks whether the routine has been loaded. If not, the relocatable linking loader is called to load the desired program into
memory.

55.Define dynamic linking. 
Dynamic linking is similar to dynamic loading, rather that loading being postponed until execution time, linking is postponed. This feature is usually used with system libraries, such as language subroutine libraries. A stub is included in the image for each library-routine reference. The stub is a small piece of code that indicates how to locate the appropriate memory-resident library routine, or how to load the library if the routine is
not already present.

Friday, March 21, 2014

Operating System

41.Define deadlock. 
A process requests resources; if the resources are not available at that time, the process enters a wait state. Waiting processes may never again change state, because the resources they have requested are held by other waiting processes. This situation is called a deadlock.

42.What is the sequence in which resources may be utilized? 
Under normal mode of operation, a process may utilize a resource in the following sequence:
• Request: If the request cannot be granted immediately, then the requesting process must wait until it can acquire the resource.
• Use: The process can operate on the resource.
• Release: The process releases the resource.

43.What are conditions under which a deadlock situation may arise? 
A deadlock situation can arise if the following four conditions hold simultaneously in a system:
a. Mutual exclusion
b. Hold and wait
c. No pre-emption

44.What is a resource-allocation graph? 
Deadlocks can be described more precisely in terms of a directed graph called a system resource allocation graph. This graph consists of a set of vertices V and a set of edges E. The set of vertices V is partitioned into two different types of nodes; P the set consisting of all active processes in the system and R the set consisting of all resource types in the system.

Monday, March 10, 2014

Computer Networks

14. Write the keys for understanding the link state routing?
The three keys for understanding the algorithm are,
·         Knowledge about the neighborhood. 
·         Routing to all neighbors.
·         Information sharing when there is a range.

15. How the packet cost referred in distance vector and link state routing?
In distance vector routing, cost refer to hop count while in case of link state routing, cost is a weighted value based on a variety of factors such as security levels, traffic or the state of the link.

16. Define Reliable flooding?
            It is the process of making sure that all the nodes participating in the routing protocol get a copy of the link state information from all the other nodes.

17. What are the features in OSPF?
·         Authentication of routing messages.
·         Additional hierarchy.
·         Load balancing.

18. Define Subnetting?
            Subnetting provides an elegantly simple way to reduce the total number of network numbers that are assigned. The idea is to take a single IP network number and allocate the IP address with that network to several physical networks, which are now referred to as subnets.

Sunday, March 9, 2014

Computer Network

1. Define packet switching?
            A packet switch is a device with several inputs and outputs leading to and from  the hosts that the switch interconnects.

2. What is a virtual circuit?
            A logical circuit made between the sending and receiving computers. The connection is made after both computers do handshaking. After the connection, all packets follow the same route and arrive in sequence.

3. What are data grams?
In datagram approach, each packet is treated independently from all others. Even when one packet represents just a place of a multi packet transmission, the network treats it although it existed alone. Packets in this technology are referred to as datagram.

4. What is meant by switched virtual circuit?
Switched virtual circuit format is comparable conceptually to dial-up line in circuit switching. In this method, a virtual circuit is created whenever it is needed and exits only for the duration of specific exchange.

5. What is meant by Permanent virtual circuit?
Permanent virtual circuits are comparable to leased lines in circuit switching.  In this method, the same virtual circuit is provided between two uses on a continuous basis. The circuit is dedicated to the specific uses.  

6. What are the properties in star topology?
·         Even though a switch has a fixed number of inputs and outputs, which limits the number of hosts that can be connected to a single  switch , large networks can be built by interconnecting a number of switches.
·         We can connect switches to each other and to hosts using point-to point links, which typically means that we can build networks of large geographic scope.

7. What is VCI?
            A Virtual Circuit Identifier that uniquely identifies the connection at this switch, and which will be carried inside the header of the packets that belongs to this connection.


Saturday, January 11, 2014

Propositional Logic Inference
Let KB = { S1, S2,..., SM } be the set of all sentences in our Knowledge Base, where
each Si is a sentence in Propositional Logic. Let { X1, X2, ..., XN } be the set of all the
symbols (i.e., variables) that are contained in all of the M sentences in KB. Say we want
to know if a goal (aka query, conclusion, or theorem) sentence G follows from KB.

Inference in First order logic
Rules of Inference
Here are some examples of sound rules of inference. Each can be shown to be sound once
and for all using a truth table. The left column contains the premise sentence(s), and the
right column contains the derived sentence. We write each of these derivations as A |- B ,
where A is the premise and B is the derived sentence.
Name Premise(s) Derived
Sentence
Modus Ponens A, A => B B
And Introduction A, B A ^ B
And Elimination A ^ B A
Double Negation ~~A A
Unit Resolution A v B, ~B A
Resolution A v B, ~B v C A v C
 Using Inference Rules to Prove a Query/Goal/Theorem
A proof is a sequence of sentences, where each sentence is either a premise or a sentence
derived from earlier sentences in the proof by one of the rules of inference. The last
sentence is the query (also called goal or theorem) that we want to prove.
Example for the "weather problem" given above.
1. Q Premise
2. Q => P Premise
3. P Modus Ponens(1,2)
4. (P ^ Q) => R Premise
5. P ^ Q And Introduction(1,3)

6. R Modus Ponens(4,5)
Propositional Logic Inference
Let KB = { S1, S2,..., SM } be the set of all sentences in our Knowledge Base, where
each Si is a sentence in Propositional Logic. Let { X1, X2, ..., XN } be the set of all the
symbols (i.e., variables) that are contained in all of the M sentences in KB. Say we want
to know if a goal (aka query, conclusion, or theorem) sentence G follows from KB.

Inference in First order logic
Rules of Inference
Here are some examples of sound rules of inference. Each can be shown to be sound once
and for all using a truth table. The left column contains the premise sentence(s), and the
right column contains the derived sentence. We write each of these derivations as A |- B ,
where A is the premise and B is the derived sentence.
Name Premise(s) Derived
Sentence
Modus Ponens A, A => B B
And Introduction A, B A ^ B
And Elimination A ^ B A
Double Negation ~~A A
Unit Resolution A v B, ~B A
Resolution A v B, ~B v C A v C
 Using Inference Rules to Prove a Query/Goal/Theorem
A proof is a sequence of sentences, where each sentence is either a premise or a sentence
derived from earlier sentences in the proof by one of the rules of inference. The last
sentence is the query (also called goal or theorem) that we want to prove.
Example for the "weather problem" given above.
1. Q Premise
2. Q => P Premise
3. P Modus Ponens(1,2)
4. (P ^ Q) => R Premise
5. P ^ Q And Introduction(1,3)

6. R Modus Ponens(4,5)
Knowledge engineering in first order logic

• A sentence (also called a formula or well-formed formula or wff) is defined as:
1. A symbol
2. If S is a sentence, then ~S is a sentence, where "~" is the "not" logical
operator
3. If S and T are sentences, then (S v T), (S ^ T), (S => T), and (S <=> T) are
sentences, where the four logical connectives correspond to "or," "and,"
"implies," and "if and only if," respectively
4. A finite number of applications of (1)-(3)
• Examples of PL sentences:
o (P ^ Q) => R (here meaning "If it is hot and humid, then it is raining")
o Q => P (here meaning "If it is humid, then it is hot")
o Q (here meaning "It is humid.")
• Given the truth values of all of the constituent symbols in a sentence, that
sentence can be "evaluated" to determine its truth value (True or False). This is
called an interpretation of the sentence.
• A model is an interpretation (i.e., an assignment of truth values to symbols) of a
set of sentences such that each sentence is True. A model is just a formal
mathematical structure that "stands in" for the world.
• A valid sentence (also called a tautology) is a sentence that is True under all
interpretations. Hence, no matter what the world is actually like or what the
semantics is, the sentence is True. For example "It's raining or it's not raining."
• An inconsistent sentence (also called unsatisfiable or a contradiction) is a
sentence that is False under all interpretations. Hence the world is never like what
it describes. For example, "It's raining and it's not raining."
• Sentence P entails sentence Q, written P |= Q, means that whenever P is True, so

is Q. In other words, all models of P are also models of Q
UNIT III
KNOWLEDGE REPRESENTATION
Knowledge Representation and Reasoning
Intelligent agents should have capacity for:
Perceiving, that is, acquiring information from environment,
Knowledge Representation, that is, representing its understanding of the world,
Reasoning, that is, inferring the implications of what it knows and of the choices
it has, and
Acting, that is, choosing what it want to do and carry it out.
Representation of knowledge and the reasoning process are central to the entire field of
artificial intelligence. The primary component of a knowledge-based agent is its
knowledge-base. A knowledge-base is a set of sentences. Each sentence is expressed in a
language called the knowledge representation language. Sentences represent some
assertions about the world. There must mechanisms to derive new sentences from old
ones. This process is known as inferencing or reasoning. Inference must obey the primary
requirement that the new sentences should follow logically from the previous ones.
Logic is the primary vehicle for representing and reasoning about knowledge.
Specifically, we will be dealing with formal logic. The advantage of using formal logic as
a language of AI is that it is precise and definite. This allows programs to be written
which are declarative - they describe what is true and not how to solve problems. This
also allows for automated reasoning techniques for general purpose inferencing.
This, however, leads to some severe limitations. Clearly, a large portion of the reasoning
carried out by humans depends on handling knowledge that is uncertain. Logic cannot
represent this uncertainty well. Similarly, natural language reasoning requires inferring
hidden state, namely, the intention of the speaker. When we say, "One of the wheel of the
car is flat.", we know that it has three wheels left. Humans can cope with virtually infinite
variety of utterances using a finite store of commonsense knowledge. Formal logic has
difficulty with this kind of ambiguity.
A logic consists of two parts, a language and a method of reasoning. The logical
language, in turn, has two aspects, syntax and semantics. Thus, to specify or define a
particular logic, one needs to specify three things:
Syntax: The atomic symbols of the logical language, and the rules for constructing wellformed,
non-atomic expressions (symbol structures) of the logic. Syntax specifies the
symbols in the language and how they can be combined to form sentences. Hence facts
about the world are represented as sentences in logic.
Semantics: The meanings of the atomic symbols of the logic, and the rules for
determining the meanings of non-atomic expressions of the logic. It specifies what facts
in the world a sentence refers to. Hence, also specifies how you assign a truth value to a
sentence based on its meaning in the world. A fact is a claim about the world, and may be

true or false.