instruction stringlengths 35 29.1k |
|---|
Before i explain exactly what i mean, let me just say that i never studied CS or low level programming, so i don't know much about the subject(I'm a self-taught JS programmer). To the point:
Imagine you have a group of workers, you need to construct a work-schedule for. Each worker has "constrains", meaning days/shifts... |
Let $(E,D)$ be a cipher with message space $M = \{0,1\}^n$ and key space $K = \{0,1\}^n$.
Assume that there is an algorithm $A\colon \{0,1\}^n \to \{0,1\}^n$ of size $T$ that given an
encryption of a message can guess the entire message with probability $0.2$. Namely, for a message $m \in M$ it satisfies $$P[A(E(k,m))... |
There's a data structure that has the following operations:
$\text{init}(n)$ - Initializes $n$ integer elements set to zero, $O(n)$.
$\text{inc}(i)/\text{dec}(i)$ - Increments/decrements the element at index $i$ by one, $O(1)$.
$\text{get}(i)$ - Returns the element at index $i$, $O(1)$.
$\text{min}()/\text{max}()$ - R... |
In the Art of Computer Programming, Knuth describes a computational method as a quadruple $(Q, I, \Omega, f)$ where $I, \Omega \subseteq Q$, $\Omega$ is pointwise fixed, and each $x \in I$ defines a sequence $x_0, x_1, x_2, \ldots$ such that $x_0 = x$ and $x_{k+1} = f(x_k)$ for $k \geq 0$. He notes that the sequence te... |
I am currently working through Metaheuristics by El-Ghazali Talbi where he discusses encodings of algorithms.
"Messy representations: In linear representations of fixed length, the semantics
of the values is tied to its position in the string. In messy representations, the
value associated with a variable is independen... |
sort an array where $0\leq a_n\leq n$
sort an array where $0\leq a_n\leq n^2$(hint represent every element in base $n$)
All the elements are integers
for the first 1 I used counting sort and for the second one I thought maybe after changing to base $n$ using raddix? ONe more thing,i've been asked to prove correctness ... |
Given a connected directed acyclic Graph $G=(V,E)$ and a subset $U\subseteq V$. Prove that if for every vertex in $G[U]$ with out-degree zero there is an edge in $G$ to every vertex in $G[V-U]$ with in-degree zero, then there is a path from every $u\in U$ to every $v\in V\backslash U $.
I thought maybe to try a proof... |
I am reading Data Structures and Algorithms by Alfred Aho, Jeffrey Ullman, et al. In the section about lists it's said:
We should note that a position in a linked-list implementation of a list behaves
differently from a position in an array implementation. Suppose we have a list with
three elements a, b, c and a varia... |
I am designing a algoritm for a game using a Monte Carlo tree search AI that I implemented. I play against another player and want to get the best move. Every time I do a move I completely build a new search tree and do as much iterations possible given a certain deadline. Is there a way to use the previous tree that I... |
Consider (over $n$-bit strings) the uniform distribution $U$, and another distribution $D$ such that
\begin{equation}
\text{Distance}(D, U) \geq \frac{1}{e},
\end{equation}
where $\text{Distance}$ stands for the total variation distance, given by
\begin{equation}
\text{Distance}(D, U) = \sum_{z \in \{0, 1\}^{n}} \left|... |
In practice, the amortized O(α(n)) data structure is good for every case. But if I want to be pedantic and require each operation to be under a certain time complexity, what's the currently known best complexity, and is it optimal?
The normal disjoint set implementation with recorded rank (height before optimization) c... |
I'm looking for a solution to search for strings in a large text file. I would like to match strings with as many of those words in close proximity as possible.
For example, if a query is for the string "what is the term for a supreme court justice"
"a supreme court justice has lifetime tenure, meaning"
"the term of j... |
I need to provide one simple evidence that graph isomorphism (GI) is not NP-complete.
I saw a number of papers on google scholar and answers on StackExchange. However, I have very limited knowledge of graph isomorphism, and I would like to just provide one simple evidence which I both understand and can explain clearly... |
I'm interested in coloring a graph, but with slightly different objectives than the standard problem. It seems like the focus of most graph-coloring algorithms (DSATUR etc) is to minimize the number of color classes used.
My goal, in contrast, is to maximize the number of color classes of fixed size N.
As a concrete ex... |
I have the following question, and I need to write it as an integer programming problem:
A manager of a company wants to by presents to his 100 employers. He can buy the presents from two different suppliers:
Every present costs 110\$. For any present above 500, the manager would have to pay 5\$ extra for insurance (f... |
I'm looking for some tips on how to best implement the algorithm to accomplish the following:
Imagine a 3×3 cube with a rubik's cube mechanism, i.e. you can freely rotate any of the 6 faces.
You don't care about colors.
Instead you index the component 26 cubes A–Z and ignore the middle.
Illustration image (component ... |
I got a question about who and how sets the transation function values in markov decision processes?
I mean when some says that an agent, in real world grid, is going to step up by %80 and left/right by %10 each. How did he know that? Do we have to determine the transition probability for each step or agents have to? S... |
So there was this question in one of my class tests. It may seem very simple and straight-forward, but I am unable to catch up with its meaning or explanation. I have referred my textbook of COMPUTER ORGANIZATION AND ARCHITECTURE by William Stallings. But that has just got me more confusing.
The definitions according t... |
I'm searching for an alogrithm that takes two strings, a query and a string that is to be searched for the query. The algorithm should result in a 'found' when the string contains the characters of the query in the right order but with any amount of other characters inbetween.
Example: query:'abc', string to search: 'x... |
It would be a mess if the answer had to be NO after all these speculations and theorems about these languages but..
I am not conviced liar paradox is well defined. And Godël himself said his theorem is just an exhibit of a liar paradox.
I am not conviced halting problem is well defined.
I am pretty conviced that if you... |
According to Relations Among Complexity Measures by Pippenger & Fischer, the definition of an oblivious machine is:
An oblivious machine is one whose head movements are fixed functions of time, independent of the inputs to the machine.
In other words, a Turing machine $M$ is oblivious if and only if it exists a funct... |
Not sure if this is the right place, but I guess it is better than Reddit and I couldn't find any discussion.
I was wondering why Apple include a neural network "processor" and can't help but feel that is a waste as a prospective ML Engineer, so it is very likely that I am missing / in ignorance of something so wanted ... |
Let $G = \{0, \cdots , p-1 \}$ be a field. Let $K = G^{m \times n}$ and $F:K \times G^n \to G^m$ be a family of functions.
For $A \in G^{m \times n}$ and $x \in G^n$ we have $F(A,x) = Ax$.
I need to check if $F$ is a secure pseudo random function.
We say that PRF $H: K \times X \to Y$ is $(T, \epsilon)$-secure if for e... |
Can someone recommend a graph theory textbook that covers treewidth thoroughly?
Something that focuses on the graph-theoretic structure of bounded treewidth graphs rather than solving problems on them. Don't need the strongest/newest results but would prefer something that
Preferably something that covers sublinear tr... |
Suppose we have access to a stream of ordered pairs, where the $i^{\text{th}}$ element in the stream is an ordered pair $(a_i, b_i)$, where $a_i$ is a timestamp and $b_i$ is an arbitrary real. How can we design a data structure with the following two methods:
$\mathcal{O}(1)$ insert
Sublinear lookup to determine when,... |
I need to prove that $\log\lfloor f(n)\rfloor = O(\log\lfloor g(n) \rfloor)$ if $f(n) =O(g(n))$.
I know that if $f(n) = O(g(n))$ then $\log f(n) =O(\log g(n))$, but I can't prove the current statement because it involves the floor function.
|
I have a graph with average degree $n/2$. How I can find an approximation algorithm for the longest path problem with factor $1/4$?
|
in my beginner’s computer science class, we are asked to create an bot for a variant of rummy. It has to make logical moves as it needs to beat other very simple bots. I wanted to know how you would go about coding such program. From what I’ve seen in a few Google searches, people seem to rely heavily on decision trees... |
If a set of numbers $a_1, a_2, \cdots, a_n$ $($such that each $a_i \in \mathbb{N} \cup \{0\})$ and an $r \in \mathbb{N}$ are given, find set $X = \{x_0, x_1, \cdots, x_r \ | \ x_0 = 0 < x_1 < \cdots < x_r = n\}$ such that $f(r,X) := \displaystyle\max_{j=0}^{r-1} \sum_{i = x_j}^{x_{j+1}-1} a_i$ is minimized over all pos... |
I know it is true that if A is not in P, and A reduces B, then B is not in P.
But is it true for NP as well?
If A is not in NP, and A reduces to B, does this mean B is not in NP?
Why or why not?
Thanks!
|
Given the theorem:
Let $\Sigma$ be an alphabet. The set $\mathcal{P} \left( \Sigma^{\star} \right) $ is uncountable.
In other words, there are uncountably infinite languages over any alphabet.
Can someone explain to me how does it hold for $| \Sigma | = 1$ ?
|
In my books it is written that the concept of pipelining can happen only with Harvard structure as CPU can both fetch data from and write back data to memory at the same time my question is how can fetching and writing back be done at the same time when there is only one bus for data just like von Neumann structure? Ho... |
Say we have a number of start strings (green) and a number of target strings (red). Two strings can always be concatenated to a new string which can then be arbitrarily often reused (two arrows in, (1,∞) arrows out). A string can also be concatenated with itself.
Is there an algorithm that can tell if this is the DAG ... |
I am wondering if Rice's theorem (or something similar to that) applies also to sequential circuits. I.e. given any finite sequential circuit, can there be an algorithm that can formally verify any property of this circuit? I'm thinking yes, because the number of latches is bounded, so is the number of states. Even if ... |
I am trying to work my way through some computer science training and I am not able to properly understand the following pseudo code:
COUNTING-1 (n) cost times
1 for r=1 to n c1 n+1
2 for c=1 to n c2 n(n+1)
3 sum = sum+1 c3 ... |
There is trivially $\emptyset\in\text{NP}$. From the definition of $\text{co-NP} = \{L : \overline{L} \in \text{NP}\}$ where $\overline{L} = \{0, 1\}^*-L$ follows $\{0, 1\}^*\in \text{co-NP}$. Is this true? If so, it is also true that $\{0,1\}^*\in \text{NP}$?
|
In a setting where I have n clients each owns a subset of the dataset, each computes the mean and variance on his data and send them to the server. The server would average all means and variances. For mean, I simply do the averaging by:
$\mu = \frac{\mu_1+\mu_2+.....+\mu_n}{n}$
However, for the variance, I can't figur... |
Consider an undirected graph $G$. A subset $S \subseteq V(G)$ is n-dependent if for every $x \in S, d_{<S>}(x) \leq n-1$. The n-dependence number of $G$, denoted $\beta_n(G)$, is maximum cardinality of an n-dependent set of $G$. That is, the n-dependence number of $G$ is the maximum cardinality of a subset of vertices ... |
I did some basic research on regular lossy and lossless compression algorithms but somehow I couldn't really figure the right direction for the information I need.
My basic problem is that I would like to compress a series of numbers with an unknown number of data points (can be 10, can also be a 1000). The numbers the... |
We have a weighted graph, where each node is a city. And the edges between the nodes are a pair of floating-point values (distance and cost of travel).
Given a node/city, describe an algorithm that can find the path with the largest distance/cost ratio from said node/city. Note that the path can traverse multiple nodes... |
There is plenty of algorithms available online, but they do things exactly opposite of what i need:
Find longest path in a graph between any nodes.
Do not remember the path, just weight.
I need an algorithm that can return both weight and path itself. I have tried two things so far:
Dijkstra's algorithm with negativ... |
I want to find a solution to a problem that asked before.
in the following question: https://stackoverflow.com/questions/43435799/path-with-the-minimum-number-of-alterations-in-graph-with-colored-edgest
I have a directed graph with colored edges (red & blue) that may contain cycles. The question is to write an algorit... |
This might be a trivial question, but I have the following problem: I want to (perfectly) hash a number of lists of integers of length $n$, with all entries between $k_{min}$ and $k_{max}$. How can I construct a perfect hash function $h$ that takes such a list and outputs an $m$-bit number where $m$ is as small as poss... |
By the definition, in an Interactive Proof system the verifier is allowed to generate random numbers, which allows the omniscient prover to not fool it in the vast majority of cases for every problem in $\mathsf{PSPACE}$. The verifier is a polynomial time machine, therefore an ability to generate random numbers makes i... |
A Knowledge Proof is a mechanism by which a 'prover' entity can show to a 'verifier' entity that it possesses some certain information without revealing what that specific information is (within some arbitrarily small tolerance of certainty).
Is it possible for a 'prover' to show to a 'verifier' that it does not posses... |
Regarding the difference between Two Vs Dual Port RAM Here is what I understand:
The first can read and write at the same time but can't read twice or read twice at the same time while the second can read and write, read twice or write twice.
Is this correct?
Plus, Is this connected to software or hardware, let's suppo... |
Given below is a question from $\text{GATE } 2015 \text{ CS}$ paper,
Consider the sequence of machine instruction given below:
\begin{array}{ll} \text{MUL} & \text{R5, R0, R1} \\ \text{DIV} & \text{R6, R2, R3} \\ \text{ADD} & \text{R7, R5, R6} \\ \text{SUB} & \text{R8, R7, R4} \\ \end{array}
In the above sequenc... |
Consider the language
$$ L = \{ w : w \in {0,1}^* \text{ and } w \text{ doesn't contain } 0110 \text{ as a substring.} \} $$
What is a regular expression for this language?
I thought of $1(1)^*0(0)^*$.
But this seemed to not contain any strings starting with $0$. If I do $1(1)^*0(0)^* | 0(0)^*1(1)^*$ then it can contai... |
A language is a collection of strings--assuming we have an infinite number of words then concatenating this collection (keeping things simple, normally you need to at least be able to tell where one word ends and another begins) and viewing the language as the resulting single big string, if the Kolmogorov complexity ... |
I was solving problems related to P and NP where I encountered the following problem:
Given a standard definition of NP,
if x belongs to L then there exists y such that |y| <= |x|^d and A(x, y) = 1;
if x does not belong to L then for every y with |y| <= |x|^d we have A(x, y) = 0.
1. what is the new class formed when... |
Basically, most of the definition for disjointness are such that $DISJ(A, B) = 1$ if $A \cap B = \emptyset $ and $DISJ(A, B) = 0$ for other case. My confusion is how is $0$'s influence in here. For example, is all-zeros string considered as $\emptyset$ and therefore the result will be $1$ no matter what the other strin... |
A lot of the work in data science -- machine learning in particular --involves "reshaping" arrays, tables, and other data structures. These data transformations are not really lossy transformations (except for subsets/selective views), but rather simply getting existing data into a different form acceptable to existin... |
I have a question regarding the following sentence:
So we can make the following expressions:
The best case running time of LINEARSEARCH is a constant function $T(n)=a$ OR $Θ(1)$
The worst case running time of LINEARSEARCH is a linear function of $T(n)=an + b$ OR $Θ(n)$
Merging them together, the running time of LINEA... |
Let $\mathcal{C}$ be a basic complexity class (such as $\mathrm{NP}, \mathrm{PSPACE}$).
And $\mathcal{C}$ is closed under a reduction "$\leq$" (such as polynomial time many-one reduction "$\leq_{m}^{p}$", polynomial time Turing reduction "$\leq_{T}^{p}$").
Suppose that a decision problem $L \subseteq \Sigma^{*}$ is com... |
I want to create a finite state machine that accepts the following language:
$$
L=\{w\in\{a,b\}^* | w \text{ contains abb but not on the first position}\}
$$
So I began by writing a regular expression from this and this is what I came up with:
$(a+b)(a+b)^*abb(a+b)^*$
And for the finite state machine I tried to do this... |
So far i've tried with making x = z = p and y = 2*p, but it seems that if I place vxy to represent all b's then I can't get a contradiction.
|
I have a system that consists of binary inequality constraints between variables, plus some indicator variables that can assume only two values:
a, b, c, d ⊆ ℝ
i ⊆ {true, false}
// unconditional inequality constraints
a < b
// conditional inequality constraints
i -> b < c
i -> b < d
!i -> b > c
!i -> a < d
and I wou... |
Here is a short description of my problem:
Part of my objective function is not a regular function. Instead it's a table.
You can see a short extract here:
So if the height is smaller or equal to 300 and the length is between 301 and 345 (including 345) the price is p2.
My first idea was to create a boolean variable:... |
How can an NDTM have a growing number of branches as you feed larger and larger inputs with only finite number of transition rules specified--ie what is the relationship between the number of branches and the number of transitions?
An NDTM has a finite number of states, a finite number of input symbols and a finite num... |
I take occurrence typing to be typing that "... allows the type system to ascribe more precise types based on whether a [check] succeeds or fails." (adapted from the Racket docs with "predicate check" replaced with "check")
Here's a TypeScript example:
function foo(x: string | number) {
switch (typeof x) {
... |
I'm trying to figure out an efficient way (without recursion) to convert a string (number representation) from one arbitrary base to another using custom alphabet. But I cannot think of a very fast efficient method (byte shift?) to do it:
def convert_base(target, base_from, base_to):
alphabet = '0123456789ABCDEFGHIJK... |
How can one show that the counting problem:
Given a graph, output the number of perfect matchings
Is self reducible?
I found a hint in Moore's Chapter on Counting, Sampling and Statistical Physics:
Let G be a graph and e one of its edges. Show that we can modify G to
produce two graphs, G0 and G1, such that the numbe... |
Suppose I wish to show that my decision problem $Q$ is NP-Hard. Why do I need to reduce from one problem $Q'$ of known hardness ?
Consider for instance the following situation:
Here, I have my set NP of problems, where problems $A$ and $B$ were proved to be NP-Complete through direct proof, and problems $C$, $D$, $E$,... |
If you were given a state transition diagram could you tell, just by looking at the diagram, if the diagram represented a DTM or a DFA (especially if it was unlabeled, just a directed graph)? Would there be any difference between the diagram representing the deterministic Turing machine and the diagram representing the... |
I have two queues of jobs and each job consists of the pair (utilization %, time to complete). I have one machine and its utilization cannot exceed 100%. The first job in a queue must be completed before the second one can be started (and so on). What is an algorithm to find the best schedule for these jobs so that the... |
A directed graph is said to be oriented if for all edges (i, j), (j, i) is not an edge. In other words, the binary relation defined by the edges is asymmetric. Given a strongly connected directed graph, you have to find whether there exists a spanning oriented subgraph which is also strongly connected. In other words, ... |
I keep seeing 3 X 8, 4 X 16, etc. kind of decoders explained on youtube
4 is the input (address bus) and 16 is the output.
4 X 16 can only access 16 unique addresses.
What if I have thousands of memory address like 4096, 65,536, etc.
How many address bus and output is required in these decoders?
.
.
.
.
If I put 12 bit... |
I need to find out if the following problem is decidable:
Given a context-free language $L$, decide whether its complement $\bar{L}$ is also a context-free language.
I am having trouble in defining the $TM$ I need in order to solve this problem. My thinking was to see if it is possible to construct a $TM$ that takes ... |
Without going into details about my life's story, here's the basic facts:
I grew up with 386 and 486 and Pentium PCs running MS-DOS 5 (I believe), Windows 3.1 and Windows 95, a well as various game consoles from the 8-bit, 16-bit and 32-bit eras.
I have almost none of them left, and what's more, most game cartridges a... |
Total functional programming is a paradigm of non-Turing-complete programming languages where any program that type checks is proven to halt.
Well-founded recursion is a recursive definition of a function such that the definition of $f(x)$ only ever makes a recursive call $f(y)$ when $y<x$ for some well-founded relatio... |
I'm reading through the proof for the fractional knapsack problem presented here: https://www.cs.rice.edu/~nakhleh/COMP182/Knapsack.pdf
I follow the proof until the definition of the new set $Q = \langle q_1, q_2, ..., q_n \rangle$
for every $1 \leq i<j: q_{i}=o_{i} ($also $q_{i}=y_{i})$ which is constructed as follow... |
I'm really not sure how to approach this problem.
|
How can i find the Hamiltonian cycle on an nxn grid that uses the least amount of stright lines (curves left/right as much as possible)?
Here's an example we have devised for 8x8:
Here is an example we have devised for a 6x6:
And can this be applied to a grid of any dimensions (apart from non-hamiltonian grids)?
|
The below-given lines are written in the book of the operating system (Page -307), details of the book are as follows:
OPERATING SYSTEM PRINCIPLES, 7TH ED., Abraham Silberschatz, Peter Baer Galvin, Greg Gagne. Wiley India Pvt. Limited, Nov 27, 2006
"A lazy swapper never swaps a page into memory unless that page will be... |
For a set $I\subseteq \Bbb N$, defined $s_{I}(n)=\min\{i\in I\mid i>n\}$. The set $I$ is called polynomial-time-enumerable if $s_I(n)$ is computable in $\mathsf{poly}(n)$ time.
Most of the sets I can imagine are polynomial time enumerable. I am really looking for an example of a set of integers that is NOT polynomial t... |
Given the following language, I am tasked with giving a context-free grammar that generates it.
$\left \{ a^{3n}b^{m}c^{n}|n>0, m>0\right \}$
Would this be correct?
$A \rightarrow aaaA$
$B\rightarrow Bb | b$
$C\rightarrow Cc|c$
$S\rightarrow ASBSCS|\epsilon $
|
So I am trying to tackle a combinatorial optimization problem and would like some insights on how to approach it. The problem statement is as follows: Consider a set of elements of size N, how do I select a subset of size k<N such that the sum of the elements in the subset is maximum and variance among the elements is ... |
Let's say we have a matrix M[1..B, 1..B] (i.e., a square matrix) and a mouse in the upper left corner (1,1). We also have an integer A, which tells how many pieces of cheese there are in the matrix. The mouse can move from a given positon (i, j) either in the direction (i+1, j) or (i, j+1). When the mouse visits a give... |
This is my attempt at a proof:
Let $E$ be a $REGEX$ accepting $L$. We claim the $REGEX$ $E^{'} = E^{+}$ accepts L. i.e. $L(E^{+}) = (L(E))^{+}$
$L^{+}$ is regular since there is a $REGEX$ $E^{+}$ accepting $L$
I am very unsure if my proof makes sense or is correct. Can someone please advise?
|
I'm interested in how fuzz testing and something called combinatorial testing. Combinatorial testing attempts to forgo exhaustive testing in favor of trying to test all possible "interactions" of a certain size. It's an interesting result that all interactions of a certain small size can be tested in far far fewer test... |
I am trying to solve the following recurrence relation :-
$T(n)=16T(n/2)+n$ using masters theorem. I got $\Theta (n^2)$ (Which matched the first case in the theory) which is wrong, any help with this please?
|
I have to find the lower bound of the following recursion:
$A_1 = C_1 = p_1$, $B_1 = D_1 = 1-p_1$, $F_k = A_k + B_k$. Evaluate $F_n$.
\begin{align}
A_{k+1} &= (A_k + 2C_k) p_{k+1} + (1-p_k) p_{k+1}, \\
B_{k+1} &= (B_k + 2D_k) (1-p_{k+1}) + p_k (1-p_{k+1}), \\
C_{k+1} &= C_k p_{k+1} + (1-p_k) p_{k+1}, \\
D_{k+1} &= D_k ... |
I read online that this problem is in P:
Problem = {a^n, where n is a primary number}
I can't find any algorithm that decides if a word w in {a}* is in Problem, can someone help me because I'm not really convinced that this problem can be solved in polynomial time.
|
Consider an algorithm for reversing a sequence given below:
def reverse(S, start, stop):
if start < stop − 1:
S[start], S[stop−1] = S[stop−1], S[start]
reverse(S, start+1, stop−1)
The time complexity of this algorithm is $O(n)$ because we make $n$ recursive calls each taking at most $O(1)$ time.
But ... |
Can you write an algorithm which can take in a given function/algorithm, and produce a distribution of generalizations of the function at hand? One such simple example of generalization might mean the generalization from the factorial function to the gamma function, or the generalization of the irrationals to the reals... |
Draw a graph on $5$ vertices that satisfies all of the following conditions:
$G$ is an undirected connected graph.
For every node $v∈V$, in the spanning tree received by BFS($v$), $\deg v=2$.
For every node $v∈V$, in the spanning tree received by DFS($v$), $\deg v=2$.
I was trying to draw many graphs but none of th... |
I am working with a shared resource with the following specifications
acts as a dictionary (values can be obtained with key name: dictionary['key'])
does not have builtin system for locking
Multiple threads can read and write to same keys (simple writes and reads are atomic)
I am trying to implement locking based on k... |
My question is strongly related to the one asked here:
How do I show T(n) = 2T(n-1) + k is O(2^n)?
$$T(n)=2T(n-1)+1$$
Going with the steps, I reached the point where:
$$c*2^{n}\geq c*2^{n}+1$$
which implies
$$0\geq 1$$
which is false for all possible values of $c$ and thus the claim $T(n)=O(2^{n})$ should be incorrect.... |
I'm currently dealing with the problem $$T(n)=T(\sqrt{n})+T(n-1)+n$$
This doesn't seem to show any pattern when continously broken down as a whole, but I was able to find the complexity of $$T(n)=T(n-1)+n$$ and $$T(n)=T(\sqrt{n})+1$$ because they were both easier to solve.
Does it makes sense to guess an upper bound fo... |
I have a question concerning NP reduction.
My question asks me to show that if I have a graph with Edges that connect 3 nodes together instead of 2, (Y style I assume). I need to prove that finding out if the TRI-Graph is 3 coloring is NP-Complete.
I'm not asking for the answer. But I've been racking my brain on how to... |
For index field I got '9' because 2^(9) = 512 words. But I'm stuck on what the formula for calculating the tag field is... any ideas?
Given a cache that holds 512 words and block size of one word. Assume 32-bit addresses. The index field is ____ bit. The tag field is ____ bit.
|
I was asked this question:
Given an image with shape [1,28,28], what will be the shape of the output of a convolution layer with 10 5x5 kernels (filters) without padding?
Now, are the shape dimensions [row, column, depth]?
I really don't understand how you apply a 5x5 kernel on such image, because its 1x28...
What am I... |
I am new to the domain of Machine learning. I have been asked to present a paper related to the mathematics behind the depth separations in Neural Networks (by Itay Safran, Ronen Eldan and Ohad Shamir). I have been having a hard time in understanding the paper.
I am looking for easy papers to learn the foundation so th... |
Consider two probability distributions $D$ and $U$, over $n$-bit strings, where $U$ is the uniform distribution. We are not given an explicit description of $D$: we are only given black-box access, ie, we are only given a sampling device that can sample from $D$. Consider a sample $z \in \{0, 1\}^{n}$, taken from eithe... |
Given an unambiguous context-free language L and an unambiguous regular language L (moreover, every regular language is unambiguous) such that L∩ R = ∅, then prove that L∪ R is also unambiguous.
|
How do I prove the following statement?
The relation $≤_p$ (polynomial time reduction) is an equivalence relation.
|
I have to show that a binary tree with $n$ nodes has at least $(n-1)/2$ weight-balanced nodes and at most $n-1$ weight-balanced nodes. Here a node is weight-balanced if its siblings satisfy $\operatorname{weight}(u) \leq 2\operatorname{weight}(v)$.
So we get at least $(n-1)/2$ (where $n$ is positive and odd) if the one... |
For a boolean function $f:\{0,1\}^n\longrightarrow\{0,1\}$, $H_{avg}(f)$ is a function from $\mathbb{N}\longrightarrow \mathbb{N}$, termed as the average case hardness, if $\forall$ circuit $C_n$ of size $H_{avg}(f)(n)$, $Pr_{x\in U_n}[C_n(x)=f(x)]<1/2+\epsilon$, $\epsilon >0$.
Similarly, for a boolean function $f:\{0,... |
The problem I have in hand is like drawing Google Maps by myself, in particular, roads. When my map scale is huge, I face no problem, but when I zoom out there are too many things to draw -- sure, I can rank the elements, and for example draw only important roads (like highways), but at given scale there will be always... |
I analyzed a dataset using those 3 different algorithms.
As I can see, Random forest performs better in most cases.
My dataset is composed of 4000 instances of two classes (class A 2000 elements, class B 2000 elements).
I use 207 metrics to classify the instances, but I also use the first 20 or 10 best metrics for Info... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.