Skip to the content.

Undecidable and decidable problems w/ homeworks

Popcorn Hack 1 An algorithm can be used to solve an undecidable problem. (This is Falso))

Popcorn Hack 2 If a programmer encounters an undecidable problem, they can just use an alogirhtm that works most of the time. (This is true)

Popcorn Hack 3 Which of the following options is not an example of an undecidable problem?

A. Halting Problem

B. The Collatz Conjecture

C. Rice’s Theorem

D. Bubble sorting

The answer is Bubble sorting

Handling Infinite Loops in Modern Systems

Modern operating systems and browsers cannot always detect infinite loops because it’s an undecidable problem, but they use practical tools to manage them. For example, browsers like Chrome show an error message like “Page Unresponsive” if a script runs too long, and give users the option to stop it. Operating systems use task managers or activity monitors to detect when a program is using too much CPU or memory, allowing users to force quit it. These systems rely on timeouts, resource limits, and user input to handle problems that can’t be solved automatically, helping prevent crashes or freezes.

Graphs & Heuristics

Popcorn Hacks – Directed Graphs & Heuristics

Popcorn Hack #1

True or False:
In a directed graph, an edge from node A to node B implies that there is always a corresponding edge from node B to node A.
Answer: False
Explanation: In a directed graph, edges have direction. An edge from A to B does not mean there is an edge from B to A.


Popcorn Hack #2

True or False:
Heuristics always provide faster solutions than exact algorithms, but they may sacrifice accuracy for speed.
Answer: True
Explanation: Heuristic methods are designed to find quick, good-enough solutions. They often trade accuracy for speed.


Popcorn Hack #3

True or False:
While heuristic algorithms like the Nearest Neighbor algorithm can significantly reduce the computational time for TSP, they can never guarantee an optimal solution, and the gap between the heuristic solution and the optimal solution can grow exponentially as the number Answer: is true

HOMEWORK

How are users (nodes) and relationships (edges) represented in social networks? In social network analysis, graphs are used to model and understand relationships between people or entities. This is done through:

Nodes (vertices): These represent users or entities (like people, groups, or pages).

Edges (links): These represent relationships or interactions between users (such as friendships, follows, likes, messages, or comments).

Graphs can be:

Directed (e.g., on Twitter, where one user follows another),

Undirected (e.g., on Facebook, where a friendship is mutual),

Weighted (e.g., frequent interactions get higher weights).

This structure allows platforms to analyze influence, detect communities, and recommend connections.

Real-World Example: Facebook On Facebook, graph theory is used to:

Map users (nodes) and their friendships (edges).

Recommend new friends (using mutual connections).

Identify communities or groups of tightly connected users.

Analyze the spread of content (how posts go viral).

Detect fake accounts and unusual activity using graph patterns.