Notes, summaries, assignments, exams, and problems for Computers

Sort by
Subject
Level

Core Concepts in AI, Machine Learning, and Industrial Automation Systems

Posted by Anonymous and classified in Computers

Written on in English with a size of 422.57 KB

Linear Regression Fundamentals

In regression, a set of records containing X and Y values is used to learn a function. This learned function can then be used to predict Y from an unknown X. In regression, we aim to find the value of Y, so a function is required which predicts Y given X. Y is continuous in the case of regression.

Here, Y is called the criterion variable and X is called the predictor variable. There are many types of functions or models which can be used for regression. The linear function is the simplest type of function. Here, X may be a single feature or multiple features representing the problem.

P37C38P9ECJqqvMXffAAAAAElFTkSuQmCC

Applications of Linear Regression in AI

  • Predictive Analysis: Forecasting sales, stock prices, or house prices based on historical data.
... Continue reading "Core Concepts in AI, Machine Learning, and Industrial Automation Systems" »

Programming Fundamentals and OOP Cheat Sheet

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.49 KB

MEGA CHEAT SHEET

1. Programming Fundamentals

Software Development Life Cycle (SDLC)

Steps: Requirements → Specifications → Design → Development → Integration → Testing/Debugging → Installation → Maintenance.

Mnemonic: Really Smart Developers In Tech Install Machines.

Algorithms

  • Control Structures:
    • Sequence (In Order)
    • Selection (If/Else)
    • Iteration (Loops)
  • Design Strategies: Divide and Conquer, Backtracking.
  • Representations: Pseudocode, Flowcharts, Structure Charts, Abstraction Diagrams.
  • Checking: Identify Input/Output, Purpose, Desk Check with data.

Programming Paradigms

  • Imperative: Step-by-step instructions (e.g., Python).
  • OOP: Objects and classes (e.g., Java, Python).
  • Logic: Facts and rules (e.g., Prolog).
  • Functional: Pure functions, no state
... Continue reading "Programming Fundamentals and OOP Cheat Sheet" »

8051 Microcontroller Architecture and Pin Configuration

Posted by Anonymous and classified in Computers

Written on in English with a size of 1.86 MB

Architecture of 8051

1. CPU (Central Processing Unit)

  • Controls all operations of the microcontroller.
  • Performs arithmetic and logical operations.
  • Executes program instructions.

2. RAM (Random Access Memory)

  • Temporary storage for data.
  • Stores variables and intermediate results.
  • Data is lost when power is turned off.

3. ROM (Read Only Memory)

  • Stores the program permanently.
  • Retains data even when power is off.

4. Timers/Counters

  • Used to generate time delays.
  • Can count external events.
  • 8051 has Timer 0 and Timer 1.

5. Ports

  • Used for input and output operations.
  • 8051 has 4 ports (P0, P1, P2, P3).
  • Each port is 8-bit.

6. Serial Communication

  • Used to exchange data with other devices.
  • Uses TXD (Transmit) and RXD (Receive) pins.
  • Supports serial data transmission and reception.
... Continue reading "8051 Microcontroller Architecture and Pin Configuration" »

Dijkstra's Algorithm in C: Code & Explanation

Classified in Computers

Written on in English with a size of 3.5 KB

Dijkstra's Algorithm in C

This code implements Dijkstra's algorithm to find the shortest path from a source vertex to all other vertices in a graph represented as an adjacency matrix. The program reads graph data from an input.txt file and writes the results to an output.txt file.

Code Implementation


#include <stdio.h>
#include <limits.h>
#include <stdbool.h>

#define MAX_VERTICES 100

// Function to find the vertex with minimum distance
int minDistance(int dist[], bool visited[], int vertices) {
    int min = INT_MAX, min_index;

    for (int v = 0; v < vertices; v++)
        if (!visited[v] && dist[v] <= min) {
            min = dist[v];
            min_index = v;
        }

    return min_index;
}

// Dijkstra'
... Continue reading "Dijkstra's Algorithm in C: Code & Explanation" »

ECSE 427 Operating Systems Final Exam Cheat Sheet

Posted by Anonymous and classified in Computers

Written on in English with a size of 4.38 KB

ECSE 427 Final Exam Cheat Sheet

Process Management

  • Fork: Each fork() creates a new process (2^n processes after n forks).
  • Fork Output: for(i=0; i<3; i++) fork(); printf("hello\n"); prints "hello" 8 times (2^3).
  • Child/Parent Sharing: Only code, static data, and disk content are shared; heap, stack, and registers are copied.
  • Process vs. Thread Switch: Process switching is more expensive due to address space switches, TLB flushes, and cache pollution.
  • Multithreading Benefits: Even on single-core CPUs, threads are useful for blocking I/O operations.
  • Trap Steps:
    • Hardware: Save state → Change to kernel mode → Jump to trap handler.
    • OS: Identify cause → Handle trap → Return to user mode.

Memory & Paging

  • Address Translation (Virtual → Physical)
... Continue reading "ECSE 427 Operating Systems Final Exam Cheat Sheet" »

Cryptography Fundamentals: DES, AES, RSA and Security

Posted by Anonymous and classified in Computers

Written on in English with a size of 6.12 KB

1. DES Structure

DES (Data Encryption Standard) is a symmetric key block cipher used for data encryption. It encrypts 64-bit plaintext using a 56-bit secret key.

DES uses a 16-round Feistel structure. The plaintext first undergoes initial permutation and is divided into left and right halves. In every round, the right half is processed using a round function and XORed with the left half. After 16 rounds, a final permutation is performed to generate the ciphertext.

Features

  • 64-bit block size
  • 56-bit key
  • 16 rounds
  • Uses Feistel structure

Advantages

  • Simple implementation
  • Efficient hardware encryption

Disadvantages

  • Weak against brute-force attacks

2. AES Algorithm

AES (Advanced Encryption Standard) is a symmetric encryption algorithm used to secure digital communication.... Continue reading "Cryptography Fundamentals: DES, AES, RSA and Security" »

Essential Shell Scripting Examples for Linux Automation

Posted by Anonymous and classified in Computers

Written on in English with a size of 3.37 KB

1. Armstrong Number Checker

Write a shell script to check whether a given number is an Armstrong number.

echo "Enter a number"
read c
x=$c
sum=0
while [ $x -gt 0 ]
do
r=$(( $x % 10 ))
n=$(( $r * $r * $r ))
sum=$(( $sum + $n ))
x=$(( $x / 10 ))
done
if [ $sum -eq $c ]
then
echo "This is an Armstrong number"
else
echo "This is not an Armstrong number"
fi

2. Calculate Area of a Circle

Write a shell script to find the area of a circle.

echo "Enter radius"
read r
echo "Area is"
echo "3.14 * $r * $r" | bc

3. Average of Command Line Arguments

Write a shell script to find the average of numbers entered as command line arguments.

sum=0
for i in $*
do
sum=$((sum + i))
done
echo "Summation of $# numbers is: $sum"
N=$#
avg=$(echo "$sum / $N" | bc -l)
echo "Average = $avg"
... Continue reading "Essential Shell Scripting Examples for Linux Automation" »

Data Structures: Queues, Trees, Graphs, and Searching Algorithms

Posted by Anonymous and classified in Computers

Written on in English with a size of 497.48 KB

Understanding Data Structures and Algorithms

8. Queues: FIFO Operations

A queue is a linear data structure that follows the First-In, First-Out (FIFO) principle. The element inserted first will be removed first, similar to people waiting in a line. It has two primary operations:

  • enqueue(): Adds an element to the rear of the queue.
  • dequeue(): Removes an element from the front of the queue.

Enqueue Operation Algorithm (Array-based):

  1. Check if the queue is full (rear == size - 1).
  2. If not full, increment rear.
  3. Insert the new element at queue[rear].

Example:

if (rear == size - 1)
    printf("Queue Overflow");
else {
    rear++;
    queue[rear] = value;
}

Dequeue Operation Algorithm:

  1. Check if the queue is empty (front > rear).
  2. If not empty, retrieve the element
... Continue reading "Data Structures: Queues, Trees, Graphs, and Searching Algorithms" »

Python Data Structures for Customer Analytics

Posted by Anonymous and classified in Computers

Written on in English with a size of 2.84 KB

Experiment 5: Customer Analytics Database

This Python experiment demonstrates the practical application of core data structures: Tuples, Lists, Sets, and Dictionaries to build a basic Customer Analytics System.

# Experiment Code:
# Tuple: Fixed dataset structure (immutable)
dataset_schema = ("CustomerID", "Name", "PurchaseAmount", "Segment")
# List: Stores purchase amounts (mutable, ordered)
purchase_amounts = []
# Set: Stores unique customer IDs
unique_customers = set()
# Dictionary: Stores complete customer records
customer_records = {}

while True:
    print("\n--- Menu Customer Analytics ---")
    print("1. Add Customer Data")
    print("2. View Purchase Amounts (List)")
    print("3. View Dataset Schema (Tuple)")
    print("4. View Unique
... Continue reading "Python Data Structures for Customer Analytics" »

Fundamental Computer Science Concepts & Algorithms

Classified in Computers

Written on in English with a size of 1.64 MB

Arithmetic Progressions (AP)

Sum of terms = n[(1st term + last term)]/2

Geometric Progressions (GP)

Sum of terms = [1st term(1 - quotientn)/(1 - quotient)] (Swap positions of 1 & quotient if quotient > 1)

Logarithms

  • loga(x/y) = logax - logay
  • logaxn = nlogax
  • logab = (logcb/logca)

Permutations

For a set of n objects: The total number of permutations is n!

For arranging 'r' objects from a set of 'n' objects: The number of permutations is nPr = n! / (n-r)!. (e.g., ways to arrange 3 objects from a set of 5 is 5 * 4 * 3, since there are 5 possibilities for the first object, followed by 4, then 3.)

Combinations

For selecting 'r' objects from a set of 'n' objects: The number of combinations is nCr = n! / (r! * (n-r)!). (Divide by r! since there are r! ways

... Continue reading "Fundamental Computer Science Concepts & Algorithms" »