What's the idea of doing x mod 1000000007? [closed] - math

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
In many programming problems (e.g. some Project Euler problems) we are asked to report the answer as the remainder left after dividing the answer by 1,000,000,007.
Why not any other number?
Edit:
2 years later, here's what I know: the number is a big prime, and any answer to such a question is so large that it makes sense to report a remainder instead (as the number may be too large for a native datatype to handle).

Let me play a telepathist. 1000...7 are prime numbers and 1000000007 is the biggest one that fits in 32-bit integer. Since prime numbers are used to calculate hash (by finding the remainder of the division by prime), 1000000007 is good for calculating 32-bit hash.

Related

Solving linear equation in one variable in R [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
How do we find the solution of x
say in
2*x=6
using R?
It must be very trivial but I cant find out the appropriate answer.
You can use the solve() function, which can actually handle multiple equations:
solve(2, 6)
The first argument is the left side of the equation, the second is the right side.

Draw 7- dimentional space [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I need to represent vectors in 7- dimensional space.
How can I draw them and plot points on them?
I don't think there is a reasonable way to draw something 7-dimensional. Best thing to do is to draw several projections in fewer dimensions for instance 2 or 3. Even 4 dimensions is hard to comprehend for men.

What is most efficient way to plot a domain of convergence? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Say, you have a Newton Method algorithms with 2 parameters of interest(a,b).
And I would like to plot their domain of convergence with x-axis = a, y-axis = b. Is there a really fast and simple to do this??? Any suggestions?
My algorithm will basically converge for some values of a & b. If I input (a,b), it will return (the number of iterations , value of a that it converge to, value of b that it converge to). Right now, I am thinking of setting up a for loop within another for loop, which run through all possible values of b first holding a fixed, and all possible values that a will converge holding b fixed.
However, my trouble is: how to identify whether a & b is converging or not. And is there a better way than using nested for loops????

Applying Loops on Levels [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
I have a huge csv file of sports (EPL) data which encompasses player performance in every game for their respective teams. I would like to run a loop to compare the amount of times a team has scored first in a match (the data is called First.Goal).
I know how to calculate them individually, e.g for Liverpool from a csv called Prem1112:
Prem<-read.csv("Prem1112.csv")
sum(subset(Prem,Team=='Liverpool',First.Goal))
Ideally I'd like to run the loop so I wouldn't have to calculate all 20 teams individually. Any ideas?
What about this:
aggregate(First.Goal ~ Team, Prem, sum)

algorithm to check whether a given graph is subgraph of another graph [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
i assume that we have 2 labeled graphs G and T and the algorithm determine if G a subgraph of T and the corresponding vertices in the main graphT and the subgraph G should have same label
That problem is called "subgraph isomorphism" and it is NP-complete (and so likely to be hard). Do you need a general solution for this, or just for a particular graph G? The second case is much easier. There is some general information about algorithms here. There is a version of one of the algorithms (actually, for a more general problem) in the Boost Graph Library (see documentation here).
A general answer for a general question: the problem you want to solve is known as 'subgraph isomorphism.' Have a look here for further references: http://en.wikipedia.org/wiki/Subgraph_isomorphism_problem .

Resources