instruction
stringlengths
35
29.1k
Question: I am trying to solve question 6.10.1 from Elements of Programming Interviews. The task is as follows: Given an array $<a_1, \ldots, a_n>$ of fixed-length ints, devise an algorithm which returns a new array $<b_1, \ldots, b_n>$ where each $b_i$ is the product of all $a_j$ with $j \neq i$. That is, each element...
In an exam I took we were asked to provide a tailrecursive definition of a recursive function. I failed miserably and the provided solution makes absolutely no sense to me. If anyone could explain that would be very helpful for my resit. The provided solution is the following: Given are the functions $f, g, h \in \mat...
Let's say I have two identical jars and I want to find the height that the jars will breaks when dropped from various heights. I can drop the jars from height increments using steps on a staircase. I want to solve this problem sublinearly. I decided to increment using square numbers (1, 4, 9, 16..etc) for a complexity ...
I found the following question Suppose A and B are recursively enumerable languages such that $A∪B=Σ^∗$. Further, suppose $(A∩\overline{B})∪(\overline{A}∩B)$ is decidable. Which of the following is true? A- It is possible that either A or B is decidable but not both B- None of them can be decidable C- Both o...
Let $t:\mathbb{N}\rightarrow\mathbb{N}$ be a time constructible function with $t(n)\geq n + 100$. Show that there is no TM $T$ that given the gödel number of another TM $M$, decides wether or not M is time bounded by $t$. Can someone help me with this? I have no clue
I'm trying to understand binary floating point and using just a 4-bit mantissa and a 4-bit exponent (both 2s compliment) to keep things simple. As far as I can tell, the largest denary number I can represent is 112: 0111 0111 So why do I have trouble representing denary 11 (eleven) in this system? I get that the larges...
I have graph creation problem. Given a set of nodes of graph, and node constraints such as given every node's number of neighbors (degree). I am also provided with the total number of triangles in the graph. Given the above constraints ($n+1$), I have to generate a graph that satisfies all the constraints. I know that ...
I have a list of elements of different values, say 0 to 3. I want to split it into a certain number of sub lists, each accepting only certains elements. The sub lists may not always have the same length. For example, I have a list of 12 elements: [0,0,0,1,1,1,2,2,2,3,3,3]. I want to split it into 3 sub lists: One that...
Why doesn't infinite run time violate Turing completeness? Shouldn't "completeness" include halting? The halting problem: The halting problem is a decision problem about properties of computer programs on a fixed Turing-complete model of computation ... The problem is to determine, given a program and an input to the...
Recently I’ve studied QuickSort and understood its general idea. Basically, we do the following: Pick an element from the array (no matter which one and how in this context) Rearrange elements in the array so that elements less than the pivot are placed prior to it (in the left part of the array), and ones that are g...
I am reading the two articles below to try to figure out whether STRIPS are NP-complete or PSPACE-complete. Specifically, I am trying to figure out the complexity of finding optimal solutions using STRIPS. Also, Bylander (1994) defines PLANMIN to find the shortest plan. This is tied to length directly where minimizing ...
Using induction how do you prove that two algorithm implementations, one recursive and the other iterative, of the Towers of Hanoi perform identical move operations? The implementations are as follows. Hanoi(n, src, dst, tmp): if n > 0 hanoi(n-1, src, dst, tmp) move disk n from src to dst hanoi(n-1, tmp, ...
Normally, when discussing amortisation and worst-case complexity, amortisation negates the worst-case scenarios, and the BigO describes the average for the operation (the way it's used in interviews nowadays). For example, when an insertion of an element requires reallocation and copying of the array, increasing the si...
I need some help with my proof, because I'm not sure if the following works. Tips and Tricks are welcome since this topic is completely new to me and very difficult. Task: Prove that $M = \left\{ a^ma^lcb^{m+l}\mid m,l \in N \right\} $ with $\sum =\left\{ a,b,c \right\}$ is not a regular language using the Pumping Lemm...
I've seen some very useful posts about this, but none took into consideration both the tag and valid bits. This is a question I took from a notebook in my computer engineering course. Consider a machine with a direct mapped cache, with 1 Byte blocks and 7 bits for the tag. This machine has a RAM with 2 KB capacity. ...
I was given the following problem during an interview: Gives a string which contains some mixture of parens (not brackets or braces-- only parens) with other alphanumeric characters, identify all parens that have no matching paren. For example, in the string ")(ab))", indices 0 and 5 contain parens that have no matchi...
Given a graph consists of two-colored nodes(e.g. white and black) and a starting node, and every time you visit a node, its color is switched(from black to white, or, white to black), how to find the minimum path such that all nodes are converted to black (or white, since it is equivalent)?
I have been given this diagram of a circuit: https://www.google.com/search?q=full+adder+logic+gate&rlz=1C1CHBF_enCA831CA831&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjCjZzc_PbfAhXCj4MKHahtCvcQ_AUIDigB&biw=1536&bih=792#imgrc=GFIqfN5OgCdtRM: The second XOR gate looks like its output is being connected as inputs of 2 different...
I'm trying to solve And-Or Graph, and I find AO* algorithm can handle it. Someone said it's already used in AI, but I can't find it in detail. Have it implemented? Or it's just a pseudocode that can't realized? If it exists, where can I find it? Or any suggestions to help me to implement it? I'm really appreciate your ...
Konig's theorem says that, in a bipartite graph, the size of the maximum matching equals the size of the minimum vertex cover. This theorem has several proofs; I would like to know if the following proof, based on primal-dual linear program, is valid. This is mainly an exercise in understanding this primal-dual concept...
What can we say about the complexity of generating (negative) binomial and (negative) hypergeometric random variates? In particular, it is possible to generate (negative) binomial and (negative) hypergeometric variates in (expected) constant time (i.e. independent of the distribution parameters)? There is quite a bunch...
I have a problem to start my proof because I do not find a word $w$ where I can use the pumping lemma. Task: Be $\sum { =\left\{ a,b,c \right\} } $ and $S=\left\{ bx{ c }^{ m }|x\in { \left\{ a,b \right\} }^{ * }\wedge m\in N\wedge { |bx| }_{ a }-{ |bx| }_{ b }>m \right\} $ Proof with the the pumping lemma, that S i...
The multiplication of two integers of size $n$ can be done in time $O(n \cdot \log n \cdot \log\log n)$ using FFT method. If the two integers have different sizes $n$ and $m$, does a smaller upper bound using $n$ and $m$ exists ?
I learned that the empty set is not an element of every set unless the empty set is explicitly included in the set like {∅}, so I believe it is false because it is not ∅ ∈ {∅}.
Most modern compilers and processors implement the IEEE 754 binary formats for floating point numbers. IEEE 754 guarantees that the addition, subtraction, multiplication, division, and square root operations on real floating point values are correctly rounded, meaning that the result of each operation is as if the oper...
Wondering if there is a way technically to convert a Subdivision Curve into a Bezier Curve.
I'm autodidacting Pierce's Types and Programming Languages. On page 27 he states a definition for "terms, concretely" in constructing a language of terms, thus: For each natural number $i$, define a set $S_i$ as follows: \begin{align} S_0 & = \emptyset \\ S_{i+1} & = \;\;\;\{true, false, > 0\} \\ & \;\;\;\cup \; \{su...
I am trying to follow this tutorial where the Faster-RCNN-Inception-V2-COCO model from TensorFlow's model zoo is used to detect playing cards. I was wondering what is the practical limit to the number of object classes that I could use this to detect, specifically what I would want to do is to detect every letter in th...
Consider this procedure for building a tree from $v_1, v_2, ..., v_n$: insert $v_1$ insert $v_2$ and connect it to $v_1$ via a directional edge from $v_2$ to $v_1$ insert $v_3$ and with a uniform probabiliy connect it to $v_1$ or $v_2$ ... insert $v_n$ and with a uniform porability connect it to $v_1$ or $v_2$,... $v_...
Problem: given a set of n coins of unique face values, and a value change, find number of ways of making change for change. Assuming we can use a denomination more than once, here's the pseudocode I came up with 1. NUM-WAYS(denom[], n, change) 2. dp = [change + 1][n + 1] 3. for i = 0 to n 4 dp[i][0] = 1 5....
According to Wikipedia and other sources, the question whether $L=P$ is an open problem, and of course everyone is familiar with the problem of whether $P=NP$. However, I found absolutely no information online regarding a possible equality between $L$ and $NP$. Such an equality doesn't directly violate the space-hiera...
According to my understanding, a grammar is ambiguous if it generate strings which can be interpreted in more than one ways ( that is , more than one parse tree), but when it comes to the language itself , is there any kind of relationship between the language itself and the ambiguous nature of a particular grammar tha...
Maybe I am missing something very easy and obvious. But, I don't understand why estimate cost of source vertex is subtracted from the overall estimate cost, if heuristic function $h$ is monotonic: $$d′(x,y)=d(x,y)+h(y)−h(x)$$ What I currently know: A* algorithm can be used as an extension for Dijkstra's algorithm. At e...
I'm trying to generate a grammar from this language: L={a^i b^j c^k d^l : i+j=k+l} to be clear its a in the power of i and b in the power of j... and so on, so that i+j will equal k+l, I would love an explanation how to get to the solution as well, thank you!
Consider the following initialization step of loop invariant for merge procedure Initialization: Prior to the first iteration of the loop, we have $k=p$, so that the subarray $A[p .. k - 1]$ is empty. This empty subarray contains the k- p= 0 smallest elements of $L$ and $R$, and since $i = j = 1$, both $L[i]$ and $R[...
A problem is NP-hard iff every NP problem can be polynomially-time reduced to it. Hardness is often intuitively explained as a lower bound. But it isn't, strictly speaking. For the sake of the argument, assume P=NP. Now the definition becomes: A problem is P-hard iff every P problem can be polynomially-time reduced to...
If, suppose, P doesn't equal NP. Implication of this statement is that there is no effective procedure to solve a hard problem; however there exists an acceptable solution S. I have following two explicit queries: If an effective procedure cannot be given which yields a solution, in what sense is the S actually a solu...
I'm currently writing an application for a trick-based card game, where agents are assigned points based on the accuracy of their predictions of how many hands they're going to win. The number of tricks predicted will display a level of confidence to the other agents as well as also potentially allowing the agent to ch...
Let $G=(V,E)$ be a connected directed weighted graph with non-negative weights on edges. Let $u,v,s,t$ be vertices in the graph $G$. I need to find an algorithm which in $O(|E|\log |V|)$ time checks if there is a vertex $w$ which lies in the shorthest path from $u$ to $v$ and $s$ to $t$. My idea is to find a shortest...
Given is an alphabet $\Sigma = \{ a, b, c \}$, and a language $A4 =\{ w \mid w \in \Sigma^* \wedge |w|_a \operatorname{mod} 2 \ge |w|_b \operatorname{mod} 2 \}$ whereas $|w|_a$ is the number $a$'s in the word $w$ and $|w|_b$ is the number of $b$'s in $w$. We should give a grammar (of any type) for $A4$. I know that t...
I have read Chater 17. Balanced Allocations and Cuckoo Hashing in Mitzenmacher. Upfal. Probability and Computing: Randomization and Probabilistic Techniques in Algorithms and Data Analysis and got stuck with a problem. We have $m$ elements and $n$ buckets. Each element is hashed into two random buckets (we assume that ...
Given only an n-dimensional hyperrectangle by its corner-point-values and an n-dimensional Predicate that corresponds to an arbitrary shape and tests whether a point is contained in said shape, is it possible to calculate whether the box intersects the shape?
I’m reading CLRS(Introduction to Algorithm, 3rd edition). In the chapter 32.1 about the naive string-matching algorithm, the book says the worst case running time is $\Theta(n^2)$ if $m = \lfloor \frac n2\rfloor$. I get that when $m$ equals $\frac n2$, but I don’t see it when $m$ is less than $\frac n2$. Any hint or su...
I'm trying to solve the shortest common supersequence with Genetic Algorithm. I found it a little bit hard to reduce the size of the chromosomes in each generation. I know that the maximum size of the chromosome is the total length of the strings. Even if we create a "naive" genetic algorithm: Totally random strings (w...
I was trying to learn Coq using the famous book Software Foundations. In it I found the following: Theorem mult_0_r : forall n:nat, n * 0 = 0. Proof. induction n as [| n IHn]. - simpl. reflexivity. - simpl. rewrite -> IHn. reflexivity. Qed. which I understand perfectly but find rather unintuitive. I understand...
I have been stuck on this sorting problem for a while now: Given an array of length N find the minimum number of shift operations in order to sort the array. A shift operation is defined as shifting a value in an array to another position. For this problem however, you can only perform this shift operation on the first...
In a bipartite graph $(X+Y,E)$, it is possible to find a minimum vertex cover in polynomial time, by Konig's theorem. Suppose the minimum size is $s$. Is there an efficient algorithm for finding a vertex cover $S$ of size $s$, such that $S\cap X$ has a minimum cardinality? What I could do so far is to formulate this pr...
In a flow network, suppose we add constraints of the following type: The flow entering a vertex $v$ must be at most the flow exiting a vertex $u$. Is maximum-flow with such constraints still solvable in polynomial time? Is it possible to reduce it to a standard maximum-flow problem? NOTE: I found a recent paper that ...
In wireless communication , I understand what it means to transmit a "bit" but I wanted to understand what exactly does it mean by a packet . *******POST EDIT/RECEIVING INITIAL ANSWERS******* I got the following question , which is also there in my comment , How to decide which bytes should form one packet of data ?...
In the pseudocode guide for my syllabus, an example of a record data type is given as below: TYPE Student DECLARE Surname : STRING DECLARE FirstName : STRING DECLARE DateOfBirth : DATE DECLARE YearGroup : INTEGER DECLARE FormGroup : CHAR ENDTYPE However, for enums and pointers it gives the followin...
In my Operating Systems class I have an exercise to sketch out how a round-robin algorithm would apply to a specific scenario, which is the following: Now the correction that I was provided with by the lecturer is the following: But I do not understand how this is correct. After referring to the lecture that was ...
I'm creating a powerful regular expression matching system that can be augmented by adding small microprograms to deterministic finite automaton (DFA) states. The microprogram solves the big bang issue where a rule of the form .*ab.*cd doubles the state count of the DFA. The solution for the "big bang" problem is to cr...
I was working through a textbook (Probability & Computing by Michael Mitzenmacher & Eli Upfal) and am not able to understand the following: Let $F(x)$ be given as a product $F(x) = \prod_{i=0}^{n} (x - a_i)$. Transforming $F(x)$ to its canonical form by consecutively multiplying the $i$th monomial with the product...
Today I learned about an abstract class of machines called linear bounded automata. It is intended to model real-world computers that have a limited amount of memory. I have always thought that real computers are DFAs due to the finite memory (but the DFA is a terribly poor abstraction). Is it possible to convert LBA i...
A line $\ell$ for a set $S$ of points is bisecting if the open halfspaces on either side of $\ell$ contain at most $\frac{|S|}{2}$ points. Now given point sets $A$ and $B$ in the plane, prove that we can always find a line $\ell$ such that $\ell$ bisects both $A$ and $B$ simultaneously. We can assume that no three poin...
Assuming we have a model of TM with an infinite number of states. The domain and range of the transition function are also infinite. Given a description of a TM $M$ and a string $w$ how can we use the new model to tell if $M$ ever stops when running on $w$?
How these two languages be regular.If there is comparison between m and n since (n < m) is the condition to be satisfied.
Given is an alphabet $\Sigma = \{ 0, 1, 2 \}$ and a function quer to calculate the cross sum of a word. $quer : \Sigma^*\to \Bbb N$ with: $$quer(w)=\begin{cases} 0, &\text{when } w=\epsilon\\ quer(v)+x, &\text{when } w=vx, x\in\Sigma \end{cases}$$ Where $\epsilon$ is the empty string. Prove by Induction on words that...
I'm wondering how to express the complexity of a brute force primality testing algorithm in the number of digits the number under test has. The brute force algorithm just checks whether $n$ is prime by checking if there is a number $k$ from $2 \leq k \leq \lfloor\sqrt{n}\rfloor$ that cleanly divides $n$. How would I go...
Context: Cubical Type Theory Consider a simple HIT, say, an HitInt: data HitInt : Set where pos : (n : ℕ) → HitInt neg : (n : ℕ) → HitInt posneg : pos 0 ≡ neg 0 Or, if you don't speak Agda we can use cubicaltt: data int = pos (n : nat) | neg (n : nat) | zeroP <i> [ (i = 0) -> pos zero ...
Suppose there are $n$ triangles on a 2D plane, which don't cross each other and have no common vertex. Suggest an algorithm that gets $n$ points and in $O(n \log n)$ determines the points that don't lie in any triangle. What if the triangles could overlap. I found some algorithms to determine if a point is inside a tri...
Wikipedia defines a Top type: (edited for readability) The Top type [...] is the universal supertype, as all other types in any given type system are subtypes of Top However, the article goes on to say: In C++: The pointer to void type can accept any non-function pointer, even though the void type itself is not the ...
Given a bipartite graph $G(X+Y,E)$, how can I find a non-empty subset $Y'\subseteq Y$, such that $|N(Y')| \leq |Y'|$ (where $N$ is the set of neighbors)? If $|Y|\geq |X|$ then the problem is easy - $Y'=Y$ satisfies the requirements. The interesting case is $|Y| < |X|$. In this case a solution might not exist, for exam...
It is well known that the the decision problem $w \in \mathcal{L}(M)$ for a DFA $M=(Q,\Sigma, \delta, q_0,F)$ is in $\mathcal{O}(|w|)$. To proof this we assume that the successor state computation can be done in $\mathcal{O}(1)$, for example with an array of size $Q \times \Sigma$. My question is: Is there a better way...
I'm confused about a point regarding the Time Hierarchy Theorem. In order to establish the upper bound for this theorem it's necessary to show the following: We're given $(\langle M \rangle, t)$ where $\langle M \rangle$ is the encoding of a Turing machine $M$ and $t$ is a natural number given in unary. Claim: one can...
Let G be a graph directed without circles. Suggest a method to find a minimum set of vertices So that all the vertices in the graph can be reached. I thought to run an SCC algorithm to find binding components and then return them. This is true? Or is there a better algorithm?
The Portable Executable file format is the format that Windows EXE files use. It is a binary format. Numbers are in little endian form. Thus, the following hex represents the decimal number 256, not 1. 00 01 Some fields in the file format represent text strings. For example, the "Name" field contains a null-terminated...
Let $\mathbb{F}_p$ be a prime finite field for $p > 2$. Consider two ternary quadratic forms $$Q_1\!: x^2 - a_1(t)y^2 - b_1(t)z^2,\\ Q_2\!: x^2 - a_2(t)y^2 - b_2(t)z^2$$ over the field $\mathbb{F}_p(t)$ of rational functions with coefficients from $\mathbb{F}_p$. For simplicity let $a_1, a_2, b_1, b_2 \in \mathbb{F}_...
Why is packet delivery time equal to transmission time + propagation delay, and not equal to 2*(transmission time) + propagation delay? At the end of packet delivery time, doesn't that mean that those bits haven't been received?
I am building a lambda applicator in Java, and I have uncovered a bit of misunderstanding. Either my question at the bottom is what I am asking, or something in the build-up below is wrong. Either way, I'd appreciate any insight. So, NOT can be defined as λb.b (λxy.y) (λuv.u) If we allow A1 = λb.b B1 = (λxy.y) C1 =...
Managed code needs to be be interpreted or JIT-ed at runtime. At first glance it seems to me that in general it is more energy consuming to interpret/compile the program on every user's computer than to compile it once and distribute binary code that can be run without any further processing... So does that make compil...
I have created a context-free grammar $$ \begin{align*} &S \to S_1 \mid S_2 \\ &S_1 \to aS_3bS_4 \mid \epsilon \\ &S_2 \to bS_4 \\ &S_3 \to aS_3 \mid \epsilon \\ &S_4 \to aS_4 \mid bS_4 \mid \epsilon \end{align*} $$ for this regular expression $ (aa^*b(a \cup b)^*) \cup (b(a \cup b)^*) $ Is the grammar correct or am I ...
Provan and Ball [1] showed that the problem of counting the number of minimum st cuts is #P-Complete. What is known about the problem of approximating the number of min st cuts? Is it possible to get a Fully Polynomial Randomized Approximation Scheme for it? [1] Provan, J. Scott, and Michael O. Ball. "The complexity of...
I came across a statement in my book which claims that the problem P1 in NP-C and P2 is P. P1: Given graph G(V, E), find out whether there exists an independent set of size k in the graph, where k is any positive integer. P2: Given graph G(V, E), find out whether there exists an independent set of size 5 in the graph. ...
Given is a language $A = \{ a^n\:b\:c^{2n}\:b^m |\; n ∈ N^{+} ;\; m ∈ N \}$ ; where $N^{+}$ are the natural numbers excluding 0. I have found a type-1 grammar to describe it: $S \to A_1A_2$ $A_1 \to aA_1cc \;| \; abcc$ $A2 \to bA_2 \; |\; \epsilon$ However, this doesn't tell me much about the language's Chomsky typ...
I encountered an algorithm to solve a real world problem, and I remember a class I took where I made something very similar for some for a homework problem. Basically it's a plot of points, and the lines are drawn to be equidistant between two points. It forms a perfect partition where the lines around the point form ...
Given a directed weighted graph, we need to mark all edges (represented by an ordered triple of (source,destination,weight) ) which lie on some shortest path from source to destination (there could be more than one shortest path); I know that it can be done by running Dijkstra two times, first from source and another ...
When 54 bytes of data is transferred using the UDP protocol, the efficiency is? (In per cent) IN UDP, the maximum datagram size can be $2^{16}-1 \, bytes$ Now to this, 8 Bytes of UDP header is included and this together must fit within $65535\, bytes$ IPv4 packet limit(Including 20B IP Header size). So, maximum data th...
I am not able to understand how to write a recurrence relation for n queen problem. I searched on web and everywhere it was given directly without explaining how can we arrive to that. Recurrence relation is for n*n board $T(n)=n*T(n-1)+O(n^2)$ but think it should be $T(n)=T(n-1)+O(n^2)$ as if we put the queen anywhe...
I currently have an undirected weighted graph. I am trying to find a good algorithm for learning/finding a cluster of closely related nodes and/or loosely relationship within a cluster in a graph given a size of the cluster. For example, here the longer edges represent the farther relationship between 2 nodes. We ident...
I have some questions about the PUMPING LEMMA. First of all, I do not study computer science, I still go to school, but I'm very interested, so I could make mistakes. And sorry about my English :) Now my questions. What is the easiest way to find a word, to start the Pumping Lemma? Are there some tricks I have to know?...
The problem I'm trying to solve is difficult to to give a single name, but I'll call it the ordered decision tree problem. Imagine a row of commands: A -> Perform X B -> Perform Y C -> Perform Z You read the above as if the data you're looking at is A, perform X, else if it's B, perform Y ... Now let me add more log...
Suppose I have an NP problem, $\text{PROBLEM}(n)$, such that for certain values of $n$ I can get a reduction from vertex cover with $n$ vertices, and for others such a reduction is not possible (if $\mathbf{P}\neq\mathbf{NP}$). More precisely, there exists an infinite set $M\subseteq\mathbb{N}$ such that for $m\in M$ w...
I am trying to find an algorithm to determine whether a $N\times N$ matrix of ones and zeroes could have a sublist of ones, such that in that sublist we have only one $1$ from each row or column.
I have a set S of (key, value) pairs and a large number of subsets of S. I'm looking for a data structure that would efficiently execute the following operations : Add a (key, value) pair to S and to a collection of subsets. Delete a (key, value) pair from a collection of subsets containing this pair (not all of them...
I have to determine the Optimal Multiplication Order for above matrices using Dynamic Programming approach and also present that sequence (i.e. optimal order) in Binary Tree. Consider the following five matrices A, B, C, D and E along with their dimensions; A=(6×5) B=(5×1) C=(1×7) D=(7×4) E=(4×2) Af...
The memory that stores the input is called the input memory. The memory that an algorithm additionally occupies during the computation is called the working memory. $\textit{Model of Computations}$ Word RAM : This a very well known model of computation. Read-only word RAM: Where input memory is assumed to be read-only...
1) I need to determine recursion tree depth for strings composed of 10, 100 and 1000 elements when using merge sort. For the 10 elements one/I can do it on a paper, just drawing tree, but what about 100 or 1000 elements? How do I determine recursion tree depth for them? Is there any pattern that I cannot see? What if s...
In a computer, the processor executes different threads and changes between them, the operating system is a program at the end that it´s being executed by the processor, there exists the posibility that the processor is not executing the code of the operating system, if there is, shouldn´t this cause problems with the ...
If I were to pose the question: "Given a program $P$ containing statement $X$, will $X$ be executed (given enough runs with all possible inputs)?" This strikes me of being a relative of the Halting Problem, but I just don't know the taxonomy here. What is the name of this problem, or does it not have a name because it ...
I am working on file formats conversion. Some of them can be converted back and forth to others without losing any information (fields or precision of the numbers encoded), others file format do not take into account some data or meta-data or use approximated values. I was looking for a term to describe the first case...
I know that decidable problem: has both counting (bijection with $\mathbb N $) and membership algorithm (TM halts for both member and non member strings ) semidecidable problem: has counting algorithm and TM halts for member strings countable problem: has only counting algorithm Now I have come across undecidable lan...
Are hashing algorithms constructed to guarantee that no fixed point exists? My assumption is not, because I don’t see what utility that would have. (Please correct me if I’m wrong.) As such, purely for curiosity’s sake, have any fixed points of common algorithms (e.g., MD5, SHA-256, etc.) been found?
I have this algorithm taken out from the Manual of Algorithms Analysis: function pesky (n) r:=0 for i:=1 to n do for j:=1 to i do for k:= j to i + j do r := r + 1 return (r) I understand the time complexity of this algorithm for any given input size n > 0 will be O(n^3) since the 3 for loops will always be...
The manifold hypothesis is the statement that real-world high dimensional data (such as images) lie on low-dimensional manifolds embedded in the high-dimensional space. It has been tested to be true quite extensively. So could someone explain or give some intuition why it is true? Why doesn't real world data such as do...
Let $P$ be any nontrivial property of the language of a Turing machine. Prove that the problem of determining whether a given TM’s language has property $P$ is undecidable. Proof:(This is from sipser's book). Assume for the sake of contradiction that $P$ is a decidable language satisfying the properties and let $R_P$ b...
Why proving that we can verify the solution of a problem is polynomial time is sufficient enough to say that the problem is nondeterministic polynomial time? Please note: this is not a question on how to prove a questions is NP, but instead asking why, we can just do so? If there is more step we need to do, what are m...
I'm searching for a simple algorithm to allotment a real estate unit for the customer based on the customer preferences like the following table. Each customer has a priorities and we should allocate a unit for each customer, what is the name of this algorithms type to cover all scenarios.
I'll try to do my best to explain this. I have X circles (from 2 to 4) which can move around smaller pivot circles. The pivot circles are fixed and cannot be moved once they are in the "field". Pivot circles are never created colliding with other pivot circles. Something like this: Red are pivot circles (fixed) and or...
Suppose we have a two-dimensional table $T$ with $r$ rows and $c$ columns that is sparse. Let $T[i][j]$ be the element at the $i$th row and $j$th column of $T$, with zero-based indexing. We can compress $T[i][j]$ by putting all elements in a single 1D array $A$, and letting $A[D[i] + j] = T[i][j]$. Now with $D[i] = ci$...