# Tagged Questions

27 views

### Approximating 'big' ratio with 'small' ratio

Given a ratio $\frac{m}{n}, p \in N, q \in N$ where either $m$ or $n$ (or both) is a very big number, how can we find a ratio $\frac{p}{q}, p \in N, q \in N$ which estimates $\frac{m}{n}$ up to ...
33 views

### How can I determine least common multiple for a given number and all numbers before it?

The wikipedia article on least common multiples only talks about determining the least common multiple between 2 numbers. I'm looking for an algorithm that will determine it for a set of numbers 1 .. ...
60 views

### Use of Euclid's division method (algorithm) to find answer of hard problem

Euclid's division algorithm (a=bq+r) is used to answer the following questions. Please give me answers to them including the method. ...
216 views

### Why does the method to find out log and cube roots work?

To find cube roots of any number with a simple calculator, the following method was given to us by our teacher, which is accurate to atleast one-tenths. 1)The number $X$, whose cube root needs to be ...
26 views

### Generate Max Value Expression

How to insert * AND + OPERATORS between a given set of integers so that the expression evaluates to the max possible value if Set is [3,4,5,6,-2] it should give 3*4*5*6+-2 and also note that * gets ...
77 views

### Split by percentage

I need to give $n$ apples to three persons $A$, $B$ and $C$. $A$ should get $50\%$, $B$ should get $30\%$, and $C$ should get $20\%$ of however much ever I give. For example, if I have given $10$ ...
59 views

### Maximal non averaging subset Algorithm [closed]

Given a set of positive integers, not greater than 100000, how can we find the maximal subset such that no three numbers form an Arithmetic progression? I am looking for some algorithmic approach. If ...
105 views

### Number of Anti-Arithmetic sequences.

Original Problem Link. A permutation $p$ is called antiarithmetic if there is no subsequence of it forming an arithmetic progression of length bigger than $2$, i.e. there are no three indices ...
93 views

### Arithmetic Coding Example

I have a question for static arithmetic coding which I have done in class but I can't seem to figure out where I got the answers. It's a bit hard to get in touch with my lecturer at the moment so I'm ...
61 views

### How to represent probability as Integer - Arithmetic coding

I am doing an assignment for a class in college where we have to write an arithmetic encoder / decoder in Java. In this video, it shows how to set up / define all the variables required for the ...
70 views

### Clarification of variable values in Arithmetic Coding algorithm

I have been trying to follow this video to implement my own Arithmetic Coding algorithm in Java. I am having a bit of trouble figuring out what some of the variables in the video should be. For ...
87 views

### Static Arithmetic Encoding/Adaptive Arithmetic Encoding Algorithm

I'm trying to learn how to implement the Arithmetic Encoder algorithm for one of my classes. The thing is the notes we have explaining the actual algorithm are a bit on the confusing side. I have ...
152 views

### How to solve/transform/simplify an equation by a simple algorithm?

MathePower provides an form. There you can input a formula (1st input field) and a variable to release (2nd input field) and it will output a simplified version of that formula. I want to write a ...
98 views

### Is the result always n+1?

I'm reading a book on algorithms by Kurt Mehlhorn and Peter Sanders. On page 2, the following Theorem is stated: The addition of two n-digit integers requires exactly n primitive operations. The ...
258 views

386 views

### Floor and ceiling on fractions

Is there an algorithm to compute ceil and floor on fractions without computing the division between the numerator and denominator (to avoid losing precision on big numbers)? A trivial example: ...
284 views

### Integer multiplication without intermediary values

I'm making a programming project for learning purposes, in which I try to calculate powers of very large numbers in as short of a time as possible. One thing I could do is to try to do multiplication ...
307 views

### Is there a log-space algorithm for divisibility?

Is there an algorithm to test divisibility in space $O(\log n)$, or even in space $O(\log(n)^k)$ for some $k$? Given a pair of integers $(a, b)$, the algorithm should return TRUE if $b$ is divisible ...
698 views

### Schönhage-Strassen multiplication

I am trying to implement the SchÃ¶nhage-Strassen algorithm (SSA) for multiplying large integers, but it only gives the right result if all $\delta_j$ are zero. I'll explain what I mean by this: SSA ...
875 views

### Teach me a simple, efficient division algorithm

I want to implement arbitrary-precision arithmetic in JavaScript for non-negative integer numbers. Long division isn't efficient if instead of the usual 10 digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) there ...
187 views

### Number of operations in grade school algorithm for multiplying 577 and 423

Given 577 x 423 with grade school algorithm you calculate 577 x 3 = 1731 577 x 2 = 1154 577 x 4 = 2308 These are 3 multiplications of a number by a single digit. Then, you go on and add 1731 + ...