instruction
stringlengths
35
29.1k
I am looking for an efficient way to perform nearest neighbor searches within a specified radius in a two-dimensional plane. According to Wikipedia, space-partitioning data structures, such as : k-d trees, r-trees, octrees, quadtrees, cover trees, metric trees, locality-sensitive hashing, and bins, are often used for...
Consider the following approximation algorithm for the problem of finding a maximum clique in a given graph $G$. Repeat the following step until the resulting graph is a clique. Delete from $G$ a vertex that is not connected to every other vertex in $G$ and also delete all its incident edges. Show that this greedy app...
I have two sets of 2-dimensional coordinates on an integer grid, $A$ and $B$ $A = \{(x_{A1},y_{A1}), (x_{A2}, y_{A2}), (x_{A3}, y_{A3}), \dots\}$ $B = \{(x_{B1},y_{B1}), (x_{B2}, y_{B2}), (x_{B3}, y_{B3}), \dots\}$ I need to find all coordinates in $B$ that are directly above, below, or to the left or right of any coor...
As of recently I've been trying to get better at algorithms and I've stumbled onto one that I can't seem to solve. The idea behind the algorithm is to try to find as many different ways as possible to store each object of size K in an array of N*N given certain restraints. So take this grid right here .X.X .XX. ...X .....
Consider the set of all valid Turing Machines descriptions $T_{All}$, and the set of functions that denote the real (not asymptotic) running time of Turing Machines in $T_{All}$, lets call it $R_{All}$. Since there are infinite functions, not all of which might represent the running time of a valid Turing Machine, how ...
I am having a problem understanding the following: This is the background of the lemma: To prove the lower bounds, we use the classical lower bound construction from [5, 9]. We have an input instance L with three regions of items. In the first region, there are items of size close to 1/6, in the second region come ite...
My understanding is an "Enumerator" is a Turing Machine that: instead of taking an input string, then going through a series of transitions and "halting" or "not halting" on it, it does not accept any input string and it starts with a blank string and builds the final string according to the rules of the language For e...
Let's say we have a NFA as follows: It has 3 states, q1 - q2 - q3 and can make transition from q1 to q2 on 0 or epsilon and from q2 to q3 on 1 or epsilon My question is do we take epsilon transition before reading input or after reading input and after reading the input, if we reach a state where we have epsilon trans...
OpenAI's Chat-GPT told me: There is no known exact algorithm for finding the largest bipartite subgraph in a graph in polynomial time. This problem is generally believed to be NP-hard, which means that there is no known polynomial-time algorithm for solving it. Is this correct?
Trying to solve an ILP optimization problem with a number of potential boolean variables and then express constraints on these variables based on those boolean results. Let's say I am doing 5 coin flips and allowing people to choose heads or tails for each coin flip. They are able to choose one or more specific flips a...
When I want to judge whether two regular forms represent the same language, I have learned the next method: create the (non-deterministic) finite-state automata which accepts the language the given regular form represents for two regular forms respectively. convert the two NFA into DFAs. Judge whether the two DFAs a...
I am reading Michael Sipser's "Introduction to theory of computation" 3rd edition, page 55 - 56, the topic "equivalence of DFAs and NFAs" Case 0: Michael Sipser asks us to handle the transition function of "non epsilon NFAs" as follows: δ'( R, a ) = $\bigcup_{_{r \epsilon R}}^{}δ(r, a)$ Case 1: Michael Sipser, then, ...
I stumbled across this game in Simon Tatham's puzzle app. It's called cube. The description according to the game is: You have a grid of 16 squares, six of which are blue; on one square rests a cube. Your move is to use the arrow keys to roll the cube through 90 degrees so that it moves to an adjacent square. If you r...
As the title states, I am asked to prove that a directed graph $G=(V,E)$ is strongly connected iff for all non-empty subsets $\emptyset \neq S \subset V$, the cut $\delta(S) \neq\emptyset$, where $$\delta(S)= \left\{ (u,v)\in E \mid u \in S,\; v\in V \setminus S \right\}.$$ I've shown that if $G$ is strongly connected,...
I'm reading https://ilyasergey.net/CS4212/_static/lectures/PLDI-Week-07-more-parsing.pdf On page 11, there's the definition of Sum Grammar: S -> E + S | E E -> number | (S) Just wondering if this grammar same as follows: S -> number | (S+S)
I'm interested in analyzing the randomness of strings using relative count for 1-, 2-, etc tuples. E.g. for a long string "abbccba.." with an alphabet ["a", "b", "c"] , the quantities ["a", "b", "c"], ["aa", "ab", "ba", "bb", "ac", "ca", "cc", "bc", "cb"] etc should be approximately equal for every kind of tuples. Of c...
A sequence $(a_1,a_2, \dots, a_n) $ and natural numbers $n$ and $k$ are given. We want to calculate the longest (strictly) increasing subsequence of sequence $(b_1,b_2, \dots, b_n)$ for which there exist an interval of pointers $[l, r]$ and an integer $x$, $-k\le x\le k$, such that $b_i = a_i + x$ for $i \in [l, r]$, a...
I am learning Markov algorithms and came across the paper Markov Algorithm by CHEN Yuanmi. I am trying to understand the following example (well, any of the examples in the paper). Example 3: Multiplication. MA3 = $\{\Sigma, P, P_0\}$ $\Sigma = \{a, A, B, C, \#\}$ Productions in $P$: $p_1: Ba \to aB$ $p_2: Aa \to aB...
Let's say, initially we have an epsilon NFA in which the start state, say state 1, has epsilon transition to state 3 We know when converting from epsilon NFA to NFA, we apply the following formula for each state: E(T(E(state), input)), where E = epsilon closure and T = transition function. In this stage the start state...
I'm looking for a good mathematical symbol to represent the conversion from a double-precision floating value to an unsigned 32-bit integer value. Does anyone have suggestions for a good Greek letter or a math symbol to express this? The best candidate I can think of is to use a symbol for a floor function with a subsc...
I asked the chatbot at you.com, "what is an advantage of dynamic scoping?" and it said the following on the pane titled YouChat. (If you click the link, you will probably see a different reply by YouChat since, apparently, there is some random/live factor in its algorithm). One of the main advantages of dynamic scopin...
The definition of "Single Connected" is that for every $u,v \in V$ there is at most a single simple path from $u$ to $v$, and at most a single simple path from $v$ to $u$. The objective is to find an efficient algorithm to decide whether the graph is "single connected". I've managed to come up with the following algori...
I am working through (1) "GLL Parsing" (2) "GLL parse-tree generation" and (3) "Structuring the GLL parsing algorithm for performance" by Elizabeth Scott and Adrian Johnstone. An example grammar given in (3) 2.1 is S ::= b a c | b a a | b A c A ::= a When parsing bac the following packed forest is shown as the result....
I'm attempting to search through all the integers between 10^15 and 10^16 to check if they are in the oeis sequence A277274, and the entirety of the program can be summarized as mostly equivalent to : for n in range(int(10**15),int(10**16)): if pow(3, n, n) == 11: print("Found one: {}".format(n)) Since the...
Problem: we have a sequence of numeric values, e.g. [102, 25, 77, 17, 2, 13]. We need to implement 3 operations, each can be at most logarithmic time complexity. insert(i, v) - inserts value v at index i. remove(i) - removes value at index i. peek(i) - returns value at index i. What I've tried: AVL tree, where node k...
There are n houses in a city T, some of which are connected by streets in such a way that there is exactly one path between any two houses (i.e. the graph of houses and streets is a tree T). Tanya has already prepared $m$ gift bags but she ran into a problem. After all, she herself also needs to find a house in the cit...
I am not sure if this is a math question or a computer science question, so please direct me to a better suited community if needed. Given a bounded space G,and a set of points P, I want to create two sets of polygons of Q, and R where Q is a set of polygons where a point in P is the center of each polygon in Q, and R ...
In an older question I asked about stack, the statement came up that recursive functions cannot be inlined (link). I am interested in whether this statement is actually true or not. I understand that it is extremely impractical. But, is it impossible, in theory? To my intuition, it seems like it should be possible. But...
In an abstract rewriting system $\langle A, \rightarrow\rangle$, confluence may be stated by using set inclusion. Namely, a rewriting system is confluent iff ${\leftarrow^*\rightarrow^*}\ {\subseteq}\ {\rightarrow^*\leftarrow^*}$ (or equivalenty as the Church-Rosser theorem, ${\leftrightarrow^*}\ {\subseteq}\ {\rightar...
Lets assume $2n $ gifts such that each gift $i$ has price $a_i$ The goal is to find a partition of the gifts into $n$ pairs such that each pair $P_i=\left(a_{i_{0}},a_{i_{1}}\right)$ has maximal minimum average IE $ \min_{i\le n}\left\{ \frac{a_{i_{0}}+a_{i_{1}}}{2}\right\} $ is maximal. How to get a contradiction ins...
I am trying to create the regular expression for the automaton named "full closure" in the following diagram using the arden's theorem: Since, we have 3 accepting states, we would find 3 different regular expression and then just union them up. I was able to find regular expression for q0, q1 but facing issues when tr...
Suppose I start with a directed graph, and remove any leaf nodes, and then repeatedly remove leaf nodes from the now-modified graph until there are no more leaves. Then I repeatedly remove root nodes as well. What is the remaining graph when there are no more roots or leaves? (Assuming it's not empty.) I have an idea t...
On the Wikipedia article on Karatsuba algorithm (https://en.wikipedia.org/wiki/Karatsuba_algorithm#Time_complexity_analysis) it is stated: $T(n) = 3 T(\frac{n}{2}) + cn + d$ And then, by invocation of the "master theorem" it is deduced that $T(n) = O(n^{\log_2{3}})$. My question is, is there an easy way in this case to...
I have a very specific problem and Im desparate for help, I've been working part time on it for almost a year without almost any success, I'll do my best to describe it as thorough as I can Our input data is an array filled with objects who have properties time and type. From now on I'll refer to them as "events". Tho...
I can't seem to get my head around the formulas to use for size of binary tree. Depending on who I ask, what website, etc. I see different similar answers. So if someone could explain simply either: the differences between these formulas, the cases to use one or another, or any other explanation. It would be greatly ap...
I am reading about Kruskal and analysing it’s time complexity. Let’s say there are E edges and V vertices. Kruskal algorithm has two important time complexity equations , Sort edges- Elog(E) For whether edge from v1->v2 , apply find(v1) and find(v2). If cycle exist don’t connect. Other wise connect them. - E*timecompl...
I want to split the main part(like people) in optical flow from the background, but I don't konw how to start. I think one way is to use some kind of clustering algorithm, first split the optical flow image into small patches, define the distance function and use clustering algorithm to aggregate them. But I don't know...
the following question came up in a problem I am working on: Suppose you have two graphs $G_1=(V_1, E_1), G_2=(V_2,E_2)$ that have features attached to them, i.e. to every $v\in V_1$ or $v\in V_2$ there is a vector $w_v\in\mathbb R^n$ with fixed $n$ of features mapped to, and similarly for all edges. We call two of the...
Problem Description Given $a, b, n \in \mathbb{N}$ with $a < b < n$. Let $M$ be the set of all possible bit strings of length $n$ which begin and end with one and have at least $a$ and at most $b$ zeros between every pair of successive ones: $$ AZ_s(x, y) :\equiv s_{x} = s_{x+1} = \ldots = s_{y} = 0 \\ M := \left\{s \i...
In this question, I'm going to introduce a prime factorization algorithm which I'm working on as my personal project. I may attach a Python code to introduce the algorithm. If it contravenes the rule please let me know, I will consider it editing as a pseudo-code or substitute it with some link. import timeit import gm...
I have just implemented a parser on the relational database. Parsing is done with recursive query. Note: one commenter was misled by the word "recursive" before "query" to think "recusive descent". But no. I am not talking about recursive descent top-down, I am talking about bottom up, LR, simple, no look-ahead, driven...
It is known that the $\mathbf{P}\overset{?}{=}\mathbf{NP}$ problem is equivalent to asking whether there exists a polynomial-time Turing machine that decides an $\mathbf{NP}$-complete problem. Let's say this problem is subset-sum. Now I'm considering enumerating all the Turing machines with fewer than $s$ states. Since...
Is there a number $\alpha < 1$ such that the independent set problem is polynomial for input graphs whose independence number is at least $\alpha n$ (where $n$ is the number of vertices)?
If one proves that the lower bounds of an $NP$ problem, are not bounded by any polynomial, is this enough to prove that $P$ does not equal $NP$?
We want to distribute 3*n known cards among 3 players evenly given a set of constraints that prohibits some players from having certain suits. For example: We want to distribute 1H, 2H, 3S, 4S, 5D, 6D (second letter refers to suit of card) among three players A, B, C such that A does not get any card of suit Hearts. Is...
I'm trying to optimize a practical problem in a database query. Suppose we have a db tableProducts and each product has a few numeric properties. I save the properties values in a different table ProductProperty table because the user can add more property types. The user wants to look for products using range filters ...
Build a context-free grammar for the language: $L=\{\#x\#y\#\,\,;\,\,|x|=|y|\,\,\wedge\,\,x,y\in\{0,1\}^{*}\}$ over $\sum=\{0,1,\#\}$ How can I make sure that |x|=|y|?
Build a context-free grammar for the the complementary language of: $L=\{ww^{R}\,\,|\,\,w\in\{0,1\}^{*}\}$ I think $L^C$ is the set of all strings that are not palindromes, but I don't know how to start building the grammar. Attempt: S→ A | B A→ AAA | 0 | 1 B→ 0C1 | 1C0 | 0B0 | 1B1 C→ 00C | 01C | 10C | 11C | ε
Imagine that I have an algorithm written in C that is of, let's say, 10,000 characters in length. Such a program can be simulated on a turing machine (Wikipedia: Anything a real computer can compute, a Turing machine can also compute. For example: "A Turing machine can simulate any type of subroutine found in programmi...
There are several players at the end of the poker night with wins and losses, with zero sum. What is the optimal solution to settle the balance that minimize the total number of transactions (eg. if we consider a transaction as a venmo payment). name | balance (N means how much net win, negative means lost) A | -2...
Given 2 integer $M$ and $N$, a recursive modulo is $M \bmod (M \bmod (M \bmod ...(M \bmod N)$ until the result is 0. What is its time complexity? I guess that it's $O(log(M))$ but I can't prove it.
I have to prove whether a certain property is safety or liveliness. The property represents the absence of deadlock so I expected it to be a safety property from what I read online. The issue is that I seem to show that it is both, but this is impossible as the only property that is both safety and liveliness would be ...
In a database systems course, we have been presented with the following definition for third normal form (3NF): A relation $R$ is in 3NF means: a nontrivial dependency $A_1,\dots,A_n\to B_1,\dots B_m$ can hold in $R$ only if $\{A_1,\dots,A_n\}$ is a key (either minimal or super) in $R$ or for $1 \leq i \leq m$, each $...
The problem I am trying to solve is that there is an underlying undirected graph G = (V, E) with weights on the vertices, where the weight on vertex v is denoted by wv = d(v) (the degree of the vertex). My goal is to find a vertex cover set U (a set where for every e = (u, v), one of vertices u, v is in U) with the min...
In depth first search each vertex can be associated with a discovery time and a finish time. I am reading the following implementation of topological sort in terms of depth first search TOPOLOGICAL-SORT(G) 1 call DFS(G) to compute finish times for each vertex 2 as each vertex is finished, insert it to the front of a li...
I am working on a Sparse Autoencoder but Andrew NG's notes are hard to understand. My question is about the following equation: Loss Function. In sparse autoencoder, the goal is to inactive some nodes to obtain low-level features or more precise features. Now if you check Andrew NG's Notes on sparse autoencoder (avail...
Assume that I have designed an algorithm A, which runs two sub-methods: M1 and M2. M1 has a O($n$) expected time complexity. M2 has a O($n^2$) time complexity. Clearly A uses O($n + n^2$) = O($n^2$) time. Since $n^2$ > $n$, in terms of time complexity, should A be described as having an expected time complexity of O($n...
I am wondering, what is the top type, $\top$, in JavaScript? The diagrams at MDN make it look as if 'null' is a top type, but wikipedia's entry for top type indicate that it is Object in JS, which makes more sense. Am I misreading the MDN article?
i got this question in a theory of computation quiz "give pda for a^(n) b^(2n) c^(2n) d^(n)" i am arguing that there is no pda for that question but our ta says that we can push 5x to the stack then pop x each time we read a b or c or d. i am arguing that doesn't guarantee count because we might get only "d"s which one...
I'm currently studying virtualization and while looking at hypervisors I realized that bare metal hypervisors are quite similar to operating systems. So while from an application standpoint they are different, can an operating system theoretically be viewed as bare metal hypervisor?
The Kind programming language has a sufficiently powerful type system to support proving theorems like in Lean, Coq, Idris, or Agda. I've seen it said that Kind has an even more powerful type system that goes beyond what these other languages support. Since Kind is a work-in-progress, I've struggled to find documentat...
Problem statement We're given a directed simple acyclic graph with weighted vertices. Find an edge $e$ such that reversing it would create a strongly connected component (SCC) whose price is maximal. The price of an SCC is defined to be the sum of the weights of its vertices. In the example below, reversing an edge $(7...
What problems belong in NSPACE(n^2) and DSPACE(n^2) class? Examples?
As I understand, all modern CPUs perform register renaming: given a sequence of instructions to interpret, they check which registers these instructions use, detect patterns where a register's previous value is overwritten, and then map the instruction sequence so that each instruction's "architectural" register is map...
We have a set of people, and each person has a list of wished items (not unique, they could want multiple copies of each item). We have an inventory of items that we want to assign to the people. We want to maximize the number of people who receive all the items on their list. The inventory may not have enough items to...
In statistical computing, we often have linear models that involve computing multiple vector dot products, but there's a high amount of redundancy in the operations when you break them down. As an example, let X be the following 12x3 matrix: [[-1,-1,-1] ,[-1,-1,1] ,[-1,1,-1] ,[-1,1,1] ,[0,-1,-1] ,[0,-1,1] ,[0,1,-1] ,[0...
Knowing that $log(n!) = \theta(nlogn)$
Let $H=\left( E_0 ,E_1 ,E_2 , \ldots , E_d \right)$ be a $d$-dimensional full-hyper graph/complex. That is to say, if for some $i\in \left[d \right]$ the hyper-edge $e_j \in E_i$ than for any $i-1$-dimensional $e_k \subset e_j$: $e_k \in E_{i-1}$. The vertices are $E_0$, the hyper-edges between $2$ vertices are $E_1$, ...
(I haven't read any literature on this paradox nor am I good at formal proofs, so this is just my intuitive thoughts on the paradox.) If we assume the statement "This statement is false" as a function f() on a state machine M, where M has 2 states S0 and S1 representing false and true, we'd just be evaluating M.f() in ...
For any 2 strongly normalizing terms in the Simply Typed Lambda Calculus, s and t, is st also strongly normalizing? And why? I'm a bit confused as this is used in a proof regarding strong normalization and the typable lambda calculus, but I have not been able to show that this is the case. Any help would be much apprec...
I am interested in tight bounds for the Parallel Machine scheduling problem with a gang scheduling constraint. In the notation of Graham, Lawler, Lenstra and Rinnooy Kan, this might be called $Pm|\rm{gang}|C_{\rm{max}}$. There are $m$ identical machines, and $n$ jobs. Each job has both a processing time $p_j$, and a g...
Previously, I've asked a question about coinduction. That gave me a lot of useful high-level insights on what coinduction provides, and what are the usefulness of coinductive proofs. This question is about walking through an example in more detail. The example is based on this other question "What is coinduction?". I'l...
In a hypothetical scenario, where a precise and formal definition does not exist here, and thus expressed with analogies and verbal reasoning for the sake of simplifying the P, NP problem. A(lan) Turing Machine arrives to the "Universal-Algorithm-Island", and meets Christopher, an oracle with a True or False response. ...
I have a matrix of size NxM. Each coefficient can have either some fixed value or a joker denoted by * Let's take two random rows. We are going to loop through the columns. For each column, either we color it green or in red. We color using red when the two values in the same column have an intersection, i.e. either ...
There are two types of sets $\mathcal{X} = \{X_{1}, X_{2}, \ldots, X_{n_{1}} \}$ and $\mathcal{Y} = \{Y_{1}, Y_{2}, \ldots, Y_{n_{2}}\}$ such that $X_i, Y_j \subseteq [m]=[\mathrm{poly}(n)]$ and $n = n_{1} + n_{2}$. Given a sequence $\alpha$ over $\mathcal{X} \cup \mathcal{Y}$, the goal is to find the longest (increasi...
I am new to Linear Programming and Approximation algorithms. and I am trying to do this exercise for writing an IP and relax it to LP. What I am given: A digraph G = (V,E) with wv being the weight on vertex v for every v ∈ V. A multi-set S is a set such that it contains elements more than one time. Suppose from a dir...
I have read that 1NF, 2NF and 3NF decompositions are lossless and dependency-preserving. Consider this example on a relation $R(A,B,C,D)$ with functional dependencies set as $FD =${ $AB \rightarrow CD, A \rightarrow C, BC \rightarrow D$ } Here when we do 2NF decomposition we get $R_{1}(A,C)$ with $FD =${$A \rightarrow ...
So i'm defining the embarassingly parallel complexity class as the set of decision problems which can be solved in time $O(T(n))$ on a single computer and in time $O(T(n)/g(n))+O(\log(g(n))$ if you have access to $O(g(n))$ machines where $g(n)$ can be of a total size up to $T(n)$. So these are the types of problems, wh...
In my OS course, the instructor mentioned the following: In UNIX if a parent process creates a new child ("fork") then the child is an exact duplicate of the parent. This means its memory space is a copy of the parent's. Now if the child process immediately calls "exec", it replaces its own memory space with that of a ...
I am currently reading reading Chapter 11 of Operating Systems: Principles & Practice by Anderson and Dahlin, which speaks about file systems as abstractions for non-volatile storage. The distinction between files and directories is first made. Afterwards, in examining what files are, a distinction between file data (i...
Donald Knuth's The Art of Computer Programming, Volume 1 Fascicle 1 contains the following exercise: If $\alpha$ is any string of 0s and 1s, let $\operatorname{s}(\alpha)$ and $\operatorname{u}(\alpha)$ be the integers that it represents when regarded as a signed or unsinged binary number. Prove that, if $x$ is any in...
I understand that pumping lemma can only be used to prove that a certain language is "non-regular", it cannot be used for proving regularity But since, it's a property of regular language, we should be able to pick up a language that is regular, literally, and then see if this property exists in that language, which sh...
One popular algorithm to find the Voronoi diagram out of a collection of points (sites) in the plane is Fortune's algorithm. It is usually described in terms of a sweep line, whose interaction with sites give raise to parabolas, whose intersections eventually provide the Voronoi diagram. The Wikipedia page also include...
In a project of mine, I want to represent states as efficiently as possible. Initially, I went ahead with a BitBoard representation and some clever tricks to speed up the evaluation of the game tree. That works fine. Though when looking up any given state in the Look-Up table, I need to do some heavy calculations. Afte...
Prove or disprove: f(n-1) is omega(f(n)). I actually need a more specific example of this but I thought this claim was interesting. I want to know if (n-1)log(n-1) is omega(nlogn)
I'm learning how to write my own theorem prover. After skimming Decision Procedures (Kroening & Strichman, 2016), I didn't find any SMT algorithms for solving quantified n-ary predicate formulas. I realize that some quantified predicate formulas with an arity above 2 are undecidable. But I'm not sure if all of them are...
I have this grammar: E -> E + T E -> T T -> T * F T -> F F -> ( E ) F -> id And this is the state diagram for it: I tried to construct a parse table and I am getting shift/reduce conflict. More specifically in state 2 I can shift *. Also, FOLLOW(LHS) = FOLLOW(T) contains * so I can also reduce using rule 2. Hence shi...
I’m reading Leslie Lamport’s white paper, “Time, clocks, and the ordering of events in a distributed system”. His explanation for total ordering has me a bit confused in the following excerpt. I've interpreted this as if event x's timestamp is less than event y then x happened before y. If x's timestamp is the same a...
I was wondering if there are any mathematical functions or algorithms that take a known minimum amount of time to calculate. The closest thing I could find to this is Proof of Work algorithms used for blockchain, but the speed at which hashes for these are calculated is affected by device hardware. I'm interested to kn...
In the SKI combinator calculus, Kxy returns the constant function which always returns x. Since y is always ignored, why not just define K as having a single parameter, namely, x? What is the purpose of having a variable y which is guaranteed to be ignored by K? I'm guessing that there would be some deleterious effect ...
I apologize if I did not use the terminology entirely correctly in the title. This problem seems to me quite similar to an assignment problem and likely something that occurs in real life in business. The problem: In this problem, we have a set of assets (in the economics/finance sense) $\left\{ a_i \right\} $ with va...
It is known that the general traveling salesman problem is NP-hard. Even when the distances follow the triangle inequality. But let's take the problem very literally. There are actual cities (points) on a 2-d euclidean space and a tour must be devised to visit all of them in the smallest total distance. We are given th...
Is there a reason why you cannot use flash memory as a HD? Less moving parts and more affordable. Whats not to like? Why dont we see Pci-express cards with a couple of terrabytes of flash memory that you can use as a HD?
If L is NP-complete then how can I prove that $L_1$: $L_1= (1$ { $0, 1$ }$^∗) \cup ${ $0x | x \in L$} is also NP- complete. My thoughts: A reduction from (for example) SAT to L can be converted to a reduction to { $0x | x \in L$} by adding a 0 to the output.
I have a PhD in theoretical physics, where I had worked on mathematical models of hydrodynamics around compact objects. I have basic knowledge of programming in C/C++ and Python. Currently, I am more interested in computational work, particularly on numerical simulations and machine learning algorithms for data mining ...
The question is in the title. What do you call "root nodes" in directed graphs. Is there a commonly accepted term? "Root" implies there's only one, which is not the case. I've scanned half a dozen glossaries before asking. I'm starting to suspect that no, there's no agreed moniker.
I am working currently on Path-Packing problems and found this Book: https://jeffe.cs.illinois.edu/teaching/algorithms/book/Algorithms-JeffE.pdf My question is about exercise 23b on page 184. Here is a description of the problem : Assume $T$ is a tree (T is not necessarily a binary tree) with $n$ nodes and root node $r...
I'm interested in this functions \begin{align*} g(m) &= \begin{cases} \text{defined} & \text{if turing machine $m$ computes $g$} \\ \text{defined} & \text{if turing machine $m$ loops on $m$} \\ \text{undefined} & \text{otherwise} \\ \end{cases} \end{align*} \begin{align*} f(m,n) &= \begin{cas...
The class DP is defined as the set of languages L for which there are two languages $L1 \in NP$ , $L2 \in coNP$ such that $L = L1 \cap L2$. (Do not confuse DP with $NP \cap coNP$, which may seem superficially similar.) Show that (a) EXACT INDSET ∈ DP. (b) Every language in DP is polynomial-time reducible to EXACT INDSE...
Prefetching is a task that the compiler feels like it should be suited for. Prefetching requires knowing in advance what data the program is about to load, and the compiler has a ton of information at its disposal about control flow and what data the program is likely to access in the new future. And yet, when I could ...