instruction
stringlengths
35
29.1k
Say I had a list of numbers in the range of 1-20 for example: [5, 16, 17, 3, 2, 14, 4, 9, 11, 19], and an integer k (let's say k = 40) How would I find the maximum possible size of S, where S is a set of pairwise-disjoint subsets of the list, and every element of S sums to k? I believe this algorithm is NP complete. Ju...
I'm going through Cormen et al.'s Introduction to Algorithms and I am a little thrown off by some of the subtleties of solving recurrences with the substitution method. Given the recurrence: $$ T(n) = T(\lfloor n/2 \rfloor) + T(\lceil n/2 \rceil) + 1, $$ We guess that the solution is $T(n) = O(n)$. Thus we try to show...
I am in the process of making a cryptocurrency trading bot. Currently, I am doing backtesting over a period of 7 months in which I provide a portion of historical data as if it were in real-life. By modulating 3 variables: decision threshold, maximum % gain per trade, and stop loss, I want to find the best input value...
Say I have the following contrived example code: a(1) function a(x) { var n = b(x) var m = c(x) return n + m } function b(x) { var n = d(x / 2) var m = e(x) return n - m } function c(x) { var n = d(x) var m = e(x) return n * m } function d(x) { return x + 2 } function e(x) { return x + 3 } T...
I am an undergraduate majoring in Computer Science and Mathematics. For my undergraduate research, I would like to work on something that lies in the overlap between systems research and theoretical computer science. Something that could satisfy this requirement is cache-oblivious algorithms because it is about the an...
Looking at the Symbolic Execution limitations, there are some good solutions to the "Environment interactions" problems. However, the solutions to the path explosion problem are less than ideal. Solutions to the path explosion problem generally use either heuristics for path-finding to increase code coverage,[2] reduc...
My question is if the following statement is true or false: Does every turing-recognized $B$ language has a turing machine $M$ that recognizes $B$ and fullfiles the following statement: For every word $w$ the belongs to $B$, $w \in B$, the writing-reading head never moves to the left? Notice that the condition is requ...
On one hand, it seems to make no sense, because of the following: When expanded, the claim $f(n,a) \in O(n/a)$ would be There exist $C > 0$, $n_0$, and $a_0$ such that if $n \geq n_0$ and $a \geq a_0$, then $f(n,a) \leq C \cdot n/a$. Now, given any $\epsilon > 0$, we can find an $a_\epsilon \geq a_0$ such that $C \c...
So on my course we're dealing with a more basic, simple varition of the Bellman Equation. V(S) = max a(R(s,a)+yV(s')) As far as I can tell... V(S) = Value of a state max a = Maximum over all the actions R(s,a) = Reward of a state and action y = Gamma (Discounting factor) V(s') = The end state So how I've always ...
Given a lower-bound predicate function which returns true if an input is greater than or equal to a constant string, what is the optimal way to search for the constant? The strings should be lexicographical compared. For example, given a handle to the following function, but not knowing the specific constant used: fn l...
I'm hoping to design and implement an intuitive algorithm that solves 9x9 Sudoku puzzles. I want to do this by first formalising the basic rules of the puzzle, and then deriving principles from these that when followed should be sufficient for solving the problem. I have reproduced my (very rough) work below. Rule 1: E...
So for example, we are trying to predict the amount of rainfall in the afternoon base on continuous features such as humidity and temperature in the morning. 1st neural network: Regression neural network on features to give one output label which is a continuous value for predicted rainfall in the afternoon. 2nd neural...
I'm a bit new to automata theory, I'm sorry if this question is a bit too simple. If this question has been answered somewhere already, please point me to it. One basic problem I wanted to solve was defining the minimal set of states need to construct a (minimal) DFA that accepts $$(a^+)+bcd^*\,.$$ I'm not sure how to ...
I have some "fuzzy" congruences like these: \begin{align} \\ x&\equiv a_1 \mod 3 \text{ with } a_1 \in \{0,1\},\\ x&\equiv a_2\mod 5 \text{ with } a_2 \in \{2,3,4\},\\x&\equiv a_3 \mod 7 \text{ with } a_3 \in \{5,6\}\\ \end{align} These example moduli would provide a unique solution for $x \mod lcm(3,5,7)$, if the $a_i...
The problem of determining, given a string $x$ and a context-free grammar $G$, whether $x \in L(G)$ is conjectured to take more than linear time in the length of $x$. Currently the best known algorithm is Valiant's which takes $\Theta(|G||x|^\omega)$. On the other hand, for a fixed $G$ there may be a specialized recogn...
I have a network which includes $L$ blocks ($B_1,\cdots,B_L$) connected one after the other. I have an algorithm having computational complexity $\mathcal{O}(N)$ which runs in each block individually. I first run the algorithm on $B_1$ and get the output. Based on that output, I select the second data set in $B_2$. ...
I am trying to re-implement SuperPI myself in Rust, but the results I get are not very accurate. SuperPI computes pi using the Gauss-Legendre algorithm. The Gauss–Legendre algorithm is quite simple, but the problem is how to store values with full precision. I store all numbers as arbitrary sized rationals, but I am s...
Is the speed of compiling software very dependent on the CPU? I know this question is a bit broad, but I'm to find an answer to the case described below. If I download a software project that makes use of Node.js, TypeScript, and JavaScript and compile it running yarn it takes a certain duration on machine A and anothe...
To elaborate on the title: I have a recursive algorithm whose input is reduced by 1 for every iteration until the input size is 1. 1st iteration: n 2nd iteration: n-1 3rd iteration: n-2 4th iteration: n-3 . . . nth iteration: n-(n-1) How can I describe this in asymptotic notation?
So i have asked this before, but i still didn't get my answer so I'll try to make my question more clear this time : Based on my O.S book, Time sharing operating systems switch between processes very fast using a time slice and it uses interrupts when the time slice ends and switches to another process, so isn't this ...
Consider this implementation of the Bakery Lock: integer array[0..n-1] label = [0,...,0] boolean array[0..n-1] flag = [false, ..., false] lock(me): flag[me] = true; label[me] = max(label[0], ... , label[n-1]) + 1; while (∃k ≠ me: flag[k] && (k,label[k]) <l (me, label[me])) {}; unlock(me): flag[me] = false; I...
I understand intuitively that gear bits in the massively successful Turing Tumble game (funded by kickstarter) are necessary for Turing completeness*. I had a fantasy about building a computer with the Lego racetracks which have Y junctions operated by gates. Going into a branching path, the gate controls the car's pat...
Is there any algorithm for estimating how well certain array of bytes could be compressed in lossless manner? Usage for me is to automatically choose "best" data reorder method without knowing what compression method end user is going to use. I don't need perfect/optimal result, I just need some kind of numerical resul...
This problem involves the time complexity of erasing entries that occur more than once in a list. I think it might be $n \log n$. Problem The input is a finite set $S$ and a finite list $T$ whose entries are in $S$. The size of the input is $n= |S|+ |T|$, where $|T|$ is the length of the list. The output is a...
I'm trying to understand why the following is incorrect. Given a $STCON$ problem, specifically a graph and nodes $(G, s, t)$, we can assume we are given it's adjacency matrix, $A$. By adding self-loop (filling the main diagonal with $1$'s) we can multiple this matrix with itself n times, each time checking if the $s,t$...
Okay.I have problem about cache mapping. Here is the problem . Memory size is 1 MB Byte addresable Cache block size is 16 Bytes. Cache size is 64kb Since memory is 1 mb=2**20 Bytes. So we need 20 bits for the one single address . Since it is byte addressable and each block size is 16 bytes we need for 4 bits the ...
This is the problem : Given two arrays of $n$ elements A and B, let's define their sum as $$ A + B = \{ a + b \mid a \in A \text{ and } b \in B \}. $$ Calculate $A + A$ in optimal time given that $A[i] \in [1,10n^{1.5}]$ for all $i$. In order to solve this problem I used FFT by representing a polynomial in the f...
I'm currently creating a NeuralNetwork with backpropagation/gradient descent. There is this hyperparameter introduced called "learning rate" (η). Which has to be chosen to guarantee not overshooting the minimum of the cost function when doing gradient descent. But you also do not want to slow down learning unnecessaril...
In the book by Sangiorgi and Walker ("The $\pi$-calculus: A theory of Mobile Processes"), Subsection 3.2 is devoted to recursion. They state the following constraint (pages 132-133): "The environment is finitary, in the sense that any process depends on only finitely many constant definitions. (Formally, the transitiv...
I’m wondering whether there are any algorithms that use so much time that they must be represented using Knuth up-arrow notation. Required: Use more than one up-arrow for time complexity. Bonus points: Have the algorithm be useful. Have the algorithm be useful and optimized
Suppose I have a positively weighted (bounded-degree) graph $G$ where each vertex in $G$ is colored either black or white. I'm curious about the complexity of the following problem: Find a subset $S$ of edges of G of maximal weight, subject to the constraint that any node colored black is incident to an odd number of ...
I'm currently looking into computability logic. Japaridze explain that a game !P v P like !Chess v Chess is always winnable thanks to the copycat strategy (http://www.csc.villanova.edu/~japaridz/CL/3.html#copycat). However, what guarantees that the environment will play the same moves? One game could be e4 e5, but the ...
In Coq we have an impredicative base type, called Prop, and a predicative base type, called Set, both of type Type 0. On the other hand, in Lean we only have an impredicative base type. We do not have an equivalent to Set. Instead we use directly Type 0(a synonym of Sort 1). What are the implications of this design dec...
Currently, I am developing a transpiler for my own language, however, I find difficulties to transpile generic functions. For example, how would you translate the following Java-like code in to C? interface Comparable<T> { boolean compare(T that); } class Person implements Comprable<Person> { public string nam...
Assuming P = NP, why should P be a subset of NPC? Here is how I understand it: P is a subset of NP NPC is a subset of NP if we solve an NP Complete problem on a deterministic machine in polynomial time then NP is a subset of P P=NP (from 1 and 3) NPC is a subset of P (2 and 3) But why is P a subset of NPC, if P = ...
I'm reading about an operating system but some concept confuses me. What doesn't confuse me: When an interrupt or system call or processor exception occurs, it happens when user mode tries to switch to the kernel mode, the operating system uses PCB(process control block) to save needed stuff, namely - hardware complet...
I have a table and asked me to add my information to it. And then asked me to find my information in the easiest way (after adding your details to the table, assume that the table is arranged alphabetically for names How many comparisons to find your name in the table if you use binary search Give details on how you go...
Consider a recurrence of the form $T(n) = a T(n/b) + f(n)$ Master theorem's regularity condition excludes some cases (for example, when $f(n)$ is oscillating). Suppose, however, that $f(n)$ is always less than or equal to a function $g(n)$ that does not violate the regularity condition, so that the master theorem is ap...
I'm currently looking into Japridze's computability logic. It looks great, but I was wondering whether any programming languages or systems implement it. Does anyone know of any implementation? Thanks.
So in the silberschatz O.S book it says Windows uses one to one model (mapping user level threads to kernel level threads) but why? i thought many to many and two level models are much better, specially two level model, so why not use the two level mode or many to many? whats the benefit compared to other models and is...
Is Turing machine most powerful model of computation? Is it possible theoretically to build the model of computation which is more powerful than TM i.e is it theoretically possible to build the machine which could solve the problems that T.M cannot?Are quantum computers also the T.M or are they more powerful than T.M?
I would like to train a neural network whose parameters (alternatively, weights) are subject to linear constraints such as $w_{i,j} = w_{i',j'}$, where $w_{i,j}$ denotes the weight from input node $i$ to hidden node $j$ in the case of a network with a single layer. (In the case of several hidden layers, it is okay to ...
I have read that the translation lookaside buffer (TLB) is implemented in hardware and stores the page numbers and the corresponding frame numbers for faster lookups. Now suppose there are two processes, A and B. Page 2 is mapped to a particular frame number. Now if we are searching for page 2 in the TLB, it can belong...
I have some "fuzzy" congruences like these: \begin{align} \\ x&\equiv a_1 \mod 3 \text{ with } a_1 \in \{0,1\},\\ x&\equiv a_2\mod 5 \text{ with } a_2 \in \{0,3\},\\x&\equiv a_3 \mod 7 \text{ with } a_3 \in \{1,2,6\}\\ \end{align} These example moduli would provide a unique solution for $x \bmod lcm(3,5,7)$, if the $a_...
I am reading the following paper: https://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf On page 4 of the paper they describe the hierarchical softmax which is intended to reduce the computational complexity (I believe only during training time) of training a n...
I am trying to implement Graph slam. I have some doubts regrading implementation. I attached a picture to clarify my doubt. [ I have a doubt in line number 2. It show omega have a scalar value 0. But at line 3 it show omega is a Matrix. Next doubt at line 7. In this line omega which is a 3*3 matrix is add with a 6*6 ...
I'm trying to find a way to explain the idea of the Halting Problem proof in as accessible a manner as possible (to undergrad CS students). The simplest argument I have found is this one; this is precisely the style of treatment I am aiming for. However, the self-reference (in particular, checking if a program halts on...
Here is the problem: Given a dictionary $D$ and two strings $s$ and $t$, write a program to determine if $s$ produces $t$. If it does produce $t$, output the length of of the shortest production sequence, otherwise, output $-1$. Example: $D$ = [bat, cot, dog, dag, dot, cat], $s$ = cat, $t$ = dog, the shortest productio...
What are the practical and theoretical implications of the unit type and the unit value being the same or different entities? For example, in Haskell the unit type and unit value are both spelled (). In ML, the unit type is spelled unit and it's value is (). Are there any problems that arise from either option? Are the...
Need help solving this recurrence: $T^2(n) = T(n/2) * T(2n) - T(n) * T(n/2)$
Input: You are given a graph $G(V, E)$ undirected, loop-less, no parallel edges, etc. and a label function $L: V \to \mathbb{N}$. Also, a sequence of $|V|$ natural numbers is given. Output: Is it possible to order the incident edges set of each vertex and choose a starting vertex $s \in V$ so that a pre-order DFS trave...
I'm new to computer vision and I want to solve the task of recognizing the game units of the game Clash Royale in the screenshot. Briefly, there are about 70 different types of gaming units belonging to two teams (they differ a little in colors and some are visible in front, others with backs). I want to find game unit...
Let's say we have array $A$ of $N$ integers, each of them in the range $[-1, 1]$. We define an array $B$ of $N+1$ integers, such that $$B_{N+1} = 0, \\B_i = A_i + A_{i+1} + A_{i+2} + \dots + A_{N}= A_i + B_{i+1}$$ So now we want to build data structure over the array $B$ such that it will be possible to perform two typ...
Given a bipartite graph $G = (V, U, E)$ such that $|V| = |U| =2^n$, one wants to sample an edge from $G$, uniformly at random, with the following operations: 1. One can sample $u \in U$ w.p $\frac{1}{|U|}$ ,or $v \in V$ w.p $\frac{1}{|V|}$. 2. There exists a polynomial time oracle, which can, given $u \in U$ (or $v \in...
I was reading some publications on cellular networks. They constantly mention two similar concepts — backhaul network and core network. I am not sure if these two are the same stuff, or in any way they are different. Does anyone know the differences? thanks!
Problem: Find the maximum sum of the elements in an array, with the following constraints: all the elements of the array are non-negative integers each element can either be left out completely from the sum (skipped), can be added, or can be subtracted from the sum when reading the array left to right (i.e. from index...
Is there a search tree where union is associative, so $a \cup (b \cup c) = (a \cup b) \cup c$ gives a tree with the same structure? A complete binary tree would be such a tree, but for example a red-black tree has several possible constructions for a given set of elements. Is there such a tree that does better than $O(...
I am having trouble finding the time complexity of the below code. # Definition for a binary tree node. # class TreeNode(object): # def __init__(self, x): # self.val = x # self.left = None # self.right = None class Solution(object): def isBalanced(self, root): """ :type...
I am reading through the following paper: https://papers.nips.cc/paper/5021-distributed-representations-of-words-and-phrases-and-their-compositionality.pdf Under section 2.3 on page 4 the authors discuss subsampling of frequent words. Now based on my understanding of subsampling of frequent words, the goal is to reduce...
I was solving this question: Which of the following statement(s) is/are false? $L^0=\{\epsilon\}$ $|L^0|=0$ The answer given was None. That is, none of these statements are false and both are true. However, I feel both are wrong. I feel $L^1=L$ and $L^0=\phi$ Also $|L^0|=|\phi|=0$ Am I wrong with this?
In C#, one can define a class/method/function with multiple type parameters. For example, // function void foo<T1, T2>(T1 x, T2 y) { /*body*/} // class class Bar<T1, T2> { /*body*/ } I understand how to use it, but I don't understand why I need it. So I'm hoping someone can answer the following questions: 1) What is...
For those of you who are not familiar with FPL, here's a short version. You have players playing as either Goalkeeper, Defender, Midfielder or Forward. Each player has some price (either rounded to .5 or .0), and based on their real life performance you earn points. You have a budget of 100£ and you need to build a tea...
Take a decision problem $Q$, which maps encoded instances of a problem, i.e., $\lbrace 0, 1 \rbrace \ast$ to the solution set $\lbrace 0, 1 \rbrace$. Since $Q$ is in $NP$, there exists a verification algorithm $A$, which takes an input and a certificate, in that order, as arguments and maps those to $\lbrace 0, 1 \rbra...
I want to implement algorithms from this paper: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.56.5609&rep=rep1&type=pdf In particular, I am currently dealing with the one in section 2.2.1. In page 4 (first paragraph), one algorithm step is as follows: Find an edge $(v_k, v_{k+1})$ of $P_i$ ($P_i$ is a convex...
Let's say we have an alphabet $\Sigma = \{a,b, \dots , z\}$ Set $A$ consists of words $x_i$ containing symbols from $\Sigma$ alphabet, which have this structure $x_i := \alpha_i \beta_i$, where $\alpha_i$ is just 1 symbol from $\Sigma$ and $\beta_i \in \Sigma^{*}$ (can also be empty) So the set A should look like this ...
Given an undirected tree with 7 nodes how many roots would this tree have. My intuition tells me that because the tree is undirected it would either be 7 or 0. How would I solve this?
From what i've learned, the HW is responsible for setting the accessed and dirty bits in the PTE of a process, and the OS is responsible for turning them off. My question is why? The first part, i think is because only the HW is preforming the page table walk and it's a good opportunity for it to set them (because by d...
I am trying to find an algorithm for finding an optimal solution to a puzzle of a given format. The 7 by 6 puzzle board is made out of the following pieces: The tears are as follows: Tears and grommets can be rotated and moved around the board, but spools, tie-offs and blockers cannot. A simple example of the puzzle ...
I have heading measurements of two Sensors (BNO055 and HMC6343) and also accurate measurements from better sensors for comparison from a rotating platform. Most of the measurements are with some kind of potentional error source like passing train, large ferromagnetic materials. The measurements of the BNO055 can't be u...
Let's say we have given two numbers $x, z$, and we need to find another number $y$ such that $x \text{ xor } y = z$. The xor ( exclusive or ) is bitwise operation: xor table . I know that this can be solved if we analyze both $x \text{ and } y$ bit by bit, starting from the first, but I was wondering if it can be solve...
I have the recurrence of the form T(n) = T(n/2) + O(n) This can be solved using master's theorem and if i use the results of the theorem, the recurrence evaluates to a time complexity of O(n). But if i think of it in terms of its tree, the input is reducing by half each time so we have a tree of logn height. Cost of...
I have an array 'a' which is 1xn, and has positive and negative values. In a rolling window of size m smaller than n. I want to move backwards (to the left) the positive values of the array in order to offset the negative ones. The positive values moved, need to adopt the inverse of the shape of the negative values. Hi...
On Hacker News there is an interesting exchange about the async\await RFC for Rust. The author of the proposal withoutboats is responding to a comment about the usage of async-await construct vs a monadic implementation in Rust. He notes three problems, the first one I am having some trouble parsing: Higher kinded pol...
Most of you know this diagram. If this diagram is true, all software is free to not know the levels lower than ISA. But it's not true. Softwares like performance-critical programs or system softwares like OS and compilers, are often forced to understand not only ISA but also microarchitecture. If so, what about the l...
For a binary search tree (BST) the inorder traversal is always in ascending order. Is the converse also true?
I have these grammar rules defined as follows, FDL -> FDEF FDL | ε FDEF -> #feature #: FEXP FEXP -> #op #( FLIST #) FLIST -> FEXP #, FEXP | #feature I know how to derive the derivative tree for a given string from this, but how do I draw a NFA for this string {#feature #: #op #( #feature #)}*. I have seen many example...
I am working on the longest common subsequence (LCS) problem while learning dynamic programming. Below is the Java code I created to solve the problem, which is not dynamic programming as far as I understand. public class LCS { public static String lcs(String a, String b ) { String lcs = lcs(a, b, "", 0, 0...
When reading about approximation algorithms, I often find the terms "matching lower bounds". As I understand, these means to provide examples where the approximation algorithm matches the proved bound___proving that the algorithm achieves the best possible approximation ratio. Often, the approximation algorithm solves ...
In order for a lambda expression to run forever, there must be at least one lambda in the expression in which an argument is passed to itself. For example the following runs forever. $$ (\lambda x.xx)(\lambda x.xx) $$ However, I am curious if an expression could run forever if arguments were only passed to themselves ...
Say you have a vector $v$ with $n$ length $v=\begin{bmatrix}v_1&\dots&v_{n}\end{bmatrix}$ can we write as $v=v_+-v_-$ where $v_+$ agrees with $v$ on non-negative components and is $0$ otherwise and $v_-$ agrees with $v$ on non-positive component and is $0$ otherwise. Eg: $v=[-1,-3,4,5,0,0,1,2,-3,-4]$ then $v_+=[0,0,4,...
This question concerns determine which sets in a collection of sets contain a given subset S: An undirected graph (V,G) is given with V= {1,..,m}, and given via its neighborhood sets, N(v_1),.., N(v_m). A subset S of V is given {v_{i_1}, .., v_{i_k}}. The output will be the vertices whose neighborhoods contain S...
This was a question that I got while taking a test at our university. The question paper was taken away after the exams. I remember the question only, not the multiple choices. If a regular expression is of the form (x+y)*y(a+ab)* , then what is the maximum number of strings with length 4 will bee accepted by its lang...
I learned that in numpy, given a vector, slicing and indexing could give different results. I ran the following codes: a = np.array([1, 2]) b = np.array([3, 4, 5]) print(b[a]) c = b[1:] print(b) c[0] = 1 print(b) print(c) print(b[1:] is c) and get the result: [4 5] [3 4 5] [3 1 5] [1 5] False Since when I modify c, b...
I am using detectEigenFeatures in the Matlab command to obtain the corner points. This function only can provide the corner points within a rectangular boundary region. But I want to extract the corner points within a polygon. I have thought about using small rectangles in order to obtain a polygon. But it seems time-c...
For two ordered sets of keys Paul Heckel's diffing algorithm generates the necessary actions to transform, or patch, one set to the other. I am asking how you'd do the patching without keeping a copy of the "old set" around, nor incurring a large performance penalty. The problem statement is agnostic to the choice of d...
A simple optimization problem is of form $\max_{x\in\mathcal R}f(x)$. We can quantify as $\exists x\in\mathcal R\forall y\in\mathcal R f(y)\leq f(x)$. The quantification here is $\exists\forall$. Is there a meaning to $\forall\exists$ from optimization? What is a good natural meaning to $\forall\exists$ quantificatio...
I was referring book by Peter Linz, which defines linear grammar as follows: A linear grammar is a grammar in which at most one variable can occur on the right side of any production, without restriction on the position of this variable. The wikipedia page also defines it similar way at the top of Linear grammar page...
In the fourth row of the TLB the valid bit is 0. The corresponding row in the pagle table (fifht row) has the valid bit 1. How is this possible? What events leads to this incoherence?
How to represent in first order logic the expression: "there are infinitely many" To be honest I'm confused and not even sure whether you can represent them in first order logic.
Not talking about the actual moon lander, but an old game that was inspired by it (see screenshot). Suppose I wanted to write a program that "plays" this game: Can only operate the vertical thruster (on/off) Does not know how much thrust is produced Does not know about the vehicle's inertia, weight, etc. Does know its...
We have a array of $N$+1 integers. The integers range from 1 to $N$. The array contains at least one duplicate. Our goal is to find one of the duplicate entries. We have the constraint that we cannot modify the input array. Is there any solution to this problem which has $O(N)$ time complexity and $O(1)$ space complexi...
The typical presentation of the syntax of the $\lambda$-calculus is as an ambiguous CFG (or BNF) like the following: $$T \rightarrow \lambda X . T \mid T ~ T \mid X \mid (T)$$ Where we permit $X$ to range over an infinite number of variable names. To disambiguate $\lambda$ terms two conventions are usually established:...
I want to evaluate the usefulness of Philox pseudo random number generator for drawing multidimensional random vectors. What is known about the equidistribution properties of Philox? I read the Philox paper but it does not contain any information about its equidistribution properties.
What is the name of the tree data structure where node weight equals the sum of all descendant nodes' weights? Example: 15 / \ 10 5 / \ / \ 2 8 1 4
While looking through some problems on CodeForces, I noticed that there were several problems that required knowledge of techniques that just aren't covered in standard algorithm texts. Topics that I want to understand include segment trees, least common ancestor, range-minimum query Fenwick trees heavy-light decompo...
There does not seem to be a canonical definition of "pure function", but the widespread language-agnostic understanding seems to be a function that has no side effects produces a value that is completely and uniquely determined by its explicit arguments This appears to beg a question when the arguments are themselves...
I have two values $A$ and $B$, I want to know if I can implement the equals $=$ operation as the product of the two values. I can apply any function to $A$ and any function to $B$, but I need to use multiplication at the end. Basically I want to find $f$ and $g$, such that: $$ f(A) \cdot g(B) = \begin{cases} 1, & A = B...
We have a database with well-formated and structured data. From time to time we get Excel - files from our clients. This Excel Files have to be imported to the database. It it very important that we dont create duplicate data so we first need to check if the data record already exists in the database. The problem is: T...
I suspect this may be more of a concept / theory question, but, I haven't been able to wrap my brain around what exactly a binary file is. I've read links such as the below: https://en.wikipedia.org/wiki/Binary_file https://betterexplained.com/articles/a-little-diddy-about-binary-file-formats/ But, the piece of the puz...
I've heard that computers cannot forget anything, but yesterday my teacher told me that a computer can lose its memory from getting very hot. Is that true that computers can lose information? How and why does this happen? Can the lost information be retrieved back?