instruction stringlengths 35 29.1k |
|---|
I have been trying to come up with a better algorithm that detects conflicts in the scenarios below.
Let's say we have 4 dancers. We pair them up and find out which ones can dance together. So, we have the dancer # combination and whether they can dance together or not.
(1,2) True
(1,3) True
(1,4) False
(2,3) True
(2,... |
I'm trying to understand the paper Incentive Compatibility of
Bitcoin Mining Pool Reward Functions (Schrijvers, Bonneau, Doneh and Roughgarden, in Financial Cryptography and Data
Security – FC 2016 Workshops, BITCOIN, 2016; PDF).
In page 3 Section 2.1, they say pool operator does not know actual $\alpha_i$ mining power... |
Say I have a bidirectional graph G and I have the list of articulation points and bridges of this graph. Say, the list of articulation points is ap[] and the list of bridges are bridges[]. Now, if I remove a node which does not belong to the list of ap[], meaning, this node is not an articulation point and deleting thi... |
The below example confused me:
lw $r0, 4($r0)
sw $r0, 4($r0)
add $r0, $r0, $r0
Using MIPS 5 stage execution what are the hazards we have 1) without forwarding 2) with forwarding only in the stage of execution (exe or alu) 3) with forwarding. Add nops to eliminate hazards.
|
Since if I want to increase the priority of a specific node, how do I find the node without linear searching it.
I need to pass the index to this function, which is in a way a bottleneck. So the question is, how can I avoid it? Or exactly this data structure doesn't provide any solution for this problem?
Link: web.cse.... |
Let $G$ be an undirected graph, seen as a network of 1 Ohm resistors.
As explained by this article (or stated on Wikipedia), the effective resistance between any two vertices can be obtained by taking the pseudo-inverse of the Laplacian matrix $L$ of $G$.
Are there any efficient ways to compute this? Say I am only inte... |
I've been trying to internalize some of the basic sorting algorithms recently, and to do so I've been looking at their wikipedia pages to refresh myself with how they work, and then coding my own "version" of the algorithm from there.
I did this with MergeSort recently, and I got an algorithm that for what I can tell... |
I'm learning about floating point numbers and I don't quite understand when one should interpret an exponent as moving the decimal point to the left.
By book shows an example of converting -10.5 into binary in normalised form (using 8 bits):
First we convert it into binary without normalisation and use a fixed floati... |
We know that linear bounded automatons accept context-sensitive grammars.
Now suppose that we modify the LBA such that any location of the tape except the
input part can be changed.What language does this automaton accept?
I think it is as strong as the standard Turing machine because we can copy the input part som... |
Assume one wants to store $1000$ distinct integers of $5$ digits in a hash table that is defined once for all (the intent is to hard-code it).
We have some freedom to change its behavior by changing the number of buckets and/or the hashing function.
Is there a theory that can help minimize the worst-case or average-cas... |
Note: this is from JeffE's Algorithms notes on Recurrences, page 5.
(1). So we define the recurrence $T(n) = \sqrt{n}T(\sqrt{n})+n$ without any base case. Now I understand that for most recurrences, since we're looking for asymptotic bounds, the base case wouldn't matter. But in this case, I don't even see where we cou... |
I am building a small library for computing information retrieval metrics for classifiers (precision, recall, f1, accuracy, whatever). Typically each metric is built by calculating a single value for each object being classified (each metric will have its own formula there) and then calculating a single value (an avera... |
I read that recursive definitions, refer to the definition of a function in that function body, cannot be done in $\lambda$-calculus, but recursion can be achieved by using $Y$ combinator.
As I know, nominal logic is the theory of handling bindings. So wondering how it handles recursive definition of functions? Does i... |
I have to prove that
$$\mathcal{O}(g(n))\subseteq\mathcal{O}(f(n))\implies\mathcal{O}(f(n)+g(n))=\mathcal{O}(f(n))$$
The functions are non-negative.
Clarification:
$$\mathcal{O}(f(n)+g(n))=\mathcal{O}(f(n))$$
it means
$$\mathcal{O}(f(n)+g(n))\subseteq\mathcal{O}(f(n))\land\mathcal{O}(f(n))\subseteq\mathcal{O}(f(n)... |
Following the blog post, where the dropout in the deep learning models has been approximated to a Gaussian process. Research paper and its appendix.
Looking at the suggestion of the author from the blog post that the variance in the prediction is given by the following piece of code. I found it counterintuitive as the ... |
I have an equation $x = 3a+4b+2c+4d$, where $a$, $b$, $c$ and $d$ are nonnegative integers such that $a+b+c+d=5$.
What algorithm can I use to calculate maximum value of $x$?
|
I came across a set of articles back from the 2000s that stated Intel was planning a 10Gz CPU by 2011. Obviously, this didn't pan out. But how well are Moore's law and it's cousins holding up in terms of:
Transistors per \$1000
Floating point operators per \$1000
The performance of the world's most powerful supercompu... |
I don't have much experience with ML but am looking for some guidance on where I should start.
I have timestamp data mapped to a certain category, e.g. travel, food, groceries, etc.
Judging by some other posts and answers, would it be correct to break the data into these intervals (day, week, month, year) and then tr... |
Consider a standard LP minimization problem of the form
$$\begin{array}{ll} \text{minimize} & c^\top x\\ \text{subject to} & A x = b\\ & x \geq 0\end{array}$$
Should I expect, on average, an improvement in the number of iterations needed to achieve optimality if adding a (tight enough) constraint of the form $c^\top x ... |
How can I demonstrate that the EXP class is closed under union, concatenation, and complementation?
|
I'm missing two details from Paxos made easy
P1. An acceptor must accept the first proposal that it receives.
What exactly is the reason for rule P1? What if the rule P2 was different, i.e. Upon receiving a proposal: acceptor memorizes the proposal as most recent proposal; if acceptor is not waiting with a running cou... |
Given are two following languages:
$L_1 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ visits each of its states at least once} \}$
$L_2 = \{ w\#x \hspace{1mm} | \hspace{1mm} w,x \in \{0, 1\}^* \text{ where } M_w \text{ with input } x \text{ does not visit at... |
For a numerical simulation framework, I use a hierarchical Cartesian grid in 3D to discretize the computational domain. I am thus looking for the most space-efficient way to store the resulting octree on disk, given the following conditions:
It is very sparse (i.e., not all nodes exist), but potentially deep (a depth ... |
Suppose I have a number of airports which have a set number of routes. Large airports have 7, medium airports have 4, and small airports have 1.
First of all, what would I call a graph of this type where it is undirected, has no parallel edges, no loops, and every edge is connected to another (that is no route goes unu... |
I am currently doing a research on data sensing and I came across the following concept. The requirement for me is to identify different data types using neural networks. Please note that I don't want to use regular expressions for this since it is suggested by most when I explain what i want to do. The neural network ... |
I have a set of several geometric segments, they can be defined with two points (for example a segment could be (4,6)--(2,7)).
Now, I want to query this set with another segment, and I want the operation to return whether it intersects with any of them or not. (And as a bonus, to return the instance or pointer to that ... |
Let U be a pre-determined and fixed universal set (and |U| = n = 2k for some integer k, so the set may be huge).
I create many arbitrary subsets of U in running time (These sets may be or may not be sparse).
I do not need to check whether an element is in a set.
But I need to be able to
check whether a set is empty,
... |
Regular expressions are equivalent to DFA's and describe regular languages, but is the language used to construct regular expressions regular?
My guess is that the original syntax (concat, | and *) is, but the Perl-style syntax is not (backtracking). As the newer syntax recognises non regular languages they must also g... |
In a previous question there was a definition of weight-balanced and a question regarding red-black trees.
This question is to ask the similar question, but for treaps.
The question is:
Is there some $ \mu > 0 $ such that the expectation of $ \frac{|N_L| + 1}{|N| + 1} $ not less than $ \mu $ and not greater than $ 1 -... |
I would be very glad if someone could help me with my machine learning task. I have palettes of 5 colors each (in RGB format), and would like to train the neural network so that I can input a color, and the model would give me 4 other colors that would go best with it.
My training set consists of 1500 palettes (1500 * ... |
To frame the question, in computer science often we want to calculate the product of several probabilities:
P(A,B,C) = P(A) * P(B) * P(C)
The simplest approach is simply to multiply these numbers, and that is what I was going to do. However, my boss said it's better to add the log of the probabilities:
log(P(A,B,C)) =... |
While Going through Exercise problem of " Computer Networking A Top-Down Approach" by Kurose and Ross, i encountered this problem.I am giving my approach and the point where i am stuck at.
Question
Suppose Host A sends 5 data segments to Host B, and the 2nd segment
(sent from A) is lost. In the end, all 5 data segmen... |
Let's assume that we have to generate huge number of 256-bit symmetric keys. How to do it and how to be sure that it is safe. Perhaps it requires a strong mathematical backend. Don't hesitate to reference me somewhere.
|
I would like to find cycles in a finite length list of numbers where there is no function:
xn = f(xn-1).
For example, in the list:
3, 12, 11, 46, 1034, 23, 12, 11, 46, 1034, 5
x0 = 3, x1 = 12, etc. and the cycle starts at x1 with a length of 4.
There is a Java implementation of Brent's Cycle Algorithm here which includ... |
How can I teach random number generator algorithms? I'd like to show how seeding makes randomization closer to truly random.
Details of the task to be given are as follows:
Code should read a text file. The file has random words (one word on each line). This is the dataset from which words will be selected randomly.
... |
Currently reading a recent draft of Reinforcement Learning: An Introduction by Sutton and Barto. Really good book!
I was a bit confused by exercise 4.7 in chapter 4, section 4, page 93, (see attached photo) where it asks you to intuit about the form of the graph and the policy that converged. I do not understand why t... |
I've been stuck on this problem for some time, and I don't want to just look at an answer. I'd like a hint(s) so that I can get myself thinking in the right direction so that I might gain more insight into solving similar types of algorithm problems. This exercise is actually from CLRS on the section on Divide-and-Conq... |
Given an array with $2n$ elements, we want to select the greatest $n$ elements, i.e. obtain new array with these elements, no matter of the ordering (it's not necessary to be sorted). Can we do this in $O(n)$ time?
|
Suppose we have a graph $G = (V,E)$.
Every edge $e \in E$ has a unary cost $f(e) > 0$.
Also, for every two edges $e_1,e_2 \in E$ we have a binary reward function $g(e_1,e_2) \geq 0$.
Given two vertices $s$ and $t$, is it possible to find the path that minimizes the following objective function efficiently?
$
\sum_{e \i... |
I have a problem where the values are represented to humans as [0, .5, 1, ..., 8]
But the function is massively recursive (game trees for a set of increasingly intractable problems) so I'm wondering is it more computationally efficient to use the values [0, 1, 2, ..., 16] and only divide by 2 when outputting for humans... |
I am trying to understand tick lines in Fig 2 on Page 2 of "Time, Clocks, and the
Ordering of Events in a Distributed System" paper [1]. Below are 2 things which I did not understand
What is the relation between the total no of tick lines and the events on different processes? According to his explanation (i) there mu... |
Let us have a set of N men and N women, and we have two matrices of affinities $M$ and $W$ such that $M(i,j)$ is the affinity of the ith man towards the jth woman and $W(i,j)$ is the affinity of the ith woman towards the jth man.
The problem at hand is to find an optimal stable marriage, which satisfies that:
There is... |
Data is read in terms of a block from a storage device(magnetic, optical, flash). Size of the block depends upon the filesystem and os. The physical device may have different units of storage like sectors.
Do filesystems create the abstraction layer directly over the physical device, or do they work over something cal... |
I have a set of points in a 2D plane. I'm searching for an algorithm that:
Draws a continuous line passing through all the points starting from a
random point.
Optimizes for the minimum total line length in Euclidean distance.
The line should end at the point it started but not cross any
other point more than once.
... |
Can someone give me suggestions how can I construct a 2-tape Turing machine which simulates PDA ?
|
$\mathsf{LTIME = DTIME(\log n), NLTIME = NTIME(\log n)}$.
For example, it seems that NTM can find an element in unsorted array in log-time by use of non-deterministic binary search (check if first half leads to solution and if second half leads to solution).
Obviously, it can't be done by log-time deterministically. I ... |
Let us define a "root universal family" as a family of hash function which for every two items $k_i,k_j$ the probability $P(h(k_i)=h(k_j)) \le \frac{1}{\sqrt m}$ where $m$ is the size of the table.
Now, let us have $|U| = n$ - (the size of the given universe, note that it is perfect hash).
Define an efficient perfect ... |
I know what are both locality principles and pipelining techniques. But I can't see any sort of interconnection between the two things.
How can locality principles impact pipelining techniques?
|
The Queen of England wants to organize a set of tables for n guests talking different languages. The tables have to be set in a way that every guest can speak to his neighbor on the right and his neighbor on the left.
Four possibilities come up :
1- One table for all guests.
2- One table for all guests, but we alternat... |
Set Cover: Consider a set of points X and Si a subset of X. The goal is to get the minimum number of subsets Si such as all points in X are covered. An example is shown by figure bellow. In this case, optimal solution should be OPT = {S3, S4, S5}.
Greedy Algorithm:
greedy(X, F = {S1, S2, ...})
G_OPT = {}
... |
Given a Problem $A$ that has an answer $true$ if and only if both conditions $1$ and $2$ are $false$, for some conditions 1 and 2.
Whether condition $2$ is $true$ can be tested with certainty in deterministic polynomial time. Thus, we can say that answer to an instance of $A$ is $false$ in polynomial time (in case cond... |
Are there computational models that can be considered useful for solving common programming problems, where it can be proven that computation will terminate for all possible inputs?
|
For a given positive number n. Numbers from 0 up to n, are streamed one by one in some order without repetition.
What would be recommended a strategy to store the order of these n numbers in the most space conservative way?
Highest priority is to consume minimal bits to store the order.
Second highest priority is to ha... |
There seems to be various implementations of algorithms that find the connected components of a graph.
I have not found, however, an algorithm or implementation for finding which of the connected components are also complete. Does anybody know of one?
Thank you!
|
I have been trying to find the algorithmic complexity of a problem that I have. I am almost sure it is either NP-hard or NP-complete but I cannot find any proof. Recently, I found that my problem can be something similar to a special instance of the Maximum Capacity Representatives problem, which is NP-complete. Howeve... |
While watching MIT's 6.006 Lecture # 4 which is on heaps and heapsort, the professor was explaining why the time complexity of the max_heapify procedure is $O(\lg n)$. It's quite intuitive that it's bounded by $\log n$. But there's a lurking reason also, that affects the implementation, and that reason was the key assu... |
Question:
Given 2 arrays of size $n$, $A = \langle a_1,a_2,\dots,a_n \rangle$ and $B = \langle b_1,b_2,\dots,b_n\rangle$, where $A$ and $B$ store the binary value of an integer. Find $A + B$ and stores the result in array $C$ of size $[n+1]$, $C = \langle c_1,c_2,\dots,c_{n+1}\rangle$.
Pseudocode:
ADD-BINARY(A,B)
C = n... |
Hi! I'm new here, a terrible computer-scientist, and have no idea what I'm doing; I'm more expecting / hoping for links to research on algorithms or data-structures that contribute to problems like this, than a straightforward answer (I don't even know how to properly ask the question.)
In some programming-language w... |
Currently, it is not proven that $NP \geq O(n \log n)$ in the Turing Machine Model.
The weakness of this statement can be illustrated by NP-complete problems, which we think require way more time. But I'm looking for the easiest-to-solve decision problem in P that probably has $\Omega (n \log n)$ as lower bound in the ... |
I want to construct a linear bounded automata for the language $L = \{a^nb^{2n} \mid n\geq1 \}$ . I know how LBA works but I don't have an idea how it can count the numbers of a's and check if the b's are 2 times more than a's. I would like to to hear some suggestions.
|
Let's consider the following algorithm to multiply squares matrix:
A is a matrix of NxN.
r_i, r_j defines interval of rows. For example r_i = 2, r_j=3 means the second and the third rows. c_i, c_j means the same as r_i, r_j but for columns. We assume that N = 2^s for some s.
mul(A, B, r_i, r_j, c_i, c_j){
if(r_i != r_... |
I found the following set of lemma in my lambda calculus textbook :
Lemma 1.16 Let $x, y, v$ be distinct (the usual notation convention), and let no variable bound in $M$ be free in $vPQ$. Then
(a) $[P/v][v/x]M \equiv [P/x]M$ if $v \notin \mathrm{FV}(M)$;
(b) $[x/v][v/x]M \equiv M$ if $v \notin \mathrm{FV}(M)$;
(c) $[... |
I am reading Categorial Grammar: Logical Syntax, Semantics, and Processing by Glyn Morrill and I am stuck with the Fig. 3.9:
Can someone explain this set of formulas and |.| function specifically?
This figure displays the definition of the |.| function that maps some proof (of some formula) in Lambek calculus (as frag... |
This imaginary problem involves a vector of length 5, with each value to be selected from a unique range of values.
A real-world example might include 5 different single-digit combination locks.
How many different ways could I lock a single gate, assuming that I can use any number of locks?
Assuming that each lock tak... |
"We need $k$ to be large enough so that $(\frac{1}{2})^k = O(\frac{1}{n})$, and to do this we can choose $k = \log_2 n$. Thus, when $k = \log_2 n$, the size of the active region has been reduced to a constant, at which point the recursion bottoms out and we can search the remainder of the array directly in constant tim... |
I am working on a Recommendation System as a personal project (I finish it on time, I'll present it as my final year project). I devised mathematical methods that estimated User's ratings of products based on their previous ratings, without using ML. I developed a host of such algorithms for recommendation (I developed... |
In chapter of Hardness of Approximation in V. Vazirani's book it says:
For establishing a hardness of approximation result for, say, the vertex cover problem, PCP theorem is used to show the following polynomial time reduction. It maps an instance φ of SAT to a graph G = (V,E) such that
• if φ is satisfiable, G has a ... |
I came across the following theorem in page 12 of the following pdf :
There exists an oracle relative to which there is a problem solvable
in polynomial time (with bounded error probability) on a quantum
computer, but any probabilistic Turing Machine with bounded error
probability solving this problem (using the... |
I'm trying to show that the language in the title is not regular but I don't know how to chose a decomposition $x = abc$ to express the word in the language because the $w \in \{a,b,c\}^*$ is kinda tricky for me, I know it means $ \{ a,b,c\} \cup\{ a,b,c\}^2 \cup ... \cup \{ a,b,c\}^k $ but I don't know how to chose th... |
Not All Equal SAT is an NP Complete problem. Let us now consider another variant of the problem.
Given a Not All Equal SAT (NAESAT) problem (arbitrary number of literals allowed per clause) with an additional constraint that each pair of clauses share at least 1 literal (not variables but literals).
Is this problem sti... |
Question 1
From busy beaver uncomputablity it follows that we cannot design algorithm that for every input N, generate the appropriate set of TM instructions (the bit value of every bit in every card) that run and output BB(N).
As i understand, the number of bits in the cards is growing almost linearly with N, so the ... |
To tune the parameters of Particle swarm optimization (PSO), there are two methods offline and online. In offline manner, the meta-optimization is used to tune the parameters of PSO by using another overlying optimizer. In the online manner, there are two techniques, Self-Adaptation, "consisting of adding some or all o... |
I'm trying to prove that the language L generated by the CFG $S \to aS | aSbS | \varepsilon$ is the language $L=\{ w \in \{a,b\}^*: \text{every prefix of $w$ has at least as many $a$'s as $b$'s} \}$.I proved the first inclusion $w \in L(G) \implies w \in L$. I can't prove the vice versa. By induction on the lenght of $... |
L = {w#x | w,x ∈{0,1}∗ and Turing Machine Mw with input x visits every non-end state at least once}
I believe this problem is undecidable.
My proof would consist of me reducing L to a Halting Problem; however, the structure of these proofs seem incosistent and inconclusive. I would appreciate if I could have some const... |
I know that quick sort has an average case of O(nlogn). And I also know that the average case of comparison-based sorting algorithms are Omega of nlogn. Can we say that quick sort is the best sorting algorithm in average case compared to other comparison-based sorting algorithms? (I think the answer is yes. However, I ... |
I found the following set of lemma in my lambda calculus textbook :
Lemma 1.16 Let $x, y, v$ be distinct (the usual notation convention), and let no variable bound in $M$ be free in $vPQ$. Then
(a) $[P/v][v/x]M \equiv [P/x]M$ if $v \notin \mathrm{FV}(M)$;
(b) $[x/v][v/x]M \equiv M$ if $v \notin \mathrm{FV}(M)$;
(c) $[... |
I'm looking for some guidance to get me going. I assume (and please correct me if I'm wrong) that it'll need 2 tapes and by reading various resources, I found that it might be easier with the binary string reversed.
In any programming language, I would first convert the binary string to decimal, but is this needed/a go... |
Let's state a collection of key/values.
Key is an unsigned integer (0 - 2^32-1). Hense there are comparable.
Value is few bytes fixed size.
There are 4M items in the collection.
Keys are not evenly spread in the key space i.e there is no way to predict hole size between two consecutive keys.
This collection is created ... |
I'm working on a recommendation system. My system uses user's past rating data, to predict future ratings.
I designed mathematical methods for generating recommendation algorithms that allows me to generate an unlimited number of recommendation algorithms (given a large enough set of relevant ratings).
I intend to ag... |
Main Question
We can represent subsets of a vector using, say, a bit mask. Let's say a nested subset is a pair of masks, for example
A B C D E F
1 0 0 1 0 1
1 0 0 0 0 1
is a nested subset, where the first mask tells us inclusion in the first set and the second mask tells us inclusion in the first. In this case the fir... |
I am reading a paper on recognition of online handwritten characters. One of the features proposed in the paper is "normalized first derivatives, $(\hat{x}'_t,\hat{y}'_t)$", which they have defined as follows:
$$
\hat{x}'_t=\frac{x'_t}{\sqrt{(x'_t)^2+(y'_t)^2}}\quad\quad
\hat{y}'_t=\frac{y'_t}{\sqrt{(x'_t)^2+(y'_t)^2}}... |
A receipt is an array of products. I have an array of receipts.
I need to generate a report in where I can find the products often bought together.
For instance, for a single receipt where the products bought are [A, A, B, B, B, C], a report would look like
Pair - count
A&B - 2
A&A - 1
B&B - 1
A&C - 1
B&C - 1
Notice t... |
I am aware of the frequent use of "smoke and mirrors" in order to achieve the effect of non-euclidean geometry, but I was wondering it if it possible to implement spherical (sometimes called elliptic) and hyperbolic geometries. If so, how would we do that?
|
Is $DSPACE(f) \subseteq DTIME(f)$ always?
For example, if we have a language $A\in DSPACE(log^2(n))$ can we say that $A\in P$ (and subsequently in NP and coNP) since $DSPACE(log^2(n))\subseteq DSPACE(n^3) \subseteq DTIME(n^3)$?
I know about $ DTIME(f) \subseteq DSPACE(f) \subseteq DTIME(2^{O(f)})$ but $DTIME(2^{O(f)})... |
Let me first sketch my situation. I have a list of events with time slots, and I need to generate a schedule from these. We can assume that I have already validated and ordered the events from lowest to highest priority, so I will have a list like:
Starts Ends Event
---------------------------------
0 12 B... |
In the Geometric Spanner Networks book by Giri Narasimhan and Michiel Smid Page 153 says
Definition 9.1.3 (Well-Separated Pair Decomposition). Let $S$ be a set of $n$ points in $\mathbb R^d$, and let $s > 0$ be a real number. A well-separated pair decomposition (WSPD) for $S$, with respect to $s$, is a sequence
$\{A_1... |
I am trying to generate a list of digit triplets to specify stimuli in an auditory (speech-in-noise) perception experiment. Each triplet has to have three different digits (i.e., no repetition within triplets). I have recordings of digits 0-9, recorded in each triplet position (i.e., I have 30 digits, 0 in 1st position... |
I need to create a simple text parser that replaces {tokens} with text from a table. The more complicated bit is the {?text?} tag where text must be included only if the preceding AND the following tokens exist and are not empty. You could do {?text} where it looks for a non-empty neighbouring tag only on that side.
I ... |
I'm writing a paper on the system I designed which upon receiving an event, performs a number of calculations and publishes the result to several subscribers. I can calculate the amount of time it takes from the moment the system is informed about the event, to the moment when all subscribers successfully received the ... |
In polar codes, the frozen bits in each message are determined through the worst channel, where the relevant parameter is the Bhattacharyya .
How can I estimate Bhattacharyya parameter for BSC channel?
|
We have
Some big hashed array of data with boolean values, we know keys, but don't know values.
Oracle who have input of array of keys and can tell how much of them are true (it Answers with number T)
Number of keys N, true values M, for example M/N = 0.4
How to find a way to make own array of keys, length be M and ... |
Given an array of $n^2$ integers, what is the most efficient way to determine whether any permutation of those integers can form a magic square? "Magic square" being an arrangement of those integers on a square grid such that all rows, columns and diagonals sum to the same value.
Note that this isn't asking how to test... |
If a language $A\in DSPACE(n^c)$, then $EXP^A\neq EXP$
If a language $A\in DTIME(n^c)$, then $EXP^A= EXP$
What I tried:
Since it's impossible to show that $EXP \subseteq EXP^A$ because:
We know that $DSPACE(n^c)\subseteq DTIME(2^{n^c})$
exponential functions aren't closed to composition
so from the above two, ... |
I have a circle with radius $R$ and $N$ points on a 2D plane with known locations $(x_i,y_i), i=1,2,..N$. I want to place the circle such that it maximizes the number of covered points.
Let $d_i=(x_i-x)^2+(y_i-y)^2$ be the square of the distance between the point $i$ and the potential center of the circle $(x,y)$. To e... |
Dynamic Programming seems to result in good performance algorithms for Weakly NP-hard Problems. Two examples are Subset Sum Problem and 0-1 Knapsack Problem, both problems are solvable in pseudo-polynomial time using Dynamic Programming. It turns out this is a pretty good result in most cases.
On the other hand, Stron... |
What is the fastest way to select $n$ values from an $n$ by $n$ matrix such that each value comes from a different row and column and the sum of those n values is minimized?
For example, given the matrix:
$$A=\begin{bmatrix}0 & 1 &5 \\1 & 4 & 3\\2 & 7 & 0\end{bmatrix}$$
The solution is $\{A_{1,2}, A_{2,1}, A_{3,3}\}$,... |
I want to know if the recurrence equation $T(n) = 9T(\frac{n}{3}) + nlogn$, can or cannot be solved using master theorem.
At first, I naively went for $O(n^2)$ applying case 1 of master theorem. But then someone pointed out that $f(n)=nlogn$ and $n^{\log_3 9}$ do not have polynomial difference and therefore master th... |
Given the space A of all programs that could be possibly written in a given language and given the space B of all programs that could be possibly written in the same language but without any mutable state: can we be sure that with just B we can solve all the same problems we could solve with A ?
|
Unique SAT is defined as:
Given any SAT problem, does the SAT problem have exactly 1 solution?
As I understand it is co-NPHard. I am unclear how it is in co-NP
Assuming the problem has more than 1 solution, any 2 solutions can be a certificate of it being nonUnique. That part is coNP. Now, given a problem can be unsat... |
Is every instruction ultimately all read or write instructions? So, how I imagine this is that every place where something can be stored can be either in a read or write state, including the CPU registers.
How this is controlled is by the control unit. Every instruction goes through the control unit which is connected ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.