Just convince him (or better, make HIM convince you and others) that you have an external pen-test on the result done. If the result is fine, all is ok. Otherwise, some change requests are to be opened.
Harald M
Posts
-
Roll your own... -
.NET's Sometimes Nonsensical LogicHave you ever heard of first-order logic - the logic which has been used formally for about 200 years (and informally much longer; on the order of 2000 years) for all sound reasoning in mathematics? Where it is obviously correct that "there is no x where P(x) is false" is equivalent with "for all x, P(x) holds" - because otherwise, that calculus would explode in your face ... Have you ever heard about vacuous truth? If not, please take some time to learn about these things. That's neither a .Net nor a Microsoft thing - it's basic logic knowledge. H.M.
-
Strange questions from a nitpicker ... ;pMathematicians define the (so called "Arithmetic") Mean as "Sum of all values divided by Count of all values" - see e.g. Arithmetic mean - Wikipedia[^]. Thus, the mathematically defined (Arithmetic) Mean for a single value is that single value. It does not at all matter whether you think whether this "makes sense" :-) However, did whoever gave you this specification ("need to show ... Mean Value ...") specify that he/she actually - meant you to use the arithmetic mean? (most probably yes; but asking back is not wrong - might only confuse the analyst who maybe doesn't even know that there are many other "Means"); - wanted to help the user also in such boundary cases? Maybe the analyst would even say "Oh, but for less than a handful of values that mean doesn't make any sense - there will always be 100 or 1000s of values, in practice"; then, you two should talk for some time what's the actual reason for showing those values ... That's what I think your "feeling" is about - you question the business value of showing the Mean (and Deviation) in boundary cases - which does matter. :) H.M.
-
Four foursOk - fine :-) In other words, what you did does not take any useful step in any sensible direction for solving the problem :-D For this, one would need to create all possible expression trees fulfilling the stated properties (e.g., exactly four leaves with constant 4, only the given operator node types) and collecting the trees and their expression results. A suitable pruning condition could prevent creation of trees definitely not yielding results in {1...100} (although I don't see what a simple pruning condition would look like; maybe two stacked exponentations can always be excluded* or thereabouts). * Not true: 4^(4^(4-4)) is a valid solution for value 4, and (4^4)^(4-4) is a valid solution for value 1.
-
Four foursThe output, after repairing a small bug - condition in 2nd loop is i != modulus || j > 0:
1=(5/5)
2=(5/5)+(5/5)
3=(5/5)+(5/5)+(5/5)
4=(5/5)+(5/5)+(5/5)+(5/5)
5=5
6=5+(5/5)etc. None of these lines has five fives, so this does not solve the problem. Running it with modulus 4, one gets:
1=(4/4)
2=(4/4)+(4/4)
3=(4/4)+(4/4)+(4/4)
4=4
5=4+(4/4)etc Here, only the solution for 2 has four fours, all others are not solutions (two fours, six fours, one four, three fours, ...). So how does this "work for four fours"?
-
Four foursFour fours! (not arbitrarily many)
-
Infinite Universe?Look up "Olbers's Paradoxon" (from 1823!) - by this simple question, one finds that there is no good reason why it is infinite.