instruction stringlengths 35 29.1k |
|---|
I want to work on a paper with one of my friends in Recommender systems. My field is programming, and I favourite part is to be more technical.
I want to know that, is field of Recommender systems a part of Computer science or field in Information technology?
|
Consider following problem statement:
You have given $n$ actions. You can perform any of them. Each action gives you success with some probability. The challenge is to perform given finite number of actions to get maximum successes.
Here, we can perform actions and slowly decide upon possible probabilities of each ac... |
is this format okay? this is my first time using stackexchange.
|
Address 0000 stores 0xde
0001 stores 0xad
0002 stores 0xbe
0003 stores 0xef
Treat the data stored as 2 16 bit integers, what are the two values stored?
I thought the answer would be 0xadde and 0xefbe but I was wrong. Why?
|
I'm having trouble understanding and solving the problem.
Suppose we have a program which is composed of 3 portions A, B and C and that each portion takes $t_A$, $t_B$ and $t_C$ respectively to run on a single-core CPU.
Assume that $t_A$ < $t_B$ < $t_C$
Assume we parallelize only the portion C of the code and that we r... |
I am working on a pretty small lab for my university course and I'm having trouble converting a given regex into a set of regular definitions, then into a grammar and finally a regular grammar. I have reviewed the course material given to me and it has given me some understanding of the process, just enough for me to a... |
So I understand how to convert an NFA to a DFA, however my question is, on a conceptual level, how and why are useless states created, and how can you (if there is a way) convert an NFA to a DFA without creating any useless states?
|
I read up on an abstract example of ZKPs (the cave and the door), but I'm trying to understand NIZKs (specifically zk-snarks and zk-stark). All the examples I can find online seem to have some interactive component even when trying to explain nizks. I don't particularly fancy reading some 300 pages of papers to underst... |
In Haskell, I have the following datatypes that encodes arbitrary real numbers and arbitrary complex numbers, respectively:
newtype ArbReal = ArbReal {approximate :: Word -> Integer}
data ArbComplex = ArbReal :+ ArbReal
For the ArbReal type, the ArbReal constructor labels a function that, when fed an integer $n$, comp... |
I'm extending a framework for lossy compression of multidimensional floating-point data. At some point in the pipeline, sequences of symbols from a non-uniform distribution are losslessly compressed using entropy coding. The existing software used an implementation of arithmetic coding based on this post. As an extensi... |
Also, what is the meaning of the notation used in the question- c: v->{0,1,2....k-1} such that c(u)!=c(v)?
|
Problem Statement:
Say you have an array prices for which the $i^{th}$ element is the price of a given stock on day $i$.
Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one and sell one share of the stock multiple times).
Note: You may not engage in multiple ... |
When we have only an asymptotic upper bound, we use $O$-notation. For a given function $g(n)$, we denote by $O(g(n))$ (pronounced “big-oh of $g$ of $n$” or sometimes just “oh of $g$ of $n$”) the set of functions
$$O(g(n))= \left\{ f(n):\text{ there exist positive constants }c\text{ and }n_0\text{ such that},\\ 0\leq f(... |
i was just wondering if quantum computing has done any good so far in solving NP complete problems.
I am aware that quantum computing does solve some NP problems which are classically hard in polynomial time but as far as i know none of those problems are NP complete.
So there are a few interesting questions one could ... |
I have a graph with $n$ vertices and $m$ edges. Some edges are already oriented, some are not. How do I determine how to orient all undirected edges so that each vertex has the same outgoing and incoming degrees, and whether it is even possible to do so?
P.s This graph for example:
|
I have a planar graph and I'm trying to implement this algorithm (https://geometrictools.com/Documentation/MinimalCycleBasis.pdf Chapter 4, page 3).
For the filament F0(V4, V3, V2), that has one endpoint (same for filament F2), it's easy to detect and remove in a graph (I think it's sufficient iterate vertices and when... |
Just started learning about graph and it's various representations (matrix and adjacency list). Now I found that the adjacency list representation can be implemented in various ways:
Array of arrays (where we have one index in main array for each
vertices and adjacent vertices are in subarrays at each of this
index)
A... |
I want two know how can I add two positive or negative integers using the same Turing Machine
I am using unary numbers in the following way:
0 = 1; 1 = 11; 2 = 111; 3 = 1111 ...
I know how to add two postive integers and I am using this site for tests: https://turingmachinesimulator.com/
name: add two positive integers... |
To design a code with $m$ data bits and $r$ check bits which allow all single-bit errors to be corrected, the formula
$$(n + 1) 2^m \leq 2^n$$
with $n = m + r$ and $(m + r + 1) \leq 2^r$ is used.
Why is $+ 1$ used here, doesn't $n$ contain already all possible codewords?
|
When you are asked to hand compile into assembly language, are there multiple correct answers? For example, in https://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-004-computation-structures-spring-2017/c11/c11s3/compilation_answers.pdf, can you get the correct solution even if your solution doesn'... |
I need to solve this question using the substitution method:
$T(n) = 3T(n/2)+2n$ if $n>1$ otherwise, $T(n) = 1$
Note: $$\sum_{i=0}^k x^i = \frac{x^{k+1}-1}{x-1}$$
$$a^{\log_b n} = n^{\log_b a}$$
I made some attempts at it but I haven't been able to recognize the pattern. It looks to me that it will be $\mathcal{O}(... |
A while back I learned of these great algorithms:
function parseInt(value, code) {
let x = 0
let i = 0
while (i < value.length) {
const a = value[i]
x = x * code.length + code.indexOf(a)
i++
}
return x
}
function toString(value, code) {
const radix = code.length
let result = ''
do {
co... |
Many computer languages have complex regular expressions tools. For example, in Javascript you have global flags, escape characters, whitespace character, assertions, character classes, groups and ranges etc. I'm wondering if using just the 3 basic regular expressions operators as defined in formal languages, that is c... |
I’m finishing up Roughgarden’s two-part algorithms course on edx, and it was good, but I didn’t actually ‘design and analyze’ many algorithms, the questions mostly tested whether you understood the textbook.
I’m looking for some problems where I can drill a bit with the core concepts from the course (divide and conquer... |
There are 2 machines.
Each task either requires 1 or 2 machines to run (ie, a 1-machine task can run in parallel with another 1-machine task but a 2-machine task occupies both machine
The list of n tasks are given in [start time, end time], both of which are on top of hours. If we were to order the tasks by non decreas... |
First I have plus_assoc ready.
Theorem plus_assoc : forall n m p : nat,
n + (m + p) = (n + m) + p.
for simplicity we omit the proof of plus_assoc.
now I want to prove plus_swap:
Theorem plus_swap : forall n m p : nat,
n + (m + p) = m + (n + p).
Proof. intros n m p. rewrite -> plus_assoc. ...
the equation was rewr... |
I have a dataset with totally $1000$ scenarios, each of which is composed of $5$ users' coordinates $(x_i,y_i), \forall i \in \{1,\dots,5\}$. Now, based on users' coordinates, I want to cluster these $1000$ scenarios into 100 clusters. Specifically, if users in two scenarios keep proximal or same coordinates, such two ... |
I wanted to know if it was possible to add code directly to a computer without an operating system or any programming language. To do that, I thought that maybe I could use the binary files to reverse engineer the actual cpu architecture. Just a random thought but I would like to know if that is possible.
|
I am trying to triangulate TTF glyphs for drawing in opengl. The below image shows an example glyph (Taken fron FontForge application). The X represent control points of a bezier spline, circular and square points represent points on the glyph but they can also be the start / end points of the bezier splines.
I have a ... |
According to Wikipedia B-tree page, Knuth's definition fifth property is "All leaves appear in the same level and carry no information.".
What does it mean that they carry no information?
Does that mean that there are no more pointers to children nodes? (kinda redundant to say that as they are the leaves no?)
In the mo... |
I'm so sorry if this question is too general, but I need to understand the general process of the "State elimination method".
In other words, what is the general idea, and what is the difference to convert the NFA to RE and DFA to RE.
Online there are a lot of resources, but it is difficult to find a complete answer to... |
I have a proof that I need help with. Like the title says, the theorem is that every bit-reversal ring is $\frac{1}{2}$-symmetric. The theorem is for Leader Election algorithm in synchronous ring. The things I know follow:
Bit reversal ring is defined as follows: We assign to each process $i$ the integer from ${0,\ldot... |
In Coq, while trying to prove a lemma mult_n_Sm for mult_comm, I have this equation in a proof:
S n * S m = S n * m + S n (* simpl. *)
S (m + n * S m) = m + n * m + S n
Lets look at right hand side of the equation. S n * m + S n was simplified into m + n*m + S n.( by definition of nat, S n = n + 1, hence (n+1)*m ... |
I have a complete undirected graph $G=(V,E)$ with positive non-null rational weights $c:E \to \mathbb{Q}^+_{*}$ on the edges, such that $c(v,v) = 0$ for all $v$, and a subset $C \subset V$.
I would like to find (if it exists) a subset $S \subset V$ such that $\delta(S) < 2$, $S$ contains at least one vertex of $C$, and... |
First of all I'm a Physics Student and I've been arguing with my brother concerning the usage and the fundamental meaning of a vector on Computer Science (CS).
I) Vectors
A vector have a axiomatic meaning, i.e., given a set $\mathcal{A}$ of objects, their objects can be called vectors if and only if they satisfy the ve... |
Having trouble figuring out a NFA for the following language, the objective is to use only 3 states:
$L = {\{1^ky : y \in \{0,1\}^* }\text{ and y contains atleast k 1's, for k} \ge 1 \}$
I have got to as far as the NFA below, which would only work if the y contains clause wasn't included:
So I need a different approac... |
Given a collection of non-empty intervals [a,b), where a/b are integers in some finite range (ex. 0...100) and a is less than b, can you find an algorithm that will detect all intervals that exhibit some collision/overlap where the worst-case performance of the algorithm is better than O(n^2)?
You can assume that inter... |
I am trying to construct a nfa that generalizes Example 1.33 found in the book Introduction to the Theory of Computation by Sipser, but I am quite sure
that my transition function is wrong. I'd like some advice on how to fix that and how to simplify the notation such that to make it simpler.
Let $k > 0$ be a natural nu... |
I was reading about possible solutions to the well known problem:
Given array A with length N create a structure that enables
Answering what is the sum $\sum_{k=i}^{j} A[k]$
Updating $A[k]$
I've seen most solutions use binary index tree but was curios whether it's possible to just use a regular tree that is built u... |
Suppose the following situation.
You have a decision problem $D$.
You know that $SAT$ is $NP$-complete.
You know that $D\leq_p SAT$.
Can you conclude that $D\in NP$?
I think it's true because it means that $D$ is at least as hard as any other problem in $NP$.
As I know I am not able to post questions to answer with y... |
In the book, Data Structures Algorithms in Java Sixth Edition by Goodrich, Tamassia, and Goldwasser on page 339, there is an
"Example of a heap storing 13 entries with integer keys. The last position is the one storing entry (13,W)."
I've recreated the a similar image using qtree-tikz with my own depth and height cal... |
Consider a sphere with a coordinate system like the earth. There are $N$ points on its surface at random positions. For all the infinite planes that cuts the sphere exactly in half (i.e. the sphere's center is on the plane), given the set of $(latitude, longitude)$ of the points, find the global maximum number of point... |
I am looking for an algorithm that checks if the Levenshtein distance between two strings $s_1$ and $s_2$ is less than a certain upper bound $B$. I know, there are plenty of algorithms for calculating the Levenshtein distance, but I expect a possible efficiency gain in scenarios where $B$ << $Levenshtein(s_1, s_2)$, be... |
Why are data transfer speeds faster with EIDE than IDE? Wouldn't it be slower with the additional conversion of logical block addressing? What did they change to make it faster?
|
I thought about implementing a data structure with expected runtime of O(1) for insertion, deletion and look-up and a worst case runtime for these operations of O(log(n)). This is under the assumption of uniformly distributed data.
What I thought of was a simple hash table using BST for the collisions. Does that make s... |
I've already proven the statement using the limit definition of $o(g(n))$ and Stirling's approximation, but how do I prove it using the main definition for $o$ notation provided in CLRS instead?
Definition: $f(n) = o(g(n))$ if for all $c > 0$ there is $n_0 > 0$ such that $0 \leq f(n) < cg(n)$ for all $n > n_0$.
I've tr... |
Consider an undirected and unweighted graph with $n=|V|$ nodes and $m=|E|$ edges stored in adjacency matrix format.
What is the time complexity of finding the highest-degree vertex, assuming the vertices are given to you in no particular order?
The answer is $ \mathcal{O}(n^2) $ but I don't know how to get there.
I div... |
I’m programming web application which has some tricky calculations and I would need some help with mathematical calculations.
What I'm trying to calculate:
I have number of items. Lets call items a1, a2, ..., an. Each item consists of three components (let's call them x, y and z). Components have a ratio which is perce... |
Imagine you have a number x, when x ∈ [0, N]. Is there any algorithm that can map x to y, so that y is also y ∈ [0, N] with the mapping being unique, and the distribution of all y is distributed pseudorandomly across the whole range? I know it's possible by just generating a set from 0 to N, shuffling it, and using x a... |
Hello I am a new Computer Science student
Ok, so I am trying to sort the 2D array I know you can actually sort a 2D array by copying it into a 1D array sort it using any Algorithm, and then place back into the 2D array but here is the problem aren't we using more space and time because we have to copy the array back.
... |
I know that the below program uses Reversal algorithm to rotate an array's elements to k positions to the right. But how does the Reversal algorithm works? It seems kinda magic to see. Can somebody give me the intuition or simple math explanation for me to understand.
void rotate(vector<int>& nums, int k) {
k %=num... |
I am struggling with trying to come up with the inductive proofs to prove that the following grammar is equal to $ L = \{0^m1^n | m \leq 2n, n \leq 2m \}$
The grammar is
$ S → A \:|\: B $
$ A → 00A1 \:|\: C $
$ B → 0B11 \:|\: C $
$ C → 0C1 \:|\: ε $
How exactly do the proofs for proving $ L \subseteq L(G) $ differ from... |
I will be taking a computational complexity theory course in about a year, and as the reference material will be Computational Complexity A Modern Approach I am more than confident that without a proper preparation that course will eat me alive. The book seems to have excellent practise problems in the sense that it wi... |
I have a point location problem (in a planar graph) with a twist: rather then finding which region the point is located in, I would like to find the closest segment (edge) to a point, ideally with a O(log n) complexity.
So far I was not successful in finding any reference that would discuss this specific problem. Is th... |
I'm having a hard time understanding how left/right derivations work. I have a very simple example that I've attempted but I don't really know how to check if it's correct.
$S \to NP$ $V$ $NP$
$NP \to$ the $N$
$N \to$ cat | mouse
$V \to$ ate
LEFT
$S\to NP$ $V$ $NP$
$S\to$ the $N$ $V$ $NP$
$S\to$ the $N$ $V$ the $N$
$S\... |
Suppose I have a simplicial $k$-complex $\mathcal S$ whose vertices are embedded in Euclidean space $\mathbb R^n$, for roughly $k< n\leq 6$. Examples include triangle mesh surfaces ($k=2$) embedded in $\mathbb R^3$ ($n=3$) and one-dimensional chains of line segments ($k=1$) in $\mathbb R^n$.
Given many points $\{x_i\}_... |
I am aware that first-order logics (FOL) satisfies the compactness theorem. That is, if a FOL theory is insatisfiable, a finite subset of the axioms of such theory is insatisfiable too.
Is it the case that FOL extended with least-fixed point (LFP) satisfies the compactness theorem too?
|
Consider a variation of a Queue called MaxQueue, Q, that has the following operations:
dequeue(Q): removes and returns the first element of Q
enqueue(Q, s): Appends the integer s to the end of Q
maximum(Q): returns the largest integer in Q (but does not delete it)
The MaxQueue data structure also contains a sequence... |
I came across a problem about a cashier scanning goods that I'm stuck on. I paraphrase the question below.
A cashier only has x time to scan a person's goods. The goods come 1
item per time step in a conveyor belt. In one time step, the cashier
can either scan an item or bag the item (so when bagging, the cashier
miss... |
The below function converges to a constant as you take n to infinity.
$f(n)=(1 + \frac{1}{n})^n$
$\lim \limits_{n \to \infty}(1 + \frac{1}{n})^n = e$
Would this imply that it is O(1) since you can just upper bound it with a constant?
|
I know, loosely speaking, if we can define a function $f$ in term of
\begin{align}
&f(0,\vec{x})=g(\vec{x})\\
&f(n+1,\vec{x})=h(f(n),n,\vec{x})
\end{align}
where functions $g,h$ are primitive recursive. Then $f$ is primitive recursive.
However, what it means to show a function is primitive recursive by induction?
I ha... |
I am trying to use a classical
Kalman filter
for getting indoor location. I am using geolocation API of HTML to get
latitude, longitude, position accuracy and speed. I am also using the
smartphone's accelerometer to get acceleration. The Kalman filter
combines this sensor data. I tried making a simulation in python... |
I know with absolute certainty that this is the wrong runtime, but I just wanted to show you how I got to it.
for (i = 0; i <= n; i++) do
j = 2*i
while j <= n do
j = j + 1
print("Hello World")
end
Then I get the runtime
$Θ(\sum_{i=1}^n 1 + n -2i)=Θ(n+n^2-n(n+1))=Θ(0)$??
|
I've been struggling with reduction while solving this exercise and I would really appreciate some help if not the solution.
Problem: [3-SAT-WITH-MAJORITY]
Input: A set of clauses $C = {\{c_1, \dots, c_k}\}$ over $n$ boolean variables $x_1, \dots, x_n$ where every clause contains exactly three literals.
Output: YES if ... |
I'm reading Arpaci's Operating Systems: Three Easy Pieces, the chapter on Locks.
At the end of the chapter, they present Two-phase locks (section 28.16). They say
A two-phase lock realizes that spinning can be useful, particularly if the lock is about to be released. So in the first phase, the lock spins for a while, ... |
I was given the following question (please don't mind the programming language semantics, it's a language-agnostic question):
Given a list of Persons, and two arbitrary Persons out of that list, we need to find the minimum nth-degree relationship between them.
Here are the definitions of Person and a "relationship":
A... |
Suppose we have a language $A$. I want to prove that $AA^*$ is commutative. I know that this expression equals $A^+$, but I'm not sure how to go about a proof yet. This is my attempt so far.
If $A$ is a language, then
\begin{align*}
AA^* & = A(A^0\cup A^1\cup\cdots) \tag{Definition of $A^*$}\\
& = A^1\cup A^2\cdot... |
There's a problem whose solution startles me because at first sigh, I wouldn't imagine that it could be solved so easily. The problem is:
There are n tasks, each task t_i has a weight w_i and a length l_i. Find an order of tasks t_1, ... t_j, ..., t_n that minimizes the total cost of completion, where the cost of compl... |
Problem 1: Given an undirected graph, return the edges of a Hamiltonian cycle, or correctly decide that the graph has no such cycle.
Problem 2: Given an undirected graph, decide whether or not the graph contains at least one Hamiltonian cycle.
What is the polynomial-time reduction of problem 1 to problem 2?
Let TSP1 d... |
During the presentation (a talk) Answer Set Programming: Boolean Constraint Solving for Knowledge Representation and Reasoning Torsten Schaub (University of Postdam) stated around twenty-one minutes into the talk, "You can't translate an ASP (answer set program) into SAT (propositional formula) in a modular way...." co... |
I keep hearing about lookahead parsers, LL parsers, LR, LALR, etc... but no clear explanation behind the etymology of this word.
What does "lookahead" refer to? How does this relate to LL, LR, LALR? Basic examples would be great, as I'm not well versed in this subject.
|
I'm trying to determine the big O time complexity of the following
data set where the first column is the input size, and the second column is the execution time in seconds. Where possible, I should determine the exponent of the dominant term and provide an estimate for the coefficient on the dominant term.
I made the... |
I am a little confused by the complexity proof of Radix Sort.
For counting sort, the complexity reported is $O(n+R)$, where $n$ is the number of items and $R$ is the range.
But this is not entirely correct, right? To do binary arithmetic on numbers as big as $R$, I need $\log_2 R$ operations for any deterministic hashi... |
I was reading this post about the DP completeness of the problem SAT-UNSAT (both are well defined in this post). The answer added a note at the end that states the class complexity DP differs from NP, unless NP = coNP.
I fail to see why.
I searched and I came across multiples posts such at this one and that one that pr... |
Just came across this transcript that states:
The principle is that prediction is the same thing as compression. And
what that means is that whenever you have a prediction algorithm, you
can also get a correspondingly good compression algorithm for data you
already have, and vice versa.
Even though the article gives ... |
I have an optimization problem and I want to show its complexity. The optimization problem is the same as the minimum dominating set problem, but with an additional constraint. The constraint is easy. Consider a defined subset $S$ of nodes in a graph. The additional constraint is to guarantee that at least a given numb... |
Sometimes you can substitute values for $n_0$ and $c$ in the big-$O$ equation and compare two functions. Or take limits and compare two functions.
But for the following functions, for example, taking the limit in infinity for
$f_3$ over $f_2$ requires using l'Hôpital's rule which doesn't simplify anything. $f_3$ is tec... |
Consider the following problem:
You are given $n$ coins with labels $1, \ldots, n$. You know that coins have weights $1, \ldots, n$, but you don't know whether the labels are correct (i.e. they can be in a different order). Using balance scales (the outcomes are $>$, $=$ or $<$) at most $k$ times, determine whether th... |
Input:
Some fixed $k>1$, vectors $x_i,y_i\in\mathbb R^k$ for $1\le i\le n$.
Output:
A subset $I\subset\{1,\dots,n\}$ of maximal size such that
$(x_i-x_j)^T(y_i-y_j) \ge 0$ for all $i,j\in I$.
Question:
Can this be computed in polynomial time in $n$?
Remarks:
For $k=1$ this is equivalent to the problem of finding a lon... |
I was reading about $L$-reductions and there was one part in the definition that I thought was interesting. I wanted to know what motivated people who came up with it to have it included in the definition.
Recall that a problem $A$ is $L$-reducible to another problem $B$ if there exist polynomial-time computable functi... |
Given $x_1,...,x_n,y_1,...,y_n\in \mathbb{R}^d$ find a permutation matrix $P\in\mathbb{S}_d$ that minimizes $\sum_{ij}P_{ij}|x_i-y_j|$.
This is an assignment problem and can be solved in $O(n^3+n^2d)$ time using the Hungarian algorithm.
Suppose $x_i\sim N(0, I_d)$ and let $v=\mathbb{E}_{x_1,...,x_n}\left[\min_{P\in\mat... |
Given a convex hull in $XY$ plane. and we have $n$ points sitting inside it. In one move we can move all the points to right by $1$ or move all the points to up by $1$. what are the minimum number of moves that are required to get all the points outside the convex hull?
|
https://www.researchgate.net/publication/235662494_On_separating_overlapped_fingerprints
[Paper name-"On separating overlapped fingerprint", author-Fanglin Chen,Jianjiang Feng,Jie Zhou]
I am unable to understand the process of local fourier analysis in the initial orientation field estimation. I have tried searching o... |
Word grammar (w-grammar) is a context free grammar in which all laws are of the following forms:
$A \rightarrow B, A \rightarrow \epsilon, A \rightarrow w_1B, A \rightarrow Bw_2$
$A, B \in N$ (nonterminal), $w_i \in \Sigma^\ast$
$ L_{w-grammar} $ - set of all languages that have a w-grammar
$ L_{CFG} $ - set of all lan... |
∃y∀x [A(x) ∧ B(y) -> C(x,y)]
∃y∀x [¬(A(x) ∧ B(y)) v C(x,y)]
∃y∀x [¬A(x) v ¬B(y) v C(x,y)]
I need to convert the above to conjunctive normal form. I'm a little confused about the order of operations in the case of both existential and universal quantifier and which part of the expression they apply to.
From the last... |
Like including parenthesis (( and )), addition, subtraction, multiplication, and division, and the Order of Operations in mind.
I tried (in Lark EBNF):
%import common.WS
%ignore WS
%import common.SIGNED_NUMBER -> NUMBER
start: exp
?exp : add
| mul
| sub
| div
| NUMBER
| frac
| parenthesis... |
Suppose I have two LL languages $L_1, L_2$, both describable by LL($k$) grammars for the same $k$, and regular language $R$. Which of the following are also LL languages, and can they be described by LL($k$) grammars?
$L_1 \cup L_2$ (union)
$L_1 \circ L_2$ (concatenation)
$L_1^*$ (Kleene star)
$L_1 \cap R$ (intersecti... |
It is said that a gate that can simulate AND and NOT is universal and able to recreate any classical circuit. I was looking at some of the circuits simulated by NAND, and for some of them, we need to split the output of a gate and direct each of the splits to other NAND gates (see the area circled in red):
If we make ... |
For each of the 2 pairs of functions I need to figure out the following:
g(n) = Θ(h(n))?
g(n) = O(h(n))?
g(n) = Ω(h(n))?
g(n) = o(h(n))?
g(n) = ω(h(n))?
Pair one
g(n) = (64)(n/4), h(n) = 256(n/8)
Pair two
g(n) = n1024, h(n) 2(lg(n)*lg(n)), lg is base 2
For pair one, I have the limit as n->inf for g(n)/h(n) = inf. The... |
I have worked with image classification and image segmentation etc.
While working with images we are either mapping from $\mathbb{R}^2\to\mathbb{R}$ or $\mathbb{R}^2\to\mathbb{R}^2$. Are there any machine leaning methods that can map from $\mathbb{R}\to\mathbb{R}^2$. For example, I have a feature vector of $3$-$5$ elem... |
Let $A$ and $B$ be two sets of integers with $|A|>|B|$.
Given a map $f: A \rightarrow B$ and $i \in A, j \in B$, let us use the shorthand "$i$ is matched to $j$" if $f(i)=j$. I am looking to solve
$$ \min_{f: A \rightarrow B} \sum_{j \in B} (\mbox{ number of nodes matched to } j)^2, $$
$$ \mbox{ subject to } |i-f(i)| ... |
My question is a follow-up for the following thread: Solving unusual recurrence with two variables
I baisically have the same reccurence relation but with a small change---
$$T(n,k) = T(n-1,k)+T(n-m,k+1)$$
The change is the addition of $m$ in the second element in the recursion (instead of 1 in the original question)
T... |
I have a directed graph representing some topics organized as follows (below screenshot is a subset of the graph):
I'm looking for an algorithm to group a set of nodes (in blue in the diagram) following this logic:
Groups as evenly sized as possible: we don't want groups with very few nodes and others with lots of no... |
Is this regular or not
L = {w1w^R | w ∈ {0,1}*
(where for any word w ∈ {0,1})*, w^R denotes the reverse of w)
|
For those who think visually, say I've got 5 warehouses with a current stock level of # of fish, and a target level for each. How do I achieve the new target levels in as few truck shipments as possible?
Or given an array A{250, 150, 45, 205, 350}, how can it be transformed to {200, 200, 150, 320, 130} in as few tran... |
As far as i understand all loops have a loop invariants. My understanding is that loop invariant is an argument that is true at the beginning of the loop block as well as at the end of the loop.
For example:
while(P) {
//predicate is true here
body of the loop
//predicate still true here
}
But let`s say i have t... |
How can I convert the regular expression (ab*)*b to a context-free grammar?
When I look for examples I keep seeing plus signs in the expression but I don’t have any. Is that just a different way of writing it?
|
I want to categorise variants of a structure made up of some number of variable components by mapping it to a unique range. Assume that the individual components all fall within the same base range.
I'm using color as an example for this question as its intuitive to think about but I don't want the question to be speci... |
According to me Statement S1 and S2 is True while S3 is False.
The Solution says 'S3' is correct ? Am I Wrong ? Kindly help with explanation .
I know Connect() in TCP is used by the client side for generating a request to server while it gets the destination address and port no. as a part of address structure .
|
I am wondering if it is possible to calculate the following double sum, where $a_1,\ldots,a_n$ are positive integers, in time faster than the trivial $O(n^2)$:
$$
\sum_{i=1}^n \sum_{j=1}^n \left\lfloor \frac{a_i}{a_j} \right\rfloor.
$$
For example, if $a_1 = 1, a_2 = 2, a_3 = 3$ then the sum is $9$.
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.