instruction
stringlengths
35
29.1k
I am studing a PHD framework which the propose is to reduce the dataset with the most representative samples for training a classifier. Maybe I am loosing something, but I could not undestand a specific part. Basic this is the algoritm 1 proposed: Question 1: line 7 says it will union 'edge (s,t)'. What it means? It m...
Fix an optimal solution G∗ to k-Cycle-Free Subgraph. Partition the vertex set V of G randomly into two subsets, A and B, each of size n/2, and remove edges internal to A or B. In expectation, the fraction of edges in G∗ that remain after this process is 1/2. With probability at least 2/3 the fraction of edges in G∗ tha...
I found this question in the exercise of Tanenbaum (operating systems): Two processes, $A$ and $B$,each need three records $1, 2, \text{ and } 3$ in a database. If $A$ asks for them in the order $(1, 2, 3)$ and $B$ asks for them in the same order, deadlock is not possible. However, if B asks for them in the order $(...
I'm trying to solve the recurrence $$T(n)=2T(\sqrt{n})+\log n$$ using the master theorem. Which case applies here?
For a changing directed graph, I would like to maintain information about strongly connected components. The graph operations are incremental: only vertex addition and edge addition. What data structures achieve the best known amortized complexity for these operations? If the graph was undirected, the answer would be t...
I am going through the online course MIT OCW 6.006, lecture 1. It introduces a binary search algorithm that finds a peak in O(lgN) time. A peak A[i] is defined as A[i]>=A[i-1] and A[i]>=A[i+1]. But I wonder what if the definition takes the equal sign out A[i]>A[i-1] and A[i]>A[i+1], a peak is defined as an element that...
I've been wondering if research of these algorithms exists. An example, let's say I'm fine with $p$% of possible inputs of size $n$ to be unsorted. Is there an algorithm that would allow me to sort $n$ integers in sublinear time with a guarantee that $(100-p)$% of all possible inputs will be sorted. Algorithms don't ha...
I want to implement a program that splits a set $S$ of $n$ points in the plane into two sets such that the distance of the convex hulls of the two sets is maximized. It should be done in $O(n^3)$. I have several ideas but I'm not sure whether they are correct: I sort points by $X$ and then for each two points I find ...
Is every language (including languages over alphabet having infinite symbols) which is not recursively enumerable, uncountable? In other words, let $R$ be the set of languages (including languages over alphabet having infinite symbols). For all $L$, belonging to $R$, that are not recursively enumerable, can it be s...
I have an assignment that I have to do and the question is Draw a DPDA that accepts the language L = {ba(bb)^(n+1)a^(n – 1) |n > 1}. Im not looking for the answer but rather some direction. I would like to understand the 'n' powers. Currently my understanding of the above language is that it will start with ba (obvi...
I'm trying to learn the Big O Notation...and I got a bit confused by this article: https://brilliant.org/practice/big-o-notation-2/?chapter=intro-to-algorithms&pane=1838 where it stands that f(x) = 4x and g(x) = 10x, (...), and that one could look at the Big O Notation by dividing f(x) by g(x): 10x/4x Shouldn't it be ...
was doing coin change problem as an assignment(didnt know before), after came with this solution i checked the solutions available couldnt find a similar one like this, just curious. removing the element from the list is O(N) so seems this also O(N^2) right? def rec_coin(target,coins): if target == 0 or coins == []...
I was trying to modify the Floyd–Warshall's algorithm to take into account the weights over the vertices, in addition to the weight of the edges, while computing the shortest path. The length of a path from vertex A to an adjacent vertex B, Path(A,B) , is defined as: Vertex_Weight(A) + Edge_Weight(AB) For a vert...
I have to find the maximum, minimum, and average height of a BST with n nodes. After doing some researching I found that the maximum height is $n-1$ and the minimum height is $\log_2(n+1)-1$. My question is how do I get the average height of a BST with n nodes?
$\mathrm{NP}$ has not been separated from constant-depth circuits consisting of solely $\mathrm{Mod}_6$ gates. So, the question is whether current techniques are enough to deduce interestingly unintuitive consequences of that bizarre claim.
A tree is a special kind a graph. However, I came across a data structure which is a like a rooted tree, but where nodes are authorized to have direct links to any of their descendants. Shortcuts if you will. This is not a tree anymore. This is a specialized DAG that has more restriction. That is, it has a single root ...
I couldn't find a good answer to how this formula was derived for the divide and conquer algorithm in a 1D Peak-Finding problem. About the problem Basically, there's an array of numbers and we want to find a peak in this array (a peak is a number higher than the two numbers to the left and right of it). The formula ...
Why do we consider the sequence "3,3,4,5,2" a bitonic sequence? In the sequence, "3,3,4,5,2", the sequence is constant for "3,3", increasing for "4,5", and decreasing for "5,2".
I wanted to know if there is good resource to learn about the ADTs like set ADT, list, array, boolean etc and their implementation.
(The notations used: $\oplus$ is XOR operator $\odot$ is XNOR operator) I was solving a problem, where they asked which of the given options give equation for the difference of full subtractor. The circuit in the solution option was: For me the first line: $(x'y'+xy)'z'+(x'y'+xy)z$ looked more like $x\odot y\odo...
I would like to get some opinions about using a context free grammar to generate sample utterances for Amazon Alexa/Google Assistant skills. When developing these skills one has to provide a large number of sample utterances, i.e. sentences with which a user could try to invoke a particular feature of the skill. So whe...
I'm looking for a generic algorithm to optimally combine elements of a list. I'm not sure if it even exists, but I believe some kind of divide-and-conquer algorithm could exist. In my specidifc case, optimally combining the score means minimizing, but that's probably not important Formally stated: We have the function...
{Q} = {n>0} C1 = i := 1; C2 = c := 1; C3 = p := 0; {P} = {i<=n, p = fib(i-1), c = fib(i)} My lack of understanding towards the rule of consequence in hoare logic is blocking me from find the solution which i hope someone can shed some light on how can i approach this with minimal abstraction of the process. {R} = {i<=n...
I'm working on a scheduling algorithm that schedules a set of events with an event duration to a set of agents with various working times. However, some events require more than one agent to be assigned to them to be completed. The event must be completed by both agents simultaneously. Does anybody know of an algorithm...
Dancing Links: wikipedia article, research paper is an implementation of algorithm X for exact cover problem. In the Knuth's research papaer, linked above it is shown how Polymino problem (that is covering a given shape with given sets of Polymino) is translated to exact cover problem, so that dancing links can be used...
I'm trying to setup a primary and secondary on call schedule with 6 people. I'm trying to schedule people to be on call, so that they will be paired with everyone and they have the longest "break" between their schedules. Ex for one rotation: week: 1 2 3 4 5 6 7 8 9 10 11 ... primary: 1 2 3 4 5 6...? seconda...
A Bitonic Sequence is a sequence of numbers which is first strictly increasing then after a point strictly decreasing. According to the definition of a bitonic sequence, we know that a graph of a bitonic sequence can have at most one "peak" and one "valley". So, why is the sequence 1,3,2,4 not a bitonic sequence? I ha...
Is preorder traversal enough to check if a tree is subtree of a binary tree? Are there any scenarios which I can miss if I use just the preorder traversal? What other methods can be used to check if a tree is subtree? Also, what happens if my binary tree contains non-unique values at nodes?
I understand that TM is a 'Model of Computation' which tells us about the computational power of a machine while Von Neumann Architecture is a 'System Architecture' that tells us about how the machine is actually been implemented. Also, I think of 'Programming Paradigms' as how a problem is modelled in a High-Level Lan...
Here is a problem that I've been given to solve in time $O(n^2|\Sigma|)$. Given an alphabet $\Sigma$ and the product of every two elements in this alphabet (i.e., an arbitrary mapping $\cdot\colon \Sigma^2 \to \Sigma$), find an algorithm that determines whether we can parenthesize the expression $x_1 \cdot x_2 ֿ\cdot...
In Concrete Mathematics Textbook by Donald Knuth and Oren Patashnik , ch.2 Sum ,sec2.2 He wrote: The average number of comparison steps made by quicksort when it's applied to $n$ items in random order satisfies the recurrence : $$C_0=0;$$ $$C_n = n + 1 + \frac{2}{n}\sum_{k=0}^{n-1}C_k$$ The question is how he g...
What would these statements mean if f(n) and g(n) are functions over natural numbers? g(n) is in Θ(f(n)). and An algorithm is in the complexity class Θ(f(n)).
Knuth's Algorithm X (described here in more details) prescribes that we select a column deterministically (but arbitrary), when we backtrack rows we do not backtrack columns, so we do not have an opportunity, to "rewind", select a different column and try again, during the course of the algorithm. How can we be sure, t...
Given two arrays of the same length $n$: $A = \{a_1,a_2,\dots,a_n\}$, $B = \{b_1,b_2,\dots,b_n\}$, I have to maximize the following expression: $$\frac{a_{i_1} + a_{i_2} + a_{i_3}+ \dots + a_{i_k}}{b_{i_1} + b_{i_2} + b_{i_3}+ \dots + b_{i_k}}$$ Where $k \lt n$. Given the constraints: Firstly, when you select a particu...
Problem inputs is an ordered array $A = [a_1, a_2, \ldots, a_n]$ with $\text{weight}(a_i) = w_i$. We define a $subgroup$ of $A$, denoted by $B$, whose elements' indices are continuous in integer. For example, if $A = [a_1, a_2, a_3, a_4, a_5]$, then $[a_2,a_3, a_4]$ is a subgroup of $A$, while $[a_1, a_3, a_4]$ is not...
I have just started reading about fitness landscapes and I couldn't understand what the peak means. What does the peak mean?
Programming courses are about 30% of my computer science degree. Also at my university, around 15-20% of the degree are applied math courses. What other areas/fields are covered? For the majority of ABET accredited universities? The question that inspired this post was "should i study computer science if I'm only inte...
I am not sure this is the right forum to ask. For a machine learning training, I need a dataset of old top news by keywords that can be organized by date. From where I can download it? I have seen that Google News API can provide only real time news.
Say, I have one of the standard implementations of a hash table: chaining or open addressing, and my hash key is a pair of strings. Instead of using the hash table with the pair as a key, I can use the first key to get to a "sub" - hash table, and then use the second key to find the element from it. How do these strat...
Suppose we have a peer to peer network of, say, $n$ peers. Peers communicate by an asynchronous randomized gossip protocol (Push, Pull, Push/Pull doesn't really matter here). The task is for any local peer to get an (approximate) picture of the global communication in all of the network over time. I mean after some ti...
Given a 4096-bit integer $x$ and a 4096-bit RSA modulus $N$ (of unknown factorisation) what is the fastest circuit to compute $x^{2^T} \mod N$ where $T=2^{40}$. That is, what is the fastest parallel-time (i.e. lowest latency) algorithm for repeatedly squaring $x$ modulo $N$ a trillion times? For context, I am looking t...
Suppose that I have a graph $G = (V,E)$, given as an incidence matrix of edges and vertices. Suppose that $G$ is planar, that is, it can be embedded in the plane without edge crossings. I would like to construct in the combinatorial map corresponding to some (any) planar embedding. That is, corresponding to each planar...
I am trying to do the formal semantics (Montague grammar, abstract categorial grammar) of natural language and encode the sentence John is boss. The type system has to primitive types - e for entity and t for Boolean type. John has type e, is has type (e->t)->(e->t) and boss has type (e->t). The the full sentence is tr...
As the title states I'm trying to write an algorithm that generates accepted strings to an upper bound from a given DFA. It should not generate more strings than the upper bound n if it contains cyclic patterns, because obviously I can't print an infinite amount of strings, which leads me to my problem. Machines with ...
I was reading about the page cache Page cache - the cache in memory for files, but I couldn't find the answer to my question. Does the page table have anything to do with, or maintain any entries, for the page cache? My guess is no, despite the similar sounding name, as the page table only stores entries for text/code,...
Consider n buckets that contain from 0 to x items. From time to time something is added (moved, removed) to (between, from) any bucket(s). Once in a while runs something that will have to calculate what items have to be moved from their bucket to another with minimal amount of moves so number of items in each bucket wi...
"Can QTM (Quantum Turing machine) solve halting problem" Why not have an immediate answer "No QTM Can't do this", we know that Turing proved it impossible when DTM , i meant , " Why we cant use the same proof which turing use it" Let H be a program in a quantum turing machine that will solve the issue of halting , why ...
I am reading Operating Systems: Three Easy Pieces, but I can't fully understand the following paragraph. It's from the 6th chapter of the book. I think it's self-contained, so I quote here. Note that there are two types of register saves/restores that happen during this protocol (context switch). The first is when the...
I am studying pumping lemma from Introduction to theory of computation by Michael Sipser. I wanted to check if the language generated by regular expression a(b*)c(d*)e can be proved to be regular using pumping lemma. The string generated by this expression are of the form. abcde abbcdde... We can not write these st...
In Dybjer's Inductive Families the author present a method to derive an eliminator/induction principle for every inductive family of types. In particular for the type of finite lists, namely $$List' \colon (A \colon set) (n \colon N) set$$ we get the eliminator $$\begin{align*} listrec' \colon &(A \colon set)\\ & (C \...
Can I get a bit of help over here, I can't seem to get to a finish point with this code complexity. I have trouble with making notations, exponential ones in particular..... I spent hours with this particular piece of code to get BIG O but i can't mathematically..... I'm a newbie. I tried to logarithmate the whole thin...
My approach to the problem has been to reformulate it into something more recognizable, but I don't know the best way to solve the reformulated problems either. I list the original problem, an example, and two reformulations below. The second reformulation is equivalent to an unbalanced assignment problem with a binary...
I am not sure if the names of these logics are right, but I saw that you can generalize logic with probability theory. Then I found 3 ways of reasoning with probabilistic/smooth logic, Fuzzy, Bayes/probabilistic and quantum. Can someone explain what are the major differences and expressiveness of such logics? Are they ...
I understand that many similar questions of this sort have been asked, but in this case, the solution does not appear to be provable - or is it? Question: If $f(n) = \Theta (g(n))$ and $g(n) = o(h(n))$ then $f(n) = O(h(n))$ Current solution: $f(n) = \Theta (g(n))$ implies that $c_1 . g(n) \le f(n) \le c_2 . g(n)$ for $...
This is mostly a terminological question: Is there a fundamental difference between "optimization problems" and "search problems"? Apologies if this is an obvious question As I understand it, we can define the two as follows (note, I consider the problem for a fixed input size for brevity): Search problem. Given a set...
My basic position is that everything is in P. Then comes the time hierachy theorem and EXP. That's easy: simulate and then diagonalize. After that comes EXP-completeness; that's difficult to swallow. Papadimitriou basically says that the proof is very similar to that of Cook-Levin theorem and do it yourself. Also, I wi...
The language of a DFA can be the empty set (by defining no final states), but can a Regular Expression do that? If Regular Expression cannot do that, does it mean that DFA and Regular Expression are not equivalent (in at least some cases)?
I was calculating the time complexity of one of the phases of my proposed algorithm, but unfortunately, I faced a problem about solving that and providing an understandable running-time. This phase of the algorithm indeed iterates a task $t$ times where $t$ is that iteration in which the algorithm achieves the desire r...
i am a beginner to Discrete optimization domain. I am working on the real world problem, i.e., Scheduling of hybrid appliances. I have hybrid appliances which can use gas and electricity or electricity and hot water or hot water and gas for their operation. Each appliance has some set of tasks, each task use above ment...
Lets just say I have two lists of the running time of tasks A and B. Formally, I would have: A = {a_1, a_2, a_3 ... a_n} B = {b_1, b_2, b_3 ... b_n} I can only have one task from A running at any one time. All other tasks in A have to wait on that task to complete before they can be released. I can have any amount of ...
$M=(Q,\sum,\Gamma, \delta, q_{0}, q_{accept}, q_{reject})$ is a TM with one tape. let $c_{1}, c_{2}$ be two configurations of $M$. A configuration is defined like this: $uqv$ where $(q\in Q; u,v\in \Gamma^{*} )$ we say that $c_{1}$ is reachable from $c_{2}$ in $M$, if when $M$ is in configuration $c_{1}$ it can reach...
The P vs. NP poll provides 3 possibilities: equal, not equal, and independent. This is reasonable, because despite the law of the excluded middle you must supply a proof for your answer, which itself is insufficient. But then the statement "P vs. NP is independent" itself can be independent, with a proof. And this proc...
Given collections I (items) and S (slots), where I >= S. And a pairing function that determines whether a slot can accept an item. Is there an efficient way to find whether a "complete" pairing of items to slots exist, where "complete" means every slot is filled? (More importantly for my use case... is there a way, oth...
My understanding had been badly lacking in just what complexity theory was in the context of computer science. I thought it was abstracted to all mathematical problems applicable outside the realm of computation. Truthfully, I doubt I understand it. But seeing as how this is here to stay, here's an idea for a P=NP proo...
So this is my question. I am trying to understand this part of the book: At d) why do we stop looking at the other nodes in that branch? There could be a acceptable value next to the 2? I am just trying to understand alpha beta pruning for a while.
I have been studying data structures. In that I have come across topics like Array being defined as Power set of cross product of set of objects and set of natural number and list being defined as sequence of objects. I wanted to read more about these things but I haven't been able to find any reference. Can anyone hel...
Previously, I ask a similar question, but the answer given only demonstrates the usage of multiple-type-parameters(MTP) data structure, but not MTP generic interface. Based on my experience, generic interface is useful for generalizing algorithms. For example, the sorting algorithm can be defined as such: // Java code...
I am writing a work on pathfinding algorithms and DFS is a part of it. And the book Introduction to Algorithms and many another websites mention timestamps. And they say timestamps could be used for others algorithms using DFS, topological sorting and etc. So for pathfinding these timestamps dont really matter? Thank...
Here is the link to the puzzle: http://www.cs.brandeis.edu/~storer/JimPuzzles/ZPAGES/zzzQuzzle.html My idea is to construct the tree of all possible moves and then use a search algorithm (probably BFS or A*) to find the shortest path to the solution. This is the initial state: 1 1 2 2 1 1 3 4 0 0 3 4 5 6 6 7 ...
I have read multiple questions here that involve this kind of subject but I haven't found any definite answer. In what class do regular languages belong? (P or NP or some regular are P and other NP), context-free languages? (same question) ,context-sensitive? and general languages? . I personally believe all regular la...
I am writing a paper on the invariance thesis introduced by Cees F. Slot and Peter van Emde Boas as; 'Reasonable' machines can simulate each other within a polynomially bounded overhead in time and a constant-factor overhead in space. The paper I am writing is in Croatian where I cannot find a properly convenient wor...
How do we prove that any logical circuit can be simulated by a Turing machine? For example, we take a logical circuit $L$ that is made of gates and, or, and not. This circuit determines a problem, for example, whether the input is an even number. How can we prove that if a problem is decided by a logical circuit, ther...
I'm currently reading Foundations of Machine Learning by M. Mohri, A. Rostamizadeh, A. Talwalkar and according to their definition a concept class $C$ is said to be PAC-learnable if $$Pr_{S \sim D^m}[R(h_s)\leq\varepsilon] \geq 1-\delta$$ holds for any sample size $m \geq poly(1/\varepsilon,1/\delta,n,\mathrm{size}(c))...
I use interval arithmetic for reliable computing. Now, a procedure coded in a good implementation of interval arithmetic takes perhaps about eight times as much as the same procedure carried out without interval arithmetic (if the lion's share of runtime is taken by floating-point computations). I have sometimes been a...
Given a set of elements $U=\{1,2,\ldots,n\}$ and a collection of $m$ sets $\{S_1,S_2,\ldots,S_m\}$ whose union equals $U$. Each element $e$ of a set $S_i$ has a weight $w_i(e)$. The weight $w(S_i)$ of the set $S_i$ is defined as $w(S_i):=\max_{e\in S_i}w_i(e)$. The problem is to choose an ordered collection of sets $O...
It may seem obvious to many but i am having a hard time figuring out the iterative solution to the Tower of Hanoi problem. There are some solutions on the Internet but without explanations. So can anybody give a sound explanation so that it becomes more intuitive and easy to reason.
The problem is to try and find a word in a 2D matrix of characters: Given a 2D board and a word, find if the word exists in the grid. The word can be constructed from letters of sequentially adjacent cell, where "adjacent" cells are those horizontally or vertically neighboring. The same letter cell may not be used more...
A similar question was asked here: Solving recurrences using substitution method, but I am still somewhat hazy as to how this process works. Say, for $T(n) = T(\lceil n/5 \rceil + 36) + n \log n$ Statement: we wish to prove that $T(n) \le 5 \ n \log n$ for $n \ge 0$ Base case, $n = 0$ and $T(0) \le 0$ $T(0) = 0$ $T(0) ...
$E_{TM}=$ { < $M$> $|$ $M$ is a TM; $L(M)$=$\varnothing$} Where $L(M)$ is the language accepted(recognized) by $M$. $OVERLAP_{TM}=$ {< $M_{1}$,$M_{2}$> $|$ $M_{1}$,$M_{2}$ are TMs; $L(M_{1})\cap L(M_{2}) \ne \varnothing$} Is there a mapping reduction of $E_{TM}$ to $OVERLAP_{TM}$ ?
Several questions (1, 2) have been asked about this topic already but I am trying to be more specific. In Tarjan's SCC algorithm, the calculation of lowlink when encountering a vertex which is already on the stack is // It says w.index not w.lowlink; that is deliberate and from the original paper v.lowlink := ...
Metropolis Light Transport is an application of the Metropolis-Hastings algorithm. Its variants differ only in the used "mutation strategy". Is there ongoing research on other Markov Chain Monte Carlo algorithms (with faster convergence rates) for use in ray tracing? If so, I'm interested in any paper. (Cross-posted on...
I've recently implemented RB tree, B-Tree and vEB tree. I was wondering however if there's any rule of thumb for testing if my implementation are actually correct. Is there any reference that can tell how to develop proper test cases for such data structures? Besides from mathematical techniques maybe. What about graph...
I have written two constraints for Mixed integer linear problem. I am working on the scheduling problem i.e., Scheduling of hybrid appliances. For example, the washing machine is appliance indicated by i, which has set of the task like washing, rinsing and spinning etc., indicated by j. Here we divided the 24 hours int...
Given an array of numbers. Find all pairs of numbers satisfying the condition $1/a + 1/b < 1$. For example: Input: $2, 3, 1, 0.5, 3, 1.6$. Output: $(2,3), (3,2), (3,3), (3,1.6), (1.6,3)$. We can compare each element with each other but it takes $O(n^2)$ complexity. How to improve that algorithm? Maybe use special str...
I've got an array of weights, for example [1, 0, 3, 5] The distance between two strings is defined as a sum of weights for different bits, like this: size_t distance(const std::string& str1, const std::string& str2, const std::vector<size_t>& weights) { size_t result = 0; for (size_t i = 0; i < str1.size(); ++i) ...
Edit: The solution to my problem is called a trie ; according to Section 8.1 of Peter Brass book "Advanced Data Structures", for a given alphabet $A$ and a word $w$ of length $n$ on this alphabet, a trie can search $w$ in $O(n)$ and insert or delete $w$ in $O(|A| n)$. Since in my case $|A|=2$, all these operations are ...
In the research on sorting networks, two parameters are typically of interest: The number of comparators required and the depth required. They have practical implications for throughput and latency. Results in latter category are usually easier to achieve than corresponding results in the former. Already in 1989, Parb...
What is the VC dimension of $k$ finite unions of one-sided intervals: If we take 3 one-sided intervals like $(-\infty, a_1] $, $(-\infty, a_2] $ and $(-\infty, a_3] $, I think union of these intervals can shatter $4 $ points as below, assuming that $a_1>a_2>a_3>a_4$: Point $p_1$ at interval $(-\infty, a_1]$ Point $p_2...
So we are calculating the loss $$J(\theta) = -\frac{1}{T}\sum_{t=1}^T\sum_{-m \leq j \leq m} \log P(w_{t+j}|w_t;\theta)$$ and to do this we need to calculate $$P(o|c) = \frac{\exp(u_o^Tv_c)}{\sum \exp(u_w^Tv_c)},$$ which is computationally inefficient. To solve this we could use the hierarchical softmax and construct a...
Given: A rooted, directed, a-cyclic graph $G$. Let $r_0$ be the root node and $t_0$ be another target node. Each node in $G$ is assigned a non unique id/color ($ID_i),\ 1<i<N$ for some integer N. Problem: Is there a directed path from $r_0$ to $t_0$, such that for some $ID_x$ there is no node in that path with $ID_x$ a...
I was reading the book Introduction to Algorithms, Chapter 1. When I saw this diagram, I got confused because $\lg n$ has the largest value of time while $n!$ has the least value of time. And that doesn't make sense to me - perhaps I misunderstood this?
Is this variant of Vertex Cover Cook-complete for $\mathrm{NP}$? Input: An undirected graph $G(V, E)$ together with a vertex cover $C\subseteq V$ Output: YES if there exists a vertex cover $C'\subseteq V$ such that $|C'|=|C|-1$, NO otherwise
How would you evaluate a new metric or benchmark? My concrete example: I want to benchmark code review. As others did [1, 2] , one can apply metrics from social network analysis (such as centrality, degree, ...) to a social network emerged from code review (who reviewed when whom?). But how do I evaluate if the metric...
deep learning research papers always claim that deeper layers of CNN have good "semantic information" but poor "spatial information". What is the spatial information exactly. Is that some activations in deeper layers?
I have a verification engine where while loops are translated into functional code, like this: def f() = ... while(c) b ... def f() = ... fwhile() ... def fwhile() = if(c){ fwhile() } We want for the users to be able to annotate while loops with a decreases construct which says that certain m...
Someone in a discussion brought up that (he reckons) there can be at least continuum number of strategies to approach a specific problem. The specific problem was trading strategies (not algorithms but strategies) but I think thats beside the point for my question. This got me thinking about the cardinality of the set ...
2^n=O(3^n) : This is true or it is false if n>=0 or if n>=1 since 2^n may or not be element of O(3^n) I need a hint to figure the problem
I know it's a keyword based search. But sites like Quora have some good suggesting algorithms where the algorithm understands the intent of question asked rather than just the keywords meanings. For instance, for a question involving "O(n^2)" it adds 'Algorithms' and 'Computer Science' as topics and for a question inv...
I'm a bit confused about some proof that PATH-SELECTION-PROBLEM is NP-complete (Problem 9, chapter 8 in "Algorithm Design" by Tardos and Kleinberg) that I found in some solution manual here: https://github.com/weimin/CS-180/blob/master/Algorithm%20Design%20(Kleinberg%20Tardos%202005)%20-%20Solutions/Algorithm%20Desi...
The buddy algorithm is: The buddy for any block of size $2^k$ is another block of the same size, and with the same page frame number except that the kth bit is reversed. Example: If the block size if $2^3$ and the start page frame number(aka pfn) of this block is 0xC, the page frame number of the buddy of this block ...