instruction
stringlengths
0
29.8k
⌀
Let $f(n) = n \cdot \sqrt n$ and $g(n)= \frac{n^2}{\log n}$. Why is $f(n) = o(g(n))$? Could you please explain to me why this is so? I have tried l'Hôpital's rule but it doesn't add any clarification.
Why, for $f(n) = n \cdot \sqrt n$ and $g(n)=n^2/\log n$, we have $f(n) = o(g(n))$?
|big-o-notation|
null
DMA is expensive. It is used in more expensive devices. More expensive devices are faster. There is a correlation but not a causal relationship. And in the 2020s you want nobody, not even a trusted external device, to have the ability to write directly to your RAM. Too much of a security risk.
I am wondering why are read/write operations on I/O devices much faster when we use DMA?I must be that when using DMA we have 1 less clock cycle to access the local buffer of a IO device since it is already part of the main memory.Am I correct?
null
Instead of using the pumping lemma, you can prove directly that a finite state machine cannot work. Assume you have a state machine with k states. And you just parsed 0^p 1 for some prime. So you are in a state where n\*p-1 1s will get you to an accepting state. After parsing a 1, you are in a state where parsing n...
In *Machine Learning: The Basics*, Alexander Jung, Spinger, the author states that using the zero-one loss function defined by:$$\mathit{L}((\mathbf{x}, y), h)= \begin{cases} 1, y \ne \hat{y}\\ 0\ otherwise, \end{cases}\\ (with\ \hat{y}=1\ for\ h(\mathbf{x}) \ge 0, and\ \hat{y} = −1 \ for \ h(\mathbf{x})\lt0). $$...
Complexity of zero-one loss vs logistic loss functions
|complexity-theory|
f each edge has a distinct weight then there will be only one, unique minimum spanning tree. This is true in many realistic situations, such as the telecommunications company example above, where it's unlikely any two paths have exactly the same cost. This generalizes to spanning forests as well. Proof: Assume th...
Uniquness of a graph. Why do we need to add e1 to B to create a cycle?
|graphs|trees|
null
Training is a crucial step of machine learning, where You take Your model (hypothesis) and find values for its parameters such that it fits Your training data well enough. The error between model and data is measured by a loss function. Training boils down to minimizing the loss function with respect to the parameters....
I've been stuck for hours trying to solve the recurrence T(n) = 7T(n/3) + n^2 + 2n by using case 3 of the master theorem. I've done a good chunk of the proof, but currently stuck attempting to solve the regularity property af(n/b) <= cf(n). I don't think this fits the case 3 requirements, but my best shot has bee...
Master Theorem - Solving Recurrence
|master-theorem|
What do you call a *valid* λ-expression? This is not a standard concept. Anyways, λ-expressions are the terms built inductively as follows: * given a fixed set $V$ of variables, all $x \in V$ are λ-expressions, * for any variable $x$ and λ-expression $M$, $λx.M$ is a λ-expression, * for any λ-expressions $M$ a...
null
If each edge has a distinct weight then there will be only one, unique minimum spanning tree. This is true in many realistic situations, such as the telecommunications company example above, where it's unlikely any two paths have exactly the same cost. This generalizes to spanning forests as well. Proof: 1. Assu...
If $e_2$ is the lightest edge from $B$ then the weight of $e_2$ could be smaller than the weight of $e_1$ (when $e_2$ also belongs to $A$). Even if such $e_2$ was in $B$ but not in $A$ and had a larger weight than $e_1$ (which is implied from the choice of $e_1$), this still doesn't prove that you can get a lighter...
null
null
Question: Let G(V, E) be an undirected connected finite graph with the weight function w : E → R+. Let T be a minimum spanning tree of G. Prove that there exists a run of Kruskal’s algorithm that finds T (for suitable ordering of edges). Answer: We show that the following proposition P is true by induction: If F i...
Trying to give a proof about graphs. Having a hard time giving proof for Kruskals algorithm. Can you check my answer?
|algorithms|graphs|proof-techniques|check-my-answer|
Could you please explain me why that's the case?
Why, for $f(n) = n \cdot \sqrt n$ and $g(n)=nlog n$, we have $f = ω(g)$?
|algorithms|asymptotics|
I've been stuck for hours trying to solve the recurrence $T(n) = 7T(n/3) + n^2 + 2n$ by using case 3 of the master theorem. I've done a good chunk of the proof, but currently stuck attempting to solve the regularity property $af(n/b) \leq cf(n)$. I don't think this fits the case 3 requirements, but my best shot h...
null
Why, for $f(n) = n \cdot \sqrt n$ and $g(n)=n(log n)^5$, we have $f = ω(g)$?
Why, for $f(n) = n \cdot \sqrt n$ and $g(n)=n(log n)^5$, we have $f = ω(g)$? log is base 2
$f(n) = \omega(g(n))$ if, for every constant $c$, there is some value $n_0$ (possibly depending on $c$) such that the following is satisfied by all $n \ge n_0$: $$ f(n) \ge c g(n). $$ Intuitively, $f(n)$ grows faster than any scaled-up (by a multiplicative constant) version of $g(n)$. This is the case with...
null
Your update is almost right. The one problem is that distances may be negative, meaning that the distance to a predecessor $v.\pi$ may be greater than the distance to $v$. A simple alternative would be an induction on the *length* of path, that is the number of edges on the unique simple path from $s$: The proof is ...
Your update is correct. On first reading I thought it was wrong because distances can be negative. It's early here for me ... then I remembered that CLRS defines distance from $s$ to $v$ to be the minimum number of edges on any path from $s$ to $v$ when discussing BFS. Indeed, here is a simple proof: The proof is by...
$f(n) = n^{1.5}$ and $g(n) = n^2/\log n$. Note that $\log n$ grows slower than any polynomial function. Try to compute $$\lim_{n \to \infty} \frac{f(n)}{g(n)}$$ Which grows faster, $\log n$ or $\sqrt n$? --- More details: By dividing by $n^{1.5}$, we get $$\lim_{n \to \infty} \frac{f(n)}{g(n)} = \lim...
null
I am trying to understand the "Structure Theorem" in [Arora's TSP slides][1]. In particular, I do not understand the image on slide 13-3 (page 68 of the PDF). The high level idea is to show that (without randomization/derandomization) there is a chance that you will get a "bad" approximation of the Euclidean TSP using ...
Understanding the "Structure Theorem" for the Euclidean Traveling Salesman PTAS
|approximation|traveling-salesman|
null
null
To prove correctness of Kruskal's algorithm (and Prim's), you can use _the cut property_. **Lemma** (The cut property). Let $\emptyset \subset S \subset V$ be a set of vertices and $e$ a cheapest edge with exactly one endpoint in $S$. Then there is a minimum spanning tree $T$ that contains $e$. **Proof** (sketc...
The answer is no. Consider a problem $X$ in $\mathsf{NP}$ that is not $\mathsf{NP}$-complete. Suppose that finding out some bound on the complexity of $X$ would show $\mathsf{P}=\mathsf{NP}$. The thing is that if $\mathsf{P}=\mathsf{NP}$, then all problems in $\mathsf{NP}$ are $\mathsf{NP}$-complete, except for t...
What is the efficient algorithm to find a submatrix (*must be rectangle*) with a sum that is as close as possible to k? Matrix consists only of nonnegative integers. Iterating through all possible submatricies requires O(n^4). Computing the sum can be done in O(1) time using prefix sums. I've thought about a similar pr...
Find submatrix with sum as close to k as possible
|algorithms|data-structures|dynamic-programming|matrices|
null
I had posted earlier a question regarding ranking max "n" consecutive "0"s and "1"s in a "K"-bit string - https://cs.stackexchange.com/questions/162157/order-in-a-subset <br> I got clarification regarding how it can be solved by using DFA (Deterministic Finite Automation) - https://cstheory.stackexchange.co...
DFA for "K" bit value with max "n" consecutive "0"s and "1"s
|finite-automata|binary|rank|
null
|formal-methods|static-analysis|
null
Yes. Ladner's theorem shows that for any problem $X \in \mathrm{NP} \setminus \mathrm{P}$ there is a problem $Y \in \mathrm{NP} \setminus \mathrm{P}$ such that $Y$ is reducible to $X$ but not vice versa. If we apply the construction from Ladner's theorem to e.g.~$\mathrm{SAT}$ we obtain a problem $Z \in \mathrm{N...
One of the services of a OS is communication between processes.However how much important is that?I dont think it is that important just for example if we saved a .txt file the file explorer wouldnt give back the name of the file to the text processor .Am I missing something here?
Is communication between processes really important for a OS or is it just a convenience?
|operating-systems|process-scheduling|
null
I am trying to understand the "Structure Theorem" in [Arora's TSP slides][1]. In particular, I do not understand the image on slide 13-3 (page 68 of the PDF). The high level idea is to show that (without randomization/derandomization) there is a chance that you will get a "bad" approximation of the Euclidean TSP using ...
null
this paragraph describes the immediate consequences operator $T_P(I) = \{ a \mid \text{there exists a rule } r \in G(P) \text{ with } head(r)=a \text{ and } body(r) \subseteq I \}$ for some interpretation $I$ modelled as a set of ground terms. What is the significance of this operator ? We start from an interpretati...
> Am I missing something here Yes, you are. > However how much important is that? It is one of the most important problems when you write a multi-process program. It is quite complicated topic in programming and it is one of the most frequent sources of errors. > I dont think it is that important just for e...
null
I was reading *Type Theory and Formal Proof* by Nederpelt and Geuvers and in Chapter 3 about $\lambda2$ at page 81 they show how the self-applicator $\lambda x . xx$ can be typed by observing that $\lambda x : (\Pi \alpha : * . \alpha \rightarrow \alpha) . x(\sigma \rightarrow \sigma)(x\sigma)$ typechecks correctly. Th...
Proof that the Omega combinator cannot be typed in System F
|type-theory|
null
Here are some examples of communication between processes that may not have occurred to you: - Terminal I/O. Any text-based program needs to communicate with a terminal program somehow. - Application control. Almost all modern operating systems have a way to communicate important information to running programs. ...
null
null
null
The process of converting assembly to actual machine code is carried out by the joint work of the assembler and the linker. The former is responsible for converting the assembly listing to object code, that is, actual instructions; the latter is responsible for linking together two or more objects and eventually produc...
null
I am wondering is usually the OS kernel which provides a link between 2 processes part of the main() of the os or is it a seperate function?In other words do we usually encapsulate the OS kernel in the main or we use a seperate function?
Is the OS kernel part of the main() of the OS or is it a seperate function?
|operating-systems|process-scheduling|os-kernel|
You can launch an emulator (VirtualBox, VMware...) and run an old MS-DOS install. You will be able to run the "debug" program which can assemble this code (just replace the REPEAT label with the address). "debug" can also execute that program step by step. If you only want to see machine code, there are online ...
null
According to [this][1] article, we have the following: > The device controller gets data from a connected system device and > temporarily saves such data in a special purpose register inside the > controller known as a local buffer. So according to the above statement, the local buffer is a part of the special...
Device Controllers in OS
|operating-systems|
null
null
null
Why, for $f(n) = n \cdot \sqrt n$ and $g(n)=n(\log n)^5$, we have $f = \omega(g)$? log is base 2
null
null
It depends on the device and, specifically, how much data needs to be buffered. Some devices, such as GPIO or SMBus (used for things like temperature sensors on the motherboard), have such a low bandwidth that the maximum amount of data that needs to be "buffered" is a small number of bytes. A hardware register or t...
It will help to know how to figure out the size of header of a WAV file by looking at its byte structure. [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/DsHpb.jpg Source: http://soundfile.sapp.org/doc/WaveFormat/
How to know size of header of a WAV file
|filesystems|
null
It will help to know how to figure out the size of header of a WAV file by looking at its byte structure. [![enter image description here][1]][1] [1]: https://i.stack.imgur.com/DsHpb.jpg Source: http://soundfile.sapp.org/doc/WaveFormat/ UPDATE: On second look, it says SubChunkSize = 16. But not sure h...
null
null