Notes, summaries, assignments, exams, and problems for Computer science

Introduction to Computer Systems and Assembly Language Programming

Computer science7.29 KB

Computer System

Components:

  • CPU
  • Memory (ROM/RAM)
  • I/O unit

BCD (Binary-Coded Decimal)

  • Add 0110 to the result if it falls between 1010 and 1111.

Overflow

  • Occurs when both numbers being added are positive or negative, and the result exceeds the maximum representable value.

IEEE-754 Standard

  • 32 bits: 1 sign bit, 8 exponent bits, 23 mantissa bits
  • NAN (Not a Number): Represents an error, exponent with all 1s and a sign bit of 0.
  • Always add trailing zeros to complete the required number of bits.

Decoder

  • Converts input to output using 2^n AND gates.

Memory

  • Components: Address, data, enable, read, write

Control Unit

  • Hardware instruction logic
  • Decodes and monitors the execution of instructions.

ALU (Arithmetic Logic Unit)

  • Performs numerical and logical evaluations.
  • Receives
...
Continue reading "Introduction to Computer Systems and Assembly Language Programming" »

Programming Concepts: Constants, Constructs, and Operators

Computer science1.72 KB

Programming Fundamentals

What is a Constant?

A constant is a data value that remains unchanged during the execution of a program.

Three Programming Constructs

The three fundamental programming constructs are: selection, iteration, and sequence.

Logical Operators

One example of a logical operator is AND.

  • Operator: and
  • Description: Logical AND: True if both operands are true.
  • Syntax: x and y

Functions vs. Procedures

Difference: A function is typically used to calculate a value from a given input, while a procedure is a set of commands executed in a specific order.

Similarity: Functions must return a value, but in stored procedures, it is optional. Procedures can return zero or multiple values. Functions usually have only input parameters, whereas procedures...

Continue reading "Programming Concepts: Constants, Constructs, and Operators" »

Internet Safety and Digital Responsibility Guide

Computer science5.88 KB

What is the Internet?

The internet is a vast network of thousands of computers and devices worldwide, connected through various means like copper wires, fiber optics, and wireless connections.

Internet of Things

The Internet of Things (IoT) is a revolutionary concept that describes the connection of everyday objects to the internet. This interconnectedness allows us to interact with these objects remotely and seamlessly.

Web Browsers

A web browser is a software program that retrieves and displays the content of web pages. It acts as your gateway to accessing information and resources on the internet.

Search Engines

Search engines are sophisticated computer systems that index files stored on websites across the internet. They continuously crawl and...

Continue reading "Internet Safety and Digital Responsibility Guide" »

Data Management Fundamentals: Databases, Algorithms, & Distributed Systems

Computer science12.62 KB

Understanding Algorithms

A programming algorithm is a computer procedure, much like a recipe, that tells your computer precisely what steps to take to solve a problem or reach a goal.

Evolution of Data Management

Early data management systems include file and database systems that were designed prior to the relational database in the 1970s. These include:

  • Flat File Data Management
  • Hierarchical Data Management Systems
  • Network Data Management Systems

Database Generations & Models

1. Flat File Data Model

An organized set of data stored in a long-term storage medium, such as a disk or magnetic tape.

2. Hierarchical Data Model

Files are related in a parent/child manner, with each child file having at most one parent file.

3. Network Data Model

Made of data...

Continue reading "Data Management Fundamentals: Databases, Algorithms, & Distributed Systems" »

Java File Handling: Reading Text and Managing Files

Computer science4.37 KB

Java File Handling Examples: Reading Text and Managing Files

This document presents two distinct Java examples demonstrating fundamental Input/Output (I/O) operations, including reading data from text files and managing file existence and metadata.

Example 1: Reading and Summing Numbers from a Text File

This program reads characters from a file named pepe.txt using FileReader. It attempts to parse and sum numerical values found within the file. Note the specific logic used for character processing and summation.

Java Code: Summing File Contents (EjerciciosFiletexto2)

package ejerciciosfiletexto2;
import java.io.FileReader;
import java.io.IOException;

/**
 *
 * @author thene
 */
public class EjerciciosFiletexto2 {    
    /**
     * @param args
...
Continue reading "Java File Handling: Reading Text and Managing Files" »

Predictive Modeling Techniques in Data Mining

Computer science4.25 KB

CH6

Predictive Modeling Techniques

61) Predictive modeling is perhaps the most commonly practiced branch in data mining. What are three of the most popular predictive modeling techniques?

Answer:

  • Artificial neural networks
  • Support vector machines
  • k-nearest neighbor

62) Why have neural networks shown much promise in many forecasting and business classification applications?

Answer: Because of their ability to "learn" from the data, their nonparametric nature (i.e., no rigid assumptions), and their ability to generalize.

Understanding Neural Networks

63) Each ANN is composed of a collection of neurons that are grouped into layers. One of these layers is the hidden layer. Define the hidden layer.

Answer: A hidden layer is a layer of neurons that takes input...

Continue reading "Predictive Modeling Techniques in Data Mining" »

Polynomial-Time Reductions for NP-Complete Problems

Computer science3.67 KB

1. Independent Set to Vertex Cover Reduction

Input

A graph G and an integer k.

Reduction Steps

  1. Call the black-box for Vertex Cover with the input graph G.
  2. Provide n-k as the target size, where n is the number of nodes in G.
  3. Return the result ('yes' or 'no') from the black-box call.

2. SAT to Independent Set Reduction

Input

A CNF formula F.

Reduction Steps

  1. Construct a graph G where the nodes of G are the literals occurring in F (with possible repetitions).
  2. Add the following edges to G:
    • An edge joining every pair of complementary literals.
    • An edge joining any two literals that occur in the same clause.
  3. Call the black-box for Independent Set with input graph G and an integer k, where k is the number of clauses in F.
  4. Return the result ('yes' or 'no') from the
...
Continue reading "Polynomial-Time Reductions for NP-Complete Problems" »

Understanding Network Characteristics and Protocols

Computer science5.89 KB

1. The performance of a client-server system is strongly influenced by two major network characteristics: the bandwidth of the network (that is, how many bits/sec it can transport) and the latency (that is, how many seconds it takes for the first bit to get from the client to the server). Give an example of a network that exhibits i) high bandwidth but also high latency, and ii) then give an example of one that has both low bandwidth and low latency. i) High bandwidth but also high latency: A transcontinental fiber link might have many gigabits/sec of bandwidth, but the latency will also be high due to the speed of light propagation over thousands of kilometers. Similarly, a satellite link may run at megabits/sec but have a high latency to...

Continue reading "Understanding Network Characteristics and Protocols" »

Data Models, Schemas, and Database Normalization

Computer science3.46 KB

Categories of Data Models

  • Entity: Represents a real-world object or concept.
  • Attribute:
    • Represents some property of interest.
    • Further describes an entity.
  • Relationship: Represents an association among two or more entities.
  • Entity-Relationship model
  • Relational data model: Used most frequently in traditional commercial DBMSs.
  • Object data model:
    • New family of higher-level implementation data models.
    • Closer to conceptual data models.
  • Physical data models: Describe how data is stored as files in the computer.
  • Access path: Structure that makes the search for particular database records efficient.
  • Index:
    • Example of an access path.
    • Allows direct access to data using an index term or a keyword.

Schemas, Instances, and Database State

  • Database schema: Description of a
...
Continue reading "Data Models, Schemas, and Database Normalization" »

Using Proximity, White Space, Alignment, Contrast, and Repetition in Design

Computer science1.05 KB

Proximity

Proximity is all about using visual spaces to show relationships in your content. We can group the items in blocks of text or elements in the graphic to take visual emphasis.

White Space

White space, also known as negative space, refers to the spaces between your content, between lines, and even the margins. White space defines and separates different sections.

Alignment

We can separate text boxes, images, etc. by imagining their content as a range inside of a grid. Centering the images to the text and using equal size margins can create a visually pleasing alignment.

Contrast

Contrast means that one item is different from another. We can create contrast using color, size, shape, or contrasting styles of text. Hierarchy, a visual technique...

Continue reading "Using Proximity, White Space, Alignment, Contrast, and Repetition in Design" »