instruction
stringlengths
35
11.4k
There is an approach given in this article Shortest Path in Directed Acyclic Graph to find the shortest path in O(V+E) using topological sort. I have another approach which I think is more efficient. If use dynamic programming to store the minimum distance from a vertex to a destination than I don't need to explore tha...
A graph with $C_3$ + 3 "ears" is called a net graph. In general, $C_n$ + $n$ pendant vertices are called sunlet graphs. Is there a name for 4-sunlet graph minus two pendant vertices?
Suppose we have a binary string $s$. We wish to partition this string in a series of $0$s followed by $1$s (alternatively: we wish to sort), using only one operation: moving three consecutive elements to the end. E.g. if our string is $ABCDEFGH$ we can do our operation at index $1$ to get $DEFGHABC$. If we did it at in...
I have to prove that $H_\varepsilon = \{<M> \mid M\ \text{halts on input }\varepsilon\}$ reduces to $H$ (the halting problem). I am very confused how to PROVE it, I mean it is clear that we can take a TM $M$ that decides $H$ and then build a TM $M\varepsilon$ that decides $H\varepsilon$ by taking the input $<M1>$ and s...
I'm trying to design and DFA that accept string with an odd number of 0`s, but counting only the ones within sub-strings with two or more 0. So, for example, 011000, will be accepted since it has 4 0`s, but only three or them are inside a sub-string of two or more. But 0001000, wont be accepted.
I know that not all truthtables have a corresponding 2-cnf representation, but is there a way to find out if a given truthtable has a 2-cnf representation, and if so to find what that is?
I had a question regarding the use of the pumping lemma for a particular language I came across. I feel like I have almost solved it, but have gotten stuck on the last steps and wanted some advice. Here's the language in question: $$L = \{a^nb^jc^k:\ k = jn\}$$ $\space$ Choose $w = a^mb^mc^{m^2}$. For $w_0 = uv^ixy^iz$...
I was reading an article on Construct binary palindrome by repeated appending and trimming. The problem is Given n and k, Construct a palindrome of size n using a binary number of size k repeating itself to wrap into the palindrome. The palindrome must always begin with 1 and contains maximum number of zeros. I solved ...
This problem is about working with smart-phone accelerometers. To calibrate accelerometer, I need to find three unknown matrices T, K and B that minimize this sum: $$\sum_{i=0}^N(|g|^2 - |TK(a_i + B)|^2)^2,$$ where $a_i$ is a known 3x1 vector and |$g$| is a known constant and unknown matrices are: $$T = \begin{bmatrix}...
What are the disadvantages of storing a playlist as plain text in a text file? This is what I thought: The main disadvantage of storing the play list as plain text is its simplicity. The basic conceptual structure of the rows of values can be very inefficient and inappropriate for data sets with complex structure. The...
I'm sure there must be something wrong with the following reasoning because otherwise a lot of P vs. NP research would be curtailed but I cannot determine my error: For any fixed integer $k>0$ define $$B_k := \{ \langle \varphi \rangle | \; \varphi \; \text{is a wff of ZF and has a proof of length} \; \leq k{|\varphi|}...
I have been reading the following document about the undecidability of virus detection, available at: https://enterprise.comodo.com/whitepaper/Impossibility_of_Virus_Detection_WP.pdf the problem that I have is in the following part: The part that I do not understand is the one that says: Halts(P)=not(DetectVirus(MakeV...
Monk and his best friend Micro were taking a stroll, when they found an array A having N integers lying on the road. The array was injured badly, so they took it with them and treated it. When the array came back to senses, it told them, that some crazy guy came and started beating it. The array started crying and whil...
When dealing with caches, the address is split in three parts - offset, index and tag. Question is: if we are given a word address, do we first have to shift left by 2 bits by adding 00 at the end of address? Suppose cache block size is 4 . block offset is 2 LSBs of the address. If we were to add 00 at end of every mem...
I've been recently working with graph, more precisely edge-adjacency matrices. I found this source, which explains the concept intuitively. Now, when I am trying to implement this conversion, I was wondering what is the most efficient way to transform a standard (node) adjacency matrix into an edge-adjacency matrix? Th...
Time complexity of travelling salesman problem is $O(n^2*2^n)$ using held-karp algorithm. Now, if don't use dynamic programming and solve it using the recursive procedure, time complexity is still $O(n^2*2^n)$. I know there are overlapping of subproblems and there will be less computations but the time complexity is n...
The problem is we have to count number of paths between a source and a destination in a graph. The brute force approach is using backtracking which is $O(n!)$. Is there any better solution to this problem? Note that we have to count paths so we can't visit the same node again in a path. I think this problem is np-hard...
I've been given two PC's that are connected via Ethernet, and as such are using CSMA-CD with binary exponential backoff. Now, both PC's, let's call them $A$ and $B$, are trying to send data simultaneously. So, the first time both randomly choose a number from $\{0,1\}$. Let's say $A$ wins (i.e. $A$ picks 0 and $B$ pick...
Let A and B be two integers, where their size is constrained to 2 bits in binary. There exists a function F, which outputs integers of the same size, where F(A) = F(B) = Y. For example, A = 01, B = 10, and Y = 11. There exist some possible functions, such as G(X) = X xor 10. Another could be H(X) = X + 01 (ignoring ove...
A file F holds the non-zero elements of two large n×n matrices, A and B. The matrix entries are stored as triplets (i,j,value), where value is the (i,j)th element of a matrix. The file first stores the elements of A and then those of B. The matrix elements are stored in F in an arbitrary order. In each matrix, only the el...
I am developing games in Unity 3D. Currently, I am trying to place 3D objects in 3D space in a spiral pattern that looks like one of 2 the strands in a pair of the DNA (helix) spiral pattern. Would anyone please show me the equation for 3D spiral patterns, which should involve X, Y, and Z coordinate ? Thanks.
why option c is the answer ? And why not option B ?
Here is the question description. The first 2 suggested solutions involve DFS and BFS. This question refers to the 1st two approaches: DFS and BFS. Apparently, the grid can be viewed as a graph. I have included the problem statement here for easier reading. Given a 2d grid map of '1's (land) and '0's (water), count th...
Let $L_1$ and $L_2$ be the following: $L_1=\{r:\exists x,y \in \mathbb{Z} \text{ such that } x^2+y^2=r\}$ $L_2=\{(N,M): M<N, \exists 1<d\leq M \text{ such that d|N} \}$ Claim $L_1 \leq_P L_2$ Sketch Proof If I want to know whether $r\in L_1$. The number of integer solutions to $x^2+y^2=r$ is given by $g(r)=\sum_{d|r...
This is a problem from the textbook "Algorithms, 4th edition" by Robert Sedgewick and Kevin Wayne. 4.3.26 Critical edges. An MST edge whose deletion from the graph would cause the MST weight to increase is called a critical edge. Show how to find all critical edges in a graph in time proportional to $E \log E$. Note: ...
The pumping lemma for regular languages states, that one should consider a string $w = xyz, w\in L$, that is, every possible division of $w$ into $xyz$. The article on wikipedia says, that this version is a special case of a more general version, in which one should consider strings $uwv = uxyzv$. When using that gene...
I'm learning shortest path algorithms like Dijkstra's, BFS, etc. I understand on a 2D finite grid there are boundary conditions (i.e. size of the grid) that help terminate the algorithm and keep it in a certain scope/range. However when expanding this to an infinite 2D grid, I don't understand when (say using BFS as an...
I am keenly interested to do a project in Computer Science that can aid to address the problems in the field of Psychology. Now I want to know what are the most general and research-oriented issues or problems areas in Psychology that can be solved through computation or at least aid to be solved via Computer Science. ...
This question was asked in our exam long a go and I don't remember exact words. The scenario was, Initially you are given a set of finite data to start with, and a key value (which you have to find in a given set). Can we terminate binary search algorithm/program, if we grow the size of the data by feeding new finite...
I am trying to simplify a CNN model. Currently, I need to train 3 different models (with the same architecture) to estimate each parameter. I am just wondering if there is a way to just train one model that outputs 3 parameters, with input images containing only single parameter label. Say the three parameters are som...
The definition of symmetric difference of two sets $\alpha $ and $\beta$, $\alpha \oplus \beta$ is defined as the set of all $x$ such that, $x \in (\alpha \cup \beta) - (\alpha \cap \beta)$. If, $\alpha$ is some set with some members and $\beta = \phi$, Will $\alpha \oplus \beta$ not contain "nothing"? I mean, If we...
have a question regarding rectangular automata and their derivatives. In each location the derivates are defined by a interval, how are the derivates applied on the variables? Is one value chosen out of the interval and added to the value or do we reset the value to one value in the interval ? Regards
Leslie Lamport describes a algorithm to come to consensus for the case for n>3*m, there m is the number of traitors in n generals. I perfectly understand why for n=4, m=1 there is consensus trough a majority vote. Lets suppose (like in Leslies proposal) there are three type of messages for different attack time (A1, A2...
I have very little experience with graph DBs but i imagine this problem suits one Assume a dataset with two entities , Users and Foods. A user can have a relationship with a Food, specifically they can score it from 0 to 100. What i'd like to achieve is, for every user, find all the other users that are similar to them...
As mentioned in Lambda Calculus - Computerphile, Alonzo Church's method is functional where a function as a blackbox, takes an input, processes, and produces an output, and Turing machines have internal state. First, I would like to know what does it exactly mean by functional and state-based? Are they the same...
Context: I'm modelling kidney exchanges through directed acyclic graphs. I convert these to Bipartite graphs (by splitting each node into a donor and receiver, and the edge from the original graph exist between corresponding donors and receivers). I want a way to find maximum number of edges through disjoint chains and...
I came across this algorithm recently to calculate day of the week for any year. int y0 = year - (14 - month) / 12; int x = y0 + y0/4 - y0/100 + y0/400; int m0 = month + 12*((14 - month)/12) - 2; int d0 = (date + x + (31*m0)/12)%7; switch (d0) { case 1: return "Monday"; case 2: return "Tuesday"; case 3: ret...
For a project, I'm implementing the All Maximal Scoring Subsequences algorithm. In the analysis portion of the paper, it describes an optimization that makes the algorithm run in linear time. Namely, when doing the search for the rightmost value of $j$ that satisfies $L_j < L_k$, we can search a linked list with monoto...
Hey Guys I have a small question about the Hopcroft and Karp Algorithm. I have a task to solve where I have to calculate the perfect matching. My professor told me I should use the Hopcroft Algorithm. With that I can calculate the maximal matching and then valited with (number of edges/2 = number of matching) if there ...
When NOPs are introduced in the pipeline by the control unit, how does they really cause the pipeline to stall? I mean, at every clock cycle, the pipeline register will eventually forward its contents to the very next stage, so how does NOPs prevent that from happening? Also when NOPs are introduced the PC doesn't incr...
I have the following problem. Given a finite number of lists of items. The same item can appear in many lists. I would like to color items with 3 colors, such at least two colors appear in each list. I would like to show that this problem is NP-hard. I would like to provide reduction from the 3-coloring problem which s...
Suppose in an architecture, interrupt driven IO is used. And suppose a program is to be loaded from an IO device into the RAM. I have been studying IO mechanisms and I came to know that upon receiving a request to load a program, the processor generates control signals to the IO module and then the data is loaded into ...
Is it possible to define logic programming for every logic that has implication and conjunction connectives? Does logic programming adds something new to the usual inference process. By usual inference process I mean the construction of the consequence set from the axioms - deriving all true statements. Does logic prog...
In descriptive complexity, HO corresponds to ELEMENTARY. ELEMENTARY is a subset of R, so therefore all HO queries are decidable. Then undecidable problems have no corresponding HO query. Is my understanding correct? If so, can I have an example undecidable problem and an intuitive/informal explanation of why it doesn...
A while ago I wondered about how Proof Assistants like Coq prove $m \leq n$ and the like. It looks like they actually need to traverse the natural numbers based on the successor/predecessor formulation: Coq < Eval compute in le_lt_dec 100000 1000000. Warning: Stack overflow or segmentation fault happens when working...
This is problem 2.44 from Introduction to the theory of computation by Michael Sipser. If $A$ and $B$ are languages, define $A \diamond B = \{xy: x \in A \land y \in B \land |x| = |y|\}$ Show that if $A$ and $B$ are regular languages, then $A \diamond B$ is a $CFL$. My try: Let us define the following languages: $$...
Let $G=(V,E)$ be a planar graph, only specified by its set of vertices and edges. Suppose $|V|=n$. According to Fary's theorem, there exists a planar embedding of $G$ with straight line segments. Then this embedding can be represented by a set of points in the plane (each $v\in V$ is represented by a unique point $p_v$...
Alice and Bob play the famous game of divide and choose $n$ times with $n$ identical cakes. Each time, Alice cuts the cake to two pieces, and Bob chooses the piece he prefers. Alice does not know Bob's preferences, but she assumes that they come from a uniform distribution. What is the strategy that maximizes Alice's e...
Suppose P vs. NP is independent of ZFC. Then there cannot be an efficient SAT solver, otherwise it would constitute a proof for P = NP. Therefore P $\ne$ NP. What we see here is that independence implies unequality. So why is independence a big deal? It is just one way to show P $\ne$ NP. See Scott Aaronson's paper Is ...
Given two positive integers: $d \in \mathbb{N}^+$ space dimension $s \in \mathbb{N}^+$ expected sum list all the points $(x_1, .. x_d) \in \mathbb{N}^d$ such that $$\sum_{i=1}^d x_i = s$$ Expected output: For $d = 2$ and $s = 3$ the algorithm should output (3, 0), (2, 1), (1, 2), (0, 3). For $d = 3$ and $s = 1$ the ...
I am confused now (in thinking about limits and continuity) how curves are represented in a typical modern computer. Curves are "continuous" in that there is no discrete change from one angle to the next. Wondering how the computer approximates this and/or what equations it uses/approximates.
I have a robot that has a start and goal position within a maze. Each point in the maze-grid is simply a Position object containing x and y. I need an algorithm that specifies the robot only moving to its relative right only using goEast, west, east and south from the perspective of the maze. There is an implementatio...
I am confused on byte addressable/word addressable architecture. I have studied MIPS implementation and I came to know that when the data is retrieved from main memory, it is shifted accordingly to convert it into a byte. But if this is the case, why do we need byte addressable? We can simply fetch a word shift it and ...
To give a brief outline of my actual problem, I'm attempting to identify possible impurities in proteins. I have a theoretical mass and an experimental mass, and the difference between the two would in theory be caused by any impurities present in the proteins. Impurities could take the form of an amino acid insertion,...
I have been reading the Algorithm Design Manual by Steven S. Skienna and on page 15 it mentions a term called "cavallier extension claim" and I have been desperately trying to find a definition for this. A search in Google just returns quotes of the same book. Possibly my confusion lies in the misspelling of the word "...
I’m not even a CS student, so this might be a stupid question, but please bear with me... In the pre-computer era, we can only implement an array data structure with something like an array of drawers. Since one have to locate the drawer with corresponding index before extracting the value from it, the time complexity ...
**A hypergraph is k-rainbow colorable if there exists a vertex coloring using k colors such that each hyperedge has all the k colors. Is k-rainbow coloring of a hypergraph is NP-complete or not? The problem is also called "polychromatic coloring" ** I looked at some reference papers such as "Hardness of Rainbow Colorin...
Let there be a language $A$ which is NP complete and language $B$ which is a finite language, is the union of $A \cup B$ NP complete language?
So it seems that you can get pretty far with just type definitions as a formal model of a system. The typed properties verify that the properties will have that type, typed function arguments verify the functions will get the appropriate input and output types, etc. But now I am wondering about algorithms. In an ideal ...
In the paper Total Functional Programming by D.A. Turner three rules are given for a programming language to remain total: complete case analysis covariant type recursion (type constructor should not appear in negative position in a constructor argument) structural recursion But with these rules I can still have an i...
How can I prove that $\mathsf{DTIME}^{\mathrm{Htm}}(n^2)$ is contained in $\mathsf{DTIME}^{\mathrm{Htm}}(n^3)$? (sorry about how it is written. I mean the set of languages decided by a deterministic TM with an oracle to $\mathrm{Htm}$ in $n^2$ time and $n^3$ time). If someone can please write the proof, it will be grea...
During lecture the professor talked about Integer Compare for floats and kept mentioning two's complement. What's the relation between them? All I understand is that two's complement can take us from a number to its negative.
I have a problem which is basically TSP where is a limit on how far youcan go and every city has a profit. I need to make algorithm where he could come back with highest profit after a trip. It's not important how many cities he will visit as only profit is important. I need to the solution in code so it has to be pra...
I have some data that includes two columns for dates, and I want to retrieve - based on these two columns - all the instances where an illegal operation has occured. An operation is illegal if the value in Col B breaks chronology in the column. Structure * Col A * Col B * * Opened * Moved ...
Can someone explain how the insertion sort have quadratic time complexity and not quasi-linear time complexity in the worst-case? Even in the case of a reversely sorted list, it's not like it'll have to compare each element with all the other elements. For example in [4, 3, 2, 1], 4 won't be compared with anything. 3 w...
I've seen it used but I can't think of a way to construct such TM. Would appreciate any help!
I'm trying to understand the complexity of the Kruskal algorithm implemented with the Quick-Union by rank and with the path compression. Now there is a theorem for the last structure above: The complexity of any sequence of m operations of Makeset, Union and Find, n of which are of Makeset, on a Quick Union by rank an...
in my practice for a test I came across this question: prove or disprove that those languages are regular: I succeeded proving that the second language is nonregular with homomorphism but i'm having trouble with the other 2 - my intuition tellin me that first 1 is Σ∗ but i'm really stuck on how to prove it (not sure...
I read that each segment is 64KB,but how? If you have address ABCD:EFGH , then 1 segment is 16B if it is addreses by bytes. How do they don't overlap? Example: 0000:0010 = 00010 0001:0000 = 00010 , is is same address.
I am wondering what it takes to "verify" or "prove" that an automaton is correct. What the components are that are required. It seems that an automaton would be an easier thing to formally verify as sound than say an arbitrary function. Not sure though what needs to be verified in an automaton, which is what brings up ...
In a typical read operation from a dram chip, all the banks are equipped with sense amplifiers which select one bit from each bank using column multiplexer. But how does write operation takes place? How does only one column in a bank is written in a particular row?
I have thousands of documents, and a term list with thousands of entries. The entries in the term list range in length from an acronym of two characters to a 14-word phrase with 96 characters. I would like to find every occurrence of any term in the term list in each document in the order that they appear. I have creat...
I've got a set of items that I'd like to sort into a list. The items have two independent sets of constraints that the ordering should respect: A set of hard constraints that must be satisfied, e.g.: Item A has to come before item B A set of soft constraints whose satisfaction I'd like to maximise, e.g.: It'd be nice ...
I am working through the NLP notes for Naive Bayes' classification here: https://web.stanford.edu/~jurafsky/slp3/6.pdf Below $c$ is the class of the observation and $w_i$ is the $i$th word of a text document. In developing the maximum likelihood estimate for the conditional probability of the feature (word) $w_i$ given...
The "common term" would be in standard form, but the two input multivariate polynomials needn't be, e.g $x(1+y)+y$ and $y(x+a+b)$ have one common term, $xy$. A brute force solution would be to expand both polynomials to standard form, then check for common terms. e.g. $x+xy+y$, $xy+ay+ab$. Is there a better way? EDIT ...
I apologize in advance if the wording of my problem is inappropriate for this forum. Or if another platform i more suitable for it. I'm new here and typically do not have to solve complex algorithmic problems. I'm looking for an algorithm that is able to find a answer to the following question: If I ran 10 km this morn...
Say I have a family of hash functions that are weakly universal, i.e. the probability of two non-identical keys $x\neq y$ are mapped to the same hash-value is bounded by $k/m$ when I have $m$ bins and $k$ is some constant (I am mainly interested in $k=1$ and $k=2$): $$\Pr_h\left[h(x)=h(y)\right] \leq \frac{k}{m} $$ I h...
Automatic differentiation is a set of techniques to numerically evaluate the derivative of a function. Quoting from Wikipedia (emphasis mine): These classical methods run into problems: symbolic differentiation leads to inefficient code (unless done carefully) and faces the difficulty of converting a computer program ...
I'm working on some lecture notes and wondered if there was a good example algorithm for the recurrence equation $$T(n) = T(n/2) + n$$ I know that I can do selection in this running time, but that is a probabilistic algorithm, and I was hoping not to introduce this algorithm at this point in my lecture notes. I plan to...
I took an introductory MATLAB course a couple of years ago (and since then have only taken a basic C++ course) and am presently stumped as to how to start with a project I am undertaking. As part of this, I need to simulate the formation of branching structures using a branching annihilating random walk (BARW). I am s...
Capsule networks seem to match performance of convolutional neural networks on image classification tasks (more specifically on classification of handwritten digits in the MNIST dataset) 1. I have also read in various articles that capsule networks require less training data than convolutional neural networks. Does th...
So I finally realized the difference between transition systems and automata, and now am closer to understanding Model Checking. One of the last pieces is understanding what exactly "state" is in Model Checking. It is mentioned that you create a Kripke Structure, which is pretty much just a state-transition system. But...
There's the classical problem of sorting numbers in a list with the restriction that you can only swap two neighbouring numbers. It's easy to see that getting an optimal number of needed swaps can be achieved by insertion sort or bubble sort. We can generalize this problem by changing the underlying structure from a li...
Would it be possible to explain the physical significance of pumping length $p$ in pumping lemma for regular languages? Somehow, the physical significance of pumping length $p$ in pumping lemma for regular languages escapes me. I have explored a number of tutorials and presentations on this topic. The nearest I came t...
Given a knapsack $A$ composed of $(u_i, v_i)$-item where $u_i$ is the item identifier and $v_i$ is the weight of the item. I call a maximal subset when you consider a subset $S$ of $A$ where the sum $R(S)$ over $v_i$ in this subset is less or equal than $P_{max}$ and if you try adding any item $(u_j, v_j) \in A \setmin...
As of 1993, there are 4536 scheduling problems, 3821 were proven to be $NP$-hard, 417 polynomially solvable, and 298 still open. Where can I find the most up-to-date list of scheduling problems and their statuses (if they are $NP$-hard, polynomially solvable or open)?
In chapter 10.3. Selection in worst - case linear time ($k$th minimum) from Introduction to Algorithms by Cormen, Leiserson and Rivest, the time complexity expected for step 5 of the algorithm presented in this chapter is said to take $T(n)=7n/10 + 6$ at worst. From my point of view the time complexity is the one spec...
I’m fairly new to this area so my understanding is pretty basic. Am I correct in saying that symbolic a.i would take data and use logic to search through and find the right answer. An example is a doctor machine. We feed the machine a ton of medical textbooks and it answers questions by looking up the answers from tho...
In SICP, lazy evaluation is defined as delaying the evaluation of procedure arguments until the actual values are needed. (https://mitpress.mit.edu/sicp/full-text/sicp/book/node85.html) letrec can be implemented by creating a closure (an expression + an environment) and mutating its environment to add a binding to its...
Now the title may be misleading, but I don't know how to give it a better name. My question is if I have data in a 2d matrix and under the assumption that: -I know for sure that there are correlations between some of the rows and columns, but I am not sure which rows are correlated to each other so I can't pre-order it...
As we know segmented paging is an improvement over segmentation and paging but I am having some doubts regarding the memory overhead of these three system.It is clear that segmentation need less memory overhead.But about other two system please confirm these two points. number of pages in pure paging=number of pages...
Chen et al. say that The four-color theorem implies a $4k$-kernelization for Planar Independent Det, which is the dual problem of Planar Vertex Cover. I knew that Vertex Cover has a kernelization with $2k$ vertices. Furthermore, I know that we have a lower bound which is $n/4$ for IS. But how to get a $4k$ vertex ke...
Given an image of a dress (from different angles), what could be ways to fit it on a human image (again multiple angles corresponding to dress)? Any link to research papers or tutorial regarding this?
Let's say there is the alphabet {0,1} given and you are supposed to build a NFA for language L= {w | w includes two successive zeroes}. So we are supposed to build a NFA for the language which only accepts words with two (or more) successive zeroes, where alphabet is {0,1}. Now my question, is it allowed to build a NFA...
Assume that $\forall 1 \leq i \leq n : a>0, c_i > 0 $ where $n \in \mathbb{N}$. I need to show that it is possible to compute this sum in $O(n)$ time: $$I = \sum_{(\epsilon_1,...,\epsilon_n) \in \{0,1\}^n}a^{c_1 \epsilon_1 + ... + c_n \epsilon_n}$$ (a sum over all binary vectors of length $n$) I notice that in $I$, for...
A family of deterministic finite automata of degree $n$ over an alphabet $Σ$, with $\bigcap Σ = ∅$, consists of a set $\mathcal{A} =\{(K_i,Σ∪\{1,\dots,n\},δ_i,s_i,F_i) : 1 ≤ i ≤ n\}$ of deterministic finite automata. We fix implicitly a subscript function over $\mathcal{A}$, so that we can refer to the “$i$-th automa...
The Cook-Levin theorem shows that any NP problem is reducible to an NP-complete problem. Therefore if a polynomial-time algorithm for an NP-complete problem is found, it will mean that all problems in NP can be solved in polynomial time. But If an NP problem is shown to have an exponential lower bound, would that prov...
I recently made the photo of tapestry, but I am not able to identify the smallest patch which contains the pattern. Now I wonder: How could I write a program that does so? A first step could be identifying axis-aligned bounding boxes (AABBs). The most simple way I can think of is having a combined quality metric: $$er...
Here is my problem : Given a range, let's say 0 to 10.000, and some numbers in that range (like 23, 1456, 280, 3586), I want to find, for any input x, the two closest numbers to x, the smaller one the greater one. For example for x=100, the two numbers are 23 and 280, for x=350 they are 280 and 1456. Is there a faster ...
I get confused because i don't know if it is possible to use Test and Set primitives in case where more then one process can be enter in critical section at the same time.