As I've said elsewhere, I don't think this does quite what you think it does. What measure is it you want again? I assumed from your description that you want the area under both the curves, but that's not really what you're computing - it looks like you're computing the area underneath distribution 1 but above distribution 2.
At the moment, among other things, your solution gives different answers if I switch distribution 1 and distribution 2. That doesn't seem right, given what you've said about the particular problem.
Also, I should note that multiplying by 10000 doesn't help you any - you'd get the same results if $area were "1", since the computer is using floating point variables in these computations.
--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/;
map{y/X_/\n /;print}map{pop@$_}@/for@/
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|