Topics_for_Study_Computaional Thinking
Topics_for_Study_Computaional Thinking
Boolean Logic is a form of algebra which is centered around three simple words known as Boolean
Operators: “Or,” “And,” and “Not”. At the heart of Boolean Logic is the idea that all values are
either true or false.
b) Define Information.
Information is stimuli that has meaning in some context for its receiver. When information is
entered into and stored in a computer, it is generally referred to as data. After processing -- such as
formatting and printing -- output data can again be perceived as information. When information is
compiled or used to better understand something or to do something, it becomes knowledge.
c) computational Problem
A computational problem is a problem that may be solved by an algorithm. For example, the problem
of factoring "Given a positive integer n, find a nontrivial prime factor of n."
is a computational problem. A computational problem can be viewed as
a set of instances or cases together with a, possibly empty, set of solutions for every instance/case.
For example, in the factoring problem, the instances are the integers n, and solutions are prime
numbers p that are the nontrivial prime factors of n
d) repetition in flowchart
Repetition : A sequence of steps which are repeated a number of times is called repetition. For a
repeating process to end, a decision must be made. The decision is usually called a test.
1 List is used to collect items that An array is also a vital component that
usually consist of elements of collects several items of the same data type.
multiple data types.
f) Define Factoring.
Factoring (called "Factorising") is the process of finding the factors:
Factoring: Finding what to multiply together to get an expression.
It is like "splitting" an expression into a multiplication of simpler expressions.
Example: factor 2y+6
Both 2y and 6 have a common factor of 2:
• 2y is 2 × y
• 6 is 2 × 3
So we can factor the whole expression into:
2y+6 = 2(y+3)
So 2y+6 has been "factored into" 2 and y+3
g) Recursion/example of recursion
Recursion is a process by which a function calls itself directly or indirectly. The corresponding
function is called as recursive function. It is a computer programming technique involving the use
of a procedure, subroutine, function, or algorithm that calls itself one or more times until a specified
condition is met at which time the rest of each repetition is processed from the last one called to the
first.
Example : The factorial function can be written as a recursive function call. Recall that factorial(n)
= n × (n – 1) × (n – 2) × … × 2 × 1. The factorial function can be rewritten recursively
as factorial(n) = n × factorial(n – 1).
h) Data Encoding
Encoding is the process of using various patterns of voltage or current levels to represent 1s and 0s of
the digital signals on the transmission link.
The common types of line encoding are Unipolar, Polar, Bipolar, and Manchester.
Encoding Techniques
The data encoding technique is divided into the following types, depending upon the type of data
conversion.
• Analog data to Analog signals − The modulation techniques such as Amplitude Modulation,
Frequency Modulation and Phase Modulation of analog signals, fall under this category.
• Analog data to Digital signals − This process can be termed as digitization, which is done by
Pulse Code Modulation PCMPCM. Hence, it is nothing but digital modulation. As we have
already discussed, sampling and quantization are the important factors in this. Delta Modulation
gives a better output than PCM.
• Digital data to Analog signals − The modulation techniques such as Amplitude Shift
Keying ASKASK, Frequency Shift Keying FSKFSK, Phase Shift Keying PSKPSK, etc., fall
under this category.
o Digital data to Digital signals − These are in this section. There are several ways to map digital
data to digital signals.
i) Proportional Logic
propositional logic is a branch of mathematical logic which studies the logical relationships
between propositions (or statements, sentences, assertions) taken as a whole, and connected
via logical connectives.
Propositional logic is also known by the names sentential logic, propositional
calculus and sentential calculus. It is useful in a variety of fields, including computer logic
gates.
j) data
k) Logical Reasoning
Logical reasoning consists of aptitude questions that require a logical level of analysis to arrive at the
correct solution. Most of the questions are constructed based on concepts and the rest are out of the
box thinking ones.
Logical reasoning is classified into two types:
1. Verbal Reasoning: It is the ability to logically understand the concepts and solve problems
expressed in words. Verbal reasoning tests the ability of extraction of information and
implications in a sentence.
2. Non-verbal Reasoning: It is the ability to logically understand the concepts and solve
problems expressed in numbers/letters/figures in combination with words. Non-verbal
reasoning tests the ability of deduction and induction of logic of information and implications
in a problem
l) modularization in flowchart
Modular design is a technique for breaking down a complex system (such as a large application)
into smaller components called modules. Each of these modules can be developed independently,
and should contain everything required to execute one part of the overall application.
m) example of List.
A list can be define as below
1. L1 = ["John", 102, "USA"]
2. L2 = [1, 2, 3, 4, 5, 6]
a) proportional logic and application of it
Definition: A proposition is a statement that can be either true or false; it must be one or the other,
and it cannot be both. EXAMPLES. The following are propositions: – the reactor is on; – the
wing-flaps are up; – John Major is prime minister.
Applications of Propositional Logic : In the computer science field, propositional logic has a wide
variety of applications and hence is very important. It is used in system specifications, circuit
designing, logical puzzles, etc. Apart from this, it can also be used in translating English sentences
to mathematical statements and vice-versa.
Examples:
• populating a list with variables of type real will be space-wise inefficient, when it is clear that only
whole numbers (integers) will ever be needed to solve the problem.
• initialising an array with a length of 1000 will be space-wise inefficient, when it is clear that the
maximum elements to be stores will be 100.
2. Bucket Sort Bucket sort is mainly useful when input is uniformly distributed over a range. For
example, consider the following problem.
Sort a large set of floating point numbers which are in range from 0.0 to 1.0 and are uniformly
distributed across the range. How do we sort the numbers efficiently?
A simple way is to apply a comparison based sorting algorithm. The lower bound for Comparison
based sorting algorithm (Merge Sort, Heap Sort, Quick-Sort .. etc) is Ω(n Log n), i.e., they cannot
do better than nLogn.
Can we sort the array in linear time? Counting sort can not be applied here as we use keys as index
in counting sort. Here keys are floating point numbers.
The idea is to use bucket sort. Following is bucket algorithm.
bucketSort(arr[], n)
1) Create n empty buckets (Or lists).
2) Do following for every array element arr[i].
.......a) Insert arr[i] into bucket[n*array[i]]
3) Sort individual buckets using insertion sort.
4) Concatenate all sorted buckets.
b) Write a code for factorial using recursion.
def factorial(x):
"""This is a recursive function
to find the factorial of an integer"""
if x == 1:
return 1
else:
return (x * factorial(x-1))
num = 3
print("The factorial of", num, "is", factorial(num))
The steps used in the implementation of Linear Search are listed as follows -
o First, we have to traverse the array elements using a for loop.
o In each iteration of for loop, compare the search element with the current array element, and -
o If the element matches, then return the index of the corresponding array element.
o If the element does not match, then move to the next element.
o If there is no match or the search element is not present in the given array, return -1.