Hi, I've been running code which very frequently calls books.csv. e.g:
grep -i horror books.csv > temp
Except, I'm trying to move away from using temporary files or frequently calling books.csv to improve efficiency. So I tried something like
bookfile=$(cat books.csv)
grep -i...
Thanks! I've not programed in C++ in about 2 years. I did forget about ^ (goes and looks up what the exponential is).
I have absolutely no insistence in using standard arrays, I'll go and look up whatever "std::vector" is :smile:.
P.S The idea of the first function is that it takes the...
I recently came up with a bit of a mathematical problem for myself and decided I needed a bit of code to help me. My understanding of C++ is pretty basic and I seem to have found myself stuck mixing arrays and functions.
I wrote the function:
int worko (int c[], int tri)
{
//turns...
I know you can define a field like that, but I was always taught to define a field by these:
http://mathworld.wolfram.com/FieldAxioms.html
Where devision is defined through the multiplicative inverse, the Field Axioms then imply division by 0 isn't possible because 0 has no multiplicative...
It has no elementry solution.
There is a function however called SinIntegral(x) that is defined by this very integral: http://mathworld.wolfram.com/SineIntegral.html
I know it's true just to say "division isn't defined for 0", I'm not arguing otherwise.
My quible, if any, was to do the the analogy:
'your question is like asking why we use the word "blue" to decribe light with a wavelength of 465 nm.'
The reason it's called blue is arbitrary, we could...
To be fair that's not entirely true. While you can look it that way, just dryly, saying that "because that's the way it's defined".
A more interesting way to look at it is to consider the Field of real numbers, which have a certain set of properties that must obey. Then it's non-trivial to...
Reducing it down to the results rather than the calculations:
16^198 = 16^(2*3^2 * 11)
16^(2*3^2*11) = (-4)^11 =-2^22
2^22 = 4
16^(198) = -4
-4 is the same as 96, mod 100.
Well I didn't use a calculator :P
But yeah, it looks like you have to do some clever modular arithmetic, it'd pretty easy mod 10, mod 100 or perhaps even mod 1'000 by hand, but it's a bit of a pain mod 1'000'000.
I'll think on a bit and see if I come up something (certainly nothing that...
Why would it take an enormous amount of time to evaluate? Just multiply it out...
260469313784369307581244210575049132700967121965465162515478820772032704602251252793805945346545089482145699632555985954917531314614037698451693595794... (Edit I've removed the last load of digits not to make it...
As mentioned earlier, I thought it might be a good idea to try the taylor series approach. However unfortunately this quickly breaks down, I tried to approach it my doing this:
fn(x) = a0 + a1x + ... + anxn
Then we have:
fn(fn) = g0(a0, a1, ... , an) + g1(a0, a1, ... , an)x + ... + gn-1(a0...
Yeah, I worked them both out pretty quickly, just trying to help you along rather than give the answer. I don't know how else to help you without just saying the answer :/
Well it's the same princaple, if you get a summation form in each of the element, you've worked out what it is, more over you may be able to put it in a closed form if you understand how to do the summations.
No, I don't think it makes sense either.
I tried a tayloer series before but did it with a full infinite series, I like this method a lot, keep trying it for larger and larger terms, will try it later when I have time to mess about with it. Perhaps only bother trying to approximate it for...