.. exoplanets: Exoplanets ********** An exoplanet is a planet not in our solar system but with living conditions similar as on our earth. .. code-block:: python >>> from effectus import Effects >>> from effectus.data import exoplanets >>> from statistics import stdev >>> masses = [value['mass'] for value in exoplanets().values()] >>> len(masses) 630 Let's check for 630 exoplanets if their mass is attracted by different centres of gravity:: >>> mass = Effects(masses) >>> mass 4/5 effects [total ∆: 1.5 % points]> 20 percent of the exoplanets constitute for 80 percent of the total mass. The Arithmetic Mean =================== Now let's see what the arithmetic mean tells us and whether we can trust it as a representative value:: >>> mass.groups() Causes Effects Count Mean Stdev Stdev/Mean ∆ Mean -------- --------- ------- ------ ------- ------------ -------- 100% 100% 630 2.154 5.893 2.7 20% 80% 120 8.986 11.109 1.2 +317% 80% 20% 510 0.546 0.543 1.0 -75% For the majority of the mass, our 20 percent of exoplanets, the standard deviation is half of that of all. But for most exoplanets, the 80 percent that constitute for 20 percent of mass only, the standard deviation is one mean. We can trust the arithmetic mean for each centre of gravity more than that of all. .. _nested: Nested Pareto Distributions =========================== *What if our 20 percent of exoplanets with most of the total mass has another centre of gravity in its own regard?* .. code-block:: python >>> def nested_centres(effects, right): >>> while effects.pareto: ... effects = Effects(effects.retrieve_effects(counterpart=right)) ... yield effects >>> list(nested_centres(mass, True)) [ 3/5 effects [total ∆: 0.8 % points]>, 3/5 effects [total ∆: 1.3 % points]>, 3/5 effects [total ∆: 1.8 % points]>, 3/5 effects [total ∆: 0.7 % points]>, 2/3 effects [total ∆: 2.2 % points]>] Wow, if we enter each majority of causes that stands for the minority of mass, we find another two centres of gravity on another four leveles, so five in total. What will we find if we enter each minority of exoplanets that constitute a majority of mass? .. code-block:: python >>> list(nested_centres(mass, False)) [ 3/5 effects [total ∆: 2.0 % points]>, 3/5 effects [total ∆: 3.4 % points]>] We do find two centres of gravity on two levels. Can we see if an exoplanet belongs to the group of the majority of mass? ======================================================================== First, let's get the volume right:: >>> from math import pi >>> eplanets = dict() >>> for planet, values in exoplanets().items(): ... eplanets[planet] = {'mass': values['mass'], ... 'volume': values['radius']**3*4/3*pi} Is there a pareto distribution present for the volume? .. code-block:: python >>> from effectus.helpers import get_values_by_attribute >>> volume = Effects(get_values_by_attribute(eplanets, 'volume')) >>> volume 3/5 effects [total ∆: 2.2 % points]> 1. Let's determine those exoplanets of constituting the 80 percent of total mass. 2. Let's determine those exoplanets of constituting the 80 percent of total volume. 3. Let's get only those from 1. that are not in 2. .. code-block:: python >>> from effectus.intervals import keys_in_effects_interval >>> # 1. >>> majority_mass = set(keys_in_effects_interval(eplanets, ... 'mass', ... 0, ... mass.summary['effects'])) >>> # 2. >>> majority_volume = set(keys_in_effects_interval(eplanets, ... 'volume', ... 0, ... volume.summary['effects'])) >>> # 3. >>> majority_mass_majority_volume = majority_mass.intersection(majority_volume) How many of the 20 percent minority constituting the majority of mass belong to those constituting 80 percent of the volume? .. code-block:: python >>> len(majority_mass_majority_volume)/len(majority_mass) 0.42276422764227645 Only 42 percent. So more than half of the 20 percent of the exoplanets constituting 80 percent of the total mass (123 of 630) looks similar to most that do not constitute the majority of mass. **The volume does not say for most exoplanets whether they belong to those constituting the majority of mass.** *Similar effects of similar causes might have different causes.* The Art of Differentiation ========================== .. code-block:: python >>> minority_mass = set(keys_in_effects_interval(eplanets, 'mass', mass.summary['effects'], 1)) >>> the_groups = {'all': dict(), 'minority': dict(), 'majority': dict()} >>> the_groups['majority']['mass'] = [values['mass'] for planet, values in eplanets.items() if planet in minority_mass] >>> the_groups['majority']['volume'] = [values['volume'] for planet, values in eplanets.items() if planet in minority_mass] >>> the_groups['minority']['mass'] = [values['mass'] for planet, values in eplanets.items() if planet not in minority_mass] >>> the_groups['minority']['volume'] = [values['volume'] for planet, values in eplanets.items() if planet not in minority_mass] >>> the_groups['all']['mass'] = [values['mass'] for planet, values in eplanets.items()] >>> the_groups['all']['volume'] = [values['volume'] for planet, values in eplanets.items()] >>> print('{:12} {:12} {:15} {:17} {:20} {:14}'.format('Group', 'Total mass', 'Total volume', 'Mass per planet', 'Volume per planet', 'No. of planets')) >>> print('-'*95) >>> def print_group(group): >>> print('{:12s} {: 10.1f} {: 14.1f} {: 18.1f} {: 19.1f} {: 17d}'.format(group, ... sum(the_groups[group]['mass']), ... sum(the_groups[group]['volume']), ... sum(the_groups[group]['mass'])/len(the_groups[group]['mass']), ... sum(the_groups[group]['volume'])/len(the_groups[group]['volume']), ... len(the_groups[group]['mass'])) ... ) >>> for group in the_groups.keys(): ... print_group(group) Group Total mass Total volume Mass per planet Volume per planet No. of planets ----------------------------------------------------------------------------------------------- all 1356.9 4152.4 2.2 6.6 630 minority 1086.4 1380.4 8.8 11.1 124 majority 270.5 2772.0 0.5 5.5 506 .. code-block:: python >>> print('{:.0f} times the planets have only 1/{:.0f} the mass of the minority.'.format(506/124, 1086/270)) 4 times the planets have only 1/4 the mass of the minority. Collect the Exoplanets ====================== Suppose we want to collect all exoplanets: * Then we need some instrument to pick them. * We need a bucket to carry them. * We need to get to the planets. Design Picker ------------- *How big should it be?* If we go by the average volume for all exoplanets, we should design it to grab a volume of 2.2 Jupiters. We see, however, that it will not make either group happy: * It would be just a quarter of the average volume of our mass-rich minority. * For the mass-poor majority of exoplanets it would be four times the size appropriate. *How strong must our picking tool be?* The average mass for all planets, makes us believe 6.6 would be sufficient. If we followed such advice, the tool would likely break if it happens to pick one of the mass-rich. For the minority it should be strong enough to hold at least the mass of 11 Jupiters. Yet for most we shall deem a mass of 6 Jupiters as representative. Design Bucket ------------- If we collected all exoplanets with a single bucket, we would need it to carry a density of 1/3 (2.2/6.6). However, if we design for each group a distinct one, things look differently. The bucket for the mass-rich would have to carry **half the volume** compared to the mass-poor yet **four times the mass**. The mass-rich minority averages a density of 0.79 (8.8/11.1), the mass-poor one of 0.09 (0.5/5.5). It seems as when an exoplanet is high in mass, it has a high density. If it is low in mass, its density is very low. *How could we save material and improve the situation for all exoplanets?* For a volume of 1380 we need to increase the density requirement from 1/3 to 0.79. 140% more material means 1.4*1380 = 1932. For a volume of 2772 we can reduce the density requirement from 1/3 to 0.09. We can save almost 3/4 of material. That is 3/4*2772 = 2079. This adds up beautifully. Now we can go to most exoplanets with a bucket that is 3/4 lighter. We no longer carry the mass-rich exoplanets most of the time. Instead their bucket is more than two times stronger than before. Collection Procedure -------------------- If we want to collect the exoplanets, we have to * get to them, * pick them with out picking tool into * our buckets we carry around with us. If we collect the 'mass-rich', we need to approach 124 of 630 exoplanets only. We need to carry around with us only a bucket that is less than half as big in size than one for all would require. This affects our mode of locomotion: A considerable smaller bucket meets longer distances between two exoplanets (assuming they are randomly distributed in space). We could travel with less fuel, maybe even faster. As our bucket is not designed for the average density of 1/3 (2.2/6.6) but for 0.8, we will not risk our bucket to break. For the 'mass-poor' we would would expect the distance between two exoplanets to be a quarter that of between the 'mass-rich'. We no longer try to eat a boiled egg with a table spoon and to dig with the same a pit. No longer feel to waste the time with the boiled egg we need for the pit -- and vice versa. Actually we lacked time for one because (1) we wasted it with the wrong tool at the other and (2) we wasted it with the wrong tool at the one. **Single bucket for all** If we build one bucket for all exoplanets and do not consider that a few required a much more solid material, we risk to break it. If we want not to break it, we would be required to build a bucket to hold the volume of all exoplanets from solid material. That is, of course much more costly. We either risk to let our bucket break or of being no more profitable at all. **Two distinct buckets** If we build two buckets, we can build one for the 'mass-rich'. That required only to **buy solid material for half** of the total volume of exoplanets **only**. Compared to the two options of the single bucket solution we could manage the risk of breaking the bucket and save half of the solid material. That should be much more profitable than the single bucket approach, even if one considers the cost that comes with a second bucket. Intersecting Pareto Distributions ================================= Since we considered a pareto distribution to be present for the mass and the volume of the exoplanets. We can :ref:`intersect ` the subsets of each attribute with each other. In addition, we add the combinations up to ease decision making:: >>> from effectus.intersections import REffort >>> REffort(eplanets, 'volume', 'mass') Group Results Efforts R/E ------- --------- --------- ----- A 37% 6% 18.54 AB 59% 20% 9.09 ABC 90% 34% 8.02 ABCD 100% 100% 3.06