Posts

Data Structures book chapter 3 exercise solutions

 1. What are arrays and why are they needed? Arrays are the most important and brilliant piece of development in software area. They are grouped into data structures and its use and implications is very high in programming languages. So what are arrays, Array is also a type of variable just like int, char, float, etc.. but with some changes. Here array has a structure, data structure with a collection of data elements in a structured way of storing it. It holds similar type of data elements. Why are they needed, consider this example. there are 20 students whose marks is to be scanned and printed. So in terms of programming language, we need at least 20 variables to hold 20 students marks, 20 statements or ( 1 statement with 20 variables ) for getting input, 20 print statements for printing marks. Therefore it is really manual, tedious, highly taxing and error prone process. Since this was only 20 students, consider 200, 2000, 20000 or 200000 students data entry job. It is exponent...

Computer Security book by Charles Chapter 1 Exercise Solutions

Image
1. Distinguish between vulnerability, threat, and control. In the above diagram, a man is standing near a wall with his finger placed inside a hole. There is water on left side of wall and a crack in a wall that you can see. For understanding the threat and vulnerability difference, we will understand it by the above diagram as a analogy.  By definition. Vulnerability is a weakness in the system ( loophole ) that might be exploited in the future to cause harm or loss.  Threat is a set of events, circumstances that may happen and potential to cause harm. Now, in the above diagram, If the water level rises, then the man may get wet, get harm either the water gets spilled out, overflows. So Water is the threat to Man. Now there is a weakness in the wall, i.e Crack is present, that some time it can diminish the entire wall, break the entire wall and thus it is a vulnerability.  To address this Harm, Threats, Vulnerabilities, We have Control or CounterMeasures.  Therefore...

Let us C book Chapter 2 Exercise SOlutions

 [A] Point out the errors, if any, in the following C statements: (a) x = ( y + 3 ) ;   Proper  (b) cir = 2 * 3.141593 * r ; r is undefined  char = '3'; WHere is the name dude , no variable name given  (d) 4 / 3 * 3.14 * r * r * r = vol_of_sphere ; Right to left associativitiy applies and left side of = should contain only one variable  (e) volume = a 3 ; Error no exponentiation form avaiable  (f) area = 1 / 2 * base * height ; Correct  (g) si = p * r * n / 100 ; perfect  (h) area of circle = 3.14 * r * r ; space not allowed in variable name  peri_of_tri = a + b + c ; ok  slope = ( y2 – y1 ) ÷ ( x2 – x1 ) ; ok (k) 3 = b = 4 = a ; NOt ok - > left side of = cannot have constant  count = count + 1 ; perfect  (m) char ch = '25 Apr 12' ; not ok only one character allowed in single quote [B] Evaluate the following expressions and show their hierarchy. (a) ans = 5 * b * b * x - 3 * a * y * y - 8 * b * b * x + 10 * a * y ;...

Search Engines Exercise Chapter 1 Solution

 1.1. Think up and write down a small number of queries for a web search engine.Make sure that the queries vary in length (i.e., they are not all one word). Try to specify exactly what information you are looking for in some of the queries.Run these queries on two commercial web search engines and compare the top 10 results for each query by doing relevance judgements. Write a report that answers at least the following questions: What is the precision of the results? What is the overlap between the results for the two search engines? Is one search engine clearly better than the other? If so, by how much? How do short queries perform compared to long queries? Queries  1. Computer Algorithms time complexity 2. Security in computing 3. covid-19 variants 4. Earth atmosphere layers Web search Engines used Are Google and DuckDuckgo Top 10 results were highly relevant and some of the results returned were similar in both the search engines. There were overlapping results founded in b...

Data Structures Chapter 2 Exercise Solutions

Short forms used DS -> Data structure 1. Explain the features of a good program. A good program is one that has the following points covered 1. Runs Correctly 2. Easy to read and undersand  3. is easy to modify A good program that runs correctly but runs efficiently, that's important. So a program that takes less time to execute and occupies minimum storage space is a good program. And also meets other points mentioned above. 2. Define the terms: data, file, record, and primary key.  Data : The term data means values or data sets  Record : It is a collection of data items like name, address, phone number, etc.. File : File is a collection of related records. File may be of school students attendance records, or marks records etc Primary Key : In a record that contains data items like name , id , phone number, age , etc.. , A primary key is the id field which is unique for each data item and cannot repeat , therefore using this as a key will serve identification of reco...

Let us C book Chapter 1 Exercise Solutions

  [A] Which of the following are invalid C constants and why? ‘3.15’ : Valid C Constant falls into Real Constant category 35,550 : Invalid C Constant because comma is not allowed  3.25e2 : Valid Exponential format of Real Constant  2e-3 : Valid Exponential form of Real Constant  ‘eLearning’ : Invalid C Constant Because Only ONe character should be there and single quote present  “Show” : Valid C Constant  ‘Quest’ : Invalid C Constant because single quote present instead of double  2^3 : Invalid C Constant  4 6 5 2 : Invalid C Constant because spaces not allowed  [B] Which of the following are invalid variable names and why? B’day : Invalid Variable Name because single quote present  Int : Invalid Variable name because it is a reserved Keyword  $hello : Invalid C Variable Name  #Hash : Invalid because only alphabets, digits and underscores allowed in naming variable  Dot.  : Invalid  Number : Valid  totalArea...

Confidentiality - Integrity - Availability

Confidentiality Confidentiality means some things need protection against unauthorised access. It can be anything ranging from financial transactions to bank records to medical records, tax returns etc. But It varies from person to person. For example, A Student might scream out of the class saying "I got an A", so he is ok exposing his grades to all but other student might not choose to reveal. Other things like order of military food might not seem confidential, but an sudden increase in the order could be the sign of an military conflict or war.  Integrity Examples of Integrity failures are easy to find and too many. A number of years ago, Macro in a document added the word "not" after is in the statements after random instances. This might not appear integrity failure, but you can image the kind of havoc it can do if the word document consisted of Pentium computer chip details that produced an incorrect result due to the word "not" in a statement conta...

Threats in Computer Security

 In this Computer Security Article, we are going to discuss Threats, Assets, Value, Confidentiality, Integrity, Availability, Value, etc. In the previous articles, we had discussed all about computer security assets, value. We are not going to make this article boring, so lets discuss in a very general, easy to understand way. Harm or Attacks to the valuable assets can be seen in two perspectives or ways.  1. What bad things can happen to assets 2. Who or what can cause those bad things to happen. These two views enable us to determine how to protect assets, implement computer security. Let us think What bad things can happen, What makes your computer valuable to you. First, you use it for sending and receiving emails, searching web, writing and publishing papers, performing many other tasks like running business online, teaching online, you store and access private data, etc... and you expect the computer to be available for your use when you want. Without your computer, thes...

Algorithms : The building blocks of the Computer Software

Algorithms : The building blocks of the Computer Software In the previous blog about algorithms, It described the great ideas of computer science but computer scientists describe this ideas, call them "Algorithms". So what's the difference between idea and an algorithms? The simplest answer to this question is to say that an algorithm is a precise recipe that specifies exact sequences of steps required to solve a problem. The great example for supporting this answer is how children's get taught to add two large numbers in school as shown below. 345611 + 989811 = xxxxx2 -> xxxx22 -> The above addition shows first two steps involved in adding two large numbers. So we can see that the process of addition contains precise number of steps that is also universal irrespective of input. The key feature of an algorithm is that no human intuition or guesswork required. Its just like a mechanical machine. Therefore each of the mechanical steps can be programmed into the co...

Timeline and brief overview of Computer Algorithms

 Let us understand how the Computer Science ideas grew over the timeline. In 1930's, a British genius founds the field of computer science then goes on to prove that certain problems cannot be solved by any computer to be built in future, no matter how fast, powerful or cleverly designed. In 1948, A Scientist working at a telephone company published a paper that founds the field of Information theory. His work will allow computers to transmit message with perfect accuracy even when most of the data is lost due to interference. In 1956, A group of people attends a conference at Dartmouth with goal of Founding the field of Artificial Intelligence.  In 1969, A Researcher at IBM discovers elegant way to structure information in a database. This technique is now used to store and retrieve the information present in online transactions. In 1974, researchers in British governments lab founds the secret way for communicating securely between two computers without any other computers k...

Thoughts on Computer Science as a discipline

 Computing is transforming our society in ways that are never were before in 17th or 18th century. There is hardly any aspects of our life that has not been influenced Digital Technology/ Computers, that's indeed. But There is a mystery out there because of little awareness about Fundamentals of Computers that makes it all possible. The Reason behind the lack of awareness, appreciation of Computer Science as a discipline is that it is not taught in schools as a subject and not mandatory also. At College level, it is introduced as a subject. The general pattern of teaching is also quite overlooked because most of the schools, colleges teach skills related to use of Software Packages rather than the Studying Heart of Computer Science. Let me give you an example for explaining the above points Consider the web-based commerce like amazon.com or Flipkart or net banking that is only possible because of the ability to send confidential information ( such as credit card numbers or otp or p...

What is Computer Security

Image
In this blog, We are going to discuss  1. What is computer security in a basic sense 2. What are Assets 3. What are the goal of computer security 4. What are Threats Welcome back to another blog, in this blog i am going answer to basic questions related to Computer Security. What is Computer Security? Before answering this question, lets discuss about computers We encounter computers daily in countless situations where it is involved in moving money, controlling planes, radio, communication, monitoring health, Heating buildings, locking doors, playing music, regulate heart, tally votes, Health, finance,etc. Most of the time computers work well as they should but occasionally it does something horrible, weird that causes havoc everywhere because of an attack. Therefore Computer Security plays an very important role by not letting attackers compromise computers in any possible way. Computer Security is the protection of items that we value called Assets of computer system. There are ...

Early Days of Computer Security

As the Title suggests, Lets discuss the early days of Computer Security and by early days I mean from 1950's and 1960's. I have taken the reference from computer security book "Security in Computing " by "Charles Pfleeger" and two other authors. "Willis Ware" had written a brief overview about early days of computing which i am going to discuss it next. Lets go back in 1950's In 50's and 60's, there were mainly two conferences yearly in US named Joint Computer Conferences (JCC) later renamed to National Computer Conference (NCC) where Computer Technology Enthusiastic, Researchers, Scientists, Engineers visit Conference. Nowadays The Term "Computer Security" has got changed to "Information Systems Security". Due to wide spread of computers, Entire Computer Security Industry moved from Private Defence classified Interest to Public View. Three People namely "Robert Patrick, John Haverty, Willis Ware" observed ...