Mooc - Nptel - Aakash Sagar
Mooc - Nptel - Aakash Sagar
Mooc - Nptel - Aakash Sagar
Submitted in partial fulfilment of the requirement Seminar for the 2nd Semester
MCA
SCHOOL OF COMPUTING
GRAPHIC ERA HILL UNIVERSITY BHIMTAL
CAMPUS SATTAL ROAD, P.O. BHOWALI
DISTRICT- NAINITAL-263136
2022 – 2023
1
STUDENT’S DECLARATION
2
CERTIFICATE
3
ACKNOWLEDGEMENT
Aakash Sagar
4
Copy of confirmation/ Certification of Course Completion
5
Modules Attended
6
Week 1
Introduction to Programming
Why Programming
Introduction to Scratch
7
Scratch is a beginner-friendly programming language and online
platform developed by the Lifelong Kindergarten Group at the MIT
Media Lab. It is designed to introduce programming concepts and
computational thinking to people of all ages, especially children and
beginners.
With Scratch, users can create interactive stories, animations, games, and
more by simply dragging and dropping colorful blocks of code. It uses a
visual programming approach, where users can snap together blocks that
represent different programming commands and actions. This block-based
interface makes it easy for beginners to understand and experiment with
programming concepts without the need for complex syntax or typing.
Scratch Animations
8
Week 2
Introduction to Anaconda
9
and running Python code. Spyder offers a range of features tailored to the
needs of data scientists and researchers, making it a popular choice among
professionals in these fields.
One of the key advantages of Spyder is its user-friendly interface, which
includes a code editor, variable explorer, and interactive console. This
allows users to write and execute Python code in a single environment,
making it convenient to explore and analyze data. Spyder also provides
features like code autocompletion, syntax highlighting, and code
navigation, which enhance productivity and efficiency.
• Understanding Python
The Python basics module in our MOOC covers the fundamental concepts
of programming using Python. It begins by introducing the basic syntax
and structure of Python code, including variables, data types, operators,
and control flow statements.
10
Week 3
Fizzbuzz
FizzBuzz is a classic programming problem that helps developers
practice fundamental programming concepts, such as conditionals,
loops, and basic arithmetic operations. It involves iterating through a
sequence of numbers and applying certain rules to determine what to
output for each number.
Problem Statement:
11
Write a program that prints the numbers from 1 to n, but for multiples of 3,
it prints "Fizz" instead of the number, and for multiples of 5, it prints
"Buzz" instead. For numbers that are multiples of both 3 and 5, print
"FizzBuzz".
def fizzbuzz(n):
for i in range(1, n+1):
if i % 3 == 0 and i % 5 == 0:
print("FizzBuzz")
elif i % 3 == 0:
print("Fizz")
elif i % 5 == 0:
print("Buzz")
else:
print(i)
# Example usage
fizzbuzz(15)
Crowd Computing
12
Jumbled Words
13
• Theory of Evolution
14
Week 4
• Magic Square
The Magic Square game is a puzzle where the objective is to arrange a set
of numbers in a square grid such that the sum of each row, column, and
diagonal is the same. It tests your ability to think logically and
strategically.
To play the game, you are presented with an empty square grid. Your task
is to fill in the grid with numbers, usually from 1 to n^2, where n
represents the size of the grid. The numbers should be placed in such a
way that the sum of each row, column, and diagonal is equal to a constant
value, which is often referred to as the "magic sum."
15
Dobble Game
Dobble is a popular card game that tests your observation and speed skills.
It is a fast-paced game that can be enjoyed by people of all ages. The
objective of the game is to spot the matching symbols between two cards
as quickly as possible. Here's how the Dobble game works:
Components:
• The game consists of a set of cards. Each card has several symbols
printed on it.
• There are multiple symbols on each card, and any two cards in the
deck have exactly one symbol in common.
16
Birthday Paradox
17
• Guess the movie name
18
In the "Guess the Movie Name" game, players are presented with clues or
hints related to a particular movie, and they have to guess the name of the
movie based on those clues. It's a fun and engaging game that tests your
knowledge of movies across different genres and eras.
19
Week 5
1. You initially choose one of the three doors, let's say Door #1.
2. Before revealing what's behind your chosen door, Monte Hall, who
knows what's behind each door, opens one of the remaining two
doors to reveal a goat. Let's say he opens Door #3.
3. Now, you are faced with a choice: stick with your original choice
(Door #1) or switch to the other unopened door (Door #2).
4.
Rock Paper Scissors is a classic hand game where two players make a
hand gesture representing either rock, paper, or scissors. The game follows
a set of rules, where rock beats scissors, scissors beat paper, and paper
beats rock. The players simultaneously reveal their chosen gesture, and the
winner is determined based on the outcome of their gestures according to
the rules.
20
• Binary Search
21
5. Continue dividing the search space in half and updating the pointers
until the target element is found or the search space is empty.
Binary search is an efficient algorithm with a time complexity of O(log n),
where n is the number of elements in the sorted list. It is widely used in
various applications, including searching in databases, finding elements in
sorted arrays, and more.
22
Week 6
Substitution Cipher
23
Tic-Tac-Toe
Tic-tac-toe, also known as noughts and crosses or Xs and Os, is a classic
paper-and-pencil game played on a 3x3 grid. The objective of the game is
to be the first player to get three of their marks (either X or O) in a
horizontal, vertical, or diagonal row.
The game starts with an empty grid. Players take
turns, with one player using X and the other using
O. They alternate placing their marks in empty
cells of the grid. The first player typically starts
by placing an X in any cell of their choice.
The game continues until one of the players has
three of their marks in a row, or all cells on the grid are filled without a
winner, resulting in a tie. A winning combination can be a horizontal,
vertical, or diagonal line of three Xs or three Os.
• Recursion
24
Week 7
• Spiral Traversing
25
The spiral traversing algorithm follows the following steps:
1. Define the boundaries: Set the initial boundaries of the matrix. These
boundaries represent the outermost layer of the matrix and will
shrink as the traversal progresses.
2. Traverse the top row: Starting from the leftmost column of the top
row, visit each element in the top row from left to right.
3. Traverse the right column: Move down to the next row and visit each
element in the rightmost column from top to bottom.
4. Traverse the bottom row: Move from the rightmost column to the
leftmost column of the next row and visit each element in the bottom
row from right to left.
5. Traverse the left column: Move up to the previous row and visit each
element in the leftmost column from bottom to top.
6. Update the boundaries: Shrink the boundaries inward by
incrementing the starting row and column, and decrementing the
ending row and column.
7. Repeat: Repeat steps 2 to 6 until all elements in the matrix have been
visited.
26
GPS-Track the route
27
Week 8
28
• Image Processing-Enhance your images
29
4. Enhance the image: There are various techniques you can use to
enhance your images. Some commonly used techniques include:
• Adjusting brightness and contrast: Modify the brightness and
contrast of the image to improve its overall appearance. This
can be done by applying simple arithmetic operations on the
pixel values.
• Sharpening: Enhance the image's edges and details to make it
appear sharper. Techniques such as unsharp masking or high-
pass filtering can be employed to achieve this.
• Denoising: Remove noise from the image to improve its clarity.
Techniques like Gaussian blur or median filtering can be used
to reduce the effects of noise.
• Color correction: Adjust the color balance, saturation, or hue of
the image to improve its color representation. This can be
achieved through techniques such as histogram equalization or
color mapping.
5. Save or display the enhanced image: Once the desired enhancements
are applied, you can save the enhanced image to a file or display it on
the screen using library functions provided by OpenCV or PIL.
6. Experiment and fine-tune: Image enhancement is a subjective
process, and the optimal parameters may vary based on the specific
image and desired outcome. Experiment with different techniques
and parameters to achieve the desired results.
• Anagrams
30
• Facebook Sentiment Analysis
31
To store data from Facebook and save it in an Excel file, you can follow
these general steps:
1. Obtain the necessary permissions and access tokens from Facebook's
API to retrieve the desired data.
2. Use a suitable Python library, such as facebook-sdk or python-
facebook-api, to interact with the Facebook API and retrieve the data
you need.
3. Preprocess and organize the retrieved data into a structured format
that can be easily saved in an Excel file.
4. Use a Python library like pandas to create a DataFrame from the
structured data.
5. Export the DataFrame to an Excel file using the to_excel() method
provided by the pandas library.
32
Week 9
1. Data Collection: Gather a dataset of texts written by different authors that you
want to analyze.
2. Text Preprocessing: Clean and preprocess the texts by removing punctuation,
stopwords, and other irrelevant information. Normalize the text by converting
it to lowercase and handling any special characters.
33
3. Feature Extraction: Extract relevant features from the preprocessed texts.
Some common features used in author stylometry include word frequencies,
character n-grams, sentence lengths, syntactic features, and semantic features.
4. Feature Selection: Select the most informative and discriminative features to
reduce the dimensionality of the data and improve the accuracy of the
stylometric analysis. This step helps in removing irrelevant or redundant
features.
5. Model Training: Split the dataset into training and testing sets. Use the training
set to train a machine learning model, such as a classifier or clustering
algorithm, using the extracted and selected features.
6. Model Evaluation: Evaluate the performance of the trained model on the
testing set. Use appropriate evaluation metrics, such as accuracy, precision,
recall, and F1-score, to assess the model's effectiveness in distinguishing
between authors.
7. Prediction and Attribution: Apply the trained model to new or unseen texts to
predict the most likely author or attribute authorship to unknown texts based
on their writing style.
34
Week 10
• FLAMES
FLAMES is a popular game or algorithm used to determine the
relationship or compatibility between two people. It is often played by
individuals who are curious about their romantic prospects or
compatibility with someone else.
The acronym FLAMES stands for Friends, Lovers, Affectionate, Marriage,
Enemies, and Siblings. The game works by comparing the letters in the
names of the two individuals and eliminating common letters until only
one category remains. Each letter corresponds to one of the categories, and
the final category represents the relationship or connection between the
two people.
• Data Compression
Data compression is the process of reducing the size of data files to save storage
space or to transmit data more efficiently. In Python, there are various
techniques and libraries available for data compression. One popular library is
35
the gzip module, which provides functionality for compressing and
decompressing files using the gzip algorithm.
To compress data using gzip in Python, you can follow these steps:
1.Import the gzip module:
import gzip
2. Open the input file in binary mode and the output file in gzip mode:
with open('input_file.txt', 'rb') as file_in, gzip.open('compressed_file.gz',
'wb') as file_out:
3. Read the data from the input file and write it to the compressed file:
file_out.write(file_in.read())
4. The compressed file will be created with the extension ".gz" (e.g.,
compressed_file.gz).
36
Week 11
37
• Fun with Calendar
38
4. Calculating the difference between two dates: You can find the number of
days, months, or years between two given dates. This can be useful for
determining durations or calculating age, for example.
5. Day of the week calculations: You can determine the day of the week for
a given date. This can be done using various algorithms, such as Zeller's
Congruence or Sakamoto's Algorithm, which provide a formula to
calculate the day of the week based on the year, month, and day
components of a date.
39
Week 12
Crawlers, also known as web spiders, web robots, or web crawlers, are
automated programs that systematically browse the internet and collect
information from web pages. They play a crucial role in the operation of
search engines, as well as in various web scraping and data mining
applications.
40
The primary purpose of crawlers is to discover and index web content.
They start by visiting a set of seed URLs and then follow the hyperlinks
on those pages to find and retrieve additional pages. Crawlers use a
process called crawling or spidering to traverse the web, going from one
page to another in a methodical and automated manner.
Collatz Conjecture
41
The sequence eventually reaches 1. The Collatz Conjecture suggests that
this pattern will always occur regardless of the starting value of n.
END OF COURSE.
42