instruction
stringlengths
35
29.1k
A denotational semantic for the lambda calculus can be given by solving the domain equation $$ D \simeq [D →_c D]_\bot $$ in the category of $\omega$-complete CPOs, where $→_c$ denotes the space of $\omega$-continuous functions. The existence of an (initial) solution to this domain equation is a classic result by Scott...
For the past two days I have been on a question to understand monads in the context of Haskell. A nice explanation I found is by Graham Hutton on the Computerphile channel see here. This explanation has also been paraphrased into this nice answer on stackoverflow. It makes more or less perfect sense to me, but I am hav...
OpenAI's technical paper on GPT-3 says that GPT-3 has 175 billion parameters. Several sites (here, here) claim that these parameters are stored as single-precision floating-point numbers and so require 4 bytes of memory per parameter, but I don't see any citations for those claims. At what precision are GPT-3's paramet...
Are there any references on theoretical computer science aimed at people with a background in research mathematics? For reference, I spend my time thinking about category theory and set theory most days. I've begun programming in haskell and it feels very intuitive now that I'm starting to get the whole 'type' syntax...
( Source: Introduction to the theory of computation, Michael Sipser, 3rd edition ) I know the computation-time of a non-deterministic Turing machine ( NTM ) which is a decider is defined to be the depth of its configuration tree. In the above example of showing that $ HAMPATH \in NP $ , where it's highlighted in red -...
As per the rules of JS, Arrow functions don't have an argument Object, like a regular function inside JS. But it is also true, that we can pass arguments to the Arrow functions like any other functions. What is the data structure at play here, if not an argument object, then how does an Arrow functions references the a...
I would like to understand better how associative memory works.In associative memory we have the tag and the actual data being stored.The tag describes where the data came from but what does this mean exactly?
A $k$-regular graph is one in which every vertex has degree k. A triangle-free graph is one in which any three vertices do not form a triangle. A dominating set $D$ of a graph $G$ is a set of vertices such that $\forall v \in (V(G)\setminus D)$, $v$ has a neighbour in $D$. Is anything known about the hardness of decidi...
I am unable to understand this proof L is recursively enumerable if and only if L is Turing recognizable If anyone can prove this, that would be great help
Algorithms/Data-Structures to calculate transitive call graphs in the presence of virtual dispatch? I am trying to write a program to analyze Java programs and figure out the transitive closure of the callgraph of each main method. Consider the program below: class Foo{ void runOne(); void runTwo(); } class Bar...
Given a spring system: where the total tension between the nodes should be minimized, it seems possible that a physics simulation of this graph does not arrive at the lowest energy state, getting stuck in a local minimum instead. Is finding a positioning of nodes that achieves the lowest energy NP-hard?
I have a question I need to give the NFA of the following language: L={w belongs to (a,b)*/w starts with aa or ends with aa} with or being not exclusive meaning I can have a word that starts with aa and ends with aa. I did this: but if I turn it into the DFA I get this: but with this DFA if we have the word "baab" i...
I've been trying to fully understand the paper "Wide Neural Networks of Any Depth Evolve as Linear Models Under Gradient Descent" (available here), but I'm stuck on the linearization part, specifically section 2.2. The idea is that in the infinite width limit, the individual neural network parameters' changes vanish wh...
My problem is: Given $n$ points in $\mathbb{R}^d$, I want to find a partition of these $n$ points into $k=2$ clusters. For each cluster, instead of computing the centroid as in the usual k-means problem, I construct the one-dimensional subspace (what I call a line) minimizing the sum of squared distances between the p...
In the context of $\mathsf{\#P}$ and $\mathsf{PP}$, we have $\mathsf{\#P}$-complete problems, for example $\mathsf{\#SAT}$, however the version that I saw proves this by showing a reduction that keeps the same amount of results but not the same probability. My question is, is it also complete under probability. What I ...
A total dominating set $S\subset V(G)$ is a set of vertices such that $\forall v\in V(G)$, $v$ has a neighbour in $S$. The minimum total dominating set of $G$ is a total dominating set of $G$ of minimum possible size. The minimum total domination number of $G$ is represented by $\gamma_t(G)$.It is known that MTDS is $N...
If I go into google browser and type in the name of a website, this is the application layer of the OSI. HTTP protocol is being used and is a request-response, so when exactly does my computer send the request to the server and when do I get the response? I understand the encapsulation of data until it gets to the phys...
I need to solve the following type of problem. I have a list of many connected lines forming a closed contour. These lines come as the output of a MarchingSquare algorithm. Consequently they are lines that have their start and end points on the sides of a grid. Furthermore, the lines never intersect except at the extre...
I have a degree in maths and i am interested in learning about Convolutional Neural Networks from a mathematical/ theory point of view. Can someone point me towards some resource. I already have a basic knowledge of Convolutional Neural Networks (and other Neural Networks)
Were w is any string composed over the alphabet $\Sigma = \{0,1\}$. For the first part of the exercise I've tried decomposing the problem into three different ones, mainly the first one is for the string before the 0 the second one for the 0 itself and the third for the rest of the string after the 0. This is what I c...
if by absurdly there is a 3/2-approximation algorithm for INDIPENDENT SET then does there exist a 3/2-approximation algorithm for VERTEX COVER? the implication should be true because independent is reduced to to VERTEX COVER, right?
Edit: Since this post is gaining traction, I feel the need to clarify that the purpose of this is to see if asymptotic and constant factor estimations calculated from high level code implementations of algorithms are reasonable approximations of the true version. I am not trying to predict the speed of code when runnin...
Based on the same question asked here: Bundle diameter calculation algorithm with different wire sizes? Best answer was this: https://scipython.com/blog/packing-circles-in-a-circle/ However, there are wires in electrical design that function as a "twisted pair". Is there a way to alter the existing code above to specif...
In the below Image, S is the starting point and E is the end point. Image link Now, the Title of the video says that its a Greedy Best First Search. However, while browsing stackoverflow, I came across this answer It says that Greedy Search doesn't go back up the tree - it picks the lowest value and commits to that. an...
I have formulated the below optimization problem. \begin{align}\nonumber \hspace{-3mm}&\text{(P) minimize}\!\sum_{i}\!\alpha_{i}w_{i}\!+\!\sum_{i}\sum_{j}\!c_{ij} p_{ij}\!\\ \text{s.t.} & \sum_{i}\! p_{ij} = 1 , \forall(j) \in \mathcal{J}\\ & \sum_{j} d_j p_{ij} \leq b_i w_{i} , \forall(i) \in \mathcal{I}\\ & p_{ij} \i...
If an optimization problem A is NP-hard and P≠NP, then does there exist an instance x of A such that no polynomial algorithm provides an optimal solution for x?
What I mean by this, is let $f \in GapP$, and let $k_n =min\{k|\forall x (s.t. |x|<n):2^k > |f(x)|\}$ for every $n$, can I assume there is a nondetermenistic machine $M$ that on input $x$ does at most $k_n$ coin tosses with results in $\{0, 1\}$, and that for every $x$: $f(x)=\#(M(x)=1) - \#(M(x)=0)$, where $\#(M(x)=a...
I'm new to computing and even newer still to AI model training. However I am wondering the role of the CPU during training of LLM. I'm aware that the CPUs are good for performing strings of complicated tasks one at a time while the GPU's parallelisation means that it can perform mutiple less complicated tasks at the sa...
I have this rather weird CPU architecture for which currently only an assembler exists. I won't go into too much details about this architecture as it is not publicly available. However, some quirks of it are: It can only address full 32 bit words in memory No shift operations No internal registers. It fully operates ...
"A galactic algorithm is one that outperforms any other algorithm for problems that are sufficiently large, but where "sufficiently large" is so big that the algorithm is never used in practice." Strassen algorithm works in $O(n^{2.8074})$. There is also the Coppersmith–Winograd algorithm which runs in $O(n^{2.37188})$...
I am trying to find the first and second-order partial derivatives of a function of four variables $S$ using pythons symbolic math package sympy. The issue is that sympy does not automatically see that certain pairs of partial derivatives, when evaluated at the same arguments, are in fact equal, and so cancellations do...
I need to find the empirical mode of a sample of numbers taken from a continuous distribution (i.e. floating-point data). I can think of using an histogram, but choosing an appropriate bin size does not seem so easy. I could also count the values in a sliding Parzen window, but again, which window size ? I could also c...
I am unable to get the bound on the maximum size of a graph of order $n$ with girth $g$. Is there any literature regarding this. I know that there is an asymptotic bound on the size of a graph $G$ with even girth $2k$ and order $n$. Is there a similar one for arbitrary grith? Thanks beforehand.
Given the SMALL FACTOR problem where: INPUT: an integer N and an integer k OUTPUT: yes ⇐⇒ N has a prime factor ≤ k. I know that SMALL-FACTOR problem ∈ in NP ∩ CO-NP. If it were NP-Complete we would have that CO-NP=NP. So how can I answer the above question?
When I calculate the entropy values of files compressed with Gzip, PKZIP, 7ZIP and Winrar, I find that the compression rate of Gzip is higher than the others. The entropy value is higher (indicating less redundancy) and the file size is smaller. Even for small files, the overhead of Gzip is lower compared to the other ...
It is related to this question: https://leetcode.com/problems/product-of-array-except-self/ And assuming we cannot alter the original array, but have to allocate a same size array to store the results, that is, if the input array is 200GB, we need to allocate a 200GB array. Input 800GB, allocate extra 800GB. Input 16TB...
I have a friend who works in education. Sometimes, they need to create customized "word lists" to help students practice reading. These lists are limited in length, and must contain sufficient instances of specific orthographic properties (at least 5 2-syllable words, 3 closed syllables, etc.). I've formalized the prob...
I have a problem that I am trying to model, but I am unable to capture one particularity of the system that seems to be crucial. I will try to give an abstract description first and then the toy model hoping that someone might have an idea or a reference suggestion. Description: There is a system and I can observe one ...
Sometimes as a hobby I like to think about different possible "fundamental" abstract computing frameworks, akin for instance to Turing Machines and Lambda Calculus. In particular, I've been interested in conceptions in which a small set of 0-argument functions themselves comprise the input/output/alphabet. I ended up t...
Find an asymptotic tight upper bound for the following recursion relation: $$T(n)=5T(\frac{n}{5})+\log^2(n)$$ I tried to solve it by applying iteration: $$T(n)=5T(\frac{n}{5})+\log^2(n)=5(5T(\frac{n}{5^2})+\log^2(\frac{n}{5}))=\ldots=5^kT(\frac{n}{5^k})+\sum_{i=0}^{k-1}5^i\log^2(\frac{n}{5^i})$$ Now letting $5^k=n$, ...
In maximum flow if you have double(antiparallel) edges you just add an intermediate node and break the edge in two with the same capacity. In minimum cost flow you can do the same but break the cost also in half or use div to break in half if not even(if cost is 9 for example you break it in 5 and 4). Is this a correct...
Take the Erdos-Renyi random graph $G(n,p)$, i.e. the random graph with $n$ vertices and where each possible edge has an independent probability of $p$ of being present. Recall that a $k$-matching is a disjoint union of $k$ edges. Let $X$ be a random variable equal to the number of subgraphs in $G(n,p)$ which are isomor...
How to find and return the maximum number of edge-disjoint trails of equal length $k$ of a directed weighted multi-graph $G=(V,E)$ between arbitrary start and end vertices? The start and end vertices may be different for each trail, although they need not be different. (I'd like the output to be the paths themselves,...
If P=NP then we have W[1]=FPT. Would it just imply $k$-sum conjecture fails for some large $k$ or $k$ can be as small as $3$?
I came across this language, where M denotes a Turing Machine: PALINDROMES $:= \{M \mid M \text{ accepts strings which are palindromes}\}.$ It is proven to undecidable. And, I know one can construct a Turing Machine that decides for strings, if they are palindromes or not. Further, a set A is decidable if and only if t...
If you were to define an altered AVL tree where the balance factor (the difference between the height of the left and right subtree) of a node must be less than or equal to the depth of the node (in absolute value), would it be balanced (h is in O(log n))? How would you prove so?
Schaefer's dichotomy theorem ensures than when a constraint satisfiability problem satisfies certain conditions, the problem is either in $\mathsf P$ or is $\mathsf{NP}$-hard. Suppose the following problem: Given a monotone CNF $f(X)$ and a 2-CNF $g(X)$ such that $|g(X)|\le \log_c^k |f(x)|$ (where $|f|$ stands for the...
How to construct DPDA for the following language $L=\{a,b\}^* \setminus a^nb^n \setminus b^na^n $ $L_1 = \{a,b\}^* \setminus a^nb^n =\{a^i b^j \, | \, i>j\}\,\cup\,\{a^i b^j\ \ | \ i<j\}\,\cup\,(a+b)^* b (a+b)^* a (a+b)^*$. At this step I got stuck. What is next? How to express additional difference $b^na^n$?
I'm studying recursion and a i have a doubt about the running time complexity of the binary search. I didnt understand this passage in my book : Initially, the number of candidates is n; after the first call in a binary search, it is at most n/2; after the second call, it is at most n/4; and so on. What if n is a odd ...
A central insight of Dijkstra's shortest path algorithm is that every subpath of the shortest path is also the shortest path of the subgraph. But is that also true for the longest path? In particular, I want to find the longest path of a DAG, and I don't know if it's completely different. My problem is to find the long...
I was wondering whether the transpose of graph maintains the same size of the minimal cut in a directed graph (digraph). This may be trivial as I haven't been able to find anything here or on Google when searching for different variants of the query "directed graph transpose minimal cut preservation\conservation". I de...
I'm pretty beginner in Coq. I want to formalize negative and positive occurrence of an atom in a proposition inside coq the definition is as down below: I want to define this property as an Inductive prop so I use it with more ease in proving theorems (such as interpolation) but the problem is positively occurrence an...
We refactor code lots of times as developers. Metaphorically, our program space is an infinite-dimensional Rubik's cube. Things can be rearranged, preserving the code's action, so a "symmetry structure" is at play. You can do things in code that can be factored sort of like distributive law in a ring, but there are w...
Given an undirected graph $G$, how to reduce this problem :"Judge whether every edge of $G$ can be given a orientation such that for every vertex $v$ in $G$ has input-degree of at most $k$" to a max flow problem? I tried the method in this link where input or output degree are the same because we can change all the ori...
Recently, I have taken a Computer Science exam for the course Operating Systems. One question was as follows: Which statements about real-time operating systems are true? I selected two options, but according to the exam answers, three options were correct for this question. The following option is also correct (quot...
With regards to algorithms does anyone could explain what's exactly a free-primitive? By chance is a free-primitive any kinda sorting? I've read about that from book Algorithms Illuminated Part 1: The Basics by Tim Roughgarden page 31.
Strong Exponential Time Hypothesis states that general SAT, where clauses are not limited in length, can't be solved in time $o(2^n)$. It's proven that DPLL algorithm requires $\Omega(2^n)$ time in the worst case. CDCL algorithms, however, use more sophisticated approaches to SAT solving, primarily by using partial ass...
Google DeepMind recently published a new paper which describes how they used a reinforcement learning to discover faster sorting algorithms. A summary of the paper is here and the paper is here. It appears the reinforcement learning model is trying to write list sorting functions in assembler which are correct and effi...
Wikipedia shows graph width $k$ as the degeneracy, an ordering of the vertices $v_1,\ldots , v_k$ for which, if we orient each edge $(v_i, v_j)$ towards $i$ where $i<j$, the maximal degree is at most $k$. However, I recently came across another definition: A graph $G = (V, E)$ has width $k$ if there exists a (vertex d...
I'm trying to solve the project planning problem using DLX and exact cover matrix, but I'm struggling to find the set of constraints (columns) and the set of options (rows) to achieve this. Here is a sample that represents the main constraints of the problem. Each project have a set of tasks $\{T_1, T_2, T_3\}$ Each p...
Let $n$ be the minimum possible size of a 4-regular graph with girth $g$. Consider a graph with a minimum degree of at least four with girth $g$, can I say that the size of such graph must be at least $n$ (as each vertex has at least four neighbours, making the graph more denser than a 4-regular graph; hence, in order ...
Note: This question assumes familiarity with cons-style linked lists (e.g., from Lisp or Scheme). It also assumes familiarity with snoc-style lists. Snoc is like cons, except it appends elements to the end of the list, instead of the beginning. A cons is car/cdr pair. Alternatively, some people use the terms head/ta...
Thanks in advance for assistance and patience with my hardware naivety Reading the below answer about the NMI on pin 6 for an Apple 6502, and the signal on the pin falls from high to low, how does this get recognized by the edge detector to CPU food chain? Is there "hardware polling" (each cycle check/read a bit, chec...
I want to find "interesting" elements in a sequence of symbols that are independent of their absolute position in that sequence. Formally, I have a window size $s \in \mathbb{N}$ and a finite alphabet $\Sigma$. I'm looking for a function $f: \Sigma^s \to \{0, \; ..., \; s\}$ that points to the first interesting positio...
Is there a proven upper bound on the number of possible sorting algorithms that cannot be reduced to another sorting algorithm? Sorting algorithms with "useless steps" wouldn't count because they can be reduced by removing the useless steps. I define a "useless step" as something that can be removed from the algorithm ...
I'm reading the chapter Radix Search of the book Algorithms (Robert Sedgwick). I've made a simple implementation and something isn't behaving as expected. In program 15.5 you can see that we start with an empty tree where the head is a null node. In figure 15.12 you can see that the null node is always the leftmost nod...
Imagine there's a boat with a fixed number of seats. The boat goes on a journey with n number of stops. Here is a diagram of the journey where n = 4 The squares represent a stop. The lines represent a trip. Trips occur from each stop to every other stop that comes after it. People may go onboard at the start of a trip...
I'm trying to do some research on graph search algorithms that are practically fast on relatively dense graphs. Besides the common ones like A* or Dijkstra's, what are some graph search algorithms that give a good enough jab at the shortest path while having performance advantages compared to Dijkstra's? The graph is w...
I have a grid of cells, X cells wide by Y cells high. Each cell has four corners, NW, NE, SW and SE. Each corner is shared with adjacent neighbors; i.e., a cell's SW corner is the NW corner of the cell just below it. In any grid of (X,Y) cells, there are (X+1,Y+1) corners. In this grid, each corner can be assigned an a...
I am working on Ramanujan graphs and have encountered something that needs a suggestion. Does the girth of a Ramanujan graph change if I delete one random edge from the graph? The question can also be as follows: are there at least two edge-disjoint shortest cycles in Ramanujan graphs? If yes, the girth does not chang...
In my reference, Exercise 0.4(e), Algorithms by Sanjoy Dasgupta, Christos H. Papadimitriou, and Umesh V. Vazirani, it is given that $$ \begin{bmatrix}F_n\\F_{n+1}\end{bmatrix}=\begin{bmatrix}0&1\\1&1\end{bmatrix}^n\begin{bmatrix}F_0\\F_1\end{bmatrix} $$ Prove that the running time of $fib3$ is $\mathcal{O}(M(n))$, wher...
Let $H=\{h|h:X\to Y\}$, $|X|=n$, $|Y|=m$. $H$ is a universal hash family if Def 1. For any $x_1,\ x_2\in X$, $x_1\neq x_2$, $\left|\left\{h\in H\middle| h(x_1)=h(x_2)\right\}\right|\leq |H|/m$. (or what if $=|H|/m$ ?) Def 2. For any $x_1,\ x_2\in X$, $x_1\neq x_2$ and for any $y_1, y_2\in Y$, $$ \Pr\limits_{h\in_u H}\l...
Is time complexity of log(n+logn) is equal to theta log(n)? Can I take only the dominants from inside of a log?
Given a large dataset $D$ and multiple sets of filters that can be applied to $D$, e.g. $setA = \{filterOnColorRed\}$ $setB = \{filterOnAgeGreaterThan20\}$ $setC = \{filterOnColorRed, filterOnAgeGreaterThan20\}$ $setD = \{filterOnColorRed, filterOnAgeGreaterThan20, filterOnSizeIsLarge\}$ where each filter is expensiv...
I am looking to provide a formula saying "A graph with $n$ vertices has an independent set $X$ of size at least $n/2$" in existentional second order logic. (This is exercise 1.2. from Libkin's Elements of Finite Model Theory (see here for online pdf, page 10 of the book (or 23 in the pdf)). I can express that $X$ is an...
Are there known algorithms to find a line that intersects a given set of segments? In: A finite set of segments. Out: A line that cross all these segments or explicit answer that there is no such line. I've tried wiki and general algorithms books but found none.
An $(\alpha,\beta)$-ruling set is a set $S$ such that any two nodes in $S$ are at distance at least $\alpha$ from each other, and, for any node $v \notin S$, there exists a node $u \in S$ such that the distance between $u$ and $v$ is at most $\beta$. Let $G$ be graph which is nearly regular, with all degrees in $[k,2k]...
Take a set of $n$ points in the plane. You want to sort them by increasing abscissa. But you also want to sort them by abscissa after several arbitrary rotations, say $k$, in increasing angles. The obvious brute-force solution takes time $O(kn\log n)$. Is there a method with a better complexity ? If one considers a fu...
I have a problem where I need to find all subsets of a set that satisfy some validity function. The function has the property that if a subset is invalid, so are all its supersets, and if a subset is valid, so are all its sub-subsets. This can clearly take exponential time if, for instance, all subsets are valid. Howev...
I am learning about computational models, I wonder why Turing chose his model of Turing machines (the strip with the head and Read / Move left or right / Change state). I am suspecting his physical machine Enigma was having a stripe and behaved similarly. Is this correct? The circuit gates model seems close to what an ...
In the dragon book, section 9.2.6, why is the $OUT[B]$ initialized to $U$ except for $OUT[ENTRY]$. Wouldn't using the $OUT[B] = \emptyset \quad \forall B$ be a more conservative solution? The book gives this example: Let $IN[B_2] = OUT[B_1] \cap OUT[B_2]$ $OUT[B_2] = G \cup (IN[B_2] - K)$ and $I^j, O^j$ be the $j$th a...
I'm trying to understand how the system's call stack works internally when a recursive function is called. Specifically, I'm looking at a function that computes the maximum depth of a binary tree using a postorder traversal. I do know there is a stack solution out there, but I would one that mimics the internal call as...
How do I Verify that $n\log n=\Theta(10n\log10n)$ I think I need to prove that there exists $c_1,c_2>0$ such that $c_1.g(n)\le f(n)\le c_2.g(n)$ Step 1 $$ \log n\le \log 10n\implies f(n)=n\log n\le 10n\log 10n=g(n)\\ f(n)\le c_2.g(n)\implies f=O(g) $$ Step 2 $$ n\log n\ge\frac{1}{10\log 10}\big[10n\log 10n\big]=\frac...
How the story begins? I was learning about Red Black Trees on my own. When one opens the Wikipedia article, it can be read: (Conclusion) If a node N has exactly one child, it must be a red child, because if it were black, its NIL descendants would sit at a different black depth than N's NIL child, violating requiremen...
Question: What are the current main challenges in TCP congestion control algorithms? Are there any foundational trade offs that algorithms need to make? E.g. minimizing router buffer sizes while quickly reacting to available bandwidth on noisy links? Context: I was reading some of the old discussions from 20 years ago ...
I can solve the following problem by Jeff Erickson in $O(n^3)$(and maybe in $O(n^2logn)$) time but how is the $O(n^{3/2} log(n))$ time solution possible? Let $D[1 .. n]$ be an array of digits, each an integer between $0$ and $9$. A digital subsequence of $D$ is a sequence of positive integers composed in the usual way...
I'm writing a graph traversal function to be used in a garbage collector. To avoid stack overflow, I used a finite state machine. Roughly, it descends into child nodes recursively to mark objects, and return to root (to descent down again) whenever a branch is exshausted. However, I realized that if there's loop in the...
I have a doubt related to pumping lemma in CFL for which I dont find an answer, so I think is very easy because no one wonder about. The lemma says: My doubt is: Is there any restriction related to strings u (the most left) and y (the most right), I mean can they be empty?. In case they can, I cannot proof that a^nb^n...
My textbook gives the equation for the power dissipation $$ P=CV^2 f $$ but after reading it a couple times, I can't get very clear on exactly what each of these is measuring. It describes $P$ as the "power dissipation", which I take to mean something like the heat lost to the environment as the current passes through...
Both MAX-CUT and MAX-3-CUT are known to be NP-complete. This post shows a reduction from MAX-CUT to MAX-3-CUT. I am curious if there is a way to reduce MAX-3-CUT to MAX-CUT? MAX-CUT: Given an undirected graph $G=(V,E)$, a weight function $w:E\to\mathbb{N}$, and $k\in\mathbb{N}$, determine if there exists a partition $(...
I have recently reviewed the new article by DeepMind (Google) in Nature named "Faster sorting algorithms discovered using deep reinforcement learning". They claim that branchless algorithms, such as sort4, maintain full correlation between the algorithm length and its latency (Table B.5 in the supplementary material). ...
I'm having a lot of troubles understanding a preparation exercise about oriented graphs: Consider the following game played on a directed graph G = (V, E) with n nodes and m edges. A pawn is initially placed on node s. The pawn can be moved from its current position u to a node v if there exists a directed edge (u, v)...
I am looking for a variant of the knapsack problem in which the items are nodes in an undirected graph, and the knapsack must be filled with a connected subgraph. Formally: The input is an undirected graph $G=(V,E)$, where each node $v\in V$ has both a size and a value; and a knapsack capacity $C$. The goal is to find...
There are $n$ people and $m$ jobs. We would like to assign at most one job to each person. For each person,job pair, there is a positive value determining the fitness of this person to that job. The goal is to find an assignment that maximizes the total value. So far, it is exactly the problem of finding a maximum-weig...
Suppose we have sets $X$ and $Y$, $|X|=m$, $|Y|=n$. $H$ is a universal family of hash functions from $X$ to $Y$. Let $S\subsetneq X$ be a proper subset of $X$. Does there exist some "partial" universal hash family that is universal on $S$ to $Y$, but not necessarily universal on $X$ to $Y$? The circuit complexity of th...
All of the discussion is in the context of this paper. I think that the whole procedure that the paper describes is not decidable, because if we can have an algorithm for it, then we can solve halting problem. I begin with the definition of termination, which has not been expressed in the paper. First thing that comes ...
Given: A planar undirected connected graph $G$ in which degree of every vertex is $2$ or more. Fact: A planar graph can have multiple planar embeddings. Question: Give an efficient algorithm to find the set $S$ of face cycles corresponding to any one of the planar embeddings. We do not care about from which specific em...
Consider the following algorithm: We are given a planar graph $G$. We initialise a set of vertices $S$ to an empty set. We randomly pick a vertex $v$ in $G$ and insert it in $S$. Now we keep including in $S$ vertices from the neighbourhood of $S$ such that the vertex we include is adjacent to exactly one vertex in $S$....
Find the equivalence classes of a nerode theorem and use equivalence classes to construct a reduced DFA for the following language: $^+(+)^*$ The answer: $,^+,^+^∗+^+^+,(+)Σ^∗+⋅(+)Σ^∗$ I figured that the minimal base for the language is $a^+$ and for the $^+^∗+^+^+$ its just multiplying the expression with $(+)$ but ...
I have read that a decrease in response time does not necessarily entail an increase in throughput, but I'm struggling to understand the exact way that this can happen. What I'm imagining is a server receiving requests from several different connected devices. Say computer A sends a request and the server starts work...