In short; 20 is of form 3k+2. The set of numbers given (all of form 3k except one which is of form 3k+1) can only add up to numbers of form 3k or 3k+1; they cannot add up to numbers of form 3k+2 (like 20).
The value 30340 is a value of the form 3k+1, so I can't rule that one out. I can rule out 30341, which is of form 3k+2.
Also, it doesn't matter how many calculations I do to find the answer - what matters is how the number of calculations *scales* with an increasing number of elements in the set. If I find a way to solve the set sum problem with ten billion calculations for a set of _any_ size, then that would prove P=NP (since the number of calculations would then be independent of N, therefore polynomial in N)
I see what you're getting at there, yes; but my point was that you can do many:1 _without_ needing a constant factor in _all_ terms.
Consider the following set, for example: (1, 3, 6, 9, 12, -15, -18, 21, 24). You will notice that all of them are multiples of 3; _except_ the 1 at the beginning of the list. Therefore, any sum of any subset of this set will be either a multiple of three, or a multiple of three plus 1; in no circumstances can any subset of this set ever add up to 20 (which is a multiple of 3 plus 2). Thus, I am bypassing the calculation of each subset sum _without_ requiring that _each_ number have the _same_ common factor. And as the common factor amongst some of the set gets larger, the number of numbers that I can have without that common factor also increases...
They didn't have stovetops. But they did have heat. If your ancestors stuck their hands in fire and _didn't_ quickly pull it back, they would lose that hand.
It's the heat that triggers the instinct, not the stovetop. Which is why you can touch a cold stovetop without instinctively pulling back.
Taking the time to ensure that you properly understand the problem you're trying to solve is probably number one on the list.
Properly understanding the tools available is number 2.
Automating away the writing of boilerplate code is also helpful. And if you care about the efficiency of your final code, than a good profiling tool is important.
The presence of the lawsuits (if he ever stops being President) means that he has every reason to claim that he is concerned over _something_, whether or not those concerns are legitimate.
It is always possible that there is some legitimate concern with postal votes, which I, being very distant from America, cannot see. However, I suspect that the fact that Trump is publicly expressing concern is pretty near to zero evidence in favour of that concern; since he would express concern _whether or not_ there was actual cause for it.
Honestly, the guy is pretty much an American version of Jacob Zuma.
us politics, bell pottinger style
So, first off, I'm not in the U.S. - this is very much an outsider's perspective on the current mess.
But I've been taking a look at the federated feed on here, and one thing seems clear - someone is controlling the discourse here.
There are any number of posts suggesting - or outright claiming - that fake democratic ballots will be shipped in in order to force a democratic victory. At first, I thought that these were merely bitter Trump supporters... but then there was a series of posts claiming that a number of _republican_ ballots had been found somewhere, where (apparently) someone had put them and the forgotten about them. And every one of the toots I saw on _that_ story were phrasing it as how "those evil democrats were trying to hide real republican votes".
That wasn't the last of it, but just thinking about the way those two sides were presented - both stories about ballots that were put aside and recovered from opposite sides, both framed in such a way as to suggest the same side was evil, both repeated dozens of times and I never once saw any one making the opposite claim - that tells me that someone is _pushing an agenda_.
Whoever it is, they're trying to make it _seem_ as if it's a grassroots movement, people complaining because they feel strongly about something.
This feels (to me) as if it's a Bell-Pottinger-type social media campaign; where they have a bunch of people write suitably grassrootish tweets and toots, and some software platform that just spams these messages _everywhere_; probably using a couple of hundred fake accounts.
...good grief. So you can handle low-polygon 3D on a Pi?
...so, if you add in a couple of accelerometers, a pair of very small screens, and maybe a GPS system, it might even be possible to get a pair of entirely self-contained low-polygon-count VR goggles?
As long as it runs graphically-simple games like ADOM and Cataclysm:DDA, who cares about missing out on all the fancy pictures?
I've always appreciated a good story; something that makes me think. As a result, I really do enjoy quality #literature; Pratchett and Asimov are great examples, but I could probably name a dozen more as well.
I make my daily bread #writing #software (and those who think that there's no artistry in software have clearly never come across the right bit of code).
I also find a lot of enjoyment in #mathematics, and there are plenty of interesting fields of #science...
I've heard good things about Lulu, but you'd have to check and compare the details I guess.
That's fair!
That's true. I hadn't really thought of pre-existing competitors; that will make it harder to get those sales, I guess.
Oh.
...I was thinking more along the lines of roses and oranges and so forth, though I guess it really holds for any plant material.
Eh... maybe. If your system's cheaper to install than whatever they're using currently, then it's a possible commercial application, I guess.
Best of luck with it, though!
Have you considered the possibility of putting this in greenhouses, to give someone full control over the light that his plants get? A really serious commercial gardener might be willing to pay for this. (By controlling temperature and light and when he waters, he may be able to persuade his plants that is is summer when it is really autumn or even winter outside the greenhouse, and thus obtain out-of-season fruits and vegetables...)
If you've enjoyed Asimov's work (I admit I don't remember The Gods Themselves in particular, but I've enjoyed a whole lot of his other works), then you may very well enjoy the Chanur series (by C.J. Cherryh).
I'm also a big fan of just about anything written by Pratchett or Douglas Adams. John Christopher also wrote some good stuff, as did Joan Aiken (though she tends to get a little absurd); Jasper Fforde gets even more absurd, but again, writes some very good stuff.
Myself? Nothing significant published. But I have completed Nanowrimo before, and am giving it another try this year!
"char" is a signed type - it runs negative as well as positive, and thus (for example) can hold the value -32 but can't hold the value 192 (assuming your system uses eight-bit characters). You can get around that by making sure to use "unsigned char" - but at this point I should draw your attention again to that earlier parenthesis.
"unsigned char" is _usually_ eight bits of unsigned data, which can be used for byte manipulations. But there is _no_guarantee that this will still hold in future compilers - or even in different locale settings (unicode characters come from a list that is _way_ longer than the 256-character ASCII set, and it's always possible that, one day, compilers will default to a unicode char type...)
On the other hand, if you use uint8_t, then you are _specifically_ calling for an unsigned eight-bit integer - and if you're doing byte manipulations, then that's what you want. Right now, it'll be exactly the same as the unsigned char... but in twenty years, there may very well be a future programmer complaining about all the code using these huge 16-bit characters because it causes all _sorts_ of issues for byte manipulation!
Hmmmm... possibly. I also have a healthy interest in fiction, both as a reader and a writer - do you share that interest as well?
I wish I could say I was surprised... but honestly, Trump is pretty much the American version of Zuma, and it looks like he's getting the same sort of election wins, too...