Notes, summaries, assignments, exams, and exercises for Computer science for Other courses

Mastering Topic Modeling, Anomaly Detection, and PageRank

Computer science12.48 KB

Topic Modeling: LSI vs LDA

Latent Semantic Indexing (LSI)

Use LSI for semantic similarity, retrieval, short/sparse documents, and synonymy problems. It uses Singular Value Decomposition (SVD) to find latent concept axes from term-document co-occurrence. Concepts are mathematical directions, not clean probability-based topics. It is better when the goal is to “find similar documents.”

Latent Dirichlet Allocation (LDA)

Use LDA for discovering hidden themes and topic percentages. In this model, each document is a mixture of topics, and each topic is a distribution over words. It is better when the goal is to determine “what themes exist in this corpus?”

Key Distinction

  • LSI finds latent concept dimensions.
  • LDA explicitly models probabilistic topics.
...
Continue reading "Mastering Topic Modeling, Anomaly Detection, and PageRank" »

Software Engineering Principles and UML Modeling

Computer science5.55 KB

What is Software Engineering?

Software Engineering is the application of engineering principles, methods, and tools to the design, development, testing, deployment, operation, and maintenance of software systems in a systematic, disciplined, and measurable way.

Software Process Flows

A software process defines the approach used to develop a system. Common process flows include:

  • Linear/Sequential: Activities are performed one after another in a fixed order. Each phase must be completed before the next begins.
  • Iterative: The development process is repeated in cycles. Each iteration improves the software based on feedback.
  • Evolutionary: The system is developed in versions or increments, where each version adds new features and improves the previous
...
Continue reading "Software Engineering Principles and UML Modeling" »

Python Data Structures for Customer Analytics

Computer science2.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" »

Essential Shell Scripting Examples for Linux Automation

Computer science3.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" »

Understanding Display Technology: Resolution, Aspect Ratio, and Scan Methods

Computer science3.29 KB

1. Resolution

Resolution refers to the number of pixels used to display an image on a screen. It determines the clarity and detail of the image.

  • It is usually written as width × height (e.g., 1920 × 1080).
  • The higher the resolution, the sharper and clearer the image.
  • Lower resolution images appear blurry or pixelated.

Example: If a display has a resolution of 1024 × 768, it means the screen contains 1024 pixels horizontally and 768 pixels vertically.

2. Aspect Ratio

Aspect Ratio is the ratio between the width and height of a display screen or image. It defines the shape of the display area and is expressed as width : height.

Common Aspect Ratios:

  • 4 : 3 – Old computer monitors and televisions
  • 16 : 9 – Modern widescreen monitors and TVs
  • 21 : 9 –
...
Continue reading "Understanding Display Technology: Resolution, Aspect Ratio, and Scan Methods" »

Computer Architecture: Functional Units and Memory Systems

Computer science659.68 KB

Functional Units of a Computer

A computer system is logically divided into several functional units that work together to perform data processing. These units accept input, process the data, store information, and produce output.

Main Functional Units

1. Input Unit

  • Accepts raw data and instructions from the user and enters them into the computer.
  • Converts the input data into machine-readable form (binary) for processing.

Examples: Keyboard, Mouse, Scanner, Microphone.

2. Output Unit

  • Displays the processed results to the user.
  • Converts the machine results into human-readable form.

Examples: Monitor, Printer, Speakers.

3. Memory Unit

  • Stores data, instructions, and intermediate results required for processing.
  • Supplies data to the CPU whenever needed.

Types

...
Continue reading "Computer Architecture: Functional Units and Memory Systems" »

Understanding Microcontrollers: Architecture and Functions

Computer science3.16 KB

What is a Microcontroller?

A microcontroller (MC, uC, or μC), also known as a microcontroller unit (MCU), is a small computer on a single integrated circuit. A microcontroller contains one or more processor cores along with memory and programmable input/output (I/O) peripherals.

Microprocessor Core Functions

The core directs all operations of the microprocessor:

  • Instruction Handling: It fetches instructions from memory, decodes them, and sends signals to other units.
  • Role: Think of it as the “manager” of the microprocessor.

Arithmetic and Logic Unit (ALU)

The ALU performs mathematical operations (addition, subtraction, etc.) and logical operations (AND, OR, NOT). It acts as the “calculator” part of the microprocessor.

Registers

Registers are...

Continue reading "Understanding Microcontrollers: Architecture and Functions" »

Data Structure Trees: Concepts and C++ Implementations

Computer science5.29 KB

Data Structure Trees: Fundamentals

A tree is a non-linear data structure that represents data in a hierarchical form. It consists of nodes connected by edges.

Key Tree Terminology

  • Root Node: The topmost node (has no parent).
  • Parent Node: A node that has child nodes.
  • Child Node: Nodes that have a parent.
  • Leaf Node: Nodes with no children.
  • Edge: The connection between two nodes.
  • Level: Distance from the root (root = level 0).
  • Height: The length of the longest path from the root to a leaf.

C++ Node Structure Example

This structure defines a basic node for a binary tree:

#include <iostream>
using namespace std;

struct Node {
    int data;
    Node* left;
    Node* right;

    Node(int val) {
        data = val;
        left = right = nullptr;
    }
...
Continue reading "Data Structure Trees: Concepts and C++ Implementations" »

UMTS Cell Search and WCDMA Architecture Components

Computer science355.61 KB

Q18. UMTS Cell Search Importance and Procedure

Importance of Cell Search

Cell Search allows the User Equipment (UE) to find and synchronize with a nearby UMTS cell before communication begins. It ensures correct timing, frequency, and scrambling code detection.


Steps in Cell Search

  1. Step 1 – Slot Synchronization:
    • UE detects the Primary Synchronization Channel (P-SCH) to identify slot boundaries (10 ms slots).
  2. Step 2 – Frame Synchronization:
    • UE detects the Secondary Synchronization Channel (S-SCH) to determine frame start and scrambling code group.
  3. Step 3 – Scrambling Code Identification:
    • UE reads the Common Pilot Channel (CPICH) to determine the exact scrambling code of the cell.

Diagram: Cell Search Flow

+-------------------------------+ |

...
Continue reading "UMTS Cell Search and WCDMA Architecture Components" »

Digital Hardware Design Reference: SystemVerilog and Architecture Fundamentals

Computer science11.13 KB

SystemVerilog Fundamentals

  • logic Data Type: Supports 4 states (0, 1, X, Z).
  • Legacy Types: Replace old Verilog reg/wire with logic in SystemVerilog (SV).
  • Always Blocks

    • Combinational Logic: always_comb begin ... end
    • Sequential Logic: always_ff @(posedge clk or posedge rst) begin ... end
  • Assignments

    • Blocking Assignment (=): Sequential execution. Use in combinational logic (always_comb).
    • Non-blocking Assignment (<=): Parallel execution. Essential for sequential logic (always_ff).
  • Module Definition Example

    module m(input logic a, b, output logic y);
    assign y = a & b;
    endmodule
  • Concatenation: {a, b, c}
  • Replication: {8{in[7]}} (Repeats the specified bit 8 times, often used for sign extension).

Testbench Development

  • Instantiate the Device Under Test (DUT) inside
...
Continue reading "Digital Hardware Design Reference: SystemVerilog and Architecture Fundamentals" »