text:
# Finding world-writable files in local directories only

Over at Stack Overflow I asked how to scan a local filesystem ignoring all remote mount points. I only really wanted a push in the right direction and received it. After clacking away on my keyboard I think I might have what I what I need. I ask for an evaluation to determine if it fulfills the requirements:

1. Scan every local directory for world-writable files ignoring "special" directories (/sys, /proc, /dev)
2. Ignore directories
3. Ignore files on any remote filesystems which may be mounted
4. Ignore any files in an "exclude" list

I'm quite certain it could be drastically optimized and any suggestions are welcome as are any suggestions for a better algorithm. However, rewriting the script is secondary to performing the task properly.

I've tested it and I'm fairly confident that I've created what I want. I just need some extra eyes to confirm.

#!/usr/bin/perl

# Directives which establish our execution environment
use warnings;
use strict;
use Fcntl ':mode';
use File::Find;
no warnings 'File::Find';
no warnings 'uninitialized';

# Variables used throughout the script
my $DIR = "/var/log/tivoli/"; my$MTAB = "/etc/mtab";
my $PERMFILE = "world_writable_w_files.txt"; my$TMPFILE = "world_writable_files.tmp";
my $EXCLUDE = "/usr/local/etc/world_writable_excludes.txt"; my$ROOT = "/";
my @devNum;

# Create an array of the file stats for "/"
my @rootStats = stat("${ROOT}"); # Compile a list of mountpoints that need to be scanned my @mounts; open MT, "<${MTAB}" or die "Cannot open ${MTAB},$!";

# We only want the local mountpoints
while (<MT>) {
if ($_ =~ /ext[34]/) { my @line = split; push(@mounts,$line[1]);

}

}

close MT;

# Read in the list of excluded files and create a regex from them
my $regExcld = do { open XCLD, "<${EXCLUDE}" or die "Cannot open ${EXCLUDE},$!\n";
my @ignore = <XCLD>;
chomp @ignore;
local $" = '|'; qr/@ignore/; }; # Create a regex containing mountpoint dev numbers to compare file device numbers to. my$devRegex = do {
chomp @devNum;
local $" = '|'; qr/@devNum/; }; # Create the output file path if it doesn't already exist. mkdir("${DIR}" or die "Cannot execute mkdir on ${DIR},$!") unless (-d "${DIR}"); # Create our filehandle for writing our findings open WWFILE, ">${DIR}${TMPFILE}" or die "Cannot open${DIR}${TMPFILE},$!";

foreach (@mounts) {
# The anonymous subroutine which is executed by File::Find
find sub {
# Is it in a basic (non-special) directory, ...
return if $File::Find::dir =~ /sys|proc|dev/; # ...a regular file, ... return unless -f; # ...local, ... my @dirStats = stat($File::Find::name);
return unless $dirStats[0] =~$devRegex;

# ...and world writable?
return unless (((stat)[2] & S_IWUSR) && ((stat)[2] & S_IWGRP) && ((stat)[2] & S_IWOTH));

# Add the file to the list of found world writable files unless it is
# in the list if exclusions
print(WWFILE, "$File::Find::name\n") unless ($File::Find::name =~ $regExcld); },$_;

}

close WWFILE;

# If no world-writable files have been found ${TMPFILE} should be zero-size; # Delete it so Tivoli won't alert if (-z "${DIR}${TMPFILE}") { unlink "${DIR}${TMPFILE}"; } else { rename("${DIR}${TMPFILE}","${DIR}${PERMFILE}") or die "Cannot rename file${DIR}${TMPFILE},$!";

}

• Tips on optimization and general code-quality are things you'll get from this site. However, wether or not this code fulfills your requirements is, IMO, part of your job (develop, debug, test, and develop some more). That's not entirely part of code-review. Anyway, welcome to the site – Elias Van Ootegem Apr 8 '14 at 7:38
• You are correct. The writing, debugging, etc is my responsibility and I have done this. I guess I'm looking for validation :) – theillien Apr 8 '14 at 19:13
• A few comments off the top of my head: 1) Don't turn off warnings; fix the code that emits the warnings. 2) Don't comment things that are obvious, e.g. "Directives which establish our execution environment" and "Variables used throughout the script." 3) Use lowercase for variables since built-in variables tend to use all-caps. 4) Use lexical filehandles and the 3-argument open, e.g. open my $fh, '<',$file or die "$file:$!"; 5) Instead of generating complex regexes (which you haven't anchored, by the way, so they will probably match more than you want), use hashes: (continue) – ThisSuitIsBlackNot Apr 16 '14 at 21:46
• e.g. my %ignore = map { $_ => 1 } @array; 6) Don't call find in a loop, just call it once with @mounts as the second argument. 7) Write a separate wanted sub and pass it to find to improve readability. 8) Don't use rename as it's not portable. Instead use move from File::Copy. – ThisSuitIsBlackNot Apr 16 '14 at 21:53 • I'm working through your suggestions. So far I've only modified variable names. I have a couple questions: When you say call find with @mounts as the second argument how do you mean? Would it be },$_, @mounts;? For anchoring the regexes (If I stick with that rather than mapping to a hash) would this be correct: qr/^@devNum$/;? I'm not sure I know how to use a separate wanted sub. – theillien Apr 22 '14 at 22:33 ## 1 Answer ### Processing mount points This can be improved in many ways: # Compile a list of mountpoints that need to be scanned my @mounts; open MT, "<${MTAB}" or die "Cannot open ${MTAB},$!";

# We only want the local mountpoints
while (<MT>) {
if ($_ =~ /ext[34]/) { my @line = split; push(@mounts,$line[1]);
}
}

close MT;

Using bare names for file handles is not recommended: replace MT with my $MT, and <MT> with <$MT>.

The comment talks about local mount points. That's too vague, when in fact you're looking specifically for ext3 and ext4 filesystems.

You could simplify if ($_ =~ /ext[34]/) as if (/ext[34]/). You could put the entire while loop inside a map, and it will be still readable. Putting it together, you can rewrite like this: open my$MT, "<${MTAB}" or die "Cannot open${MTAB}, $!"; # Compile a list of mountpoints that need to be scanned # We only want the ext3 ext4 partitions my @mounts = map((split)[1], grep(/ext[34]/, <$MT>));

close $MT;  Note that if you didn't find any mount points, the script has nothing to process, so it should exit: die 'no mount points to process' unless @mounts;  Try to apply these techniques everywhere in the script, especially the bit about filehandlers. # Read in the list of excluded files and create a regex from them my$regExcld = do {
open XCLD, "<${EXCLUDE}" or die "Cannot open${EXCLUDE}, $!\n"; my @ignore = <XCLD>; chomp @ignore; local$" = '|';
qr/@ignore/;
};

As earlier, replace XCLD with my $XCLD or something. You also forgot to close it. Btw, a common way to shorten my @arr = <$fh>; chomp @arr as chomp(my @arr = <$fh>). Most importantly, should it be really a fatal error if the file with excluded patterns doesn't exist? It might make sense to make this optional. Perhaps issue a warning instead, something like this: my$regExcld = do {
if (open my $fh, "<${EXCLUDE}") {
chomp(my @ignore = <$fh>); close($fh);
local $" = '|'; qr/@ignore/; } else { warn "Cannot open${EXCLUDE}, $!\n"; undef; } };  This bit seems pointless: # Create a regex containing mountpoint dev numbers to compare file device numbers to. my$devRegex = do {
chomp @devNum;
local $" = '|'; qr/@devNum/; };  Because @devNum is an empty array in your script, you never actually gave it any values. This is quite strange: # Create the output file path if it doesn't already exist. mkdir("${DIR}" or die "Cannot execute mkdir on ${DIR},$!") unless (-d "${DIR}");  You misplaced the die: it will run if "${DIR}" is empty, not if mkdir fails.

Also, there's no need whatsoever to double-quote ${DIR}. Corrected and simplified: mkdir($DIR) or die "Cannot execute mkdir on ${DIR},$!" unless -d \$DIR;


text:
Showing $V_1^* \otimes \dots \otimes V_k^* \otimes W \cong \mathrm{L}(V_1,\dots,V_k;W)$

This is exercise 12-4 in the book Introduction to Smooth Manifolds by John M. Lee:

Let $V_1,\dots,V_k$ and $W$ be finite-dimensional real vector spaces. Then $$V_1^* \otimes \dots \otimes V_k^* \otimes W \cong \mathrm{L}(V_1,\dots,V_k;W)$$ canonically, where $\mathrm{L}(V_1,\dots,V_k;W)$ denotes the set of multilinear mappings from $V_1\times \dots \times V_k$ to $W$.

It is clear, that we use the universal property of the tensor product space, so we construct a mapping $$\Phi : \begin{cases} V_1^* \times \dots \times V_k^* \times W \to \mathrm{L}(V_1,\dots,V_k;W)\\ (\varphi_1,\dots,\varphi_k,w) \mapsto \left((v_1,\dots,v_k) \mapsto \varphi_1(v_1) \cdots \varphi_k(v_k)w\right) \end{cases}$$

Now $\Phi$ is multilinear and thus we get a linear mapping $$\widetilde{\Phi} : V_1^* \times \dots \times V_k^* \times W \to \mathrm{L}(V_1,\dots,V_k;W)$$ such that $\Phi = \widetilde{\Phi} \circ \otimes$. It is easily checked that $\ker\widetilde{\Phi} = \{0\}$ and thus $\widetilde{\Phi}$ is injective. How do we show, that $\widetilde{\Phi}$ is surjective not knowing what the dimension of $\mathrm{L}(V_1,\dots,V_k;W)$ is? I want to use this exercise to determine the dimension of $\mathrm{L}(V_1,\dots,V_k;W)$.

• You could try make it for $k = 1$ and make canonical isomorphism. Just select any vector and consider pair $(f(x),x))$, where $x$ our vector. After it you could figure that $f(x)$ is some scalar from field. And after this you should prove injective and surjective of this map. – openspace Jul 2 '17 at 10:47

Suppose you have $f\in\operatorname{L}(V_1,\dots,V_k;W)$. By the universal property, you get a linear map $\hat{f}\colon V_1\otimes\dots \otimes V_k\to W$ and conversely, so what you really have to show is

1. $L(V,W)\cong V^*\otimes W$
2. $(V_1\otimes\dots \otimes V_k)^*\cong V_1^*\otimes\dots \otimes V_k^*$

Note that 2 is a special case of the theorem, but with $W=\mathbb{R}$ (in general, the base field), where you just need injectivity and the fact that the dimension of the two spaces is clearly the same.

For 1 it's again proving injectivity and equality of dimensions.

• Thanks. Additionally, I have also to show that if $V_1 \cong V_2$, then $V_1 \otimes W \cong V_2 \otimes W$ for bringing together your $2$ isomorphisms, right? Also I do not quite see yet the "conversly" part of your first sentence. – TheGeekGreek Jul 2 '17 at 11:54
• @TheGeekGreek “Conversely” refers to the fact that from a linear map $g\colon V_1\otimes\dots \otimes V_k\to W$ you get a unique element in $\operatorname{L}(V_1,\dots,V_k;W)$. The first statement in your comment is obvious, isn't it? – egreg Jul 2 '17 at 12:04
• Yes, my first statement is obvious, I just wanted to be sure. From what exactly does this follow? I mean given $g : V_1 \otimes \dots \otimes V_k \to W$ linear, then there exists a unique $\widehat{g} : V_1 \times \dots \times V_k \to W$ multilinear. – TheGeekGreek Jul 2 '17 at 12:09
• @TheGeekGreek $\hat{g}(v_1,\dots,v_k)=g(v_1\otimes\dots\otimes v_k)$. – egreg Jul 2 '17 at 12:11
• Thank you! Sometimes the easiest things are the hardest. So in conclusion we do have $$\mathrm{L}(V_1 \otimes \dots \otimes V_k;W) \cong \mathrm{L}(V_1 \times \dots \times V_k ; W)$$ right? – TheGeekGreek Jul 2 '17 at 12:18

format: plain


text:
Hex  1.0 Hydrogen-electron collision solver
special Namespace Reference

constant

integral

## Functions

int coulomb_zeros (double eta, int L, int nzeros, double *zeros, double epsrel=1e-8)
Get zeros of the Coulomb wave function $$F_L(-1/k,kr)$$. More...

std::vector< std::vector< int > > FdB_partition (int n)
Faa di Bruno partitioning. More...

template<class T , class OuterFunctionDerivative , class InnerFunctionDerivative >
chain_rule (OuterFunctionDerivative Df, InnerFunctionDerivative Dg, int n, double x)
Chain rule for n-th derivative. More...

## Function Documentation

template<class T , class OuterFunctionDerivative , class InnerFunctionDerivative >
 T special::chain_rule ( OuterFunctionDerivative Df, InnerFunctionDerivative Dg, int n, double x )

This function implements the Faa di Bruno's formula for n-th derivative of a nested function,

$\frac{\mathrm{d}^n}{\mathrm{d}^n x} f(g(x)) = \sum \frac{n!}{m_1! 1!^{m_1} m_2! 2!^{m_2} \dots m_n! n!^{m_n}} f^{(m_1+m_2+\dots+m_n)}(g(x)) \prod_{j=1}^n \left(g^{(j)}(x)\right)^{m_j} \ .$

The sum runs over all n-tuples $$(m_1, \dots, m_n)$$ that satisfy the Faa di Bruno's sum condition

$1 m_1 + 2 m_2 + \dots + n m_n = n \ .$

 int special::coulomb_zeros ( double eta, int L, int nzeros, double * zeros, double epsrel = 1e-8 )

Calculates given number of leading zeros of the Coulomb wave function $$F_L(\eta,\rho)$$, where $$\eta = -1/k$$ and $$\rho = kr$$.

The method used comes from Ikebe Y.: The zeros of regular Coulomb wave functions and of their derivatives, Math. Comp. 29, 131 (1975) 878-887. It uses eigenvalues of a special tridiagonal matrix. The eigenvalues are computed using the standard Lapack function DSTEV .

 std::vector > special::FdB_partition ( int n )

The Faa di Bruno partitioning is computed by looping over possible n-tuples

$(m_1, m_2, \dots, m_n)$

of integers and by picking only such that satisfy the Faa di Bruno's sum condition

$1 m_1 + 2 m_2 + \dots + n m_n = n \ .$

The initial trial partitioning is a zero tuple

$(0, 0, \dots, 0)$

and the further tuples are constructed by incrementing a corresponding multidigit number, that has a number system varying with the position. The number system base for the left-most (least significant) position is $$n + 1$$, for the next position it is $$\lceil (n + 1)/2 \rceil$$, for the next it is $$\lceil (n + 1)/3 \rceil$$, etc. For example, if $$n = 4$$, the increments are

$(0, 0, 0, 0), (1, 0, 0, 0), (2, 0, 0, 0), (3, 0, 0, 0), \mathbf{(4, 0, 0, 0)},$

$(0, 1, 0, 0), (1, 1, 0, 0), (2, 1, 0, 0), \mathbf{(3, 1, 0, 0)}, (4, 1, 0, 0),$

$(0, 2, 0, 0), (1, 2, 0, 0), \mathbf{(2, 2, 0, 0)}, (3, 2, 0, 0), (4, 2, 0, 0),$

$(0, 0, 1, 0), \mathbf{(1, 0, 1, 0)}, (2, 0, 1, 0), (3, 0, 1, 0), (4, 0, 1, 0),$

$(0, 1, 1, 0), (1, 1, 1, 0), (2, 1, 1, 0), (3, 1, 1, 0), (4, 1, 1, 0),$

$(0, 2, 1, 0), (1, 2, 1, 0), (2, 2, 1, 0), (3, 2, 1, 0), (4, 2, 1, 0),$

$\mathbf{(0, 0, 0, 1)}, \ \mathrm{etc.}$

Here, the number system are 5, 3, 2 and 2. Only those tuples in bold satisfy the sum condition and will be returned.

This function is needed by the generalized chain_rule.

Todo:
Cache results.


text:
Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

# Tag Info

## Hot answers tagged soyuz-spacecraft

49

Earlier Voskhod models used a retractable metal probe, but it was unreliable, especially in windy conditions. So in Soyuz, as the other answers have pointed out, a gamma-ray source is pointed at the ground and the backscatter is measured. The instrument ("Kaktus"), was developed in the early 60s. http://www.spacesafetymagazine.com/spaceflight/reentry-...

48

Why do we only use Soyuz to send humans to the ISS? Because other than Chinese spacecraft (which aren't allowed), the Soyuz is currently the only one that can send humans to the International Space Station. The only other vehicle capable of carrying humans to the ISS, the Space Shuttle, was cancelled. That metric (no other vehicle can do it) will hopefully ...

46

Nearly all the velocity is cancelled by atmospheric deceleration of the descent module, before its parachutes are deployed. ISS orbital velocity is around 7700 m/s. An initial retro-burn of the Soyuz engines, of something like 115 m/s magnitude, is sufficient to lower the perigee of orbit into the uppermost part of the atmosphere. The orbital module and ...

42

Look at the STS-122 video. How many astronauts do you see? I see six. Seven astronauts landed with STS-122. The six you see were the crew of STS-122 who spent twelve days in space. They could walk because twelve days in zero g isn't enough time to take a significant toll on musculature, bones, and blood. The seventh returning astronaut, Daniel Tani, who you ...

39

Soyuz uses gamma rays altimeter "Cactus", which starts soft landing engines just 1 meter before ground. Translation from russian wikipedia: The altimeter uses a source of gamma radiation (usually - Со 60, Сs 137 isotopes). The receiver detects backscattering, reflected from the atoms inside the underlying surface. Gamma ray altimeters are used at low ...

36

The ISS is at 1 bar, i.e. 1 kgf/cm2, or 10 gramsf/mm2. So the pressure on that 2 mm hole is 31.4 gramsf, well within the range a human finger can handle. Also, the ISS is really big compared to the hole. It takes a long time for hundreds of m3 to evacuate through a 2 mm hole.

35

Soyuz the booster and Soyuz the person carrying spacecraft are different. Soyuz the booster is based on the original R-7 ICBM and has seen a series of upgrades. Sometimes to engines, sometimes to computer systems, sometimes to components. I suspect you are reacting to an article like this one at SpaceflightNow.com which is actually a pretty good article. ...

33

The "three second" item is incorrect. In general (and this can be confirmed by watching multiple landings), the rockets fire approximately half a second before landing. Maybe they meant to say "three feet"? As an aside, astronauts who have ridden the Soyuz home invariably describe it as a fairly wild ride. Terms I've personally heard include "car ...

31

Yes, the launch escape system was used, contrary to earlier reports based on assumptions and ignorance of Soyuz hardware. However, it was not the tower that we are familiar with on Mercury and Apollo era manned rockets that was used. The Russian launch escape system, SAS (Система Аварийного Спасения, or Sistema Avariynogo Spaseniya, meaning emergency ...

29

It never actually happened, but there was a case when this situation had the potential for happening. That was the last shuttle flight, STS-135. If a critical flaw in the thermal protection system of the Orbiter had been detected, the shuttle crew would have had to hang out in the ISS until they could be rotated home using spare Soyuz capability. They ...

29

By itself the roll doesn't generate lift. But the Soyuz descent module (DM) enters with a non-axial center of mass that results in a non-zero angle of attack, and hence some lift. Several spacecraft, including the Apollo Command Module, have used this offset-mass approach to generate lift, thus achieving some measure of control over the atmospheric flight ...

27

There are usually 6 crew members, and 2 Soyuz spacecraft on station. Each Soyuz carries 3 astronauts. If there is an issue redocking during the move procedure, the backup plan is to return to earth. If they cannot redock and someone is left on the station, they would be stranded and cause all sorts of downstream issues. So no, you do not need 3 to move ...

26

Actually, a roughly 2-day rendezvous is standard*, and the 4-orbit expedited rendezvous, while being practiced more in the recent years, also involves phasing the International Space Station's orbit so it precisely coincides with the launch site at precise time (thus the instantaneous launch window), which sometimes isn't possible. This Soyuz TMA-18M ...

26

Rocket guidance systems generally use a fixed inertial platform based on gyroscopes to determine their orientation in space; an accelerometer solution would be useless to determine orientation (though helpful for position determination) as soon as the rocket was in motion. https://en.wikipedia.org/wiki/Inertial_platform Once operating, the platform's ...

25

ESA has a nice 3-part video series on YouTube that explains on a high-level ascent, rendezvous, and re-entry. These are actual training videos that are shown to ESA astronauts during their training. The narrator in the video gives the height at which the retro-rockets fire as "70 cm": 70 cm above the ground, the six retro-rockets fire to ...

25

The process is described here, which answers nearly all of your question. The reentry burn removes about 120 m/s of velocity from the capsule (that's your 1) and the final impact is 15 miles per hour (about 6 m/s). That's your 3. That leaves about 7.5 km/s for part 2. The only remaining question is the split between 2a and 2b, ie the velocity when the ...

25

Scott Manley answers this question here. Basically, it is due to the "shelf life" of the hydrogen peroxide propellant used by the attitude control thrusters of the Soyuz descent module. When hydrogen peroxide is passed over a heated catalyst, it decomposes to water and oxygen, and releases lots of energy, so the propellant goes from liquid to steam/gas, ...

24

The leak is in the Orbital Module (OM), which is jettisoned prior to re-entry, so there is no concern there. Source: link in the question. Image source: spaceflight101.com

23

There were more than 500 Zenit (including Vostoks and Voskhods) landing capsules; an order of 160 (as of today) manned and unmanned Soyuz variants. Plus prototypes used for modelling and testing on the ground. That's a pretty large number of used capsules. There are 65 pieces of equipment certified for reuse in Soyuz TMA landing module. Such as cosmonaut ...

22

It's really hard to answer this without complicating about how Soyuz spacecraft designers obviously didn't. Or crack a joke or two. It's a cramped little space vehicle and that space between the three crew, the seats they occupy and the control panels is pretty much all the space they have to crawl into it and later out of it. Moving the panels closer would ...

21

There are two modules in the Soyuz that are habitable. The Soyuz stack is three modules in total. The crew launches in the middle module, which is also where they land and has the heat shield on its bottom. The bottom module is the propulsion modules. The top module is the Utility module and has the washroom facilities and the airlock. They sleep in ...

21

No. And it doesn't even matter that there's no space for a crew of six no matter how small they might be or if they threw away some other pieces and try to make do. The life support of the descent module of the Soyuz TMA can only support up to three people. Since descent time is more or less constant regardless of the descent mode, and there's no way to ...

21

Most thrusters on the Soyuz-MS spacecraft use Nitrogen Tetroxide1 (N2O4, oxidizer) and Unsymmetrical Dimethylhydrazine2 (UDMH, fuel). These are stored (and burned) on the service module and both are fairly stable (from a storage-lifetime standpoint). For safety reasons it was decided that the descent module would use Hydrogen Peroxide3 (H2O2) ...

20

It's to protect the engine from the low temperature. The cover is removed before the deorbit burn: (Source: Kosmonavtika) $\rightarrow$ During mission Soyuz-32 in 1979, the cosmonauts forgot to open the cover before firing the SKD docked to Salyut-6 space station. This was a test burn. The cover was destroyed, and the engines left unprotected. As a ...

19

Just to add a better source: From the Soyuz Crew Operations Manual The АКСП consists of barostatic and time mechanisms and the Гамма-лучевой высотомер (ГЛВ) (Gamma Ray Altimeter). The barostatic and time mechanisms operating according to their settings issue commands for sequential parachute deployment and for the execution of pre-landing ...

19

"Soyuz: A Universal Spacecraft" says the electrical system produces 23-34 volts. I saw a reference to a nominal 28VDC supply to the spacecraft in the Soyuz launcher manual; 28VDC is a global standard for aircraft power supplies. I think "906V" is a part number, not a voltage; the source for that section of the WP page says (my bolding): Finally, the ...

19

This is the image of the hole (news source, although the image is from NASA) The hole is 2mm in diameter. Even with a total vacuum on the other side, you're not talking a lot of volume getting through that hole. I used this calculator with a pressure gradient of 101kPa (ISS standard) and 0.1 kPa through a 2mm hole and got a water flow rate of ~0.1 cubic ...

19

As Organic Marble points out, yes the US space program had G meters. They're likely to include these in future manned missions, as well. As for the true purpose of the toys: To humans, any sudden reduction in acceleration feels like falling. When the engines cut off, they are aware that there is less thrust, but the human body isn't great at telling you, ...

18

It's a purge of remnant hydrogen peroxide from the "secondary control system".1 "On the “ОТСТРЕЛ ЛОБОВОЙ ТЕПЛОЗАЩИТЫ” (Bottom Shield Jettison) all УРМД thruster valves are opened and all the peroxide residuals are drained out."3 A secondary guidance, navigation and control system in the Descent Module enables the crew to maneuver the vehicle after the ...

16

Thanks to the paper linked by Jan Doggen in the comments we can say that it is a natural outcome of the shape of the parachute. In particular, the shape, together with the near absence of wind and the fact that the craft is descending near vertically determines that pulsating motion. In the words of the paper: The studies of [1, 2] demonstrated that ...

Only top voted, non community-wiki answers of a minimum length are eligible


text:
# 9 Metre (keelboat)

Current Specifications
LOA 18 m (59 ft)
Infobox last updated: 19-APR-2010
Former Olympic Class

The International Nine Metre Class is a construction class, meaning that the boats are not identical but are all designed to meet specific measurement formula, in this case International Rule. At their heyday, Metre Classes were the most important group of international yacht racing classes, and they are still actively raced around the world. "Nine" in class name does not, somewhat confusingly, refer to length of the boat, but product of the formula; 9mR boats are, on average, 18 meters long.

## History

The 9mR was used as an Olympic Class during the 1920 Olympics. The International Rule was set up in 1907 to replace earlier, simpler handicap system which were often local or at best, national, and often also fairly simple, producing extreme boats which were fast but lightly constructed and impractical. The rule changes several times in history. About 50 boats were ever build.

## Rule development

### 1907 Rule

Used from 1907–1920

$9.000 \mbox{ metres} = \frac{L + B + 1/3G +3d + 1/3\sqrt{S} - F}{2}$ where

• $L$ = waterline length (LWL)
• $B$ = beam
• $G$ = chain girth
• $d$ = difference between girth and chain
• $S$ = sail area
• $F$ = freeboard

## Olympic results

No competitors did enter the Olympics in the 9 Metre.


text:
Cutting Back Hellebores In Summer, Inheritance In Use Case Diagram, Minecraft Elevator Soul Sand, Sorry To Bother You On The Weekend, Rabies Vaccine For Goats, Subject To Real Estate Course, Marcus Samuelsson Yardbird Restaurant, Bdo Oquilla Eye, Sew On Labels Canada, " />

system of linear equations project

system of linear equations project

In the last few weeks, we have talked about systems of linear equations and learned several methods to solve systems including graphing, elimination, and substitution. Guassian elimination method; Guass Siedel method; This project also includes finding inverse of the matrix using LDU decomposition. (b) Unique solution. Question: System Of Linear Equations Project Introduction Systems Of Linear Equations Are A Useful Way To Solve Common Problems In Different Areas Of Life. Nov 30, 2016 - Explore stemta18's board "Algebra 1 Project Ideas" on Pinterest. Linear equation system. Solving a System of Linear Equations. For this project I collaborated with Dan Sarkes and Adam Rienzie. Pick any pair of equations and solve for one variable. NO LATE PROJECTS ACCEPTED! 2.1 Direct methods (Inverse of a Matrix, Cramer's Rule, Gauss Jordan, Montante). Systems of Linear Equations These problems can be solved by using two or more variables and writing a system of equations. Algebra I Final Project Introduction: Systems of linear equations are a useful way to solve common problems in different areas of life. Seattle Girls School 8th Grade Alone We Go Fast Together Far. See more ideas about systems of equations, high school math, algebra. But it's interdisciplinary, gets students to apply math in a real life situation, easy to differentiate and really great! The power and progress in Matrices and its application did not come to fruition until the late 17th century. Share Share Equations: X=Seconds . For this reason, we are no longer limited to using one variable when setting up equations that model applications. iRubric RXXA7CB: Analyze and solve pairs of simultaneous linear equations. Project 4: Systems of non-linear differential equations. In this project, you will be using systems of linear equations to decide which car to buy. Systems of Linear Equations Project By: Justin Kempire & Luke Steiner. Jim can run and dribble a basketball at 10 meters per second. Shrek has completed 10 plushies and will complete 5 more per day. I followed a template with Find, however it just don't get me anywhere. If we translate an application to a mathematical setup using two variables, then we need to form a linear system with two equations. Introduction . How to download a copy of the project. One of the most powerful ways to use them is in a comparison model where two similar situations are compared side by side to determine which one is better. We have explored several real life problem situations where we use systems to solve. Differential equations can be used to model various epidemics, including the bubonic plague, influenza, AIDS, the 2015 ebola outbreak in west Africa, and most currently the coronavirus … Systems Of Inequalities Word Problems. (c) Inﬂnitely many solutions. A linear system is said to be consistent if it has at least one solution; and is said to be inconsistent if it has no solution. Pick another pair of equations and solve for the same variable. Jun 3, 2016 - Real-world applications of linear equations and systems of equations when students examine the cost of college. The points of intersection of two graphs represent common solutions to both equations. Given a linear system of three equations, solve for three unknowns. 3. Project Euclid - mathematics and statistics online. In some differential equations such as stiff equations Euler’s method can be numerically unstable. Hello All, I am struggling to find the proper code for solving a system of non linear equations, using Mathcad 15. Subjects: Algebra, Applied Math, Word Problems. The purpose of this project is to explore the limitations of Euler’s method. Students select from two different types of cars one being a hybrid car and the other being a "gas guzzler" car. These methods make … In order to complete this project, start by selecting one of the situations below: Cell Phone Plan: Your parents have decided that you should pay for your own cell phone. System solution methods involve the use of substitution or combination techniques. : This instruction will help you to solve a system of 3 linear equations with 3 unknown variables.Minimum requirements: Basic knowledge of … Systems of linear equations are a useful way to solve common problems in different areas of life. This project is a software to solve Linear Systems of equations using Crout and Doolittle matrix decomposition algorithms in Python. The algorithms used to solve the system of linear equations are . A valuable project for Algebra 2 students. 4. Solved I Had Problems With Doing The Graph And Numbe . Nov 17, 2018 - Explore Katie Kilgore Widener's board "Systems of Equations", followed by 388 people on Pinterest. (a) No solution. Any system of linear equations has one of the following exclusive conclusions. Bob can do the same at 5 meters a second. Sam found a 2012 Toyota Prius with the original price of $29,805 and a fuel In mathematics, a system of linear equations (or linear system) is a collection of one or more linear equations involving the same set of variables. PARKING For example, + − = − + = − − + − = is a system of three equations in the three variables x, y, z.A solution to a linear system is an assignment of values to the variables such that all the equations are simultaneously satisfied. Roots of equations. Students are given th. Solving Systems by Graphing Problem: Jim and Bob are dribbling basketballs. You must use each method for solving systems of equations (graphing, substitution, and elimination). To download a copy of the project, just go on the main page of the project on GitHub, click on "Clone or … Two systems are equivalent if either both are inconsistent or each equation of any of them is a linear combination of the equations of the other one. Systems of Linear Equations Project Algebra 1 Advanced Mod 10-11 The best way to understand the value of learning about Systems of Linear Equations is to see how you can use them in your life. Nonlinear equation systems (Newton 1st order, Newton 2nd order). How many seconds will it take for them to be at the same distance? Fiona has not completed any yet, but has a load of free time and can make 10 per day. One method per question.. Free rubric builder and assessment tools. To run Systems of linear equations are a useful way to solve common problems in different areas of life. Two linear systems using the same set of variables are equivalent if each of the equations in the second system can be derived algebraically from the equations in the first system, and vice versa. Chapter IV. … Systems Of Linear Equations Project. Systems of Equations Project DUE – February 13, 2014! This is done as a part of mini project in algorithm course The aim of this project is to solve a set of linear equations with many unknowns. Around 200 BC, theChinese published that “Nine Chapters of the MathematicalArt,” they displayed the ability to solve a 3X3 system of equations (Perotti). Efee Ebraicaly To Find He Componentsoc Ganizer St Chegg Com. To summarize, a system of linear equations with 2 unknowns must have at least 2 equations to get a unique solution. We now have the techniques needed to solve linear systems. Section 2.5 Projects for Systems of Differential Equations Subsection 2.5.1 Project—Mathematical Epidemiology 101. One of the most powerful ways to use them is in a comparison model where two similar situations are compared side by side to determine which one is better. PROJECT PARKING - Free download as Powerpoint Presentation (.ppt / .pptx), PDF File (.pdf), Text File (.txt) or view presentation slides online. Solving Systems by Graphing Example. Having 3 (or more) equations is too many. Solving Systems of Linear Equations Project Word Problem Graph You and Sam have decided to buy a car, you found a 2012 Chevy Camaro with the original price of$23,280 and a fuel tank capacity of 19 gal. Systems of Equations Project - Business Letters This is not really a performance task (which is what we are trying to do one per unit in Algebra One), it's more of a project. The problem is related to thermodynamics. Around 4000 years ago, the people of Babylon knew how to solve a simple2X2 system of linear equations with two unknowns. See more ideas about Systems of equations, Equations, Middle school math. One of the most powerful ways to use them is in a comparison model where two similar situations are compared side by side to determine which one is better. We consider solving such large-scale systems of linear equations $\mathbf{A}\mathbf{x}=\mathbf{b}$ that are inconsistent due to corruptions in the measurement vector $\mathbf{b}$. System Of Linear Equations Project Introduction Sy Chegg Com. Shrek and Fiona are knitting Onion Plushies to give to the children at a local school, Swampville Elementary. Solve the resulting two-by-two system. Systems of Linear Equations Project. This is a Common Core System of Linear Equations project in which students work in pairs or in groups to determine if it is worth paying more now or later for a car. Having 2 equations is exactly enough, as long as they are not redundant or inconsistent. Choose a row horizontal, vertical, or diagonal from the tic tac toe board provided. One Of The Most Powerful Ways To Use Them Is In A Comparison Model Where Two Similar Situations Are Compared Side By Side To Determine Which One Is Better. Grades: 7 th, 8 th, 9 th. Systems of differential equations are very useful in epidemiology. Bob will get a 7.5 meter head start. Posted on April 11, 2011 by eburnsmth212 . 14 05 07 The Fal Of Linear Relationships Simple And Complex Word. Some students may choose to solve some of the problems by using a single variable and equation. Project Deadline: Tuesday, April 4, 2017 @ beginning of class. The equation are given in the screenshot below. We develop several variants of iterative methods that converge to the solution of the uncorrupted system of equations, even in the presence of large corruptions. Systems of Linear Equations Project By: Lejla Hamzic and Taylor Martin. Having 1 equation is not enough, because 1 equation in 2 unknowns is represented by an entire line. You have created a system of two equations in two unknowns. System of linear equations: 2x1 + x2 = 100 - a x1 + x2 - x3 - x4 = 0 - b x1 - x3 - x5 = 50 - c x2 - x4 - x5 = 120 - d x2 + x3 - x4 + x5 = 0 - e = Solution: In order to solve for the unknown variables, I created equations for the known values given in the project; That is 100 + 50 = 150 Mbps, being the total rate at which data is transmitted over a network to five routers. 2.2 Iterative methods (Jacobi, Gauss-Seidel).


text:
# Cute numbers!

Define a cute number as a 16 digit number whose difference in pair of each consecutive digits is $$1$$ and each digit belongs to the set $$\{ 1,2,3 \}$$.

If the the sum of all cute numbers can be expressed as $$2^{a} \times b$$ where $$b$$ is not divisible by $$2$$, and both $$a$$ and $$b$$ are positive integers.Evaluate $$a+b$$.

×


text:
# apache_beam.dataframe.partitionings module¶

class apache_beam.dataframe.partitionings.Partitioning[source]

Bases: object

A class representing a (consistent) partitioning of dataframe objects.

is_subpartitioning_of(other)[source]

Returns whether self is a sub-partition of other.

Specifically, returns whether something partitioned by self is necissarily also partitioned by other.

partition_fn(df, num_partitions)[source]

A callable that actually performs the partitioning of a Frame df.

This will be invoked via a FlatMap in conjunction with a GroupKey to achieve the desired partitioning.

test_partition_fn(df)[source]
class apache_beam.dataframe.partitionings.Index(levels=None)[source]

A partitioning by index (either fully or partially).

If the set of “levels” of the index to consider is not specified, the entire index is used.

These form a partial order, given by

Singleton() < Index([i]) < Index([i, j]) < … < Index() < Arbitrary()

The ordering is implemented via the is_subpartitioning_of method, where the examples on the right are subpartitionings of the examples on the left above.

is_subpartitioning_of(other)[source]
partition_fn(df, num_partitions)[source]
check(dfs)[source]
class apache_beam.dataframe.partitionings.Singleton(reason=None)[source]

A partitioning of all the data into a single partition.

reason
is_subpartitioning_of(other)[source]
partition_fn(df, num_partitions)[source]
check(dfs)[source]
class apache_beam.dataframe.partitionings.JoinIndex(ancestor=None)[source]

A partitioning that lets two frames be joined. This can either be a hash partitioning on the full index, or a common ancestor with no intervening re-indexing/re-partitioning.

It fits into the partial ordering as

Index() < JoinIndex(x) < JoinIndex() < Arbitrary()

with

JoinIndex(x) and JoinIndex(y)

being incomparable for nontrivial x != y.

Expressions desiring to make use of this index should simply declare a requirement of JoinIndex().

is_subpartitioning_of(other)[source]
test_partition_fn(df)[source]
check(dfs)[source]
class apache_beam.dataframe.partitionings.Arbitrary[source]

A partitioning imposing no constraints on the actual partitioning.

is_subpartitioning_of(other)[source]
test_partition_fn(df)[source]
check(dfs)[source]


text:
# [Flocking] How to improve performance?

This topic is 1728 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm doing a simulation of flying birds for my thesis.

I am using the usual steering behaviors: Cohesion, Separation, Velocity Match and Obstacle Avoidance (to avoid terrain).

The program is written in C# and uses Unity3D. I have disabled physics for the boids.

I'm also using alglib to calculate K-nearest neighbors using AKNN. alglib uses k-d trees for this.

So here are the fps I get:

100 boids = 60 fps

200 boids = 35 fps

300 boids = 23 fps

500 boids = 13 fps

1000 boids = 5 fps

As the number of boids increases, performance degrades rapidly. I'd like to do something to improve it, but sadly I am using the free version of unity3D, which does not have a profiler.

Is the performance I'm getting good? I haven't found results online for this.

Should I find another library instead of alglib?

By the way, you can see the program online here. Requires unity3d plugin.

##### Share on other sites

One thing I have heard (but have not confirmed) is that Unity does not support multi-threading, but .Net/Mono does. Therefore you may be able to do all the boid calculations in a separate thread using primitive types, then pass the results back to Unity to update the boid GameObjects. Note that none of the Unity provided types are thread-safe AFAIK. Vector3 should be fine, I hope! ;)

##### Share on other sites

I have made some measurements using the StopWatch class of the .net framework.

When using the following steering behaviors I had the results below - using 500 boids.

Time to build K-D tree: 2.34ms. So this is not the problem.

Time to update boid steerings (all 500 boids, average time of N frames)

Behaviors used: Cohesion, Separation, VelocityMatch, ObstacleAvoidance => 46.77ms

Behaviors used: Cohesion, Separation, VelocityMatch, ObstacleAvoidance => 39.55ms

Behaviors used: Cohesion, Separation, VelocityMatch, ObstacleAvoidance => 24.44ms

So by not using some behaviors the time dropped significantly. The difference from not using VelocityMatch to not using Cohesion was bigger because Cohesion uses k = 30 for aknn while velocity match uses k = 10. When I set k = 10 for cohesion the time dropped as well.

This is the code that behaviors use to get k-nearest neighbors:

public class Flock
{
List<Entity> boids;
alglib.kdtree kdt;

public Flock(params Entity[] _boids)
{
boids = new List<Entity>();

}

public int GetNeighborhoodInfo(Entity character, int maxNeighbors, float maxDistance, float minDotProduct, double aknnApproxVal, out Vector3 center, out Vector3 avgVeL)
{
var point = new double[3]{character.position.x, character.position.y, character.position.z};

var results = new double[0, 0]; // the array containing the results (points of the k nearest neighbors)

int neighbors = (maxNeighbors == 0 ? 0 : alglib.kdtreequeryaknn(kdt, point, maxNeighbors, aknnApproxVal));

// get the results
alglib.kdtreequeryresultsxy(kdt, ref results);

center = avgVeL = Vector3.zero;

// where is the character looking
var look = character.transform.forward;

int count = 0;
for (int i = 0; i < neighbors; ++i)
{
var pos = new Vector3((float)results[i, 0], (float)results[i, 1], (float)results[i, 2]);
var vel = new Vector3((float)results[i, 3], (float)results[i, 4], (float)results[i, 5]);

if (pos == character.position)
continue;

if( Vector3.Distance(character.position, pos) <= maxDistance )
{
// check for angle
if( minDotProduct > -1.0f )
{
var offset = pos - character.position;
if( Vector3.Dot(look, offset.normalized) < minDotProduct )
continue;
}

center += pos;
avgVeL += vel;
++count;
}
}

center /= count;
avgVeL /= count;

return count;
}
}

I think it's pretty straight-forward... So I guess the only solution is to search for another library for aknn? I read somewhere that akkn could be made more efficient when using octrees instead of k-d trees.

##### Share on other sites

Normally you don't need to run an AI system every frame for every agent. I assume your above Behaviours are on every single agent entity?

One way to optimize is to use agent handlers that calculate behaviour for a bunch of agents. That way you can reuse many calculations.

Another way (these are combinable) is to use Coroutines (Threads are a really bad idea in Unity) to run your algorithms over multiple frames. This can boost performance really good.

The last not so obvious problem you might have is colliders. You wrote above you "disabled" physics on your agents. Does this mean you removed the RigidBody component or do you set it to isKinematic? Do you still have colliders attached to the objects?

The problem is: Unity handles every Collider that is not on the same object as a Rigidbody like it was static. Moving a static collider means for Unity to recalculate EVERY other static collider, which is performance hell. So the way to go with moving colliders is 'Collider + Rigidbody (isKinematic)' if you do want to disable physics on that object. Or you remove the colliders, too.

##### Share on other sites
I am a programming dinosaur, so I only use dynamic memory allocation when I need it. For a simulation like this, nothing other than perhaps the k-d tree implementation should use dynamic memory allocation at all. Your code has new' all over the place, and this is my first guess as to why it is so slow. Perhaps there is no alternative to using new' everywhere in C#, but my C/C++ brain is disgusted.

Is there any way you can switch to C++ for this project?

##### Share on other sites
Álvaro is right about the news. The ones on the Vector3s don't cost anything but the 2 array allocations could be hurting performance and are completely unnecessary. Move the allocation of those 2 arrrays into the constructor and just set the values in GetNeighborhoodInfo.

##### Share on other sites

Álvaro is right about the news. The ones on the Vector3s don't cost anything but the 2 array allocations could be hurting performance and are completely unnecessary. Move the allocation of those 2 arrrays into the constructor and just set the values in GetNeighborhoodInfo.

That is true, but I don't think that is the most pressing performance issue there. Making the arrays fields, will help nonetheless. Also you should use jagged arrays, not twodimensional arrays, as they are faster to fill in the mono version Unity is using, than the latter ones. (Jagged arrays: int[x][y] instead of int [x,y])

##### Share on other sites

I see what you guys mean, but the problem is that alglib expects the array to be of this type. And even If allocate earlier it will still be re-allocated by alglib (that's why it takes the array by reference) as you can see below:

// get the results
alglib.kdtreequeryresultsxy(kdt, ref results);

Also as far as I'm aware dynamic memory allocation in C# is fast (I read it's just a pointer increment, not sure how it works).

I can't switch to C++, it's too late now :P Also Unity doesn't support C++ so...

The last not so obvious problem you might have is colliders. You wrote above you "disabled" physics on your agents. Does this mean you removed the RigidBody component or do you set it to isKinematic? Do you still have colliders attached to the objects?

The agents do have rigidbodies attatched to them because I use them to set the velocity of the agents. However they do not have colliders attatched to them.

##### Share on other sites
The fact that it takes it by reference should actually be proof of the opposite. It's allowing you to handle the allocation. Also pre-allocating it in the constructor doesn't mean you have to change the array type. You can keep the same type, all you have to do is move the allocation:

List<Entity> boids;
alglib.kdtree kdt;
double[] point
double[,] results;

public Flock(params Entity[] _boids)
{
boids = new List<Entity>();
point = new double[3];
results = new double[INSERT, SIZE];

}

public int GetNeighborhoodInfo(Entity character, int maxNeighbors, float maxDistance, float minDotProduct, double aknnApproxVal, out Vector3 center, out Vector3 avgVeL)
{
point[0] = character.position.x;
point[1] = character.position.y;
point[2] = character.position.z;

int neighbors = (maxNeighbors == 0 ? 0 : alglib.kdtreequeryaknn(kdt, point, maxNeighbors, aknnApproxVal));

// get the results
alglib.kdtreequeryresultsxy(kdt, ref results);

...

}

Edit: Sorry I misread the code, I fixed it up a bit. I'm not sure what the size of the results array should be. The documentation for alglib says this:

        XY      -   possibly pre-allocated buffer. If XY is too small to store
result, it is resized. If size(XY) is enough to store
result, it is left unchanged.

So if you provide an array that's properly sized, there won't be any allocation Edited by Telanor

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

• 15
• 11
• 9
• 38
• 16
• ### Forum Statistics

• Total Topics
634128
• Total Posts
3015694
×


text:
# Homotopy Type Theory πn(Sn) in Homotopy Type Theory > history (changes)

Showing changes from revision #2 to #3: Added | Removed | Changed

<$\pi_n(S^n)$ in Homotopy Type Theoryhomotopy type theory - references, Dan Licata and Guillaume Brunerie, Invited Paper, CPP 2013

http://dlicata.web.wesleyan.edu/pubs/lb13cpp/lb13cpp.pdf

category: reference

Last revised on June 9, 2022 at 17:37:04. See the history of this page for a list of all contributions to it.


text:
Fast spherical polygon generation?

Posted 3 years ago
3665 Views
|
4 Replies
|
10 Total Likes
|

Cross posted on mathematica.stackexchange - https://mathematica.stackexchange.com/q/144167/5478

Question

Given a list of points on a sphere and the sphere/radius I'd like to plot a spherical polygon with vertices in those points.

And this needs to be fast, fast enough for the user to not "feel" generation time.

One should be able to style them too. Most importantly the surface but an edge style would be nice aswell.

What have I tried?

This is very closely related topic but answers there are not fast enough for my needs.

Is great but "only good for making spherical quadrilaterals, or isosceles spherical triangles".

• ClipPlanes in V11+ can be used as a directive which is very effective:
    RandomSeed[3];
pts = Normalize /@ RandomReal[{-1, 1}, {3, 3}]

Graphics3D[
{AbsolutePointSize@12, Point@pts,
Red, Sphere[{0, 0, 0}, .999], Blue,
Style[Sphere[], ClipPlanes -> {
InfinitePlane[{#, #2, {0, 0, 0}}],
InfinitePlane[{{0, 0, 0}, #3, #}],
InfinitePlane[{{0, 0, 0}, #2, #3}]
},
ClipPlanesStyle -> Directive[Opacity@.2, Red]]
}
] & @@ pts

But I'd need to write some code to determine in what order should those points be put in InfinitePlanes in order to clip from the right side (ClipPlane orientation). I didn't do this because I was too lazy and because:

> The number of clipping planes that can be implemented with ClipPlanes is limited by available graphics hardware.

So it won't be general enough. Though if you want to make this method automatic I will gladly upvote it.

Motivation

I think it will be useful in many applications.

I don't have time for this but I thought it would be a nice feature to have to improve code I was playing with lately, mostly based on another J.M.'s answer - Voronoi grid on a sphere

arc[center_?VectorQ, {start_?VectorQ, end_?VectorQ}] :=  Module[{ang, co, r}, ang = VectorAngle[start - center, end - center];
co = Cos[ang/2]; r = EuclideanDistance[center, start];
{{start, center + r/co Normalize[(start + end)/2 - center], end}, co}
]

points = {2 \[Pi] #1, ArcCos[2 #2 - 1]} & @@@ RandomReal[1, {10, 2}];

sp = Append[Sin[#2] Through[{Cos, Sin}[#1]], Cos[#2]] & @@@ points;

proc[] := (
ch = ConvexHullMesh[sp];
verts = MeshCoordinates[ch]; polys = First /@ MeshCells[ch, 2];

voro = Normalize[ Cross[verts[[#2]] - verts[[#1]],  verts[[#3]] - verts[[#1]]]] & @@@ polys;

edges =  arc[{0, 0, 0}, voro[[##]]] & /@      Select[Subsets[Range[Length[polys]], {2}],       Length[Intersection @@ polys[[#]]] >= 2 &];

);

proc[];

DynamicModule[{run = True},  Graphics3D[{ {Opacity[.75],
DynamicWrapper[EventHandler[Sphere[],
"MouseMoved" :>  Module[{pos = MousePosition["Graphics3DBoxIntercepts", True],
pt},  If[
Not@TrueQ@pos , pt = RegionIntersection[Sphere[], Line@pos];
If[pt =!= EmptyRegion[3],  sp[[-1]] = First@Nearest[pt[[1]], pos[[1]]]; proc[]]  ]]]
, TrackedSymbols :> {run}
]
}
, {AbsoluteThickness[2],
Dynamic[BSplineCurve[#, SplineDegree -> 2,
SplineKnots -> {0, 0, 0, 1, 1, 1},
SplineWeights -> {1, #2, 1}] & @@@ edges]}
, {Red, Sphere[Most@sp, .02], Dynamic@Sphere[Last@sp, .02]}
}
, PlotRange -> 1.1    , SphericalRegion -> True   , ImageSize -> 500]
]

To look more like https://www.jasondavies.com/maps/voronoi/

4 Replies
Sort By:
Posted 3 years ago
 I thought I had a simple solution, but I don't.
Posted 3 years ago
 I guess this comes originally from Demonstrations Project Voronoi Diagram on a Sphere by Maxim Rytin. I liked that you modernized it and interactivity works. It is broken in Maxim demonstration and I hope now they can fix it. Did you figure out what exactly the buy there was?But you also might be interested in another demonstration Voronoi Diagrams on Three-Dimensional Surfaces, which generalizes beyond the sphere and is by @Erik Mahieu who is a member here.
 I have not seen those demonstrations, thanks. The first one is probably broken as something in tetgenWolfram library has changed, I'd have to investigate. My approach is different, based on top level code provided by J.M. in the linked topic. The difference is it only generates points and edges that is why my example has no faces.About the second one, what it shows is an intersection of 3D Voronoi cells and given surface. I don't think it is the same as a Voronoi mesh on given surface. Maybe on a sphere. Or maybe it is, I'm not sure but I doubt it, would appreciate confirmation.
 Hi Sam,The implementation I gave in SE is essentially the same algorithm as Maxim's, where the relationship between the convex hull and the spherical Voronoi diagram was exploited. Maxim's old code used some TetGen functionality, which has now been supplanted by ConvexHullMesh, which I use in the code I wrote and Kuba expanded on.The code in the other demonstration you linked to does not seem to be using a geodesic-based distance, so I'm reluctant to consider it a true Voronoi partition.


text:
# Chapter 18, Problem 02Your answer is partially correct: Try again;An object has charge of -2.2 pC: How many electrons must

###### Question:

Chapter 18, Problem 02 Your answer is partially correct: Try again; An object has charge of -2.2 pC: How many electrons must be removed s0 that the charge becomes +2.5 pC? 1.875E13 Number Units (no units)

#### Similar Solved Questions

##### The rabbit population in region of the Iast fall satisfies the population model Is dp 0.04plp 16) _ Find tha equlllbrium solutionsDetermine which one asmptotically stable and which is unstable. if = Atney exist
The rabbit population in region of the Iast fall satisfies the population model Is dp 0.04plp 16) _ Find tha equlllbrium solutions Determine which one asmptotically stable and which is unstable. if = Atney exist...
##### Depakote, a drug used to treat seizures and bipolar disorder, consists of a mixture of valproic acid $left[left(mathrm{CH}_{3} mathrm{CH}_{2} mathrm{CH}_{2}ight)_{2} mathrm{CH} mathrm{CO}_{2} mathrm{H}ight]$ and its sodium salt. Give IUPAC names for each of these compounds.
Depakote, a drug used to treat seizures and bipolar disorder, consists of a mixture of valproic acid $left[left(mathrm{CH}_{3} mathrm{CH}_{2} mathrm{CH}_{2} ight)_{2} mathrm{CH} mathrm{CO}_{2} mathrm{H} ight]$ and its sodium salt. Give IUPAC names for each of these compounds....
##### Type EX for Exergonic Type EN for EndergonicThe catalysis of a protein into individual amino acidsENThe synthesis ofa new phosphodiester bondAchemical reaction with a positive change in free energy (G)ENThe hydrolysis of ATP into ADP and P;The decomposition of propane into carbon dibxide and waterThe formation ofl bond between two monosaccharides thatreleases water
Type EX for Exergonic Type EN for Endergonic The catalysis of a protein into individual amino acids EN The synthesis ofa new phosphodiester bond Achemical reaction with a positive change in free energy (G) EN The hydrolysis of ATP into ADP and P; The decomposition of propane into carbon dibxide and ...
##### How do you solve the system of inequalities 2x + 5y \leq - 20 and - 5x + 4y > - 4?
How do you solve the system of inequalities 2x + 5y \leq - 20 and - 5x + 4y > - 4?...
##### The data below shows the number of years of education beyond high school (X) end income (Y) (in tens of thousands of dollars} Calculate the correlation coefficient0.956(b) 0.941(c) 0-.971(d) - 956Refer to question 1l. Using the 0.05 level of significance can we conclude That there is significant linear relationship between education beyond high school and income? Yes (6) NoRefer to question 11. Using the 0.01 level of significance, can we conclude that there significant linear relationship betwe
The data below shows the number of years of education beyond high school (X) end income (Y) (in tens of thousands of dollars} Calculate the correlation coefficient 0.956 (b) 0.941 (c) 0-.971 (d) - 956 Refer to question 1l. Using the 0.05 level of significance can we conclude That there is significan...
##### For a small particle of styrofoam (1 $\mathrm{lbm} / \mathrm{ft}^{3}$ ) (spherical, with diameter $d=0.3 \mathrm{mm}$ ) falling in standard air at speed $V$ the drag is given by $F_{D}=3 \pi \mu V d,$ where $\mu$ is the air viscosity. Find the maximum speed starting from rest, and the time it takes to reach 95 percent of this speed. Plot the speed as a function of time.
For a small particle of styrofoam (1 $\mathrm{lbm} / \mathrm{ft}^{3}$ ) (spherical, with diameter $d=0.3 \mathrm{mm}$ ) falling in standard air at speed $V$ the drag is given by $F_{D}=3 \pi \mu V d,$ where $\mu$ is the air viscosity. Find the maximum speed starting from rest, and the time it takes ...
##### The Elite Car Rental Corporation is contemplating expanding its short-term rental fleet by 30 automobiles at...
The Elite Car Rental Corporation is contemplating expanding its short-term rental fleet by 30 automobiles at a cost of $900,000. It expects to keep the autos for only two years and to sell them at the end of that period for 60 percent, on average, of what they cost. The plan is to generate$10,500 o...
##### Jensen Tire Auto is in the process of deciding whether to purchase maintenance contract for its new computer wheel alignment and balancing machine Managers feel that maintenance expense should be related to usage, and they collected the following information on weekly usage (hours) and annual maintenance expense (in hundreds of dollars).Weekly Usage (hours}Annual Maintenance ExpenseDevelop the estimated regression equation that relates annual maintenance expense (in hundreds of dollars) to weekl
Jensen Tire Auto is in the process of deciding whether to purchase maintenance contract for its new computer wheel alignment and balancing machine Managers feel that maintenance expense should be related to usage, and they collected the following information on weekly usage (hours) and annual mainte...
##### Question 16 5 pts The Doug and Bob Corporation is calculating its WACC. Its 1,000,000 bonds...
Question 16 5 pts The Doug and Bob Corporation is calculating its WACC. Its 1,000,000 bonds have a 7% coupon, paid semi-annually, a current maturity of 25 years, and sell for a quoted price of 115. The firm's 1,800,000 shares of preferred stock (par \$100) pays a 7.5% annual dividend and currentl...
##### Epoxidation 0f cholesterolUN TIIS EAPERIMLNT Sicrold aIkcnc convcritu cpoiide wlth metn chloroperbenzoic Jcid (NCTH) dichlorumcthanc: Thc NicTB Dio duocd Acu cJ by whai Jinounts pimplc rapid (iltrauon Intoush ilial 'Kcl Eaporatlon the tolvent glves the cpotide which tecrsui: Jized Ivom mistute Di accionc und WotciDiseelte[4mA chokentetel In 0 R mlodkhlonanathumby Aetfes Ceai Ing In IO0 mm rexc Ikn tutr. In anather nesc titn tube . dhcohe I7 mcu )chbmpenntnzok scid ( 167 mx o 507# Iaterial}
Epoxidation 0f cholesterol UN TIIS EAPERIMLNT Sicrold aIkcnc convcritu cpoiide wlth metn chloroperbenzoic Jcid (NCTH) dichlorumcthanc: Thc NicTB Dio duocd Acu cJ by whai Jinounts pimplc rapid (iltrauon Intoush ilial 'Kcl Eaporatlon the tolvent glves the cpotide which tecrsui: Jized Ivom mistute...
##### A particular radioactive isotope decays from 190 milligrams (mg) to 152 mg in 15 days. Find...
A particular radioactive isotope decays from 190 milligrams (mg) to 152 mg in 15 days. Find the half life of the isotope. Hint: Find the rate first. The half life of the isotope is the half value of 190 mg then solve for x. Your answer is   days....
##### Staterent &f Csh Pov436 CHAPTER(CAse 10-[0 CONTINUED) oper-cd bakery- cafe locations in 40 states, the District company owned and franchise- Cnada 10-K Columbia, and Ont-fIo Solrce: Pareri Bread 2010 10-K Starbucks 27, 2009 (Fiscal Fcar 2010 included 53 wecks; while 2010; September fiscal October Terr ended 2009 included 52 weeks) retilcr = of specialty coffee in the world, the premier roaster operating ~Starbucks more than 50 countrict- 10-K Sultree- Starbucks Corporation 2010 10-K these co
Staterent &f Csh Pov 436 CHAPTER (CAse 10-[0 CONTINUED) oper-cd bakery- cafe locations in 40 states, the District company owned and franchise- Cnada 10-K Columbia, and Ont-fIo Solrce: Pareri Bread 2010 10-K Starbucks 27, 2009 (Fiscal Fcar 2010 included 53 wecks; while 2010; September fiscal Octo...
##### 22. Which of the following is NOT a segment of the financial management System? CH2 (4...
22. Which of the following is NOT a segment of the financial management System? CH2 (4 Points) A. Original records B. Information system C. Accounting System D. Payroll System 23. Place an X under the category for each of the cost centers. CH 6 (10) Direct Indirect Cost Cost Managed Care Marketing E...
##### 1&course_id=_24730_1&content_id = 225734118 Question Completion Status: O Values statement QUESTION 2 Effective performance teams make decisions...
1&course_id=_24730_1&content_id = 225734118 Question Completion Status: O Values statement QUESTION 2 Effective performance teams make decisions as groups, often by consensus, acknowledging the perspectives of all participants. Discuss the challenges that often occur when clinicians, manager...
##### Decision Variable- Xajk)min 2 =EEZclj kXlij k) [=1to 5,j=1to 7,k=1to 11EExfj, kLik) 2 Duj) i=1 to 5, k=1 to 11 EExtj; xli) < St) j=1 to 7,k=1 to 11 ExfjkL(k) < Utk) j=1 to 7vi,kXajky= 0Vi,J,kFor the given algebraic model above answer the questions:How many constraints are there?How many variables are there?
Decision Variable- Xajk) min 2 =EEZclj kXlij k) [=1to 5,j=1to 7,k=1to 11 EExfj, kLik) 2 Duj) i=1 to 5, k=1 to 11 EExtj; xli) < St) j=1 to 7,k=1 to 11 ExfjkL(k) < Utk) j=1 to 7 vi,k Xajky= 0 Vi,J,k For the given algebraic model above answer the questions: How many constraints are there? How man...
##### Euaiunte thr tolera% 5ek:T T Tt F0ljru" X0 0 & 7c Ã¢â€šÂ¬?
Euaiunte thr tolera% 5ek: T T Tt F0ljru" X0 0 & 7c Ã¢â€šÂ¬?...
##### Let I = Jo ((x) Ox, where f Is the function "hose graph shown belou Answer the followingvalue of _ list the numbers Lni Rn' Mnt increasing order (from smallest largest) Use the Function menu how' you arrived vour answer based on the shape the curve (Vou not need actually calculate any approxlmations)CalcPad or the subscripts:vour submitted work, explain
Let I = Jo ((x) Ox, where f Is the function "hose graph shown belou Answer the following value of _ list the numbers Lni Rn' Mnt increasing order (from smallest largest) Use the Function menu how' you arrived vour answer based on the shape the curve (Vou not need actually calculate a...
##### You spot 20 meteors within an hour. What kind of object is their likely source?
You spot 20 meteors within an hour. What kind of object is their likely source?...
##### Wrice out che cerms of the summation then acd:P; ' (0.1) (0.8) 4- ru5-4 x! r=u (Allocate space , one for each use Eerm iormula and CALC key Eo find each cerm, cnen add Check answer using sEift-log boxes key.(Allocate space one for eacn use cerm formula and CALC key find each teri, chen add Check answer uSing shi ft-log boxes key
Wrice out che cerms of the summation then acd: P; ' (0.1) (0.8) 4- ru 5-4 x! r=u (Allocate space , one for each use Eerm iormula and CALC key Eo find each cerm, cnen add Check answer using sEift-log boxes key. (Allocate space one for eacn use cerm formula and CALC key find each teri, chen add C...
##### List the spectra data highlights for 3-methylbutylacetate1-HNMR spectra13-CNMR spectraIR spectraMass spectra
List the spectra data highlights for 3-methylbutyl acetate 1-HNMR spectra 13-CNMR spectra IR spectra Mass spectra...
##### 2. Write the equation for the reaction of oleic acid (use a skeletal structure) and sodium...
2. Write the equation for the reaction of oleic acid (use a skeletal structure) and sodium hydroxide. 3. Identify the acid and base in the reaction above. Identify the conjugate acid and the conjugate base....


text:
# Inapproximability of an optimization problem

Suppose we have an optimization problem $$\mathcal{P}$$ that we should cover all points with $$k$$ disjoint rectangles in the plane and we should optimize a distance function over each rectangles . Now, suppose there is a $$\mathcal{P}'$$ that just need cover all points in the plane with $$k$$ disjoint rectangles.

Already proved that $$\mathcal{P}'$$ is NP-Hard and there is no constant factor approximation algorithm for $$\mathcal{P}'$$. Can we conclude that $$\mathcal{P}$$ has no constant factor approximation algorithm? Why?

I think as follow:

$$\mathcal{P}$$ is at least hard as $$\mathcal{P}'$$ so if there is a constant factor approximation algorithm for $$\mathcal{P}$$ then for each feasible solution $$\mathcal{I}$$ of $$\mathcal{P}$$, then $$\mathcal{I}$$ is a solution for decision version of $$\mathcal{P}'$$ hence we solve decision version of $$\mathcal{P}'$$ in polynomial time and hence $$P=NP$$. Finally, we conclude that $$\mathcal{P}$$ has no constant factor approximation algorithm.

Here is a similar example. Let $$\mathcal{Q}$$ be the problem of maximizing the number of satisfied clauses in an input CNF given that the assignment is the FALSE assignment. Let $$\mathcal{Q'}$$ be the problem of maximizing the number of satisfied clauses in an input CNF, without any other constraints. It is known that $$\mathcal{Q'}$$ has no PTAS (unless P=NP). Does it follow that $$\mathcal{Q}$$ has no PTAS?
• I think the answer is yes, because $\mathcal{Q}$ at least hard as $\mathcal{Q}'$ so we have no PTAS for $\mathcal{Q}$ (unless P=NP). Can we say my argument is true?
• The problem $\mathcal Q$ is actually quite easy. Mar 26 at 9:09


text:
mersenneforum.org > Data Missed small factors
 Register FAQ Search Today's Posts Mark Forums Read

2003-11-18, 06:22   #1
dswanson

Aug 2002

3108 Posts
Missed small factors

k5gj, GP2, and I have been having a PM exchange about factors that were missed during trial factoring. This exchange was prompted by a message GP2 received from k5gj, who has been running P-1 on exponents that have long since been verified composite by LL testing:

Quote:
 k5gj wrote: GP2, I do not know if you are interested in anomalies, however, the following 16 digit factor is a great example of why we should run P-1 tests. [Sat Nov 15 16:25:13 2003] P-1 found a factor in stage #2, B1=262144, B2=26214400. UID: k5gj/4, M268813 has a factor: 1017111715779881 Here are three more 17 digit factors that I found last month. [Thu Oct 09 02:02:53 2003] P-1 found a factor in stage #2, B1=2048, B2=204800. UID: k5gj/1, M2441083 has a factor: 75649430225324231 [Thu Oct 09 15:58:17 2003] P-1 found a factor in stage #1, B1=2048. UID: k5gj/1, M2448961 has a factor: 95075864569432231 [Tue Oct 28 05:04:50 2003] P-1 found a factor in stage #2, B1=2048, B2=204800. UID: k5gj/1, M2623141 has a factor: 23522191782267041
All four of these factors should have been found during trial-factoring. The bit depth of these for factors is
Code:
                      Bit     Report TF
Exponent         Depth      Depth
1017111715779881    49.85        57
75649430225324231    56.07        59
95075864569432231    56.40        59
23522191782267041    54.38        59
where the final column is the depth to which the nofactor.txt file stated that the exponent had been trial-factored. Hence, as both k5gj and GP2 pointed out, these "easy" factors were apparently missed during trial factoring, resulting in two unnecessary LL tests each (first test plus doublecheck).

I got pulled into this exchange because GP2 had recently run across a two-year old posting of mine in a mailing list archive:
Quote:
 dswanson wrote: You either have an extremely good memory, or you've been rereading old postings from the mailing list recently. Yes, about two years ago I found a range in which a bunch of factors seemed to have been missed. I found the first number in this range the same way - a P-1 result with an anomalously low bit depth. There was a discussion of this in Digest issues 887 through 890. If a thread gets started, it would probably be worth pasting the relevant items from those Digests into the thread. If I recall correctly, I determined that the full range of incompletely factored exponents was 7019000 - 7055000. I subsequently factored a fraction of this range to 2^58, but didn't devote the resources to factor it any deeper. At the time the leading edge of doublechecks was within this range. To avoid poaching and unncessary work, I factored all exponents that were not yet assigned, plus any exponents that expired. I did not touch any exponents that were in progress, nor any that had already completed the second test. Unless someone else subsequently factored this range, I am sure there are still missing factors between 2^56 and 2^64 [sic - final number should be 2^62].
For those with access to the mailing list digests, the discussion was in digest #887 - #890. For those without, I am posting the exchange below. There are a lot of interesting points made, most of which are still quite relevant.

 2003-11-18, 06:23 #2 dswanson     Aug 2002 C816 Posts Date: Sun, 30 Sep 2001 15:26:51 -0700 From: "Daniel Swanson" Subject: Mersenne: Factoring failure? Yesterday I was assigned M7027303 to doublecheck. The number came with the claim that it had no factors less than 62 bits. But my P-1 factorization of the number found this 55-bit factor: [Sun Sep 30 13:53:26 2001] P-1 found a factor in stage #1, B1=35000, B2=463750. UID: dswanson/nosnawsd, M7027303 has a factor: 31090234297428433 I thought this was mighty peculiar, so I stuck "Factor=7027303,0,0" into my worktodo file to force a complete refactorization of the number. Sure enough, about three minutes later out pops the result: [Sun Sep 30 15:06:10 2001] UID: dswanson/nosnawsd, M7027303 has a factor: 31090234297428433 Somebody wasted a lot of time doing a first-time LL test on this number. Does anybody have any idea how common factoring errors might be in the "exponents not factored" database, particularly since doublechecks are not commonly done on the factoring results? Dan
 2003-11-18, 06:24 #3 dswanson     Aug 2002 110010002 Posts Date: Sun, 30 Sep 2001 16:07:34 -0700 From: "Daniel Swanson" Subject: Mersenne: Re: Factoring Failure? A follow-on to my previous message: I went through the Cleared Exponents report looking for other examples of factors found during double-checks that should have been found during the initial factorization. I found the following 7 examples, including the one I just reported: 5977297 53 DF 6726544627832489 26-Aug-01 12:03 TempleU-DI C031EBA9B 6019603 57 DF 137024179940485697 18-Aug-01 18:55 TempleU-DI C031EBA9B 7019297 57 DF 160100125459121849 27-Sep-01 22:52 TempleU-DI TD01489_Cub1 7020641 58 DF 226230108157229263 30-Sep-01 02:05 RayPelzer Homebase 7025987 56 DF 74052063365823791 30-Sep-01 01:12 shaneamy P600A 7027303 55 DF 31090234297428433 30-Sep-01 20:58 dswanson nosnawsd 10159613 56 DF 68279769831982367 19-May-01 10:13 hornup lbe_pc Seems to be a big clump in the 701xxxx - 702xxxx range. Given that this is at the leading edge of numbers currently being assigned for double-checks, I'd be willing to bet several more will turn up in the next few days. Were numbers in this range all originally factored by the same user or computer? Another interesting note: Given the number of different computers working double-checks, what are the odds that TempleU-DI/C031EBA9B would pick up TWO of these?!? Dan
 2003-11-18, 06:25 #4 dswanson     Aug 2002 110010002 Posts Date: Mon, 01 Oct 2001 15:01:05 -0400 From: George Woltman Subject: Re: Mersenne: Re: Factoring Failure? Hi, At 04:07 PM 9/30/2001 -0700, Daniel Swanson wrote: >I went through the Cleared Exponents >report looking for other examples of factors found during double-checks that >should have been found during the initial factorization. > 5977297 53 DF 6726544627832489 > 6019603 57 DF 137024179940485697 > 7019297 57 DF 160100125459121849 > 7020641 58 DF 226230108157229263 > 7025987 56 DF 74052063365823791 > 7027303 55 DF 31090234297428433 >10159613 56 DF 68279769831982367 >Were numbers in this range all originally factored by the same user or >computer? My logfiles from that long ago have been zipped and stored on CDROM. It is possible that 7,010,000 - 7,030,000 were all factored by one person. It was not uncommon for me to hand out large blocks for factoring to users without Internet connections. While I no longer do this, there are a handful of users pre-factoring the 20,000,000 - 80,000,000 area. I hope their machines are reliable!! They probably are as they are finding the expected number of factors. Anyway, it doesn't appear to be a program bug as you were able to find the factor with trial factoring. I'm guessing either bad hardware or an older prime95 version had a bug. Either way, GIMPS has never considered missing a factor as a big deal. It only means some wasted effort running a LL test that could have been avoided. Thanks for the interesting findings! Regards, George
 2003-11-18, 06:26 #5 dswanson     Aug 2002 23×52 Posts Date: Mon, 1 Oct 2001 22:23:38 +0200 From: "Jean-Yves Canart" Subject: FW: Mersenne: Re: Factoring Failure? Hello all, I have browsed some logs I archived long time ago and I have found this: In may 1998, one user, "tomfakes", cleared around 80 exponents with factor found = "1" It was in the range 7013000-7055000. Regards, Jean-Yves
 2003-11-18, 06:26 #6 dswanson     Aug 2002 C816 Posts Date: Tue, 2 Oct 2001 19:52:42 -0000 From: bjb Subject: Re: FW: Mersenne: Re: Factoring Failure? On 1 Oct 2001, at 22:23, Jean-Yves Canart wrote: > I have browsed some logs I archived long time ago and I have found > this: > > In may 1998, one user, "tomfakes", cleared around 80 exponents with > factor found = "1" It was in the range 7013000-7055000. Well, (s)he's not lying - 0 = n (mod 1) is a property of integers ;-) In any event: (a) this is the _opposite_ of the reported problem - what seems to have happened is that "no factor found" was being reported, sometimes erroneously; (b) this won't get through now PrimeNet validates submitted factors; the code I wrote for this purpose rejects as garbage any single-digit factor, after stripping off any leading zeroes as well as white space. (Obviously a Mersenne number with a prime exponent p > 5 cannot have any factors less than 10, and we know pretty much all there is to know about exponents up to and including 5, so excluding these is not a practical problem). > > At 04:07 PM 9/30/2001 -0700, Daniel Swanson wrote: > > >I went through the Cleared Exponents > > >report looking for other examples of factors found during > > double-checks that > > >should have been found during the initial factorization. > > > 5977297 53 DF 6726544627832489 > > > 6019603 57 DF 137024179940485697 > > > 7019297 57 DF 160100125459121849 > > > 7020641 58 DF 226230108157229263 > > > 7025987 56 DF 74052063365823791 > > > 7027303 55 DF 31090234297428433 > > >10159613 56 DF 68279769831982367 > > >Were numbers in this range all originally factored by the same user > > >or computer? > > > > My logfiles from that long ago have been zipped and stored on CDROM. > > It is possible that 7,010,000 - 7,030,000 were all factored by one > > person. It was not uncommon for me to hand out large blocks for > > factoring to users without Internet connections. While I no longer > > do this, there are a handful of users pre-factoring the 20,000,000 - > > 80,000,000 area. I hope their machines are reliable!! They > > probably are as they are finding the expected number of factors. The primes from that block of 20,000 numbers represents quite a bit of work and maps poorly onto the "missed" factors reported. A few mistakes are inevitable but, since testing a factor takes of the order of a microsecond on current systems, hardware glitches shouldn't be much of a risk. (? Unless they get into the code stream used to generate potential factors?) Reports of two "missed" factors of exponents within spitting distance of 6,000,000 and no less than four just over 7,000,000 looks high for random glitches to be responsible, even on really ropy hardware. Remember that P-1 (which found the factors missed by trial factoring) can only find a small proportion of the "small" factors, especially when it's being run with "double checking" limits. > > > > Anyway, it doesn't appear to be a program bug as you were able to > > find the factor with trial factoring. I'm guessing either bad > > hardware or an older prime95 version had a bug. If it _was_ Prime95. There are other factoring programs out there; maybe there was a higher incidence of use about 3.5 years ago when these exponents would have been the subject of factoring assignments. > > Either way, GIMPS > > has never considered missing a factor as a big deal. It only means > > some wasted effort running a LL test that could have been avoided. True enough - though I'm concerned that the "no factors below 2^N" database may be seriously flawed, from the point of view of GIMPS it would seem to be a waste of time to go round redoing trial factoring just to fix this problem. However if it could be established that all the "missed" factors reported were the work of one user, perhaps it would be worth fixing the database to force rerunning of trial factoring for those factoring assignments run by that user when the exponents are reassigned for double checking (or LL testing). Regards Brian Beesley
 2003-11-18, 06:27 #7 dswanson     Aug 2002 23×52 Posts Date: Tue, 2 Oct 2001 23:09:31 -0500 From: "Steve Harris" Subject: Re: FW: Mersenne: Re: Factoring Failure? > > Either way, GIMPS > > has never considered missing a factor as a big deal. It only means > > some wasted effort running a LL test that could have been avoided. >True enough - though I'm concerned that the "no factors below 2^N" >database may be seriously flawed, from the point of view of GIMPS >it would seem to be a waste of time to go round redoing trial >factoring just to fix this problem. Yes, from the point of view of GIMPS (that is, searching for Mersenne primes) it's not a huge deal... but there also exists an effort to fully factor the candidates that are not prime, and this throws a big problem into that project. Someone could be trial factoring an exponent from 2^59 to 2^65 and find a factor in that range after a smaller factor had been missed, and it will go into the database as the smallest factor when it actually is not. Might be decades before the smaller factor is discovered. Oh well, Steve
 2003-11-18, 06:28 #8 dswanson     Aug 2002 110010002 Posts Date: Wed, 3 Oct 2001 02:30:10 -0400 From: "Carleton Garrison" Subject: Re: FW: Mersenne: Re: Factoring Failure? > At 04:07 PM 9/30/2001 -0700, Daniel Swanson wrote: > >I went through the Cleared Exponents > >report looking for other examples of factors found during > double-checks that > >should have been found during the initial factorization. > > 5977297 53 DF 6726544627832489 > > 6019603 57 DF 137024179940485697 > > 7019297 57 DF 160100125459121849 > > 7020641 58 DF 226230108157229263 > > 7025987 56 DF 74052063365823791 > > 7027303 55 DF 31090234297428433 > >10159613 56 DF 68279769831982367 > >Were numbers in this range all originally factored by the same user > >or computer? > Either way, GIMPS > has never considered missing a factor as a big deal. It only means > some wasted effort running a LL test that could have been avoided. I wonder if by using configuration settings, people are able to skip as many, if not all, factoring stages? I believe the idea of trying to skip P-1 factoring was talked about within the last 3 or 4 months. Apparently there are people who would just prefer to get credit for doing LL work than to find factors. Until factoring time (while one is LL testing) is at credited at the same same rate as LL testing, let alone getting credited not at all (most of the time no factors are found), results like the above could become common place.
 2003-11-18, 06:28 #9 dswanson     Aug 2002 23×52 Posts Date: Wed, 3 Oct 2001 02:41:27 -0500 (CDT) From: ribwoods Subject: Mersenne: Re: Factoring Failure? Daniel Swanson wrote: > 5977297 53 DF 6726544627832489 > 6019603 57 DF 137024179940485697 > 7019297 57 DF 160100125459121849 > 7020641 58 DF 226230108157229263 > 7025987 56 DF 74052063365823791 > 7027303 55 DF 31090234297428433 >10159613 56 DF 68279769831982367 I'm pretty sure the second column is the previous trial-factoring limit, in units of power-of-2. For M7019297, the found factor 160100125459121849 is larger than 2^57 (= 144115188075855872), and for M7025987, factor 74052063365823791 is greater than 2^56 (= 72057594037927936). Unless I'm misinterpreting something, those two cases don't indicate a trial-factoring failure. [dswanson comment on this posting: ribwoods is correct about the bit depth of the found factor. For example, the bit depth of 160100125459121849 is 57.15, which rounds down to the "57" listed. But ribwoods missed the point, which is that nofactor.txt had claimed that this exponent had no factor below 2^62. So it is indeed a trial-factoring failure.]
 2003-11-18, 06:29 #10 dswanson     Aug 2002 23×52 Posts Date: Wed, 3 Oct 2001 12:40:29 -0400 From: "Carleton Garrison" Subject: Re: FW: Mersenne: Re: Factoring Failure? > > I believe the idea of trying to skip P-1 factoring was talked about within > > the last 3 or 4 months. Apparently there are people who would just prefer > > to get credit for doing LL work than to find factors. > > This is why I like that you loose credit for a LL-test if someone else > finds a factor later, or if two other independant checks prove your > result to be wrong. Me too. I understand that George's top producer page does this, while the PrimeNet stat page does not. PrimeNet really needs this capability. Carleton Garrison LL#163 F#295 G#253 www.teamprimerib.com
 2003-11-18, 06:30 #11 dswanson     Aug 2002 23·52 Posts Date: Wed, 03 Oct 2001 18:29:52 -0700 From: Gerry Snyder Subject: Re: FW: Mersenne: Re: Factoring Failure? Carleton Garrison wrote: > > [? wrote:] > > > > This is why I like that you lose credit for a LL-test if someone else > > finds a factor later, or if two other independant checks prove your > > result to be wrong. > > Me too. I understand that George's top producer page does this, while the > PrimeNet stat page does not. PrimeNet really needs this capability. To me, there is no question that an LL test that is shown to be wrong should not count for anything. The number still required two more LL tests, so that it as if the erroneous one had not been done. But, at least in theory, every Mersenne number proven non-prime will eventually be factored. Again, to me, so what? At least the LL test showed that further factoring activity would eventually succeed. I have nothing against George doing things that way. (When I play ball with him, I play by his rules or I don't play at all. You know why? Because it's his ball, that's why.) Seriously, I can see some point to doing things that way, but I would do probably do it differently. But even more seriously, I'm just glad to be in the game, and I am grateful to George and all the others who have made it easy and fun to participate. Gerry PS I just got a chuckle from imagining a very competitive team tearing down an opponent by finding what numbers the opponent had done LL tests on, and factoring them.

 Similar Threads Thread Thread Starter Forum Replies Last Post lycorn Data 76 2015-04-23 06:07 TheMawn Information & Answers 7 2014-01-10 10:23 patrickkonsor GMP-ECM 16 2010-09-28 20:19 petrw1 Lone Mersenne Hunters 17 2009-11-20 03:40 Kees PrimeNet 6 2006-11-16 00:12

All times are UTC. The time now is 20:04.

Mon May 10 20:04:45 UTC 2021 up 32 days, 14:45, 1 user, load averages: 3.20, 3.56, 3.47


text:
### Session H5: Drowning in Carbon: The Imperative of Nuclear Power

8:00 AM–11:00 AM, Tuesday, March 22, 2011
Room: Ballroom C1

Chair: Steve Libby, Lawrence Livermore National Laboratory

Abstract ID: BAPS.2011.MAR.H5.3

### Abstract: H5.00003 : Used Nuclear Fuel: From Liability to Benefit

9:12 AM–9:48 AM

MathJax On | Off     Abstract

#### Author:

Raymond L. Orbach
(The University of Texas at Austin)

Nuclear power has proven safe and reliable, with operating efficiencies in the U.S. exceeding 90{\%}. It provides a carbon-free source of electricity (with about a 10{\%} penalty arising from CO$_{2}$ released from construction and the fuel cycle). However, used fuel from nuclear reactors is highly toxic and presents a challenge for permanent disposal -- both from technical and policy perspectives. The half-life of the bad actors'' is relatively short (of the order of decades) while the very long lived isotopes are relatively benign. At present, spent fuel is stored on-site in cooling ponds. Once the used fuel pools are full, the fuel is moved to dry cask storage on-site. Though the local storage is capable of handling used fuel safely and securely for many decades, the law requires DOE to assume responsibility for the used fuel and remove it from reactor sites. The nuclear industry pays a tithe to support sequestration of used fuel (but not research). However, there is currently no national policy in place to deal with the permanent disposal of nuclear fuel. This administration is opposed to underground storage at Yucca Mountain. There is no national policy for interim storage---removal of spent fuel from reactor sites and storage at a central location. And there is no national policy for liberating the energy contained in used fuel through recycling (separating out the fissionable components for subsequent use as nuclear fuel). A Blue Ribbon Commission'' has been formed to consider alternatives, but will not report until 2012. This paper will examine alternatives for used fuel disposition, their drawbacks (e.g. proliferation issues arising from recycling), and their benefits. For recycle options to emerge as a viable technology, research is required to develop cost effective methods for treating used nuclear fuel, with attention to policy as well as technical issues.

To cite this abstract, use the following reference: http://meetings.aps.org/link/BAPS.2011.MAR.H5.3


text:
# Roots of a canonical line bundle on a compact Riemann surface

Suppose we have a compact Riemann surface $X$ of genus $g$. Let $K$ denote the canonical line bundle on $X$, it's well known that $deg\ K=2g-2$. A square root of $K$ by definition is a holomorphic line $L$ bundle that satisfies $L\otimes L=K$. Then are $2^{2g}$ different square roots, e.g. see this link .

Now suppose $m$ is an integer such that $m$ divides $deg\ K=2g-2$. Let's call a holomorphic line bundle $L$ for which $L^{\otimes m}=K$, an $m$-root of $K$. Is true in general that they are $m^{2g}$ different holomorphic $m$-roots?

• Yes, the number of different n-roots are just the number of n-torsion points of its albanese variety. Feb 25, 2017 at 3:36
• @ChenJiang Could you give some references, please? Feb 26, 2017 at 5:25


text:
# Tuning Parameters of Locality Sensitive Hashing

We have given a set of $n$ binary vectors each of dimension $d$, i.e. a binary matrix of $d*n$. Our goal is to group vectors which are almost similar, $\forall v_i, v_j\in\{0,1\}^d$, we say $v_i$ and $v_j$ are almost similar, if $HammingDistance(v_i,v_j)<\epsilon$. Since comparing two $d$ bit vectors are expensive, and $n$ is large, we can't afford to do $O(n^2)$ comparisons, we use Locality Sensitive Hashing algorithm to computer similarity preserving matrix in subquadratic time.

Now, my question is that how to tune parameters of LSH, i.e. # of hash tables $m$, # of entries per hash table $l$, such that error is minimizes (the number of similar items which hashes to different bucket, and the number of dissimilar items which hashes to same bucket is minimizes).

Pls let me know if I am missing something obvious.

• I went quite elaborately through the details of how to fine tune these parameters in Chapter 20 of my book (Geometric approximation algorithms). Unfortunately, the version available online is not updated, so you would have to get your hands on a hard copy (the online version is significantly less polished for this specific chapter). – Sariel Har-Peled Sep 18 '14 at 1:28


text:
### Simple Game

Time Limit: 1000 ms Memory Limit: 65536 KiB

#### Problem Description

Here is a simple game. In this game, there are several piles of stones and two players. The two players play in turn. In each turn, one can choose at least one pile and at most three piles to take away arbitrary number of stones from the pile (Of course the number of stones, which is taken away, cannot be zero and cannot be larger than the number of stones in the chosen pile). If after a player ′ s turn, there is no stone left, the player is the loser.

Suppose that the two players are all very smart. Your job is to tell whether the player who plays first can win the game or not.

#### Input

The input has multiple test cases. The first line of the input contains one integer C, which is the number of test cases. Each test case begins with a line contains one integer N(1 <= N <=10000),which is the number of piles. Then comes N positive integers, which are not larger than 10000000. These N integers represent the number of stones in each pile.

#### Output

For each test case, output "Yes" in a single line, if the player who play first will win, otherwise output "No".

#### Sample Input

2
2
1
1
4
2
2
2
2

#### Sample Output

Yes
No


text:
Question 13

In how many ways can the letters of the word PERSON be placed in the squares of the adjoining figure so that no row remains empty

a) 18700

b) 18720

c) 8!

d) 6!


text:
## Algebra: A Combined Approach (4th Edition)

$\frac{8b}{8b}=8b\div8b=1$ Recall that a number divided by itself is equal to 1.


text:
Lebesgue's number lemma

In topology, Lebesgue's number lemma, named after Henri Lebesgue, is a useful tool in the study of compact metric spaces. It states:

If the metric space ${\displaystyle (X,d)}$ is compact and an open cover of ${\displaystyle X}$ is given, then there exists a number ${\displaystyle \delta >0}$ such that every subset of ${\displaystyle X}$ having diameter less than ${\displaystyle \delta }$ is contained in some member of the cover.

Such a number ${\displaystyle \delta }$ is called a Lebesgue number of this cover. The notion of a Lebesgue number itself is useful in other applications as well.

Proof

Let ${\displaystyle {\mathcal {U}}}$ be an open cover of ${\displaystyle X}$. Since ${\displaystyle X}$ is compact we can extract a finite subcover ${\displaystyle \{A_{1},\dots ,A_{n}\}\subseteq {\mathcal {U}}}$. If any one of the ${\displaystyle A_{i}}$'s equals ${\displaystyle X}$ then any ${\displaystyle \delta >0}$ will serve as a Lebesgue number. Otherwise for each ${\displaystyle i\in \{1,\dots ,n\}}$, let ${\displaystyle C_{i}:=X\setminus A_{i}}$, note that ${\displaystyle C_{i}}$ is not empty, and define a function ${\displaystyle f:X\rightarrow \mathbb {R} }$ by ${\displaystyle f(x):={\frac {1}{n}}\sum _{i=1}^{n}d(x,C_{i})}$.

Since ${\displaystyle f}$ is continuous on a compact set, it attains a minimum ${\displaystyle \delta }$. The key observation is that, since every ${\displaystyle x}$is not contained in some ${\displaystyle A_{i}}$, the extreme value theorem shows ${\displaystyle \delta >0}$. Now we can verify that this ${\displaystyle \delta }$ is the desired Lebesgue number. If ${\displaystyle Y}$ is a subset of ${\displaystyle X}$ of diameter less than ${\displaystyle \delta }$, then there exists ${\displaystyle x_{0}\in X}$ such that ${\displaystyle Y\subseteq B_{\delta }(x_{0})}$, where ${\displaystyle B_{\delta }(x_{0})}$ denotes the ball of radius ${\displaystyle \delta }$ centered at ${\displaystyle x_{0}}$ (namely, one can choose as ${\displaystyle x_{0}}$ any point in ${\displaystyle Y}$). Since ${\displaystyle f(x_{0})\geq \delta }$ there must exist at least one ${\displaystyle i}$ such that ${\displaystyle d(x_{0},C_{i})\geq \delta }$. But this means that ${\displaystyle B_{\delta }(x_{0})\subseteq A_{i}}$ and so, in particular, ${\displaystyle Y\subseteq A_{i}}$.

References

Munkres, James R. (1974), Topology: A first course, p. 179, ISBN 978-0-13-925495-6


text:
# The hydrated salt Na2SO4. x H2O undergoes 55% loss in weight on heating and becomes anhydrous. The value of x will be

Q: The hydrated salt Na2SO4. x H2O undergoes 55% loss in weight on heating and becomes anhydrous. The value of x will be

(A) 5

(B) 3

(C) 7

(D) 10

Sol:  Percent loss of H2O in one mole of Na2SO4. x H2O

$\large = \frac{18 x \times 100}{140 + 18x} = 55$

x = 10

Ans: (D)


text:
# Laplace transform

Let $f(t)$ be a function defined on the interval  $[0,\,\infty)$. The Laplace transform of $f(t)$ is the function $F(s)$ defined by

 $F(s)\,=\,\int_{0}^{\infty}e^{-st}f(t)\,dt,$

provided that the integral converges. 11Depending on the definition of integral one is using, one may prefer to define the Laplace transform as $\lim_{x\to 0+}\int_{x}^{\infty}e^{-st}f(t)\,dt$ It suffices that $f$ be defined when $t>0$ and $s$ can be complex. We will usually denote the Laplace transform of $f$ by $\mathcal{L}\{f\}$. Some of the most common Laplace transforms are:

1. 1.

$\displaystyle\mathcal{L}\{e^{at}\}\,=\,\frac{1}{s-a},\;\;s>a$

2. 2.

$\displaystyle\mathcal{L}\{\cos(bt)\}\,=\,\frac{s}{s^{2}+b^{2}},\;\;s>0$

3. 3.

$\displaystyle\mathcal{L}\{\sin(bt)\}\,=\,\frac{b}{s^{2}+b^{2}},\;\;s>0$

4. 4.

$\displaystyle\mathcal{L}\{t^{n}\}\,=\,\frac{\Gamma(n+1)}{s^{n+1}},\;\;s>0,\;n>% -1.$

5. 5.

$\displaystyle\mathcal{L}\{f^{\prime}\}\,=\,s\mathcal{L}\{f\}-\lim_{x\to 0+}f(x)$

For more particular Laplace transforms, see the table of Laplace transforms.

Notice the Laplace transform is a linear transformation. It is worth noting that, if

 $\int_{0}^{\infty}e^{-st}|f(t)|\,dt<\infty$

for some  $s\in\mathbb{R}$, then $\mathcal{L}\{f\}$ is an analytic function in the complex half-plane $\{z\mid\;\Re z>s\}$.

Much like the Fourier transform, the Laplace transform has a convolution. However, the form of the convolution used is different.

 $\mathcal{L}\{f*g\}=\mathcal{L}\{f\}\mathcal{L}\{g\}$

where

 $(f*g)(t)=\int_{0}^{t}f(t-s)g(s)\,ds$

and

 $\mathcal{L}\{fg\}(s)=\int_{c-i\infty}^{c+i\infty}\mathcal{L}\{f\}(z)\mathcal{L% }\{g\}(s-z)\,dz$

The most popular usage of the Laplace transform is to solve initial value problems by taking the Laplace transform of both sides of an ordinary differential equation; see the entry “image equation (http://planetmath.org/ImageEquation)”.

Title Laplace transform LaplaceTransform 2014-03-10 10:50:28 2014-03-10 10:50:28 rspuzio (6075) pahio (2872) 26 rspuzio (2872) Definition msc 44A10 DiscreteFourierTransform UsingLaplaceTransformToInitialValueProblems UsingLaplaceTransformToSolveHeatEquation