Today In this Article,I am posting 5 Quiz Questions..
These questions are with reference to Day-1 and Day-2 articles on
"Introduction to Computer Science and Programming"
1) Why does 53 represent the number 5 in ASCII?
5 also represents 5 in ASCII.
Either one will work
Numbers 1-47 actually represent
negative numbers. 53 is the first positive number that links to 5 (going
in order)
In this context, we're
representing characters through numbers. As such, the number 53 links to
the character '5'.
2) An ASCII Table is a large reference guide that show
which numbers represent which characters.
True
False
3) Express this binary number as a decimal number:
10010110
4) One algorithm has a run time of n/1000. Another
algorithm has a run time of log(n). Considering that n is a very large number,
which of these will complete first?
The n/1000 algorithm
The log(n) algorithm
5) In David's phonebook example, if he turns one page
at a time, it will take him log(n) steps to complete the search.
A:
Most of them believe that Computer Science is nothing but Programming.
This
is the most Common Misconception.
Q:
What is Programming?
A:
Programming is a tool of computer science, to analyze large amounts of data.
Example – Phone Book
In
old days, Before Mobiles were not developed: All of us used to store the Phone
Contacts in a Phone Book.
If
we want to search for “Karthikeyan”, we have to flip each page and search until
the Contact is found.
This
is an inefficient method.
Now
we can reduce our search time, by flipping to the middle of the Phone Book.
Let
divide the problem into two.
We
know ‘K’ doesn’t lie in the right part of the book, let’s throw away this part.
Now
we start searching in the left part of the book and Now again flip to the
middle of the Left Part of the Phone Book.
We
know ‘K’ lies in the right part of this book; let’s throw away the left part.
So
now we again start searching the right part.
As we continue tearing the book in half and throwing away part of it, we
will eventually be left with a single page on which the name “Karthikeyan”
appears.
Approach – To
Solve a Problem
In the graph below, the first steep line (n in red) represents the approach of turning one page at a time.
The second steep line (n/2 in yellow) represents a slightly
improved approach of turning two pages at a time.
The curve (log n in green) represents our “tear and throw away”
approach. As the size of the problem grows, the time to solve that problem
doesn’t grow nearly as fast.
In the context of this problem, n is the number of pages in the
phonebook. As we go from 500 to 1000 to 2000 pages in the phonebook, we need
only tear the phonebook in half one or two more times.
Algorithm : Counting Number of Students in a
class
Let’s solve this problem...
Everyone
in the class should stand up and the first person should think of the
number ‘1’
Now pair
off with second person – (example: number - 2) standing beside to first
person, add the first number with second and adopt the sum as the new
number to the second person.
Now the
first person should sit down, the second person should go back to step 2
With
this algorithm, it’s very easy to break the problem into small pieces.
Binary Numbers
Everyone
has studied in the schools, that computer deals with 0’s and 1’s.
These
0’s and 1’s comprise binary numbers system.
Binary
means “Two”...Every solution to a problem represents in binary numbers.
In
Real World, If the Switch of the Bulb is OFF – Then it represents 0 and
If
the Switch of the Bulb is ON – Then it represents 1.
ASCII
As
we have seen, Binary is used to represent the numbers.
We
now represent the alphabetic characters in numbers.
ASCII
is American Standard Code for
Information Interchange. It is an encoding system.
For example, an uppercase “A” is represented by the number 65 and a
lowercase “a” is represented by the number 97.
Few days back I have enrolled to "Python" online training course by RICE University.
Every Week, They have two sets of video Lectures with • Concepts and Examples • Two Quizes( each quiz for a set) • 1 Mini Project This Course duration is 8 Weeks (Oct -15 to Dec - 10) Today was my first class. Here are some Concepts which i learnt: 1. Comments:
Comments are Non-computational parts of the program that describe the behavior of the program to you and others.
Comments begin with #, everything after the hash symbol is ignored by Python.
# Hello,This is my first program in Python.
2. Print:
To return the values,we use print.
Example 1: # Hello,This is my first program in Python.
Print "Hello World"
Execute: The Output shows:
Line 3: SyntaxError: bad input on line 3 (''Hello world'')
Due to Case-Sensitiveness, In the statement : 'P' in Print should be in Lower-Case.
Example 2: # Hello,This is my first program in Python.
print "Hello World"
Execute: The Output shows:
Hello world
3. Strings :
Sequence of characters enclosed by a pair of single or double quotes is called as Strings.
Example 1: # Hello,This is my first program in Python.
print "Hello World"
Execute: The Output shows: Hello world
In this, "Hello world" / 'Hello World' results to same output.
Strings are one of the data types: They are denoted by 'str'.
Today I received the mail from Google. Congratulations! Here is the certificate you earned through your participation in PowerSearching with Google. Below are your assessment scores.
Few days back I have enrolled to "Introduction to Computer Science and Programming" online training course.
In this course Every Week,They have video Lectures with slides and • Finger exercises • Problem sets
After Week 5,There is a Midterm exam 1 and After Week 10,There is a Midterm exam 2. Finally after Week 14 - There is a Final exam.
Today I started with my course with Week 1 out of 14.
Week One Comprises:
Lecture 1 – Introduction to Computation Lecture 2 – Core elements of programs Finger Exercises Problem Set - 1
Lecture 1 – Introduction to Computation
Basics of Computation:
Goal of this course is,
Become skillful at making a computer do what you want it to do.
Learn computational modes of thinking.
Master the art of computational problem solving.
Q: What does Computer do? A: It does only TWO things only. i.e., Performs the calculations and Remembers the results that we can reuse.
Q:What Calculations can a Computer can perform? A: There are two calculations:
Simple Set of Primitive calculations that we can built -- Built in Primitives
Creating our own methods of calculating
Q: Is that all the Computer does? A: The Computer can perform A billion calculations per second and The Computer can store 100s of gigabytes of data
Note: Every Element of the storage is called Byte.
Q: What all can Computers can perform other than simple calculations? A: The computer can perform many things:
Searching the World Wide Web
Playing chess
Q: If you have a computer program to look ahead 6 moves, 3 moves by you and 3 moves by your Opponent..How many different options are there,if there are 35 moves each..? (Tricky Question) A: 1.8 Billion sets of chess boards.
Q: How many different games are there in Chess ? (Interesting Question) A: Experts say 10^123 different chess games are possible.
Q: Does computer have limitations? A: There are some problems that are too complex, as we dont have enough speed/storage Example: Predicting Weather at very local scale
and another is: Modern Cryptography -- The way in which the information is securely transmitted and Cracking Encryption schemes (Breaking the code).
Some problems are fundamentally impossible to compute •Predicting whether a piece of code will always halt with an answer for any input.
Q: Do u know about "Turing's Halting Problem?" A: “Does there exist an effective procedure (computable function) for deciding, for every pair (e(M),x); does M halt for x?” If we write a piece of code and then write another piece of code to check the first piece of code will always works and it will always stop and it will give us answer.
This turns out to not be possible to solve and this is known as "Turing's Halting Problem"