instruction stringlengths 35 29.1k |
|---|
Since UNARY SUBSET SUM is in P, and a positive-only SUBSET SUM problem could be represented in unary, I struggle to see why it wouldn't be the case that it is in P, when restricted to positive numbers?
|
The Canteen Queue Problem
There is a common canteen for K hostels. Each hostel (co-ed) has some $N_1,N_2,...,N_K$ students. These students line up to pick up their trays in the common canteen, in a queue.
The queue is implemented as follows: If a student sees a person from his/her hostel, she/he joins the queue behind ... |
Consider a car that can hold gas to travel a distance of $c \in N$ kilometers (its capacity) on a full tank that's initially empty. The car starts in node $s \in V$ of a graph. Each vertex $V_i$ of the graph has a gas station where the car can (not necessarily fully) refuel at price (i.e. cost) $p(V_i) \in R_{>0}$ per ... |
Suppose we want to find the value of $x$ that minimizes
$$
f(x)=\frac{1}{2}\|A x-b\|_{2}^{2} .
$$
Specialized linear algebra algorithms can solve this problem efficiently; however, we can also explore how to solve it using gradient-based optimization as a simple example of how these techniques work.
First, we need to ... |
How do I take the average of multiple fast Fourier transforms (ffts)?
I have multiple audios that I want to take the fft of and then average these results to smooth out the random noise that appears in each audio. The ffts of the audios are shown in the graph below.
However the problem I'm having is that I can't work ... |
I would like to know if it is impossible to use K-fold cross-validation for time series of data. It has been discussed that it is not reasonable to predict past from future, but I think this does not make sense since time series data might be repeated in the future. Suppose a past fold is going to be repeated in the fu... |
The Canteen Queue Problem: There is a common canteen for $K$ hostels. Each hostel (co-ed) has some $N_1, N_2,...,N_K$ students. These students line up to pick up their trays in the common canteen, in a queue.
The queue is implemented as follows: If a student sees a person from his/her hostel, she/he joins the queue beh... |
Given a graph $G$ and an integer $k$, is it NP-complete to decide whether there always exist $k$ different disjoint paths between any pair of vertices of $G$?
|
Consider the context-free grammar G = ({a, +, ∗}, {S}, {S → SS+ | SS∗ | a}, {S}) and consider the string aa+a* generated by this grammar.
Is this grammar unambiguous?
I have browsed the Internet and I have found that there is no standard procedure for proving if a grammar is unambiguous or not. But sometimes induction ... |
I'm struggling with implementing O(n+k) radix sorting algorithm for pairs of numbers which values are constrained .
For example
below is array of {x,y} before and after using modified radix sort where max_x=10 and max_y=3
{1,2} {1,1}
{10,3} {1,2}
{1,1} ----> {5,2}
{5,2} {5,3}
{5,3} {10,3}
H... |
A finite set of individuals provide bounded non-binary pairwise ratings of other individuals (say, -10 to +10), forming a directed graph (cycles possible).
I'd like to determine aggregate ratings for each individual that considers all of that individual's inbound ratings and the aggregate ratings of the upstream indivi... |
Can you help me design an algorithm to solve the following problem in polynomial time?
Let n be a given natural number. We define an input series of length n to be a string of length n which is built by using only the characters F, S and - (hyphen).
At least one F or S is guaranteed to appear in each valid input series... |
I'm doing a school project where I have to design a password manager app. I was wondering what the data model would look like. I know that I will have the user database to store authentication informations but where do I put the informations when user create vaults? Would it be something like this?
User
{
username,
pas... |
So, if I were to represent 23 in binary, what are bits here? Are 0 and 1 called bits? What they mean when they say I have five bits of information?
|
I have to give the transition diagram of an NFA accepting all strings that are not empty and start and end with the same symbol, I should also use non-determinism as much as possible (language is {0,1}*). I drew the following diagram:
Even thought this is an NFA (as all DFAs are NFAs too), I did not really use non-det... |
I am working on the following exercise:
Let $(S,\mathcal{F})$ be a matroid and let $c:S \rightarrow \mathbb{R}$ be a weight function on $S$. Find an algorithm that solves the following problem:
MAXIMISATION PROBLEM FOR INDEPENDENCE SYSTEMS (MAX IS): Find an $F \in \mathcal{F}$ such that $c(F)$ is maximal.
From the le... |
Let $G = (V,E)$ be a directed graph with source $s$ and sink $t$ and $s \neq t$.
For each edge $e \in E$, we have $c(e) \in \Bbb N$.
also, we are given a max flow function $f$ on that network.
Let $R_f$ be the residual network that represents the max-flow $f$.
I would like to prove that if $R_f$ has a directed cycle wi... |
What are bits and bytes? How do they differ? What role do these notions play in the computer science world? Why do talk about 8 bits = 1 byte = 256 states or different patterns? What's the rationale behind it? Why not 4 bits = byte? What is so special about 8? How much info can a bit and a byte hold?
|
Let $d_j \in \mathbb{Z}_{\ge 0} =$ jth duplicate unearthed by a freeware de-duplicator (like AllDup1).
$t_j >0 =$ time taken to unearth the jth duplicate.
$f \in \mathbb{N} =$ total number of files being searched.
$f_j =$ number of files already searched by de-duplicator at $t_j$. Plainly, $\uplus_j \; f_j = f$.
M... |
I want to learn prolog,two reason for that are -one can always find a counter example to the argument by searching for negation.So,one can learn by debugging the scripts.I heard that prolog is based on horn clause logic ,so want to learn more about it.
|
I was asked in an exam wether we could improve the SA algorithm by keeping a memory of the best N solutions (so far).
I couldn't find any examples of this being done in practice.
I could only think that we could use this to avoid areas that seem to converge to higher energy levels, and thus complete the search faster.
... |
Assume that in classical Local Search algorithm for MAX-SAT we could flip no more than $r
\leq n/2$ variables (let's call it $r$-flip) on every iteration. More precise: on every iteration we're finding $r$-flip which satisfies more clauses then was satisfied before the flip.
What is the approximation ratio of this alg... |
I've faced this question in my homework.
In a graph $G=(V,\ E)$ where every $v\in V$ has a color, a colored path is a path such that it has at least one vertex of each color.
We're given a directed graph $G=(V,\ E)$, weight function $w:E\rightarrow \mathbb{N}^+$ (in other words the weights are positive) and every verte... |
You have a list of $n$ items you want to sort over $r$ rounds using binary comparisons. In each round, you specify $k$ binary comparisons to be made in parallel. The objective is to fully sort the list.
For example, if you want to sort in $r\in \Theta(n \log(n))$ rounds, then you only need to make $k=1$ comparison per ... |
I have an NP hard problem $P$ that takes in arbitrary $G = (V, E)$ as input. I have another problem $Q$ that I want to show is NP hard, and this problem has arbitrary complete graphs $G'$ as input. Is this enough to say that $Q$ is also NP hard, since it is a subclass of the NP-hard problem with arbitrary inputs, or is... |
Unfortunately copy/paste doesn't work for this paper Inductive Definitions and Type Theory, but here is a snippet.
The paper begins by stating:
The first sentence of the second paragraph says type theory as a theory of inductive definitions. I have never really paid much attention to how central induction is to type ... |
I have seen examples of how to find the solve the recurrence for T(n) = T($\sqrt{n}$) + n, but how do we go about if there is another T(n/2) in there?
So I tried to unfold the recurrence out and this was what I got:
T(n) = T(n/2) + T($\sqrt{n}$) + n
= T(n/4) + T($\sqrt{n/2}$) + T($\sqrt{n}$/2) + T($\sqrt{\sqrt{n}}$) + ... |
A pixel is contained of 3 ranges of RGB color synthesis to add colors into a tiny-square small box, as I learned (correct me if I am wrong). But, through these 3 colors admixture can we create any texture of color to display on the screen? So, for example, with these 3 colors, can we make black, pink, purple, saffron, ... |
I need to solve an optimization problem, whose search space is all possible topological orderings of a DAG. There is a cost function associated with each ordering, which has no simple mathematical representation -- I have a black box which, given one of the orderings, will return the cost associated with that ordering.... |
We have a directed graph $G=(V,E)$ and each vertex $v\in V$ has a cost: $price(v)$. Our mission is to find an algorithm that runs in time $\mathcal{O}(|E|+|V|)$ that finds $\forall v\in V$ the minimal price of all vertices $w$ which are reachable from $v$ (all vertives $w$ s.t. there is a path from $v$ to $w$). Note th... |
Say you are editing a document like a 1000 page book. There are 20 authors all working furiously to edit the book. Every day they are merging their changes 2 or 3 times with the main branch. According to my understanding of git snapshots, this would create a new copy of the document every merge, so by the end of a year... |
I've tried approaching this problem by contradiction, but that did not lead anywhere. Now I am attempting a proof by construction.
i.e. given a language $L_1$, construct a language $L_2$ that cannot be mapping reduced to $L_1$.
|
I have a variable $d_{i} \in \mathbb{Z}$ with an upper and lower bound. I also have a binary variable $v_{i}$ which I want to $=1$ if $d_{i} \geq 0$; else $v_{i} = 0$. How do I enforce this as a linear constraint?
I have seen this post but it is different to my problem as I have the inequality ($\geq$) whereas they mer... |
Given a 4SAT instance such that:
Each clause has 2 negative and 2 positive literals. Thus, the clause is 'balanced'.
Each literal occurs exactly 2 times.
Is this instance of 4SAT NP-complete?
I am aware that the 2P2N-4SAT problem is NP-complete (Proving 2P2N SAT is NP-Complete), but is the balanced cases also NP-Comp... |
A friend sent me this question and I've been stuck on it so if anyone could help I'll be thankful.
Reminder: As we know Huffman coding is a lossless data compression algorithm. The most frequent character $\sigma \in \Sigma$ gets the smallest code and the least frequent character gets the largest code. The variable-len... |
I recently submitted an answer to the following question (homework in algorithms course):
A guy has m shirts, n pants, and p belts. he wants to make the maximum amount of outfits while abiding by these rules:
Every item can appear at most in one outfit
Not every pant can go with the same shirt (we have n X m boolean... |
I start with a complete edge-weighted unbalanced bipartite graph.
For a known, fixed $n$ on the order of 1000:
$$0 \lt n, n \in I$$
Left and right cardinalities might not be equal; for sides $U$ and $V$:
$$0 < |U| \le |V| = n$$
All edge weights are known, fixed, integral and non-negative.
I need to prune this graph suc... |
This problem comes up in the context of game skilltrees, for example in Path of Exile. In this case, one wants to have a subgraph of the entire graph that connects all desired nodes to the origin, but contains as few nodes as possible. Is there an efficient algorithm for this, or a good heuristic? Or is it, as I suspec... |
I have the following language
L = {a(^i)b(^j)c(^k) | i, j, k ≥ 0, and, if i = 1 then j = k} .
How do I use the fact that L′ = {ab(^i)c)^i) | i ≥ 0 to prove that is it not regular?
I am given a hint that says that the regular languages are closed under the intersection operation, but quite honestly I have no idea what s... |
How do I simplify this $((ba \cup ab)^∗ \cup b)^*$? I can draw the NFA for the '$ba$', '$ab$' and '$b$' term but when it comes to linking the '$ba \cup ab$' to the '$)^∗ \cup b)^*$' i am unsure how to draw the asterisk. Is it just an epsilon transition back to the starting state?
|
I'm having a question inspired by exercise 14 from section 1.2.1 of Donald Knuth's The Art of Computer Programming. It's phrased in the following way:
(R. W. Floyd) Prepare a computer program that accepts, as input, programs in some programming language together with optional assertions, and that attempts to fill in t... |
I am looking for a data structure that needs to have very fast and accurate queries to solve the following:
The input:
A set of 3 Dimensional axis-aligned bounding boxes B
A separate 3D axis aligned bounding box b'
The output:
A list of bounding boxes from B that overlap or are contained in b'
Traversal time is the mos... |
Consider a bijective function $f:\{0,1\}^n\rightarrow \{0,1\}^n$. Let $d_k$ be the minimal circuit depth of $f$ when expressed in terms of arbitrary $k$ bit gates (i.e. arbitrary bijective functions on $\{0,1\}^k$). Suppose $d_k$ is known for $k=k_0$. Are there known bounds on $d_k$ in terms of $k$ and $d_{k_0}$?
The u... |
Consider the language $A = \{\langle M\rangle : M$ is a Turing Machine and $| L(M) | = 9\}$. That is, $M$ accepts the language of a set of exactly 9 strings. I want to determine if this language is Turing Recognizable or co-Turing Recognizable or neither.
I think it might be Turing Recognizable considering the construc... |
I had a computer science test in school and we were asked to give the complexity of a code we had to write. the complexity was undoubtedly O(mn) where m,n were unrelated to each other. I got deducted some points as I should've assumed m=n and therefore the complexity is O(n^2). I was later told we were taught to do so ... |
This question is about ideas I regularly think about, and I would like to know what concepts already exist. Also I am not sure at all if this really makes sense, by now it is just a crazy idea
Motivation:
In all my last jobs as a software developer, I spent much time on staring at log lines, trying to find the 1 releva... |
In an example question sheet for my exams our professor included “Know to explain why for non CF languages 1 stack is not enough.”
We haven’t delved into CS and reclusively enumerable languages much and I can’t find the answer to this in my book either. I understand how PDAs work for CF languages though and I have a f... |
I'm interested in concurrent algorithms where, if a thread is waiting for a shared resource, it must call a blocking primitive, and not busy-wait. I'll call such algorithms spin-free. Specifically, I'm interested in how powerful synchronization primitives are in terms of what spin-free algorithms can be implemented on ... |
In my textbook there was the following question:
How many Huffman codes can be written for a set of three characters?
In the solution they said:
The Huffman code is determined by the source's probability vector. The code is determined by the order of the probabilities and their combinations. When given a vector of p... |
How do the 1969 and 1979 books by Hopcroft & Ullman compare? Was the 1969 book an earlier version of the 1979 book?
1969: Formal Languages and their Relation to Automata
1979: Introduction to Automata Theory, Languages, and Computation (IATLC)
The 1979 book cites the 1969 book but does not describe how these two books ... |
I would like to create a data structure representing a sparse matrix, where the number of non-zero values is $\mathcal{O}(n)$ (the matrix is $n\times n$).
The matrix should support the following operations with the following time complexities:
peek/poke an entry in the matrix - $\mathcal{O}(n)$.
add a row of zeros som... |
According to my course the question "Is $L(G)$ regular?" undecidable. But I was more interested in knowing the exact algorithm or proof that makes this question undecidable. To further elaborate what I mean it is like saying "Is 2 bigger than 1?" is pretty much decidable intuitively because $2 = 1 +1$.
|
I saw this proposition on Sedgewick's lecture slides on QuickSort, and I've been wondering why the number of comparisons is linear in the case of a constant number of distinct keys. I tried to establish a linear upper bound but failed to find the appropriate linear lower bound. Here are my workings($N$ is the total nu... |
The following exercise in my homework is about string matching using the $KMP$ algorithm with a pattern that can be modified by a linear transformation.
Question: We're given a text $T \in \mathbb{N}^*$ where $|T|=n$ and a pattern $P \in \mathbb{N}^*$ where $|P|=m$, in other words $T$ and $P$ are consisted of natural n... |
I am writing a UI that needs to display a chat log, similar to Slack and Discord. In addition to being able to scroll and lazy-fetch additional pages in either direction, I need to be able to jump to a specific point in time and fetch the message records "around" it (a backend API problem, of course).
I need a "lazy ra... |
If I have a DFA $D$ that accepts some regular language $L$, is it possible to construct some finite-state transducer $T$ that takes in an index $i$, and puts out the $i$'th word in $L$, ordered lexicographically?
I know from this paper that you can construct such a transducer that maps from a given word in $L$ to the n... |
I am studying computer architecture in my university and there is something that's troubling me. I get the bigger picture of how instructions are executed in the fetch - execute cycle and the complete process of a program being read by the compiler and then into machine code....
In my Digital Logic Design class I have ... |
New to algorithmic thinking so looking for some guidance – especially as there might be multiple approaches to this.
Say you have a list of 100 distinct items. These items are ranked in order of preference. Their prices range from ~1 to ~100 USD. You have a fixed budget of 30 USD in one month.
eg. (in order of preferen... |
Is there an AI algorithm that generates 2D vector images with given examples like the the below images that is accessed on a website or something?
|
A polynomial hash of a string $s$ with base $b$ and modulus $M$ is defined as
$$
H(s) = (s_0 + s_1 b + s_2 b^2 + \dots + s_{n-1} b^{n-1}) \mod M.
$$
I have proven (and this is quite obvious) that collisions are more likely if $b$ and $M$ have common factors.
I have also proven that if $b \perp M$ and $s_i$ are random n... |
In Algorithms 1, I'm noticing that big-Theta running times are always used for recurrence relations when using the iteration method. Meanwhile, using the Master Theorem always seems to result in a big-O. Is this always the case for Master Theorem and iteration method, respectively?
|
Internet speeds vs. computer boot speeds: Both cases involve digital signals being decrypted, analyzed, and transmitted via software and hardware. Signals from a computer boot only travel as far as the distance between its internal components. But, internet signals travel all over the world. How come when you search Go... |
The recurrent function $T(n) = \frac78T\left(\frac78n\right)+\frac78n$ where $T(1) = 0$ and $n = \left(\frac87\right)^k$ represents the running time of an algorithm. How can I find a more simple form (depending only on n) of this function? I kept replacing $T\left(\frac78n\right)$ and $T\left(\frac78\times\frac78n\righ... |
I have used KNN for predicting the output power of solar panels. I have done feature scaling based on normalization for all data points. The problem is that the MAE is equal to 0.08, and MSE is equal to 0.06. I know that MSE must be greater than MAE.
What is the reason behind that ?
|
I want to assign $m$ tasks to $n$ workers where $m>n$, so as to minimize assignment costs defined by an $m \times n$ matrix $C$. That is, I want to find Boolean variables $x_{i,j}$ which minimize
$$
\sum_{i=1}^m \sum_{j=1}^n C_{i,j}x_{i,j}, \\
s.t. \sum_{j=1}^n x_{i,j}=1 \text{ for all } i=1,\dots,m
$$
Rather than a se... |
I saw on Wikipediathat Hierholzer's algorithm has a time complexity of O(E), but won't the dfs used in this algorithm would cause the total time complexity to be O(V+E) instead of only O(E).
Assuming we performed the dfs on an Adjacency list.
Assume the graph is a connected graph with only one component.
Thanks for the... |
Multiple sources state that the time complexity of adding a vertex to an adjacency list is O(1) and my understanding right now is that this is because of optimizations with hash tables.
If we use an array of linked lists, then the time complexity is O(V) right? Because to add a new vertex we have to make a new array of... |
In Arora and Barak's textbook, page 261-262, in decision model complexity, they states:
Address Function: Suppose that $n = k + 2^k$ and let $f$ be the function that maps $x_1, x_2, \dots, x_k, y_1, \dots, y_{2^k}$ to the input $y_x$. That is, the function treats the first $k = \log n$ bits as an index to an array spe... |
Are conditional statements, loops, and basic maths operators are functions? I learn functions as a "specific action". But, I saw in a video from youtube that a guy called loops and math operators "Functions". Was he right? OR, I have to modify my definition of functions?
|
I am looking for the best known approximation algorithm for the scheduling problem $P2|tree;p_j=1;M_j|C_{max}$, which to my knowledge is at least $\mathbb{NP}$-hard.
A more elaborate description of the problem: I want to find a non-preemptive schedule on two machines with minimum makespan for $n$ jobs with uniform proc... |
Problem description:
You are given an integer array Inventories representing the ribbon
inventories, where Inventories[i] represents the length of the ith
ribbon, and an array of orders. Each order in orders is an array of
integers, representing the ribbons needed with certain lengths for
that order. For example, if o... |
I'm trying to figure out the asymptotic estimate of $\frac{(\sqrt{n}+n-1)!}{(\sqrt{n})!(n-1)!}$. I think it is $\omega(2^{\sqrt{n}})$ and am trying to prove it by showing $\lim_{n \rightarrow \infty} \frac{\frac{(\sqrt{n}+n-1)!}{(\sqrt{n})!(n-1)!}}{2^{\sqrt{n}}} = \infty$ as wolfram says it should. But can't seem to ge... |
My first question here. Please do not judge me much if this is a too simple.
Some text consists of $n=12\,500$ distinct words. I would like to construct a Bloom filter with $\epsilon=10^{-2}$ probability of false positives. Using well known formulas, the optimal filter size $m$ is computed as
$$m=-\frac{n\log\epsilon}{... |
Can somebody please explain to me, how one can calculate W = 2762827861, 1991065600 from previous representation B? An example calculation would be great.
I am unable to figure out how the translation from the second last to the last row works.
The figure is dealing with elements of fixed size. In the first row you sim... |
I have a problem regarding dependencies. I'm making a circuit simulator thingy and I stumbled upon the problem of determining which circuit component should be updated first (since updates in my case mean that the output is transformed based on its inputs according to some specified behaviour, the behaviour being irrel... |
I have used KNN for predicting the output power of solar panels. The results are shown below:
Test Set:
MAE = 0.044
MSE = 0.004
Standard Deviation = 0.272
Cross-validation:
MAE = 0.049
MSE = 0.005
Standard Deviation= 0.001
Now my question is, why the difference between standard deviations is too much in th... |
I am reading the paper "Collaborative PAC Learning" by Blum et al. So I will try to setup the problem here as to avoid reading the complete section (personalized setting).
Assume there are $k$ agents that are learning a labelling function $f^{*} \in \mathcal{H}$ of Hypothesis class $\mathcal{H}$ and observe a distinct ... |
Certain algorithms require two independent hash functions. An optimization I've seen is to split the output of a wide hash function and use the parts instead of the two independent hash functions of shorter output.
For instance, double hashing is often used as a technique to compute the k independent indexes required b... |
I am fascinated by the bloom filter data structure. Is there a similar probabilistic data structure that can efficiently store and update the relationships between certain elements and the strength of those relationships?
|
In my computational geometry book they present the following $O(n^4)$ algorithm for computing the convex hull of a pointset $P \subset \mathbb{R}^2$ assuming general position on the points in $P$: For all $O(n^3)$ triangles do an inclusion test for every point not yet discarded to see if they lie inside the triangle. I... |
The word swizzle can refer to an operation performed in GPU algorithms:
[The] ability to compose vectors by arbitrarily rearranging and combining components of other vectors.
Swizzle (computer graphics) - Wikipedia
I've found another reference to "swizzle" in a CS context when dealing with pointers, i.e. Pointer swiz... |
While reading up about Conway's Game of Life, I often come across the term conservative or non-conservative dynamics. What exactly does these terms mean?
My guess is that a certain quantity (e.g., number of dead cells) always remains the same as the system evolves. Is this what it means? Thank you.
The paper I was look... |
I am studying assembly language. I feel very difficult in understanding few instruction.
ADD R1,R2,[R3]
ADD R1, R2, R3
What is the difference between these two instructions. I think second instruction takes the value in R3 register and add it to the value in R2 register and store it in R1 register.
Then what does it me... |
Let Σ = {a, b} and L = {ww | w ∈ Σ∗ and w is of length k}. Show that for each k, no DFA can recognize L with fewer than 2^k states.
What I understand is that we prove this by contradiction. Assume that L has less than 2^k states i.e L has 2^k -1 states. We then use the pigeonhole principle which would mean that two of ... |
I am discovering the topic of Genetic Algorithms, I read a bit about it on wikipedia and towardsdatascience. When I checked papers some papers, I found them using the notation "$(1 + (λ, λ))$" Genetic Algorithm. What does it mean exactly?
They also use the notation "(1 + 1)" evolutionary algorithm. Any idea what thes... |
I am trying to design a (deterministic) one tape Turing machine that can accepts the following language L = {0^{n^2} | n belongs to N} , but so far i couldn't find a proper solutions, neither in similar questions.
I know it's a pretty general problem, but I'm stacked so far and I'm not having any good idea. Thanks in a... |
A friend and I were surprised that C still has near-best performance among languages. I thought about why this is, and I wrote up a few paragraphs. I wonder if the friendly folks on CS stack could tell me where I'm wrong, too vague, or misleading. This will help me sharpen my understanding of the situation.
One reason... |
Analytic combinatorics and concrete mathematics are the mathematics of asymptotic counting, and they draw from combinatorics, analysis, and probability. These techniques have been applied to the analysis of algorithms, e.g. in books by Knuth and (his student) Sedgewick. However, the results tend to be very precise -- t... |
I am trying to understand the fundamentals of Bayesian machine learning and I found an interesting task, which I have tried to solve:
We are in the setting of a binary classification problem with $Y=\{-1,+1\}$ and an input space $X=\bigcup\limits_{i=0}^{n} X_i$, where all $X_i$ are disjoint sets. Further, we are given ... |
I am trying to understand how asymptotic complexity of the given function is calculated based out of Introduction to algorithms by Thomas Cormen.
In the book we are trying to solve inequality for $f(n) = \frac12n^2-3n$.
It is solved such that $c_1n^2 \leqslant \frac12n^2 - 3n \leqslant c_2n^2$.
Dividing both sides by $... |
I've heard that the MAC Model prevents Trojans to charm files on the system.
How is it possible? Can somebody show any example that MAC model protects us against it?
|
I've had an exam in computational models a few days ago, and would like to check whether I made a mistake. The question goes like that:
Is there a language $ L \notin PSPACE $ over the alphabet {0,1} such that
$$
L_{pad} = \{wp^{2^{|w|}-|w|} | w \in L\} \in PSPACE
$$
over tha alphabet {0,1,p}.
On the spot I answered no... |
I am making a clone of Clash Royale which is basically a Tower Defence game.
As you can see from the picture you can deploy different troops only in your side of the court (that blue rectangle), and they will automatically target the enemy tower (placed in the enemy court in red) or, if there is one, the enemy troop n... |
I was reading [1] about reachability analysis of a feed forward neural network (FFNN). The paper encodes a FFNN as a linear programming problem. Suppose $x^{(i)}$ is the vector output of the ith layer, $W^{(i)}$ is the weight matrix corresponding to layer i, and $b^{(i)}$ is the bias vector. So by definition, the outpu... |
Let $G = (V,E)$ be a directed graph with source $s$ and sink $t$ and $s \neq t$.
For each edge $e \in E$, we have $c(e) \in \Bbb N$.
Also, we are given a max flow function $f$ on that network.
Let $R_f$ be the residual network of $f$.
I would like to prove that the set formed by all the nodes reachable from $s$ in $R_f... |
In Programming there is different data types (int , cahr , bool ,
float ) and they have different sizes (1,2,4,8 .. Bytes) , and the
size of data type are depends upon hardware or architecture of
computer or any thing else? as a beginner give me answer in simple language plz !
|
recently i started studying computer science and computer graphics, and one question really haunts me. Mby someone can explain this. How bit patterns become translated into (for example ) text. I know we have encoding like ascii and unicode but this is also just bit patterns. Main mystery is at what point do the bits t... |
My purpose is to write a journal paper related to shared computing more abstractly (simply cost model) and I need to refer to these variables in both equation and its corresponding pseudocode.
I want define variables of a struct as mathematical notation. I get lost in between programming and mathematical concept. I'm t... |
I am trying to write a simple parser for a small calculator project, that should be able to parse e.g. the following inputs:
5 + 3
5 + f(4)
5 + f(x)
x = 5
f(x) = 3*x
so basically, I want to be able to parse expressions (that may contain variables and function calls), variable assignments, and function definitions usin... |
I'm looking for what I think is a random number generator, it should have the following properties, but I'm completely uncertain how to look for a suitable algorithm. I'd appreciate either pointers to a specific algorithm, a class of them, places for starting my research, or an explanation of why what I'm looking for i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.