instruction
stringlengths
35
29.1k
When talking about kolmogorov complexity, I understand that it describes true randomness of given (for now) a string $x$, if we can describe x in less than the $|x|$ then its complexity is said to be $C(x) \leq |x| + c$ my question lies in finding that c for a given problem. Given this problem there is a constant $c...
I have the ambition to build an application that determents the best set of orders. Let's say I'm an postage-stamp collector. And I have certain postage-stamps on my wish list. On the secondhand-market are many sellers selling my desired stamps. The sellers originate from around the world. Some offer the postage-stamp ...
How to solve the following recurrence involving binomial coefficients, where $c$ is a constant non-negative integer, and $n$ and $k$ are non-negative integers ($n \ge k \ge 0$)? $$ A(n,k) = A(n-1,k) + A(n-1,k-1) + c, \\ A(n,0) = 1, A(n,n) = 1 $$ My Attempt: Without the constant $c$ (or $c=0$), $A(n,k)$ is just $\binom...
I have been searching for the applications of the LU factorization/decomposition in computer science. From Wikipedia, I have found some of the applications, but these don't seem to be relevant to computer science. Applications I found are Solving linear equations Inverting a matrix Computing the determinant Is there ...
I need a little clarification on differing time complexities. My analysis for the below algorithm was $O(n +nm)$, but the correct analysis would be $O(n+m)$. I know that Color takes $O(n)$ time to initialize and the inner for loop takes $\mathrm{deg}(v)$ time, which by the handshaking lemma, wouldn't the inner for loop...
I understand how vector clocks detect concurrent events, but they are designed for a fixed number of nodes, so we can't easily add and remove nodes. And with interval tree clock we can. Could you help me grasp how they work: Interval Tree Clocks: A Logical Clock for Dynamic Systems. I don't understand the graphic notat...
I am trying to understand the concepts behind the InceptionNet V3 and got confused with the meaning of representational bottleneck. They said One should avoid bottlenecks with extreme compression. In general the representation size should gently decrease from the inputs to the outputs before reaching the final re...
So I'm having some discrete elements X1,X2,...,Xn with positive weights Wi (all weights sum up to 1). The weighted average is an element Xk that: What I want is an algorithm to calculate that Xk in O(nlogn) time with the use of sorting algorithm. Any ideas to give me a boost? I don't want the whole solution, just some...
I am starting read a book about Computational Complexity and Turing Machines. Here is quote: An algorithm (i.e., a machine) can be represented as a bit string once we decide on some canonical encoding. This assertion is provided as a simple fact, but I can't understand it. For example, if I have an algorithm which...
How to ensure data integrity in General Purpose Registers (GPR registers) given their limited number (for x86 their number is 6),and on the other hand that they are used simultaneously by all processes?
I understand that to work out the number of faces of a connected planar graph, you use Euler's formula F = A - N + 2, where A is the number of arcs and N is the number of nodes. For a triangle node (3 arcs and 3 nodes), the number of faces would therefore be 3 - 3 + 2 = 2. But I can't count two faces, only one (the tri...
I have a language $L^*$ for $L = \{pi,po\}$ (I think pi counts as one letter and po also as one letter otherwise a max length of 9 is not possible). The question is how many words I can make with $L^*$ where the maximum length is 9. The answer is 31, but I do not know how it got calculated. How is this calculated?
I have a large number of sets, A, B, C, ... where each set includes a few integers. I would like to find the set that includes the highest number of other sets. A brute-force solution is to compare each set with all other sets and count the number of sets that are included in this set. Finally, pick the set with the h...
I need to design a hash function that fits this criteria: Limited to 32-bit integer operations (for compatibility with JavaScript bitwise operations, my target system) Produces an n-bit hash digest, greater or equal to 64-bit, with the expected collision probability of a hash of that size. Effectively combining multip...
Does $NP\subseteq RP\implies NP=RP$? Does $PP\subseteq RP\implies \oplus P=NP=RP$? At least what additional minimal conditions will give truth of above?
Just a pre-warning - I'm new to machine learning and the concepts that come with it, so please be nice with the terminology! I have a directed Graph which represents a home and some devices in it. Users are able to create rules to control how devices interact with each other (e.g. when motion sensor triggered, turn on ...
So i came upon this question where: we have to sort $n$ numbers between $0$ and $n^3$ and the answer of time complexity is $\mathcal{O}(n)$ and the author solved it this way: first we convert the base of these numbers to $n$ in $\mathcal{O}(n)$, therefore now we have numbers with maximum 3 digits. now we use radix sort...
There are relativistic spacetimes (e.g. M-H spacetimes; see Hogarth 1994) where a worldline of infinite duration can be contained in the past of a finite observer. This means that a normal observer can have access to an infinite number of a computation steps. Assuming it's possible for a computer to functional perfectl...
I have same experimental data with same noise: I have to calculate the derivative and the integral of the function that fit the experimental data. I try with all the function in this page but the result was not good. How can I do that? Update: I look for same method to interpolate the data in order to calculate the de...
I'm looking for some kind of edit distance measure between what may be called 'non-discrete symbols sequences'. By a discrete symbol sequence I would mean something like a string, where each symbol has a fixed length and there are fixed positions for symbols. A well-known edit distance measure between strings is the Le...
Say I have two real number types. They may be floating or fixed point. How can I construct a new type whose values are at least the union of the two with the minimal number of bits? There are 3 cases to consider: Fixed (Qa.x) $\cup$ Fixed (Qb.y) - I think the best here is to use Qmax(a,b).max(x,y). I think this is opti...
I sort of get what it is, but I don't understand how its actually supposed to be used in algorithms. Suppose the hash function is $h_{ab}(x) = ((ax+b) \mod p ) \mod m$ where $a$ not equal to 0. If I wanted to insert something into the table, would I calculate the bucket to place it in using the hash function and then p...
I don't get the formal way of proving the following cases: Suppose I have a minimum spanning tree $T$ in a graph $G(V, E)$, with positive edge weights $w$, I want to prove the following: 1) If I increase the edge weight of an edge that is not in $T$, then my resulting tree is still the minimum spanning tree. This obvio...
The interpreters used for running scripting language (i.e., JavaScript, Perl, PHP, etc. ) programs go line-by-line. Isn't it better to Avoid too many function invocations for programs written in said scripting languages? However, Avoiding writing functions would be really a pain because you would have huge blocks of ...
Let $n, k > 0$ and $0 < m < nk$. I want to fill an $n$-length array $A$ with random integer values in the range $[0,k]$ such that $\sum_{i=0}^{n -1} A[i] = m$. Furthermore, all such arrays should be equally likely (that is, any valid array should occur with equal probability to any other). For example, if $n = 3, k = 2...
I have a question. All finite languages can be decribed using a regular expression?
I'm trying to get a better understanding for the relationship between decidability and a few other things so that I can get a better grasp of the topic. Any info helps! Is every decidable language a deterministic context free language? Are there any decidable languages that are not recognizable? Is the question "Does a...
In one of my homework I am requested to find a Context-free-grammar (CFG) and a push down automaton (PDA) for the following language: $L = \{x_1\#x_2\#...\#x_k | k \geq 2, \text{ each } x_i \in \{a, b\}^*, \text{ and for some } i \text{ and } j, x_i=x_j^\mathcal{R}\}$ My problem is that the statement $\text{ ... and f...
It is required to count number of unordered pairs in an array of size n , l[i]+l[j] = 2*l[k] , where 1<=i< j<=n and 1<=k<= n My Approach: l = [1,3,5,4,2,5] l.sort() l2 = [] for i in l: l2.append(2*i) count = 0 for combo in combinations(l, 2): if sum(combo) in l2: count+=1 print(count) # count come...
I've been going through the control signal table and I noticed something confusing on when I should set the value as 'don't care' or 0 for control signal. For example when doing the R type add instruction, we don't go through the data memory. When we are done with addition inside the ALU, the result will justbypass t...
I have an array $A$ of $n$ integers. I need to find all quadruples $(i,j,k,\ell)$ such that $i<j<k<\ell$ and $A[i]=A[k]$ and $A[j]=A[\ell]$. What is the best way to do this? My attempt is an exhaustive search algorithm that works as follows: Generate all quadruples $Q=\{(i,j,k,\ell): i<j<k<\ell\}$. For each quadruple...
Below is my solution. Is this sufficient enough to prove? $$|x^3+5x| \le |x^3+5x^3|$$ $$x^3 + 5^x \le 6x^3, x > 1, C=6$$ Let's take $x = 2$. $$f(x) = (2)^3 + 5(2) = 18$$ $$g(x) = 6\cdot 8 = 48$$ For when $x > 1 |f(x)| \le C|g(x)|$ is false hence proving $x^3 + 5x$ is not $O(x^2)$.
Say you've got a number of sets $S_1,...,S_n$ given and are supposed to calculate $\,\,\displaystyle\big|\bigcup_{i=1}^n S_i\big|$ . The basic approach probably would be to use the classic inclusion-exclusion principle $\displaystyle\sum_{\emptyset \not= I \subseteq \{1, \dotsc, n\}} \left(-1\right)^{|I|+1}|A_I|$ , whe...
Do we need visited boolean flags when applying BFS on a tree ? /** * Traverse the grap as BFS * * @param {String} $vertex the key of the source vertex * @param {Function} $getAdjacentCallback to get the adjacent verticies * @param {Funcrion} $visitCallback called when a vertex is visisted for...
I have a word list like "English Open Word List" used to create word games. The list is in txt file with space between words, like; aa aah aahed .........and so on. I want to search it while typing the letters in the word, like google suggestions in the search bar. What is the fastest algorithm to do it? In any languag...
I understood how Horner's method reduces the complexity(number of operations) while evaluating a polynomial. I have a character array derived from a string String s = "hi how are you" char[] array = {'h' , 'i', ' ', 'h', 'o', 'w', ' ', 'a', 'r', 'e,' ' ', 'y', 'o', 'u'} I want to generate hash for set of charact...
I read an article https://www.geeksforgeeks.org/maximum-bipartite-matching/ to solve the maximum bipartite problem. In this article, two solutions are given. In the first solution, they have explained that we can use edmond-karp algorithm to find the maximum bipartite matching and that would take $O(|E|^2|V|)$ and the...
Given a finite DAG $G = (V, E)$ with $|E| \in \mathcal{O}(|V|)$, I want to compute a total ordering $<$ over $V$ that is compatible to reachability: If there is a transition $(u, v) \in E$, then $u < v$. The only way I could think of was to use Floyd-Warshall to compute a reachability matrix and then somehow extend tha...
I have been studying Integer Programming and I find out that some optimization problems are referred to as P or NP-Hard, however, as I started to read about it, it turns out that those classes are just for decision problem. Thus: What does it mean that an optimization problem ($\max\{f(c)\mid x\in X\}$) is NP or NP-Ha...
I am reading the following paper https://pdfs.semanticscholar.org/5e86/db52119d2d691af0365cdba7bb27dc0dc303.pdf and trying to implement the tabu search algorithm they describe for image segmentation. In page 2 of the paper, in step 4 and 6 of the algorithm HTS, they say that if certain conditions are met "then $z_{ij}(...
I am trying to come up with an efficient algorithm to solve the following problem but not able to design anything nice. I am encountering this problem for a project I am pursuing. Following is an abstracted version of the problem so that I don't confuse anyone with the specifics. The problem is like this: I have a lis...
I suppose not, but I do not have a clear way to prove it. Right now, I am trying to find a counter example that there exists a language that cannot be reduced from the language, but I am not sure if there is the right direction.
I can't get what is the operator-precedence grammar... I need to convert this grammar to the grammar of weak precedence but I can't get it even. What does this notation mean A -> aXYb? What's a, X, Y, b? Can someone show a real sample of OPG (grammar + some built expression)? How many start states can it have? I tried...
I have been reading about stack-based programming languages, such as FORTH and Cat, and it seems that given their nature, they can only execute one action at a time regardless of their paradigm (FORTH is imperative whereas Cat is functional). An imperative language would modify the stack, and a purely functional langu...
if 0==(n mod 4) then do somthing ϴ(n^2) else if 1==(n mod 4) then do somthing ϴ(n^3) else if 2==(n mod 4) then do somthing ϴ(n^4) else if 3==(n mod 4) then do somthing ϴ(n^5) what is best case and worst case for this algorithm?
Are there any advantages in finding the shortest tour for the problem if edge weights are much smaller than the number of vertices? Let's say the maximum edge weight is $n$, and the number of vertices is $n!$, and the adjacency matrix is dense and all distances $d_{ij}$ satisfy $0 \le d_{ij} \le n$. Are there any known...
I am working on a project where I have to train the following data-set using machine learning algorithm. One of my friend suggested decision tree, but I have never seen a situation where independent variable has more than 100 values in decision tree. I need help for choosing algorithm. Dataset is custom made and small....
I am currently studying this book on distributed systems. In the chapter on message ordering the authors appear to use the term total message ordering and synchronous message ordering interchangeably. It make sense why the authors may have done this. As far as I undertand a synchronous message-passing system enforces a...
In Chapter 2 (Page 76) of the book "An Introduction to the Analysis of Algorithms (2nd edition)" by Robert Sedgewick and Philippe Flajolet, the authors introduce two functions: Definition Given an integer $N$, define the ruler function $\psi_N$ to be the number of trailing $1$s in the binary representation of $N$ and ...
This came when I was looking at block scoping in compiler design. { A { B } { C {D} {E} } } For the above pseudo code, the order in which the scope varies as we scan left to right is A B A C D C E C A, where A to E represent scopes. A parse tree can be constructed for the above pseudo code: A / \ B C /...
Several computation models have representative programming language counterparts, as, according to this answer, Snobol for rewriting systems, APL for combinators, Lisp/Scheme for lambda calculus, and off course the family of imperative languages for TMs (or more precisely RAMs). It seems to me that Prolog should also b...
I am trying to get my head around "State Machine Replication". I understand that it is a way to ensure resilience against failures. I have read that in order to provide fault tolerance against normal failures it can be derived that, there must be 2F+1 replicas and 2F+1 replicas in the case of Byzantine failures, when m...
I'm given a number $n$ and I have to find the smallest number possible whose sum of digits' cube is equal to $n$. For example $n=9$ then output should be $12$, because $1^3 + 2^3=9$.
EDIT: if you are not familiar with the problem and the solution, it's nicely explained here. I have solved the n-Queens problem as an exercise using backtracking (recursion), but the problem I have right now is I get multiple permutations of the same solution: n = 4 (0,1) (1,3) (2,0) (3,2) (0,1) (1,3) (3,2) (2,0) (0,1)...
Given an array $A[1],\ldots,A[n]$ of natural numbers, we have to construct a new array $B[1],\ldots,B[n]$, where $B[i]$ is equal to $A[j]$ for the minimal $j > i$ such that $A[j]$ divides $A[i]$, or $-1$ if no such element exists. For example: $$ \begin{array}{c|ccccccc} A & 10 & 4 & 5 & 2 & 1 & 8 & 4 \\\hline B & 5 & ...
Given a graph/plane with N points each at a given coordinate how could I find a path between 2 points via N other points where each point is weighted on how likely it is to be passed through. Distances between points can be calculated Path must be less than a given distance Apologies if the vocabulary isn't quite r...
I am currently following a course on Data Mining and i am very curious about the deeper underlying method. As far as i have learned so far data mining is about finding unknown patterns that can be useful and provide new knowledge about your data. In data mining, is it okay to start from expectations (bias) as to which ...
After reading about Category Theory at https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/ I was wondering whether we can represent any program by means of a walk of a graph induced by the category of types. EDIT: rephrasing the question a little bit. So, given the category of types wher...
I have some confusion about the differences between finite & infinite. can someone tell me how the Toll machine or Park meter, soda vending machine can be used with infinite language? if not, please give me an example of other application.
I am having trouble transforming a maximum weighted spanning tree into a directed tree such that each node is allowed at most one parent node. Taken from page 141 Friedman et. al (1997), the outline of the algorithm is as follows: 1) Compute $I_{\hat{P}_{D}}(X_{i};X_{j})$ between each pair of variables $i \neq j$ where...
Given this following recurrence: $$T(n) = T(n/2) + O(n)$$Find the final time complexity. My first thought is $O(n\log n)$, since there is at most $\log n$ times the $O(n)$ will appear. However, if we adopt the following analysis and let $n=2^m$, then we have: $$T(2^m) = T(2^{m-1}) + k(2^m) = T(2^{m-2}) + k(2^m + 2^{...
I have a set of elements $x_1,...,x_N$, they take values $x_i \in \{0,...,N\} $ for all $i \in \{1,...,N\}$; I need to sort them. I think I can do that with complexity $\mathcal{O}(N)$, where I can create a matrix of $N\times N+1$ where the colomns represent the sorted values of the range, i.e., $\{0,1,2,...,N\}$, and...
Given 2 collections of finite sets $A_1,A_2,\ldots,A_m$ and $B_1,B_2,\ldots,B_n$, is there a set $T$ such that: $\left|T \cap A_j\right|\ge 1$, for $j = 1,2,\ldots,m$ and $\left|T \cap B_i\right|\le 1$, for $i= 1,2,\ldots,n$? I tried doing this problem by considering it as a decision problem (pi). Please suggest me if y...
I have recently started thinking about application of SAT in solving different problems and how I can encode those problems into a SAT problem. I think one of the interesting problems where SAT solvers can be used is finding a minimal representation for a logic expression. However, I have trouble encoding the problem i...
Let the characteristic sequence of a set $A ⊆ \mathbb{Z^+}$ be the following infinite binary sequence: $$χ_A = b_1b_2b_3\ldots,$$ whose $n$th bit is 1 if $n ∈ A$ And 0 otherwise. Write $χ_{A,n}$ for the first $n$ bits of $χ_A$. Prove for every decidable set $A \subseteq \mathbb{Z^+}$ there is a constant $c ∈ \mathbb{N...
A cache memory has a line size of eight 64-bit words and a capacity of 4K words. The main memory size that is cacheable is 1024 Mbits. Assuming that the addressing is done at the byte level, show the format of main memory addresses using 8-way set-associative mapping. So here's what I have understood from this quest...
Question: In the problem below, does proving $T(n) = O(n^2)$ and $n^2 = O(T(n))$ lead to the same result as proving $T(n)=O(n^2)$ and $T(n)=Ω (n^2)$? Which would be the better approach to take? I feel like I am not getting the big picture. Right now I am just trying around until I find something that seems plausible. ...
To me (but I might be wrong) Rice's theorem asserts that it's not possible to formalise the demonstration of a non-trivial property of a recursively enumerable language within the same given language. The modus ponens being the basis for demonstrating, Rice therefore says in substance that you will necessarily need a m...
Does $2^{n-1}$ and $2^{n}$ share the same complexity complexity class as exponential named as $O(2^n)$? So the former belongs to $O(2^n)$ even though it's one order lower? What is the name of the complexity complexity class of $O(n2^{n})$?
We have given integer array of $n$ points, let it be $A$, showing where it is on the x-axis. For this problem we are working only with the x-axis and the y-axis is not important at all. Now for given two indexes $l$ and $r$, such that $0\leq l\leq r \leq n-1$, we want to find the sum of distances from each point whose ...
I have to construct NFA that accepts language $L=\{wbbav \;|\; w \in \{a,b\}^*, v \in \{a,b\}^+, v\; has\; suffix\; a\}$. My solution is this automata: Can you tell me, if this is correct or not? If yes, it is possible to construct this NFA with less states?
I have been trying to do a product construction(intersection) with 2 DFA which has dead states, but I'm stuck at the transition table with a confusion that,what should I do with dead state. Should I also combine the dead state with other states?
I am interested to learn more about topological graph theory and Graph Embedding. Assume I have a metric space, $d \colon M \times M \to \mathbb{R}$ and a graph, $G=(V,E)$. What is a rigorous way to define a valid embedding of $G$ given $d$ and how to find such an embedding? Edit: I found this post about embedding gr...
Max 1-in-kSAT is the following maximisation problem : Given $n$ variables $x_1,\dots,x_n$, and $m$ clauses $C_1, \dots, C_m$, find a valuation such that the number of clauses satisfied by exactly one literal is maximal. In the following paper, there are several inaproximability results about this problem, such as Theo...
I need to give the LL grammar for the language below and explain why the grammar is LL and what the value of $k$ should be: $$L = \{ a^n c^m c^{n+m} : n \ge 1, m \ge 1 \}. $$ I have the following, but it works for $n \ge 0$ and $m \ge 0$. I'm not sure how to get rid of that case where $n$ and $m$ are 0. $$ \begin{alig...
A claw is the graph isomorphic to $K_{1,3}$, that is, a star graph with three edges, three leaves, and one central vertex. (see below) A graph is claw-free if it does not contain a claw as an induced subgraph. The line graph of G is the intersection graph of the edges of G, that represents the adjacencies between edg...
I have a binary array like this: $$A = [0,1,0,0,1,0]\,.$$ I'm trying to find a way to calculate how many arrays of the same length exist that have a Euclidean distance of 2 or less from this array. So, how many arrays of length 6 exist where $$\sqrt{\Sigma(A_{_i} - B_{_i})^2}\leq 2\,?$$ I'm trying to find or create a ...
I saw this from SO which led to Feedback Arc Set, which describes the problem nicely: In graph theory, a directed graph may contain directed cycles, a one-way loop of edges. In some applications, such cycles are undesirable, and we wish to eliminate them and obtain a directed acyclic graph (DAG). I am wondering how t...
I am wondering if there are dynamic programming speedups for the minimization problem $dp[i]=\min_{j<i}\{ f(a_j, a_i)\}$. Now I understand that its highly unlikely that such thing would exist for any arbitrary function $f$, but are there any speedups that can be applied if a certain condition is satisfied by $f$? I am ...
I found the following problem in my textbook and I'm having trouble with coming up with a solution. I'm thinking maybe there's a way to improve Dijkstra's algorithm by using a data structure other than a priority queue, since that's what causes the log(n) time complexity, but I'm a bit lost. Here's the question: Suppo...
I have question about the ALUOp control signal. When doing R type instructions, 31-26th bits are all 000000. What decides the instruction is actually the func field of 5-0th bits. In that case, I wonder why the ALUOp signals for the R type(add,sub,and,or,slt) below the table should all differ. I don't know why ALUcon...
Here is a quote from the Source 1: For example, if $M$ is a machine with an oracle for the halting problem, then obviously there isn't in general an equivalent machine that can simulate the oracle. But here is a quote from the Source 2: If you have an oracle for the halting problem, then you can compute the Bu...
In trying to understand how to convert DCG's (Directed Cyclic Graphs) to DAG's (Directed Acyclic Graphs) without removing all the edges, I came across this paper which says: Since the problem involves DCG, therefore a new algorithm to reduce the DCG into the form of a DAG should be proposed. It is simpler when no cycl...
This is a question about Markov Models. Let's say we have the following situation Let's say that we want to find the probability that $2$ rainy days follow a nice day. You'd simply have $0.25 \cdot 0.5=0.125=12.5\%$. However let's take it up a notch. What's the probability that on the $7^{th}$ day it's snowy? Or in ge...
We have 2 periodic tasks that start at the same moment in a monocore processor. Why can happen that, even if the utilization factor is <= 1, the 2 periodic tasks are not schedulable ? For example, in this picture the 2 tasks are schedulable, but if i increase the computation time of the first task of 1 ms, we've got th...
I have two array of the same set of elements, say for exemple: $a_1 = [x_1, x_2, …, x_n]$ and $a_2 = [y_1, y_2, …, y_n]$ so that $i \neq j \Rightarrow x_i \neq x_j$ Is it possible, in linear time, to construct the array $[(x_1, k_1), (x_2, k_2), …, (x_n, k_n)]$ so that $y_{k_i} = x_i$ ? I found that with dictionnaries,...
I am given a boolean circuit of depth $D \ge \log n$ where $n$ is the input size. Given an input, I need to find an algorithm that evaluates the circuit in space $O(D)$. Now, assuming the fan in of each vertex is at most 2, I can set 2 bits for each vertex, one for the value of the vertex, and the other for which of hi...
Consider we're given a set $S\subset \{0,1\}^n$ and we want to find a minimal subset $A \subset S$ under the property that if we bitwise OR all of the strings in $A$ we get the all ones string $1^n$. I have been having trouble finding a polynomial time algorithm for this or finding evidence that one doesn't exist (e.g....
I have an exam coming up and my teacher posted a practice exam for it. Problem is that I solved the question but I am not sure if I am doing it right or getting the right answer as he refuses to give us an answer key to confirm if we got it right or not. The question goes Given a simple page table as the figure below...
Here I am talking about the Functor category, which is defined as a category whose objects are functors and morphisms are natural transformations. For reference: https://ncatlab.org/nlab/show/functor+category I was wondering if it is possible to define this in Haskell. If we define category like this: class Category ca...
Right now I am working on a distributed system that sends messages from single source to many nodes. It is necessary that certain messages are sent to the same node to ensure order of processing. Using simple hashing on an important piece of the message to decide which node to send to works but leads to significantly u...
I have variables $a,b\in\mathbb R$ and if $a>1$ I want $b=1$ or else $b=0$. Can this be encoded by linear programming (no integer variables)? Even $b<0.5$ and $b>0.5$ is ok.
A remarkable feature of the reduction showing that TQBF (True Quantified Boolean Formulas) is PSPACE-complete is that it actually runs in logspace, i.e. for any $A \in \mathsf{PSPACE}$, $$ A \le_L TQBF. $$ (See for example, comment at the end of section 7.4 in these notes.) Therefore, TQBF is complete with respect to l...
I read that the Babbage machine is Turing complete. Which means that no decision Turing machine will halt on the question "does the Babbage machine computes the logarithms of its input?" (for example). The way I imagine that is there is no finite method (i.e. algorithm) which would examine the Babbage machine, possibly...
The problem involves date intervals filtered by days of week. For example, the filtered interval {2001 APR 1 - 2001 APR 30, 17} corresponds to all Mondays and Sundays between April 1 and April 30. Here is the problem: given a collection of filtered date intervals, find a minimal collection of such intervals that cover ...
Given: 3 positive integers $a,b,L$. Problem: Is there a positive integer $x<L$ such that $x^2≡ a(mod\ b)$? The above problem is NPComplete (as mentioned in G&J) even if we have the factorization of $b$ given. My query is the following: Is there some specific value of $a$ (say $a_0$) such that, if we limit the original ...
We are using hyperledger fabric. We have a doubt like, is there any limit, of creating number of nodes while configuring hyperledger fabric?
Assume a point set $P[n]$ with $n$ points which align in one plane in the euclidean space, so $p(x,y) \in \mathbb{R}^2$. Looking for an algorithm to construct an AABB (axis aligned bounding box) I did not find anything. But I thought that the simpliest appraoch could be the best: traverse all $p \in P$ and keep track o...
I have been trying to implement a Van Emde Boas tree in python, but I'm having trouble understanding how exactly it works. In the notes here, It states that the summary of a VEB structure is another VEB structure, and the individual clusters are also VEB structures. Does that mean that the individual clusters than also...
Given a sequence of 1 and 0 elements, what is the number of possible partitioning of the sequence in sub-sequences (not necessarily consecutive elements, and any number of sub-sequences are allowed) so that any sub-sequence starts and ends with a 1, and can contain an arbitrary number of 0s? For example: Given the sequ...