Translate word problems into discrete structures (graphs, sets, - Discrete Math

Start this quiz

  1. A university course scheduling system needs to assign time slots to courses such that no student has a conflict. Each course has a list of students enrolled. What discrete structure best models this problem, and what does finding a solution correspond to?
    Answer: A graph where vertices are courses and edges connect courses with common students; finding a proper vertex coloring with minimum colors This is a graph coloring problem. Courses are vertices, edges connect courses that share students (creating conflicts), and colors represent time slots. A proper coloring ensures no adjacent vertices (conflicting courses) have the same color (time slot). Choice B models course-student assignment but not scheduling conflicts. Choice C models prerequisites, not enrollment conflicts. Choice D doesn't capture the conflict relationships between courses.
  2. A university course scheduling system must ensure that no student has conflicting exam times. Each course has exactly one exam, and students can be enrolled in multiple courses. Two courses conflict if they share at least one student. The system needs to assign exam time slots such that conflicting courses have different time slots. What type of discrete structure best models this problem, and what is the optimization goal?
    Answer: Create an undirected graph where vertices are courses and edges connect courses with shared students; find a proper vertex coloring with minimum colors This is a classic graph coloring problem. Courses are vertices, edges represent conflicts (shared students), and colors represent time slots. We need a proper coloring (adjacent vertices have different colors) with minimum colors to minimize time slots. Choice A models enrollment but doesn't capture the conflict structure. Choice C incorrectly models prerequisites rather than enrollment conflicts. Choice D focuses on students rather than course conflicts.
  3. A logistics company needs to model package delivery routes where drivers start at a central depot, visit multiple delivery locations exactly once each, and return to the depot. The company wants to minimize total travel time while ensuring each route takes no more than 8 hours. Drivers can carry at most 20 packages, and some locations require special handling equipment available on only certain vehicles. How should this be modeled?
    Answer: As a vehicle routing problem using a complete weighted graph with additional constraint sets for time limits, capacity limits, and equipment requirements This is a constrained vehicle routing problem (VRP), which extends the traveling salesman problem to multiple vehicles with various constraints. It requires a complete weighted graph for distances plus separate constraint structures for capacity, time, and equipment. Choice A (MST) doesn't require returning to depot or visiting locations exactly once. Choice C (bipartite matching) doesn't model the routing aspect or return trips. Choice D (shortest path) doesn't capture the multiple-vehicle or cycle requirements.
  4. An online marketplace needs to detect fraudulent seller networks where multiple seller accounts are controlled by the same entity to manipulate reviews and rankings. The system has data on sellers, products, customer reviews, and shared characteristics like IP addresses, bank accounts, and shipping addresses. Fraudulent networks typically share multiple characteristics and have unusual review patterns between network members. How should this be modeled for fraud detection?
    Answer: Create a multi-layer network with separate layers for different relationship types (shared IPs, accounts, addresses), then find overlapping communities across layers When you encounter network-based fraud detection problems, think about the complexity of relationships involved. Fraudulent networks typically exhibit multiple types of connections simultaneously, and single-layer approaches often miss the full picture of coordinated behavior. The correct approach is C because fraudulent seller networks are characterized by multiple, overlapping relationship types. A multi-layer network captures shared IP addresses in one layer, shared bank accounts in another, and shared shipping addresses in a third layer. Finding overlapping communities across these layers reveals sellers who share multiple characteristics simultaneously—the hallmark of coordinated fraud. This approach also detects sophisticated fraudsters who might vary some characteristics while maintaining others. A is flawed because a bipartite graph only shows seller-to-characteristic relationships, not seller-to-seller connections. Dense subgraphs here would show popular characteristics (like common IP ranges) rather than coordinated networks. B oversimplifies by collapsing all relationship types into single edges. This loses crucial information about which specific characteristics are shared and makes it impossible to distinguish between coincidental single connections and systematic multi-characteristic sharing. D focuses on individual transactions rather than seller relationships. Strongly connected components in transaction graphs reveal transaction flows, not seller network structures. This approach misses the account-level coordination that defines fraudulent seller networks. Study tip: For network fraud detection problems, look for approaches that preserve multiple relationship types and can identify overlapping patterns—fraudsters typically leave coordinated fingerprints across several dimensions simultaneously.
  5. A database system stores information about employees, departments, and projects. Each employee works in exactly one department, each department has multiple employees, employees can work on multiple projects, and projects can have employees from different departments. The system needs to efficiently query: 'Find all employees working on projects that have at least one employee from the Marketing department.' What discrete structure best supports this query?
    Answer: Three separate sets with binary relations works_in(employee,department)works\_in(employee, department) and assigned_to(employee,project)assigned\_to(employee, project), using relational algebra operations This is fundamentally a relational data problem requiring set operations and joins. The query needs to: (1) find Marketing employees, (2) find their projects, (3) find all employees on those projects. Relational algebra with separate entity sets and relation functions naturally supports these operations. Choice A doesn't efficiently support the complex join operations needed. Choice B (hypergraph) unnecessarily complicates the employee-project relationship. Choice D stores department information incorrectly as edge weights rather than employee attributes.
  6. A logistics company needs to determine the minimum number of delivery trucks required to service all neighborhoods in a city. Each truck can only service neighborhoods that are directly connected by roads, and the company wants to ensure every neighborhood is covered by exactly one truck. The city's road network forms a connected planar graph with 20 neighborhoods and 35 roads. What type of discrete optimization problem is this?
    Answer: Minimum dominating set problem where each truck must be positioned to cover all neighborhoods within distance 1 This is a dominating set problem. Each truck (dominating vertex) must service (dominate) its neighborhood and all adjacent neighborhoods. We want minimum trucks to cover all neighborhoods exactly once. Choice B focuses on equal-sized partitions, not minimum coverage. Choice C covers edges (roads) rather than vertices (neighborhoods). Choice D assumes pre-existing components rather than finding minimum coverage.
  7. A social media platform wants to model friendship relationships among users to detect potential spam accounts. Each user can be friends with any other user, friendships are mutual, and a user cannot be friends with themselves. Spam accounts typically have very few mutual friends with legitimate users. Which discrete structure would be most appropriate for modeling this scenario, and what property would be most useful for spam detection?
    Answer: An undirected graph where vertices represent users and edges represent friendships; analyze the clustering coefficient of each vertex Since friendships are mutual, an undirected graph is appropriate. The clustering coefficient measures how many of a user's friends are also friends with each other, which directly relates to mutual friends. Choice B is wrong because friendships are mutual (undirected), not requests. Choice C incorrectly suggests a bipartite structure when the relationship is among users themselves. Choice D focuses on total connections rather than the mutual friend pattern that identifies spam.
  8. A project manager needs to schedule tasks for a software project where some tasks cannot begin until others are completed, and some tasks require the same specialized equipment and cannot run simultaneously. Given the precedence constraints and resource conflicts, what combination of discrete structures best models this scheduling problem?
    Answer: A directed acyclic graph for precedence constraints and a separate conflict graph for resource sharing; solve as a constrained graph coloring problem The problem has two kinds of constraint, and each one needs its own structure. Precedence is one-directional ("B cannot start until A finishes"), so it belongs in a directed acyclic graph; a cycle would mean no valid order exists. A resource conflict is symmetric ("A and B cannot run at the same time"), so it belongs in an undirected conflict graph. Giving conflicting tasks different time slots is a coloring of that graph, subject to the precedence order: a constrained graph coloring problem. Swapping the structures puts direction on the symmetric conflicts and drops it from precedence, which is exactly the part that needs it. A bipartite task-resource flow model handles assignment, not ordering. A single directed graph with the critical path method handles precedence only; it cannot represent "not at the same time".
  9. A cybersecurity analyst needs to model potential attack paths in a network where an attacker can move from one compromised system to another if they share certain vulnerabilities or trust relationships. The goal is to identify which systems, if properly secured, would prevent the attacker from reaching critical servers. What graph-theoretic concept best describes these critical systems?
    Answer: Minimum vertex cut between the attacker's entry points and critical servers in the network topology graph When analyzing network security problems involving attack prevention, you need to identify which graph concept best models the relationship between systems and the goal of blocking attackers. The key insight is recognizing this as a flow control problem where you want to disconnect sources (entry points) from targets (critical servers). A minimum vertex cut represents the smallest set of vertices that, when removed, disconnects two parts of a graph. In this context, it's the minimum number of systems that must be secured to completely block all paths from attacker entry points to critical servers. This directly answers the question of which systems are most critical for prevention. Option A describes articulation points, which are vertices whose removal increases the number of connected components. While these identify important systems, they don't specifically focus on protecting critical servers from entry points—they just identify systems whose failure fragments the entire network. Option B focuses on independent sets in vulnerability graphs, which would identify systems that don't share vulnerabilities. However, this doesn't address blocking attack paths or protecting specific targets. Option D describes dominating sets, which ensure every vertex is either in the set or adjacent to it. This is more about monitoring coverage than blocking specific attack paths between entry points and targets. Remember: when you see cybersecurity questions about blocking attackers from reaching targets, think about graph cuts and flow problems. The minimum vertex cut gives you the most efficient way to sever connections between two specific parts of a network.
  10. A cybersecurity system monitors network traffic to detect potential intrusions. The system tracks which computers communicate with which others, the frequency of communication, and whether communications are initiated internally or externally. An intrusion is suspected when an external computer communicates with many internal computers that don't normally communicate with each other. What modeling approach best supports this analysis?
    Answer: A directed graph with vertex attributes for internal/external status, edge weights for frequency, and analysis of star subgraphs centered on external vertices The intrusion pattern described is an external computer (hub) communicating with many internal computers (star pattern). Direction matters (who initiates), frequency is important (weights), and internal/external status is crucial (vertex attributes). The analysis specifically looks for star subgraphs. Choice A lacks the internal/external distinction. Choice B loses direction information needed to identify initiation. Choice C forces a bipartite structure that doesn't capture internal-to-internal communications that establish normal patterns.
  11. A university registrar needs to assign students to dormitory rooms such that no student shares a room with someone they have requested to avoid. The registrar has a list of 200 students and 850 mutual avoidance requests. If each room holds exactly 2 students, what graph theory problem must be solved to determine if a valid room assignment exists?
    Answer: Find a perfect matching in the complement of the conflict graph where vertices are students and edges represent avoidance requests We need to pair students into rooms such that no pair has an avoidance request between them. The conflict graph has edges for avoidance requests. Its complement has edges between students who CAN room together. A perfect matching in this complement graph gives a valid room assignment where every student is paired with a compatible roommate. Choice A doesn't model student-student compatibility. Choice C would assign students to two groups, not specific roommate pairs. Choice D requires visiting all students in sequence, not pairing them.
  12. A smart city traffic management system optimizes traffic light timing at intersections. Each intersection has sensors that detect approaching vehicles, traffic lights can be in one of several states (red, yellow, green for different directions), and state changes must follow safety rules (e.g., cannot go directly from green in one direction to green in the perpendicular direction). The system needs to minimize average vehicle wait time while ensuring safety. What discrete structure best models this problem?
    Answer: A finite state automaton where states represent traffic light configurations and transitions represent safe state changes, with optimization on transition timing Traffic light control is fundamentally a state machine problem where each intersection cycles through valid light configurations (states) according to safety rules (transition constraints). The optimization involves timing these transitions based on traffic sensors. Choice B models the road network but not the light control logic. Choice C doesn't capture the sequential nature of light state changes or safety transition rules. Choice D focuses on individual vehicles rather than intersection control systems.
  13. A database administrator needs to ensure that sensitive employee records are only accessible to authorized personnel. There are 5 departments (A, B, C, D, E) and the access rules are: A can access B and C's records, B can access C and D's records, C can access D's records, D can access E's records, and E cannot access any other department's records. What is the minimum number of security clearance levels needed, and how should they be assigned?
    Answer: 5 levels: A(5), B(4), C(3), D(2), E(1) where higher numbers represent higher clearance Treat each access rule as a requirement that the accessing department has strictly higher clearance than the department whose records it reads. The rules give A > B, A > C, B > C, B > D, C > D and D > E. Following A > B > C > D > E, every department sits on a single chain of five, so five distinct levels are required, and A(5), B(4), C(3), D(2), E(1) satisfies every rule. Giving D and E the same level fails because D must access E's records, which needs D above E. Giving C and D the same level fails because C must access D. Using three levels with A at the bottom reverses the direction of every rule. The longest chain of required strict inequalities sets the minimum number of levels.
  14. A streaming service wants to recommend movies to users by identifying groups of users with highly similar viewing preferences and groups of movies that are frequently watched together. The service has viewing data showing which users watched which movies. What discrete structures should be used to model both types of groupings simultaneously?
    Answer: A single bipartite graph with users and movies as vertex sets, then find dense subgraphs that include both users and movies Viewing data is naturally a bipartite graph: one vertex set of users, one of movies, and an edge whenever a user watched a movie. A dense subgraph of that graph (ideally a near-biclique) is a set of users together with a set of movies that those users all watched, so a single structure yields a group of similar users and the group of movies they watch together at the same time. Projecting the bipartite graph onto users and onto movies and clustering each projection finds the two kinds of groups separately; the projections discard which movies link which users, so the groups are not found simultaneously and may not correspond. Two independently built similarity graphs have the same problem. A hypergraph of each user's watched set records the data but overlapping hyperedges do not directly give both groupings.
  15. A task scheduling system manages project workflows where some tasks must be completed before others can begin, tasks have estimated durations, and some tasks can be performed in parallel. The system needs to determine the minimum project completion time and identify which tasks are critical (any delay in these tasks delays the entire project). Which modeling approach addresses both requirements?
    Answer: A directed acyclic graph with tasks as vertices, dependencies as edges, and vertex weights as durations, computing the longest path to identify critical tasks When you encounter project scheduling problems involving task dependencies, durations, and critical path analysis, you're dealing with a classic application of directed acyclic graphs (DAGs) and the Critical Path Method (CPM). The correct approach uses a DAG where tasks are vertices, dependencies are directed edges, and vertex weights represent task durations. To find the minimum project completion time, you compute the longest path from start to finish—this might seem counterintuitive, but since weights represent durations, the longest path determines when the project completes. Tasks on this longest path are critical because any delay in them delays the entire project. Option A uses topological sorting, which finds a valid ordering of tasks but doesn't identify critical tasks or compute minimum completion time—it just ensures dependencies are respected. Option B mentions strongly connected components, but DAGs by definition have no cycles, so this approach is fundamentally misapplied. A task scheduling problem requires directed edges to represent dependencies, making this inappropriate. Option C uses an undirected graph and seeks a maximum weight independent set, which would find the most time-consuming tasks that don't conflict with each other—completely missing the dependency relationships that define the scheduling problem. The key insight is that critical path analysis requires computing longest paths in a weighted DAG, where path length represents total duration. Remember: in scheduling problems, "critical path" always means the longest path through the dependency network, identifying bottleneck tasks that control project timing.
  16. A genetic research lab studies inheritance patterns in a population. They track family relationships, genetic markers, and disease occurrence. The research focuses on identifying genetic markers that appear in individuals who have the disease and also appear in their ancestors, but are absent in healthy family members. Each person has exactly two biological parents (if known), and genetic markers are inherited from parents. What discrete structure best models this for the research goal?
    Answer: A directed acyclic graph representing family lineage with vertex attributes for genetic markers and disease status, analyzing paths from ancestors to descendants Family inheritance requires a directed acyclic graph (family tree) where edges show parent-child relationships and direction indicates inheritance flow. The research goal requires tracing marker inheritance paths from ancestors to diseased descendants. Choice B loses the inheritance direction and generational structure. Choice C restricts to binary trees, which can't represent cases where both parents are known and may themselves be related. Choice D loses the family relationship structure essential for inheritance analysis.
  17. A social media platform wants to identify groups of users who all follow each other mutually to suggest "close friend circles." Given that the platform has millions of users and follows relationships, what specific discrete structure and computational problem does this represent?
    Answer: Finding maximal cliques in an undirected graph where vertices are users and edges represent mutual follow relationships A group where everyone follows everyone else is a clique in the mutual follow graph. We want maximal cliques (cannot be extended). Choice A finds strongly connected components in directed graphs, but we need complete subgraphs. Choice C relates to network flow and connectivity, not complete subgroups. Choice D finds critical vertices for connectivity, not complete subgroups.
  18. A telecommunications company needs to place cell towers to provide coverage to all residential areas in a region. Each tower has a fixed coverage radius, and the goal is to minimize the number of towers while ensuring every residential area is within range of at least one tower. If residential areas and potential tower locations are modeled as points on a coordinate plane, what discrete optimization problem does this represent?
    Answer: Geometric set cover where each potential tower location defines a circular coverage area and we seek minimum towers to cover all residential points This is a geometric set cover problem. Each potential tower location defines a circular coverage set containing all residential areas within its radius. We want the minimum number of towers (sets) such that every residential area (element) is covered by at least one tower. Choice B considers distances and costs beyond just coverage. Choice C connects areas through networks rather than covering them. Choice D partitions space but doesn't minimize tower count.
  19. A recommendation engine needs to suggest products to customers based on purchase history. The system has three types of entities: customers, products, and categories. Each product belongs to exactly one category, customers purchase multiple products, and the goal is to recommend products from categories that similar customers have purchased. Which modeling approach best captures these relationships?
    Answer: Three separate sets (customers, products, categories) with two relation functions: purchases(customer, product) and belongs_to(product, category) This scenario involves multiple entity types with different relationship structures that are best modeled using sets and relations. The purchase relationship is many-to-many between customers and products, while belongs_to is many-to-one from products to categories. Choice A loses the category structure. Choice C incorrectly suggests a hierarchical relationship where customers depend on products. Choice D loses the individual product information needed for detailed recommendations.

Start this quiz