Problem: How many of the first 100,000,000 hexagonal numbers are divisible by all the numbers from 1 through 20?
2nd solution - simple brute force (does work)
public static void main(String[] args) ...
|
I just discovered an algorithm for finding the power set. I googled after solutions, but found none that worked any good, so I figured out one myself. But I wonder what ... |
I am sorry, if my question sounds stupid :)
Can you please recommend me any pseudo code or good algo for LSI implementation in java?
I am not math expert. I tried to ... |
On paper, binary arithmetic is simple, but as a beginning programmer, I'm finding it a little difficult to come up with algorithms for the addition, subtraction, multiplication and division of binary ... |
Greetings!
How do I check if an element a belongs to a specific cyclic group G of prime order, given the generator? Right now i simply generate all the elements in the ... |
I am working on a geographic project in Java.
The input are coordinates : 24.4444 N etc
Output: a PLAIN map (not round) showing the point of the coordinates.
I don't know the ... |
I need to generate n percentages (integers between 0 and 100) such that the sum of all n numbers adds up to 100.
If I just do nextInt() n times, each ... |
|
I have an arbitrary function or inequality (consisting of a number of trigonometrical, logarithmical, exponential, and arithmetic terms) that takes several arguments and I want to get its range knowing the ... |
I have to convert a floating point to 32-bit fixed point in Java .
Not able to understand what is a 32-bit fixed point ?
Can any body help with algorithm ?
|
I need to find combination of combination in JAVA.
I have for instance 6 students in class. Out of them, I need to create combination of 4 people in group, and for ... |
I have a question for everyone. I have this problem statement where in given, x^2 + y^2 = c is the equation, you have to optimally find the tuples (x,y) such ... |
I have done a method to implement the Kullback-leibler divergence in java. I have used the log with base 2 value and i am not sure whether i ... |
I need to find an algorithm which determines a relationship between a square and rectangle. It must be able to determine if:
- The square is completely inside the rectangle
- The square is partially ...
|
I'm wondering which algorithms are used to implement math functions from the java.lang.Math class?
For example, is sin(x)(or log(x)) implemented as sum of elements of Taylor series or any other algorithm? ... |
The ancient Egyptians only used fractions of the form 1/n so any other fraction had to be represented as a sum of such unit fractions and, furthermore, all the unit fractions ... |
Let me start off by clarifying that(before you guys dismiss me), this is not a homework problem and I'm not a university student. :)
EDIT
Thanks to @Klas and others, my question now ... |
I am not 100% sure if this is a bug or I am not doing something right but if you give Percentile a large amount of data that is the consistent ... |
I wonder if there is an elegant way to derive all compositions of 2n as the sum of n non-negative integer variables.
For example, for n = 2 variables x ... |
I have a table with observations (x, y) and need to estimate the mean of the Poisson distribution that more closely resembles them. It seems R and Octave can both do ... |
I am trying to understand Floyd's_cycle_finding_algorithm but the explanations seem abstract.Can someone help me in undertanding this and whats the basic use ?Does it mean it can be used to find ... |
I'm writing a system tool written in Java which essentially, starts a task at t0 and completes in N secs. Because I anticipate this tool to run on different machines, the ... |
The problem:
There are X number of properties, all floats between 0 and 1.
Choosing a property has a constant cost of C. (as opposed to leaving it at 0)
The cost of a ... |
i have an array which contains only 2 types of numbers(x and x-1) eg:- {5,5,4,4,5,5,5} and i am given a range like 12-14(inclusive). i already know the length of the array ... |
i am trying to make my algorithm more efficient but for some reason its not working correctly could someone tell me if my logic is correct. The general problem is that ... |
http://en.wikipedia.org/wiki/Binary_GCD_algorithm
This Wikipedia entry has a very dissatisfying implication: the Binary GCD algorithm was at one time as much as 60% more efficient than the standard Euclid Algorithm, but as late ... |
From a given double I want to get the next highest number according to some rules which, since I have some difficulty describing them, I will illustrate by examples:
Input ...
|
I've been having trouble with this for a while, so I thought I'd ask here. Basically, I need to 'crop' array values with a min and max index given into some ... |
I am doing a simple math alogorithm that will take in 2 inputs from the user and determine the fast exponentiation. For E.g 2 to the power 3 Mod 71 In Operator terms, We use (2 ^ 3) % 71 However, The output of 2 ^ 3 does not give 8 and gives 1.Does anyone know how to trouble shoot this ... |
I've spent more than 3 days now trying to write an algorithm to do this, but can't find a way... That D is discrete structure in college is coming back to haunt me now I guess... Trying to find an algorithm to generate all combinations, of all combinations, of n arrays. I found a decent class on the net (google: java ... |