url stringlengths 14 2.42k | text stringlengths 100 1.02M | date stringlengths 19 19 | metadata stringlengths 1.06k 1.1k |
|---|---|---|---|
http://math.stackexchange.com/questions/142414/ray-parallelogram-intersection-in-2d | # ray - parallelogram intersection in 2d
i'm looking for a fast method to get the intersecting points between a ray and a parallelgram defined by the 4 vertices!
till now i've thought to test the intersection point between ray and the 4 edge, but mayebe there are computationally faster OR mathematically more elegant way to do it.
mayebe check ray-triangles intersection with the 4 triangles that forms the parallelogram?
EDIT: as copper.hat point me out the intersection points could be 0, 1 or 2. or the entire edge if the ray is coincident with an edge
-
The intersection can be $0,1,2$ points or an entire edge. – copper.hat May 7 '12 at 23:25
yeah, thanks for point me out, the question is modified – nkint May 8 '12 at 8:10
Assume that the ray starts at the origin $o$ and has direction $u\ne0$, and let $a_0$, $a_1$, $a_2$, $a_3$ be the four vertices. The line through $o$ in direction $u$ intersects the line $a_0\vee a_1$ in a point satisfying $$t u= a_0+s (a_1-a_0)$$ with real $s$ and $t$. It follows that $$0=u\wedge a_0 +s u\wedge (a_1-a_0)\ ,\qquad t u\wedge(a_1-a_0)=a_0\wedge(a_1-a_0)\ ,$$ which gives $$s=-{u\wedge a_0\over u\wedge(a_1-a_0)}\ ,\qquad t={a_0\wedge a_1\over u\wedge(a_1-a_0)}\ .$$ The ray intersects the parallelogram side $[a_0,a_1]$ iff $t\geq0$ and $0\leq s\leq1$. Leaving the special case that the ray passes through one of the endpoints apart, the latter condition is easily seen to be equivalent with ${\rm sgn}(u\wedge a_0)=-{\rm sgn}(u\wedge a_1)$ (as is geometrically evident).
These preparations suggest the following procedure: Compute the eight quantities $$p_k:= a_{k-1}\wedge a_k\ ,\quad q_k:=u\wedge a_k\qquad(1\leq k\leq 4(=0))\ .$$ Assume for simplicity that all $q_k\ne0$. If there is a sign change between $q_{k-1}$ and $q_k$ check whether $$t_k:={p_k\over q_k-q_{k-1}}\geq0\ .$$ In this case the ray hits the side $[a_{k-1},a_k]$ of theparallelogram at the point $t_k u$.
-
Classify the four vertices with respect to the line containing the ray by computing the sign of the (degree-one) expression defining the line. If all four vertices have the same sign, then the line does not cross the parallelogram. Othewise, find the two edges where the signs differ and find the intersection points. Make sure you check the intersection points are in the ray. You'll also have to take care of the special cases of the line passing through one vertex or an edge.
-
If I understand you correctly, the sign may differ, but still have no intersection with the ray. For example, the 4 vertices may lie in the half-space 'behind' the ray, yet have vertices on either side of the line. I'm not sure which computations are considered expensive, but it would seem to me that computing which quadrant (wrt to the ray) the vertices lie in, will allow you to determine exactly which pairs of vertices to check for intersection. – copper.hat May 8 '12 at 1:05
@copper.hat, you're right, of course. But the test of whether the intersection point was in the ray was part of finding the intersection point. – lhf May 8 '12 at 1:16
True. I started counting flops but got lost after a while! – copper.hat May 8 '12 at 2:02
sorry, @lhf i didn't understand very well what you mean – nkint May 8 '12 at 8:15
@nkint, I've edited my answer slightly. – lhf May 8 '12 at 10:48 | 2016-05-06 04:11:35 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.765781581401825, "perplexity": 219.1777589495061}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-18/segments/1461861718132.40/warc/CC-MAIN-20160428164158-00096-ip-10-239-7-51.ec2.internal.warc.gz"} |
http://tex.stackexchange.com/questions/2635/why-isnt-prime-automatically-set-to-be-a-superscript | # Why isn't \prime automatically set to be a superscript?
In math mode, writing \prime gives too big a "prime" symbol, and it isn't a superscript, like it always is in textbooks. Why is this?
This isn't a question about how to get \prime to be a superscript, I know that. The questions is about the reasoning behind why it isn't like that by default.
-
Probably not what you're asking either, but ' produces a superscript “prime”. Maybe \prime is just the command that holds the symbol, and it's only intended to use for defining other commands (such as ')? – Juan A. Navarro Sep 1 '10 at 11:07
add comment
## 3 Answers
This is actually one of the exercises in The TeXBook :) (exercise 16.5, p. 130):
Why do you think TeX treats \prime as a large symbol that appears only in superscripts, instead of making it a smaller symbol that has already been shifted up into the superscript position?
And the answer is:
The second alternative doesn’t work properly when there’s a subscript at the same time as a prime. Furthermore, some mathematicians use \prime also in the subscript position; they write, for example, $F'(w,z)=\partial F(w,z)/\partial z$ and $F_\prime(w,z)=\partial F(w,z)/\partial w$.
-
subscripted primes!? I've never seen that. Still, I guess the problem with it not working well if there's a subscript is legitimate... – Seamus Sep 1 '10 at 12:45
Anyway, it seems the most natural choice, given that TeX has no "real" superscripts, just regular font (with proper optical size, if any) scaled down, so treating \prime the same way is natural in the sense that it fits with the rest of the system. – Khaled Hosny Sep 1 '10 at 13:06
I always thought that the \prime macro existed so that one can write expressions such as f^{\prime,n}. After reading your answer I realized that f'^n works fine. – Aditya Oct 1 '11 at 2:15
add comment
If the default is subscript, that would appear to make the regular form inaccessible, essentially removing functionality.
edit: this appears to mesh with a statement on wikipedia which suggests the prime symbol is big so that it can be optionally subscripted.
-
add comment
There are situations where you need the big \prime instead of small ' e.g. $J^{v\prime h}$ looks great, but $J^{v ' h}$ wont serve as good as the previous one.
-
add comment | 2013-12-06 00:11:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8806681632995605, "perplexity": 1356.9364212578794}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-48/segments/1386163048663/warc/CC-MAIN-20131204131728-00061-ip-10-33-133-15.ec2.internal.warc.gz"} |
https://w10schools.com/posts/228914_perlobj---Perl-object-reference | # perlobj - Perl object reference
### NAME
perlobj - Perl object reference
### DESCRIPTION
This document provides a reference for Perl's object orientation features. If you're looking for an introduction to object-oriented programming in Perl, please see perlootut.
In order to understand Perl objects, you first need to understand references in Perl. See perlref for details.
This document describes all of Perl's object-oriented (OO) features from the ground up. If you're just looking to write some object-oriented code of your own, you are probably better served by using one of the object systems from CPAN described in perlootut.
If you're looking to write your own object system, or you need to maintain code which implements objects from scratch then this document will help you understand exactly how Perl does object orientation.
There are a few basic principles which define object oriented Perl:
1.
An object is simply a data structure that knows to which class it belongs.
2.
A class is simply a package. A class provides methods that expect to operate on objects.
3.
A method is simply a subroutine that expects a reference to an object (or a package name, for class methods) as the first argument.
Let's look at each of these principles in depth.
### An Object is Simply a Data Structure
Unlike many other languages which support object orientation, Perl does not provide any special syntax for constructing an object. Objects are merely Perl data structures (hashes, arrays, scalars, filehandles, etc.) that have been explicitly associated with a particular class.
That explicit association is created by the built-in bless function, which is typically used within the constructor subroutine of the class.
Here is a simple constructor:
package File;
sub new {
my $class = shift; return bless {},$class;
}
The name new isn't special. We could name our constructor something else:
package File;
my $class = shift; return bless {},$class;
}
The modern convention for OO modules is to always use new as the name for the constructor, but there is no requirement to do so. Any subroutine that blesses a data structure into a class is a valid constructor in Perl.
In the previous examples, the {} code creates a reference to an empty anonymous hash. The bless function then takes that reference and associates the hash with the class in $class . In the simplest case, the $class variable will end up containing the string "File".
We can also use a variable to store a reference to the data structure that is being blessed as our object:
sub new {
my $class = shift; my$self = {};
bless $self,$class;
return $self; } Once we've blessed the hash referred to by $self we can start calling methods on it. This is useful if you want to put object initialization in its own separate method:
sub new {
my $class = shift; my$self = {};
bless $self,$class;
$self->_initialize(); return$self;
}
Since the object is also a hash, you can treat it as one, using it to store data associated with the object. Typically, code inside the class can treat the hash as an accessible data structure, while code outside the class should always treat the object as opaque. This is called encapsulation. Encapsulation means that the user of an object does not have to know how it is implemented. The user simply calls documented methods on the object.
Note, however, that (unlike most other OO languages) Perl does not ensure or enforce encapsulation in any way. If you want objects to actually be opaque you need to arrange for that yourself. This can be done in a variety of ways, including using Inside-Out objects or modules from CPAN.
#### Objects Are Blessed; Variables Are Not
When we bless something, we are not blessing the variable which contains a reference to that thing, nor are we blessing the reference that the variable stores; we are blessing the thing that the variable refers to (sometimes known as the referent). This is best demonstrated with this code:
use Scalar::Util 'blessed';
my $foo = {}; my$bar = $foo; bless$foo, 'Class';
print blessed( $bar ); # prints "Class"$bar = "some other value";
print blessed( $bar ); # prints undef When we call bless on a variable, we are actually blessing the underlying data structure that the variable refers to. We are not blessing the reference itself, nor the variable that contains that reference. That's why the second call to blessed($bar ) returns false. At that point $bar is no longer storing a reference to an object. You will sometimes see older books or documentation mention "blessing a reference" or describe an object as a "blessed reference", but this is incorrect. It isn't the reference that is blessed as an object; it's the thing the reference refers to (i.e. the referent). ### A Class is Simply a Package Perl does not provide any special syntax for class definitions. A package is simply a namespace containing variables and subroutines. The only difference is that in a class, the subroutines may expect a reference to an object or the name of a class as the first argument. This is purely a matter of convention, so a class may contain both methods and subroutines which don't operate on an object or class. Each package contains a special array called @ISA . The @ISA array contains a list of that class's parent classes, if any. This array is examined when Perl does method resolution, which we will cover later. It is possible to manually set @ISA , and you may see this in older Perl code. Much older code also uses the base pragma. For new code, we recommend that you use the parent pragma to declare your parents. This pragma will take care of setting @ISA . It will also load the parent classes and make sure that the package doesn't inherit from itself. However the parent classes are set, the package's @ISA variable will contain a list of those parents. This is simply a list of scalars, each of which is a string that corresponds to a package name. All classes inherit from the UNIVERSAL class implicitly. The UNIVERSAL class is implemented by the Perl core, and provides several default methods, such as isa() , can() , and VERSION() . The UNIVERSAL class will never appear in a package's @ISA variable. Perl only provides method inheritance as a built-in feature. Attribute inheritance is left up the class to implement. See the Writing Accessors section for details. ### A Method is Simply a Subroutine Perl does not provide any special syntax for defining a method. A method is simply a regular subroutine, and is declared with sub. What makes a method special is that it expects to receive either an object or a class name as its first argument. Perl does provide special syntax for method invocation, the -> operator. We will cover this in more detail later. Most methods you write will expect to operate on objects: sub save { my$self = shift;
open my $fh, '>',$self->path() or die $!; print {$fh} $self->data() or die$!;
close $fh or die$!;
}
### Method Invocation
Calling a method on an object is written as $object->method . The left hand side of the method invocation (or arrow) operator is the object (or class name), and the right hand side is the method name. my$pod = File->new( 'perlobj.pod', $data );$pod->save();
The -> syntax is also used when dereferencing a reference. It looks like the same operator, but these are two different operations.
When you call a method, the thing on the left side of the arrow is passed as the first argument to the method. That means when we call Critter->new() , the new() method receives the string "Critter" as its first argument. When we call $fred->speak() , the $fred variable is passed as the first argument to speak() .
Just as with any Perl subroutine, all of the arguments passed in @_ are aliases to the original argument. This includes the object itself. If you assign directly to $_[0] you will change the contents of the variable that holds the reference to the object. We recommend that you don't do this unless you know exactly what you're doing. Perl knows what package the method is in by looking at the left side of the arrow. If the left hand side is a package name, it looks for the method in that package. If the left hand side is an object, then Perl looks for the method in the package that the object has been blessed into. If the left hand side is neither a package name nor an object, then the method call will cause an error, but see the section on Method Call Variations for more nuances. ### Inheritance We already talked about the special @ISA array and the parent pragma. When a class inherits from another class, any methods defined in the parent class are available to the child class. If you attempt to call a method on an object that isn't defined in its own class, Perl will also look for that method in any parent classes it may have. package File::MP3; use parent 'File'; # sets @File::MP3::ISA = ('File'); my$mp3 = File::MP3->new( 'Andvari.mp3', $data );$mp3->save();
Since we didn't define a save() method in the File::MP3 class, Perl will look at the File::MP3 class's parent classes to find the save() method. If Perl cannot find a save() method anywhere in the inheritance hierarchy, it will die.
In this case, it finds a save() method in the File class. Note that the object passed to save() in this case is still a File::MP3 object, even though the method is found in the File class.
We can override a parent's method in a child class. When we do so, we can still call the parent class's method with the SUPER pseudo-class.
sub save {
my $self = shift; say 'Prepare to rock';$self->SUPER::save();
}
The SUPER modifier can only be used for method calls. You can't use it for regular subroutine calls or class methods:
SUPER::save($thing); # FAIL: looks for save() sub in package SUPER SUPER->save($thing); # FAIL: looks for save() method in class
# SUPER
$thing->SUPER::save(); # Okay: looks for save() method in parent # classes #### How SUPER is Resolved The SUPER pseudo-class is resolved from the package where the call is made. It is not resolved based on the object's class. This is important, because it lets methods at different levels within a deep inheritance hierarchy each correctly call their respective parent methods. package A; sub new { return bless {}, shift; } sub speak { my$self = shift;
say 'A';
}
package B;
use parent -norequire, 'A';
sub speak {
my $self = shift;$self->SUPER::speak();
say 'B';
}
package C;
use parent -norequire, 'B';
sub speak {
my $self = shift;$self->SUPER::speak();
say 'C';
}
my $c = C->new();$c->speak();
In this example, we will get the following output:
A
B
C
This demonstrates how SUPER is resolved. Even though the object is blessed into the C class, the speak() method in the B class can still call SUPER::speak() and expect it to correctly look in the parent class of B (i.e the class the method call is in), not in the parent class of C (i.e. the class the object belongs to).
There are rare cases where this package-based resolution can be a problem. If you copy a subroutine from one package to another, SUPER resolution will be done based on the original package.
#### Multiple Inheritance
Multiple inheritance often indicates a design problem, but Perl always gives you enough rope to hang yourself with if you ask for it.
To declare multiple parents, you simply need to pass multiple class names to use parent :
package MultiChild;
use parent 'Parent1', 'Parent2';
#### Method Resolution Order
Method resolution order only matters in the case of multiple inheritance. In the case of single inheritance, Perl simply looks up the inheritance chain to find a method:
Grandparent
|
Parent
|
Child
If we call a method on a Child object and that method is not defined in the Child class, Perl will look for that method in the Parent class and then, if necessary, in the Grandparent class.
If Perl cannot find the method in any of these classes, it will die with an error message.
When a class has multiple parents, the method lookup order becomes more complicated.
By default, Perl does a depth-first left-to-right search for a method. That means it starts with the first parent in the @ISA array, and then searches all of its parents, grandparents, etc. If it fails to find the method, it then goes to the next parent in the original class's @ISA array and searches from there.
SharedGreatGrandParent
/ \
PaternalGrandparent MaternalGrandparent
\ /
Father Mother
\ /
Child
So given the diagram above, Perl will search Child , Father , PaternalGrandparent , SharedGreatGrandParent , Mother , and finally MaternalGrandparent . This may be a problem because now we're looking in SharedGreatGrandParent before we've checked all its derived classes (i.e. before we tried Mother and MaternalGrandparent ).
It is possible to ask for a different method resolution order with the mro pragma.
package Child;
use mro 'c3';
use parent 'Father', 'Mother';
This pragma lets you switch to the "C3" resolution order. In simple terms, "C3" order ensures that shared parent classes are never searched before child classes, so Perl will now search: Child , Father , PaternalGrandparent , Mother MaternalGrandparent , and finally SharedGreatGrandParent . Note however that this is not "breadth-first" searching: All the Father ancestors (except the common ancestor) are searched before any of the Mother ancestors are considered.
The C3 order also lets you call methods in sibling classes with the next pseudo-class. See the mro documentation for more details on this feature.
#### Method Resolution Caching
When Perl searches for a method, it caches the lookup so that future calls to the method do not need to search for it again. Changing a class's parent class or adding subroutines to a class will invalidate the cache for that class.
The mro pragma provides some functions for manipulating the method cache directly.
### Writing Constructors
As we mentioned earlier, Perl provides no special constructor syntax. This means that a class must implement its own constructor. A constructor is simply a class method that returns a reference to a new object.
The constructor can also accept additional parameters that define the object. Let's write a real constructor for the File class we used earlier:
package File;
sub new {
my $class = shift; my ($path, $data ) = @_; my$self = bless {
path => $path, data =>$data,
}, $class; return$self;
}
As you can see, we've stored the path and file data in the object itself. Remember, under the hood, this object is still just a hash. Later, we'll write accessors to manipulate this data.
For our File::MP3 class, we can check to make sure that the path we're given ends with ".mp3":
package File::MP3;
sub new {
my $class = shift; my ($path, $data ) = @_; die "You cannot create a File::MP3 without an mp3 extension\n" unless$path =~ /\.mp3\z/;
return $class->SUPER::new(@_); } This constructor lets its parent class do the actual object construction. ### Attributes An attribute is a piece of data belonging to a particular object. Unlike most object-oriented languages, Perl provides no special syntax or support for declaring and manipulating attributes. Attributes are often stored in the object itself. For example, if the object is an anonymous hash, we can store the attribute values in the hash using the attribute name as the key. While it's possible to refer directly to these hash keys outside of the class, it's considered a best practice to wrap all access to the attribute with accessor methods. This has several advantages. Accessors make it easier to change the implementation of an object later while still preserving the original API. An accessor lets you add additional code around attribute access. For example, you could apply a default to an attribute that wasn't set in the constructor, or you could validate that a new value for the attribute is acceptable. Finally, using accessors makes inheritance much simpler. Subclasses can use the accessors rather than having to know how a parent class is implemented internally. #### Writing Accessors As with constructors, Perl provides no special accessor declaration syntax, so classes must provide explicitly written accessor methods. There are two common types of accessors, read-only and read-write. A simple read-only accessor simply gets the value of a single attribute: sub path { my$self = shift;
return $self->{path}; } A read-write accessor will allow the caller to set the value as well as get it: sub path { my$self = shift;
if (@_) {
$self->{path} = shift; } return$self->{path};
}
### An Aside About Smarter and Safer Code
Our constructor and accessors are not very smart. They don't check that a $path is defined, nor do they check that a $path is a valid filesystem path.
Doing these checks by hand can quickly become tedious. Writing a bunch of accessors by hand is also incredibly tedious. There are a lot of modules on CPAN that can help you write safer and more concise code, including the modules we recommend in perlootut.
### Method Call Variations
Perl supports several other ways to call methods besides the $object->method() usage we've seen so far. #### Method Names as Strings Perl lets you use a scalar variable containing a string as a method name: my$file = File->new( $path,$data );
my $method = 'save';$file->$method(); This works exactly like calling $file->save() . This can be very useful for writing dynamic code. For example, it allows you to pass a method name to be called as a parameter to another method.
#### Class Names as Strings
Perl also lets you use a scalar containing a string as a class name:
my $class = 'File'; my$file = $class->new($path, $data ); Again, this allows for very dynamic code. #### Subroutine References as Methods You can also use a subroutine reference as a method: my$sub = sub {
my $self = shift;$self->save();
};
$file->$sub();
This is exactly equivalent to writing $sub->($file) . You may see this idiom in the wild combined with a call to can :
if ( my $meth =$object->can('foo') ) {
$object->$meth();
}
#### Deferencing Method Call
Perl also lets you use a dereferenced scalar reference in a method call. That's a mouthful, so let's look at some code:
$file->${ \'save' };
$file->${ returns_scalar_ref() };
$file->${ \( returns_scalar() ) };
$file->${ returns_ref_to_sub_ref() };
This works if the dereference produces a string or a subroutine reference.
#### Method Calls on Filehandles
Under the hood, Perl filehandles are instances of the IO::Handle or IO::File class. Once you have an open filehandle, you can call methods on it. Additionally, you can call methods on the STDIN , STDOUT , and STDERR filehandles.
open my $fh, '>', 'path/to/file';$fh->autoflush();
$fh->print('content'); STDOUT->autoflush(); ### Invoking Class Methods Because Perl allows you to use barewords for package names and subroutine names, it sometimes interprets a bareword's meaning incorrectly. For example, the construct Class->new() can be interpreted as either 'Class'->new() or Class()->new() . In English, that second interpretation reads as "call a subroutine named Class(), then call new() as a method on the return value of Class()". If there is a subroutine named Class() in the current namespace, Perl will always interpret Class->new() as the second alternative: a call to new() on the object returned by a call to Class() You can force Perl to use the first interpretation (i.e. as a method call on the class named "Class") in two ways. First, you can append a :: to the class name: Class::->new() Perl will always interpret this as a method call. Alternatively, you can quote the class name: 'Class'->new() Of course, if the class name is in a scalar Perl will do the right thing as well: my$class = 'Class';
$class->new(); #### Indirect Object Syntax Outside of the file handle case, use of this syntax is discouraged as it can confuse the Perl interpreter. See below for more details. Perl supports another method invocation syntax called "indirect object" notation. This syntax is called "indirect" because the method comes before the object it is being invoked on. This syntax can be used with any class or object method: my$file = new File $path,$data;
save $file; We recommend that you avoid this syntax, for several reasons. First, it can be confusing to read. In the above example, it's not clear if save is a method provided by the File class or simply a subroutine that expects a file object as its first argument. When used with class methods, the problem is even worse. Because Perl allows subroutine names to be written as barewords, Perl has to guess whether the bareword after the method is a class name or subroutine name. In other words, Perl can resolve the syntax as either File->new($path, $data ) or new( File($path, $data ) ) . To parse this code, Perl uses a heuristic based on what package names it has seen, what subroutines exist in the current package, what barewords it has previously seen, and other input. Needless to say, heuristics can produce very surprising results! Older documentation (and some CPAN modules) encouraged this syntax, particularly for constructors, so you may still find it in the wild. However, we encourage you to avoid using it in new code. You can force Perl to interpret the bareword as a class name by appending "::" to it, like we saw earlier: my$file = new File:: $path,$data;
### bless, blessed , and ref
As we saw earlier, an object is simply a data structure that has been blessed into a class via the bless function. The bless function can take either one or two arguments:
my $object = bless {},$class;
my $object = bless {}; In the first form, the anonymous hash is being blessed into the class in $class . In the second form, the anonymous hash is blessed into the current package.
The second form is strongly discouraged, because it breaks the ability of a subclass to reuse the parent's constructor, but you may still run across it in existing code.
If you want to know whether a particular scalar refers to an object, you can use the blessed function exported by Scalar::Util, which is shipped with the Perl core.
use Scalar::Util 'blessed';
if ( defined blessed($thing) ) { ... } If $thing refers to an object, then this function returns the name of the package the object has been blessed into. If $thing doesn't contain a reference to a blessed object, the blessed function returns undef. Note that blessed($thing) will also return false if $thing has been blessed into a class named "0". This is a possible, but quite pathological. Don't create a class named "0" unless you know what you're doing. Similarly, Perl's built-in ref function treats a reference to a blessed object specially. If you call ref($thing) and $thing holds a reference to an object, it will return the name of the class that the object has been blessed into. If you simply want to check that a variable contains an object reference, we recommend that you use defined blessed($object) , since ref returns true values for all references, not just objects.
### The UNIVERSAL Class
All classes automatically inherit from the UNIVERSAL class, which is built-in to the Perl core. This class provides a number of methods, all of which can be called on either a class or an object. You can also choose to override some of these methods in your class. If you do so, we recommend that you follow the built-in semantics described below.
• isa($class) The isa method returns true if the object is a member of the class in $class , or a member of a subclass of $class . If you override this method, it should never throw an exception. • DOES($role)
The DOES method returns true if its object claims to perform the role $role . By default, this is equivalent to isa . This method is provided for use by object system extensions that implement roles, like Moose and Role::Tiny . You can also override DOES directly in your own classes. If you override this method, it should never throw an exception. • can($method)
The can method checks to see if the class or object it was called on has a method named $method . This checks for the method in the class and all of its parents. If the method exists, then a reference to the subroutine is returned. If it does not then undef is returned. If your class responds to method calls via AUTOLOAD , you may want to overload can to return a subroutine reference for methods which your AUTOLOAD method handles. If you override this method, it should never throw an exception. • VERSION($need)
The VERSION method returns the version number of the class (package).
If the $need argument is given then it will check that the current version (as defined by the$VERSION variable in the package) is greater than or equal to $need ; it will die if this is not the case. This method is called automatically by the VERSION form of use. use Package 1.2 qw(some imported subs); # implies: Package->VERSION(1.2); We recommend that you use this method to access another package's version, rather than looking directly at $Package::VERSION . The package you are looking at could have overridden the VERSION method.
We also recommend using this method to check whether a module has a sufficient version. The internal implementation uses the version module to make sure that different types of version numbers are compared correctly.
If you call a method that doesn't exist in a class, Perl will throw an error. However, if that class or any of its parent classes defines an AUTOLOAD method, that AUTOLOAD method is called instead.
AUTOLOAD is called as a regular method, and the caller will not know the difference. Whatever value your AUTOLOAD method returns is returned to the caller.
The fully qualified method name that was called is available in the $AUTOLOAD package global for your class. Since this is a global, if you want to refer to do it without a package name prefix under strict 'vars' , you need to declare it. # XXX - this is a terrible way to implement accessors, but it makes # for a simple example. our$AUTOLOAD;
my $self = shift; # Remove qualifier from original method name... my$called = $AUTOLOAD =~ s/.*:://r; # Is there an attribute of that name? die "No such attribute:$called"
unless exists $self->{$called};
# If so, return it...
return $self->{$called};
}
sub DESTROY { } # see below
Without the our $AUTOLOAD declaration, this code will not compile under the strict pragma. As the comment says, this is not a good way to implement accessors. It's slow and too clever by far. However, you may see this as a way to provide accessors in older Perl code. See perlootut for recommendations on OO coding in Perl. If your class does have an AUTOLOAD method, we strongly recommend that you override can in your class as well. Your overridden can method should return a subroutine reference for any method that your AUTOLOAD responds to. ### Destructors When the last reference to an object goes away, the object is destroyed. If you only have one reference to an object stored in a lexical scalar, the object is destroyed when that scalar goes out of scope. If you store the object in a package global, that object may not go out of scope until the program exits. If you want to do something when the object is destroyed, you can define a DESTROY method in your class. This method will always be called by Perl at the appropriate time, unless the method is empty. This is called just like any other method, with the object as the first argument. It does not receive any additional arguments. However, the $_[0] variable will be read-only in the destructor, so you cannot assign a value to it.
If your DESTROY method throws an error, this error will be ignored. It will not be sent to STDERR and it will not cause the program to die. However, if your destructor is running inside an eval {} block, then the error will change the value of $@ . Because DESTROY methods can be called at any time, you should localize any global variables you might update in your DESTROY . In particular, if you use eval {} you should localize $@ , and if you use system or backticks you should localize $? . If you define an AUTOLOAD in your class, then Perl will call your AUTOLOAD to handle the DESTROY method. You can prevent this by defining an empty DESTROY , like we did in the autoloading example. You can also check the value of $AUTOLOAD and return without doing anything when called to handle DESTROY .
#### Global Destruction
The order in which objects are destroyed during the global destruction before the program exits is unpredictable. This means that any objects contained by your object may already have been destroyed. You should check that a contained object is defined before calling a method on it:
sub DESTROY {
my $self = shift;$self->{handle}->close() if $self->{handle}; } You can use the ${^GLOBAL_PHASE} variable to detect if you are currently in the global destruction phase:
sub DESTROY {
my $self = shift; return if${^GLOBAL_PHASE} eq 'DESTRUCT';
$self->{handle}->close(); } Note that this variable was added in Perl 5.14.0. If you want to detect the global destruction phase on older versions of Perl, you can use the Devel::GlobalDestruction module on CPAN. If your DESTROY method issues a warning during global destruction, the Perl interpreter will append the string " during global destruction" to the warning. During global destruction, Perl will always garbage collect objects before unblessed references. See PERL_DESTRUCT_LEVEL in perlhacktips for more information about global destruction. ### Non-Hash Objects All the examples so far have shown objects based on a blessed hash. However, it's possible to bless any type of data structure or referent, including scalars, globs, and subroutines. You may see this sort of thing when looking at code in the wild. Here's an example of a module as a blessed scalar: package Time; use strict; use warnings; sub new { my$class = shift;
my $time = time; return bless \$time, $class; } sub epoch { my$self = shift;
return ${$self };
}
my $time = Time->new(); print$time->epoch();
### Inside-Out objects
In the past, the Perl community experimented with a technique called "inside-out objects". An inside-out object stores its data outside of the object's reference, indexed on a unique property of the object, such as its memory address, rather than in the object itself. This has the advantage of enforcing the encapsulation of object attributes, since their data is not stored in the object itself.
This technique was popular for a while (and was recommended in Damian Conway's Perl Best Practices), but never achieved universal adoption. The Object::InsideOut module on CPAN provides a comprehensive implementation of this technique, and you may see it or other inside-out modules in the wild.
Here is a simple example of the technique, using the Hash::Util::FieldHash core module. This module was added to the core to support inside-out object implementations.
package Time;
use strict;
use warnings;
use Hash::Util::FieldHash 'fieldhash';
fieldhash my %time_for;
sub new {
my $class = shift; my$self = bless \( my $object ),$class;
$time_for{$self} = time;
return $self; } sub epoch { my$self = shift;
return $time_for{$self};
}
my $time = Time->new; print$time->epoch;
### Pseudo-hashes
The pseudo-hash feature was an experimental feature introduced in earlier versions of Perl and removed in 5.10.0. A pseudo-hash is an array reference which can be accessed using named keys like a hash. You may run in to some code in the wild which uses it. See the fields pragma for more information. | 2019-07-16 16:57:21 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.18898575007915497, "perplexity": 2793.9090925251116}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195524679.39/warc/CC-MAIN-20190716160315-20190716182315-00202.warc.gz"} |
https://www.wyzant.com/resources/answers/626738/when-does-gambling-reduce-risk | # When does gambling reduce risk?
Suppose that you face risk. It is obvious that taking gambles whose outcomes are negatively correlated with the outcomes of your other gambles can reduce your overall risk ('hedging'). My question, however, concerns **uncorrelated** gambles - can these reduce your overall risk, and if so when?**Edit**: to be clear, I am asking about when you can reducing your risk by taking **additional** uncorrelated gambles, not simply by replacing some gambles in your portfolio with others.
By:
Tutor
5 (4) | 2021-09-27 22:29:24 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8082631826400757, "perplexity": 2830.0928739412384}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780058552.54/warc/CC-MAIN-20210927211955-20210928001955-00466.warc.gz"} |
https://aharensho.net/adisadel-college-pictures-of-ted.php | Post Categories: DEFAULT
#### 10 thoughts on “Adisadel college pictures of ted”
• It agree, it is the remarkable answer
• Directly in яблочко
• Really and as I have not realized earlier
• Let's talk on this question.
• This phrase, is matchless)))
• Yes, really. So happens.
• It is remarkable
• I think, that you are not right. Let's discuss it. Write to me in PM, we will talk.
• On your place I would arrive differently.
• I perhaps shall keep silent | 2021-09-25 12:53:08 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9147922396659851, "perplexity": 7921.691994526063}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057622.15/warc/CC-MAIN-20210925112158-20210925142158-00042.warc.gz"} |
https://forum.allaboutcircuits.com/threads/another-puzzle.24621/ | # Another puzzle.
Discussion in 'Math' started by t_n_k, Jun 13, 2009.
1. ### t_n_k Thread Starter AAC Fanatic!
Mar 6, 2009
5,448
790
I think this can be done.....
File size:
20.6 KB
Views:
75
2. ### mik3 Senior Member
Feb 4, 2008
4,846
70
I found this:
File size:
9.5 KB
Views:
56
3. ### Ratch New Member
Mar 20, 2007
1,068
4
To the ineffable all,
Although I don't have time to solve it, I will describe how I would do it. That hanging span is a catenary curve or hyperbolic cosine. http://en.wikipedia.org/wiki/Catenary . It looks like a parabola, but it is not. Notice when plotted that the value of y is 1 at x=0 instead of 0 like the parabola y=x^2 would be. So each hinge should pass through the catenary curve, but the straight segments will deviate from the catenary curve.
I would plot a catenary curve within a convenient arbitrary range, something like x=-1 to +1. Designate point B on the catenary at x=1, y=1.543080635. At point B, superimpose a circle plot with a radius of 1.25*2/7 and note the coordinates where it intersects the catenary. At that point, do another circle and so on until the last segment is reached. The difference between 1.543080635 and the y coordinate of the last circle intersection should be the droop, then the ratio is easily calculated.
Ratch
Last edited: Jun 13, 2009
4. ### t_n_k Thread Starter AAC Fanatic!
Mar 6, 2009
5,448
790
Hi Mik3 - Thanks! - Although I'm not sure what 'r' represents in the equation.
5. ### t_n_k Thread Starter AAC Fanatic!
Mar 6, 2009
5,448
790
Thanks Ratch - I'll give it a try using your method.
6. ### mik3 Senior Member
Feb 4, 2008
4,846
70
r represents the radius of of the circle the sections are segments of it.
However, my answer is false because the sections are described by the cosh function (catenary) and not by the circle function. Ratch is right.
7. ### studiot AAC Fanatic!
Nov 9, 2007
5,003
523
Not sure if this isn't someone's mechanics homework?
This is not a catenary problem.
It should be realised that this frame is not statically determinate.
Nor is it statically indeterminate.
It is officially a mechanism.
As such there are an infinite number of possible reaction sets that satisfy the equations of equilibrium.
The vertical hinge reactions are all determinate. But any horizontal reaction will do.
The problem is purely determined by geometry. I suggest making the distance AB equal to 2L, the length of each link rod equal to 2l. You can then use the symmetry to work on the half frame without fractions.
The length ratio condition then becomes 28l = 5L.
8. ### steveb Senior Member
Jul 3, 2008
2,431
469
I would approach this problem using minimum potential energy principles.
It is useful to define an angle for each segment relative to the horizontal.
$\theta_i$ for each segment from left to right with i=1,2, .... 7
It can be noted that the angle of the center section is zero using symmetry, and also by symmetry only i=1,2,3 need to be considered.
First, two very simple relations can be given just based on the geometry. Note that L is the length of a segment equal to the length of AB divided by 5.6.
$D= L\; (\sin\theta_1+\sin\theta_2+\sin\theta_3)$
$2.3=\cos\theta_1+\cos\theta_2+\cos\theta_3$
Then write the sum of the potential energies (U) of each segment using the end-posts height as the reference zero energy, where L is the length of a segment, m is the mass of a segment and g is the gravitational acceleration (9.8 m/s^2). Note that the potential energy of a segment can be taken at the height of its center of mass, so this is easy.
${{U}\over{2mgL}}=-\sin\theta_3-2\sin\theta_2-3\sin\theta_1$
This function must be minimized to find the solution. It can be seen that the minimum energy solution will have the following condition met. $\theta_3<\theta_2<\theta_1$
I wasn't able to come up with a nice simple algebraic solution for the three angles that define D at minimum energy. It may be possible to do so, but I don't have time to investigate. My approach would be to do this last step numerically. The angles must be such that the sum of the cosines of the angles equals 2.3. Just search for the combination of angles that meets this constraint and that minimizes the potential energy.
This problem can also be solved by analyzing forces and torques for the static solution of each segment, but that looks more tedious to me.
EDIT: By the way, once the 3 angles are found, the ratio R defined as the length D divided by the length of AB is found as follows:
$R= {{1}\over{5.6}}\; (\sin\theta_1+\sin\theta_2+\sin\theta_3)$
ANOTHER EDIT: By the way, the numerical solution obtained with the minimum value search can be converted into a root solving problem using the usual technique. The constraint equation can be plugged into the energy equation, resulting in an equation with two unknowns. Then this energy function can be minimized by taking derivatives with respect to those two variables and setting both equations equal to zero. This is the way I tried to find an algebraic solution, but it doesn't seem to work out into a simple form. In principle, this can be worked out, but it looks like a case where "the cure is worse than the disease". However, this problem can be solved numerically with either root solving, or minimum value search.
Last edited: Jun 14, 2009
9. ### steveb Senior Member
Jul 3, 2008
2,431
469
I looked up a trig identity which allowed the root solving method to look more friendly. i.e. $acos\;a=asin\;\sqrt{1-a^2}$ where the power -1 indicates the inverse trig function (i.e. arccos or arcsin).
If I didn't make a mistake, the following root equations can be solved for two of the angles and then the original constraint equation can be used to find the third remaining angle.
$3\;\cos\theta_1-{{K\;\sin\theta_1}\over{\sqrt{1-K^2}}}=0$
$2\;\cos\theta_2-{{K\;\sin\theta_2}\over{\sqrt{1-K^2}}}=0$
where $K={2.3-\cos\theta_1-\cos\theta_2}$
then $\theta_3=acos K$
Don't rely on my answers since I could have made a mistake, but the basic approach should work.
Still looks like a numerical solution is needed to find the roots.
EDIT: I corrected the above formula since I had a sign error.
Last edited: Jun 15, 2009
10. ### Tesla23 AAC Fanatic!
May 10, 2009
374
88
This way is OK but the optimisation minimum you are looking for is very shallow, convergence may be poor.
I've solved it simply by balancing forces, it's pretty straightforward. I didn't bother with trig identities to find a closed form, simply did a numerical solution, but it seemed to converge rapidly. It also seems to minimise your energy (starting the energy minimisation on my solution and the optimiser doesn't seem to be able to lower the energy).
I've got no idea what studiot is talking about - it's clearly a stable configuration as long as A and B are fixed.
11. ### t_n_k Thread Starter AAC Fanatic!
Mar 6, 2009
5,448
790
I've made an attempt using a slightly different approach.
The three angles were 49.83 deg, 40.24 deg and 26.92 deg. The ratio was then about 0.3327.
I don't know if this the minimum energy solution Steveb proposed.
Any agreement with these values?
The puzzle is something I dreamed up when I was thinking about things that were catenary like but not an ideal catenary. I know - I should "get a life!"
12. ### Tesla23 AAC Fanatic!
May 10, 2009
374
88
I didn't give my answer as I assumed it was homework!
The angles I get are 51.87, 40.34 and 23.01 deg. The ratio is 0.3259.
The energy of your solution seems to be higher than that of mine.
13. ### steveb Senior Member
Jul 3, 2008
2,431
469
This looks to be correct. I went back and corrected my minimum energy root equations since I had a sign error. Solving these gives your answer.
14. ### studiot AAC Fanatic!
Nov 9, 2007
5,003
523
Static determinancy has nothing to do with stability.
The first thing to decide is whether to treat this as a framework or as a continuous flexible cable.
Now since each of the seven bars is a significant percentage (18%) of the inter-support distance the setup cannot be considered as a cable.
For a 2D framework that is pinned at both supports the condition for static determinancy is
number of bars = 2(number of joints -2) including the supports.
Frames with exactly this number of bars can be solved by applying the three equilibrium conditions a sufficient number of times to joints or sections. These are called statically determinate.
Frames which have more bars than this are statically indeterminate and can only be solved by stress analysis and consideration of materials properties. They cannot be solved by use of the equilibrium equations alone.
Frames where there are fewer bars than the statically determinate number are mechanisms.
That means that they can be reconfigured to other arrangements of bars. There are insufficient constraints to prevent the frame changing shape.
Now looking at the seven member frame proposed
There are 8 joints, including A and B
So a statically determinate frame would have n = 2*(8-2) bars ie 12 bars.
there are only 7 so this is a mechanism.
An alternate configuration would be a sawtooth.
A further difficulty arises because there are 7 bars, not 6 or 8. This means that nearly 20% of the lowest boom of the frame is horizontal. There is no 'lowest point'
With an even number of bars the shape would be a V so the tangent at the lowest point
is horizontal. This allows the use of the fact that the 'tension' is purely horizontal at this one point to solve the force equations when deriving a hanging curve eg a catenary.
So we cannot do this with such a long horizontal bottom bar.
I am short of time right now but will publish a fuller analysis when I can.
15. ### steveb Senior Member
Jul 3, 2008
2,431
469
Can you post the details of how you solved with balanced forces? When I tried to do this it looked more complicated than the minimum energy approach. I must have missed the simple way to look at it, and now I'm curious.
16. ### steveb Senior Member
Jul 3, 2008
2,431
469
This is another reason why I thought that the minimum energy solution is the better approach. Only one possible arrangment will have miniumum energy and it will be the one that looks like the diagram. Note that the problem stated that the situation was like a suspension bridge and the diagram showed that there was no sawtooth shape. Hence it seemed reasonable to say that there was sufficient information to solve the problem.
One can look further at this problem and see if any of the sawtooth shapes would be stable. My gut feeling is that this particular arrangement is only stable in the lowest energy case, but the root equations I provided can be used to test this. If there are other local minimum energy points (with higher energy than the lowest state) then a stable sawtooth shape can exist for this problem.
If no one beats me to it. I'll check this out later.
17. ### Tesla23 AAC Fanatic!
May 10, 2009
374
88
I just balanced the torques at the three mid-joints, and made the horizontal forces at the two ends of each bar the same, it comes out in a few lines to
$3\,cot\left( {\theta}_{1}\right) = 2\,cot\left( {\theta}_{2}\right) = \,cot\left( {\theta}_{3}\right)$
I'll have to study studiot's post when I have more time - seems that this is the tip of the iceberg of a whole discipline that I know nothing about.
18. ### steveb Senior Member
Jul 3, 2008
2,431
469
OK, but what is the next step? You still need to identify one of the angles to solve for the other two angles.
19. ### Tesla23 AAC Fanatic!
May 10, 2009
374
88
The extra equation you need is the length constraint:
$image=http://forum.allaboutcircuits.com/mimetex.cgi?+2.3=\cos\theta_1+\cos\theta_2+\cos\theta_3&hash=dc7f26e0de44978c040683a6368187dc$
As I said in my earlier post, I solved it numerically (before you posted your energy solution), these three equations gave much better convergence than just using the length constraint and the energy one. I'm not knocking the energy approach though - I like the simplicity.
20. ### studiot AAC Fanatic!
Nov 9, 2007
5,003
523
Actually, Steve, the configuration shown is not the only 'minimum' energy solution in terms of the forces acting. Inverting the arrangement to form an arch has the same forces and dispositions. | 2019-10-18 19:03:17 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 14, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7614734768867493, "perplexity": 771.4054102388664}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986684425.36/warc/CC-MAIN-20191018181458-20191018204958-00387.warc.gz"} |
http://www.koreascience.or.kr/article/JAKO201611962056642.page | # SOME CHARACTERIZATIONS OF CANAL SURFACES
• Kim, Young Ho (Department of Mathematics, Kyungpook National University) ;
• Liu, Huili (Department of Mathematics, Northeastern University) ;
• Qian, Jinhua (Department of Mathematics, Northeastern University)
• Published : 2016.03.31
• 101 17
#### Abstract
This work considers a particular type of swept surface named canal surfaces in Euclidean 3-space. For such a kind of surfaces, some interesting and important relations about the Gaussian curvature, the mean curvature and the second Gaussian curvature are found. Based on these relations, some canal surfaces are characterized.
#### Keywords
canal surface;Gaussian curvature;mean curvature;second Gaussian curvature;Weingarten surface;linear Weingarten surface
#### Acknowledgement
Supported by : National Research Foundation of Korea (NRF), NSFC
#### References
1. J. A. Galvez, A. Martinez, and F. Milan, Linear Weingarten Surfaces in $R^3$, Monatsh. Math. 138 (2003), no. 2, 133-144. https://doi.org/10.1007/s00605-002-0510-3
2. S. Haesen, S. Verpoort, and L. Verstraelen, The mean curvature of the second funda-mental form, Houston J. Math. 34 (2008), no. 3, 703-719.
3. Y. H. Kim and D. W. Yoon, On non-developable ruled surface in Lorentz-Minkowski 3-spaces, Taiwanese J. Math. 11 (2007), no. 1, 197-214. https://doi.org/10.11650/twjm/1500404646
4. S. N. Krivoshapko and C. A. Bock Hyeng, Classification of cyclic surfaces and geomet-rical research of canal surfaces, Int. J. Res. Rev. Appl. Sci. 12 (2012), no. 3, 360-374.
5. R. Lopez, Linear Weingarten surfaces in Euclidean and hyperbolic space, Mat. Contemp. 35 (2008), 95-113.
6. R. Lopez, Rotational linear Weingarten surfaces of hyperbolic type, Israel J. Math. 167 (2008), 283-302. https://doi.org/10.1007/s11856-008-1049-3
7. T. Maekawa, M. N. Patrikalakis, T. Sakkalis, and G. Yu, Analysis and applications of pipe surfaces, Comput. Aided Geom. Design 15 (1998), no. 5, 437-458. https://doi.org/10.1016/S0167-8396(97)00042-3
8. A. D. Polyanin and V. F. Zaitsev, Handbook of Exact Solutions for Ordinary Differential Equations, Second edition, Chapman and Hall/CRC, 2003.
9. J. S. Ro and D. W. Yoon, Tubes of Weingarten types in a Euclidean 3-space, J. Chungcheong Math. Soc. 22 (2009), 360-366.
10. S. Verpoort, The Geometry of the Second Fundamental Form: Curvature Properties and Variational Aspects, PhD. Thesis, Katholieke Universiteit Leuven, Belgium, 2008.
11. Z. Q. Xu, R. Z. Feng, and J. G. Sun, Analytic and algebraic properties of canal surfaces, J. Comput. Appl. Math. 195 (2006), no. 1-2, 220-228. https://doi.org/10.1016/j.cam.2005.08.002 | 2020-01-23 13:30:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7440922260284424, "perplexity": 3530.550829528415}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579250610919.33/warc/CC-MAIN-20200123131001-20200123160001-00309.warc.gz"} |
https://www.physicsforums.com/threads/magnetic-moment.295163/ | # Magnetic Moment
#### latentcorpse
A small sphere is uniformly charged throughout its' volume and rotating with constant angular velocity $\omega$. Show it's magnetic moment is given by
$m=\frac{1}{5}Q \omega a^2$. the question doesn't say but i'm assuming a is the radius.
Anyway, so far I have:
$m=\frac{1}{2} \int_V dV (\mathbf{r \wedge J})$
but $\mathbf{J}= \rho \mathbf{v} = \rho \mathbf{\omega \wedge r}$
and so $m=\frac{\rho}{2} \int_V r^2 \mathbf{\omega} - (\mathbf{r \cdot \omega})\mathbf{r}$
but i don't really know where to go from here?
Related Advanced Physics Homework News on Phys.org
#### gabbagabbahey
Homework Helper
Gold Member
Choose a coordinate system and carry out the integration. The easiest choice is probably spherical coordinates, with omega pointing in the z-direction.
#### latentcorpse
ok so $\int (\mathbf{r \cdot \omega})\mathbf{r} dV=\int r \omega \cos{\theta} r^2 \sin{\theta} dr d \theta d \phi \frac{\mathbf{\hat{r}}}{r}=\omega \int_0^a r^2 dr \int_0^{\pi} \cos{\theta} \sin{\theta} d \theta \int_0^{2 \pi} d \phi \mathbf{\hat{r}}$
giving
$\omega \frac{a^3}{3} 2 \pi \int_0^{\pi} \frac{1}{2} \sin{2 \theta} d \theta \mathbf{\hat{r}}= \frac{2}{3} \pi a^3 \left[ -\frac{1}{4} \cos{\theta} \right]_0^{\pi} \mathbf{\hat{r}}$
which is
$\omega \frac{a^3}{12} \pi (-[-1-1])=\frac{\omega \pi a^3}{6} \mathbf{\hat{r}}$
#### latentcorpse
and the first integral is $\omega \int_0^a r^4 dr \int_0^{\pi} \sin{\theta} d \theta \int_0^{2 \pi} d \phi \mathfb{\hat{z}}=\omega \frac{2a^5}{5} 2 \pi \mathbf{\hat{z}}=\frac{4 \omega \pi a^5}{5} \mathbf{\hat{z}}$
#### latentcorpse
reckon i've messed up somewhere though because they shouldn't have directions should they?
#### gabbagabbahey
Homework Helper
Gold Member
reckon i've messed up somewhere though because they shouldn't have directions should they?
Magnetic moment is a vector, so it most definitely should have a direction.
But you have messed up somewhere; is $\hat{r}$ really position independent? Because that's what you are assuming when you pull it out of the integral.
#### latentcorpse
ok. not sure what to do with it then?
#### gabbagabbahey
Homework Helper
Gold Member
Cartesian unit vectors are position independent, so rewrite $\hat{r}$ in terms of them.
$$\hat{r}=\sin\theta\cos\phi\hat{x}+\ldots$$
#### latentcorpse
ok. did that. both the $\hat{x},\hat{y}$ bits dropped out.
and i got
$\omega \int_0^a r^2 dr \int_0^{\pi} \sin{\theta} \cos^2{\theta} d \theta \int_0^{2 \pi} d \phi \mathbf{\hat{z}}=-\frac{\omega a^3}{3} \int_{1}^{-1} (-u^2) du 2 \pi \mathbf{\hat{z}}$ where $u=\cos{\theta}$
which simplifies to $\frac{2 \omega \rho \pi a^3}{3} \mathbf{\hat{z}}$ when you multiply in the factor of $\frac{\rho}{2}$ and so overall we get
$m=\left( \frac{2 \omega \rho \pi a^5}{5} -\frac{2 \omega \rho \pi a^3}{3} \right) \mathbf{\hat{z}}$ which doesn't quite give me what i want. there must still be a mistake somewhere i guess.
and i assume $Q=\fac{4}{3} \pi \rho a^3$
Homework Helper
Gold Member
What is 2/5-2/3?
Last edited:
#### latentcorpse
kool. i got it.
the next bit is to find the angular momentum L of the sphere of mass M and verify that $\mathbf{m}=\frac{Q}{2M}\mathbf{L}$
i was wanting to use the formula i'm meant to be verifying for finding L so since that's out the window, I was guessing $\mathbf{L}=M(r^2\mathbf{\omega}-(\mathbf{r \cdot \omega})\mathbf{r}$ but that's not getting me anywhere!
#### gabbagabbahey
Homework Helper
Gold Member
Use the definition of angular momentum: $$\vec{L}=M\vec{v}\times\vec{r}$$
P.S. \mathbf doesn't always show up too well here, so you might want to switch to \vec
Edit: $$\vec{dL}=\rho_M\vec{v}\times\vec{r}dV$$ where $$\rho_M=\frac{M}{\frac{4}{3}\pi a^3}$$
Last edited:
#### latentcorpse
do i sub in for v before i integrate?
#### gabbagabbahey
Homework Helper
Gold Member
did you sub in v before integrating when inding m?
#### latentcorpse
yes. so is it basically going to be the same integral again?
#### gabbagabbahey
Homework Helper
Gold Member
You tell me...
"Magnetic Moment"
### Physics Forums Values
We Value Quality
• Topics based on mainstream science
• Proper English grammar and spelling
We Value Civility
• Positive and compassionate attitudes
• Patience while debating
We Value Productivity
• Disciplined to remain on-topic
• Recognition of own weaknesses
• Solo and co-op problem solving | 2019-04-25 01:59:33 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.874198317527771, "perplexity": 2350.240426652295}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-18/segments/1555578678807.71/warc/CC-MAIN-20190425014322-20190425040322-00362.warc.gz"} |
http://www.zeusindia.org/cost-of-production-2.html | ## What are the costs of production?
In economic theory, production costs are the costs incurred by an industrial organization when it engineers a project or provides a service that generates revenue and benefits. Labor costs, raw materials, consumable manufacturing costs, and general overhead sum up, accounting for production costs. Total cost data is calculated by combining total direct costs of materials, labor costs, and total production costs.
## Engineering economic production costs
Engineering economics measures the revenues and total costs of engineering projects for a detailed estimate to see if they have enough profit and benefit to justify their investment in capital budgeting. Cost engineering economic analysis entails decision-making using engineering design and analysis techniques to create parametric goods and services that benefit customers at a reasonable price. The cost engineer who evaluates material selection and construction project costs should be familiar with various elements as prerequisites of engineering economics.
## Types of costs
### Direct costs
A direct cost is a cost incurred in the production of a certain good or service. Direct cost data can be linked to a cost object such as a service or department. Direct costs factor any expenditures incurred in the creation of a good, even if they are merely a part of the total cost given to the manufacturing subcontractor. Labor, raw materials, construction costs, and wages are all examples of direct costs.
### Indirect costs
Indirect costs are those that cannot be directly linked to a finished product. Materials, salvage value, electricity, production managerial pay, and machine maintenance factors are some of these costs. Indirect manufacturing expenses are pooled into an overhead expenses band and assigned to the units produced in a financial quarter clipboard, resulting in some absorption of these expenses into the asset account.
### Implicit costs
Any expense which has already been incurred but is not shown or documented as a standalone expense is considered an implicit cost. It's an opportunity cost that occurs when a corporation risks the alternative to gain money through the utilization of resources elsewhere in return for a financial transaction.
### Explicit costs
Explicit costs have dollar values that are clearly stated and pass through to the financial statement information during a business cycle. Wages, rental bills, electricity, materials, and other direct costs are instances of explicit costs.
### Life cycle cost
Research department, development research, planning, engineering, training, production, installation, management, service, and phase out are all part of a project's workflow. The term "life-cycle costs" refers to all cost calculations that occur throughout a product's life cycle.
## Average cost curves
The price per unit produced is represented by the average total cost (ATC). The number of variable expenses that can be attributed to a single production unit is a small percentage of the total cost. The remaining component is the allocation of fixed expenses to each production unit.
The average cost (ATC), along with its components, average fixed cost (AFC), and average variable cost (AVC), is depicted in the diagram below. The graph depicts previous instances of variable cost inefficiency at extremely low and extremely large production volumes as short-run costs. Even while the average fixed cost continues to fall, there is a production level (marked Q3) where the average total cost is at its lowest. The capacity of an operation is defined by economists as the level of production function at which the average cost is the lowest.
We can think of capacity in the economic costs as the volume level at which we have the most efficient production in regards to average cost. Many businesses can operate at full capacity up to a certain effective physical limit, but they will pay a higher price for that extra production volume because they will need to recruit either more costly or less productive resources, causing production to slow down, or overusing resources, leading to higher servicing costs per unit.
## Production costs during times of epidemic
The world has witnessed various pandemic outbreaks that spread to more than one continent. During the times of such pandemic outbreaks, the governments of each of the affected nations had to interfere to provide medical assistance to their citizens. Even the neighboring nations that were not affected during the outbreak have to provide aid to the affected nations. Existing medications were being repurposed to treat disease, which was critical to lowering mortality and managing the epidemic public policy. To assure equity and access, particularly among low and middle-income nations by the government, bulk accessibility at economical pricing was essential for monetary policy as well. The production costs for life-saving medicines are kept at an affordable rate so as to increase their accessibility to lower and middle-class households. Even the government provides aid to the manufacturing facilities to keep the production rate higher and costs lower.
## Context and Applications
This subject is particularly important to graduate students, university students, and job market candidates for studying the fundamentals of economics. It is studied by students undergoing courses such as Bachelor of Science in Industrial-Organizational Psychology, Bachelor of Science in Electrical Engineering, and Master of Science in International Trade Relations.
## Practice Problems
1. Which of the following statements define implicit costs?
1. The overall fixed costs are equal to the whole fixed costs.
2. American Economic Review
3. "Payments" for resources that are self-employed.
4. Short-run gains are always greater than long-term gains.
Explanation: Implicit costs are the opportunity costs forgone where the firm could have gained profits, to utilize self-employed resources.
2. Which of the following identifies as implicit cost for a firm?
1. Regarding the firm's employee earnings and salaries
2. The firm was reimbursed for the cost of leasing a building.
3. Paid for the firm's production supplies
4. Of wages foregone by the firm's owner
Explanation: Implicit costs are the opportunity costs forgone where the firm could have gained profits.
3. Which curve reaches its lowest in Q3?
1. Average fixed cost
2. Average total cost
3. Average variable cost
4. All of the above
Explanation: In the diagram given in the article, in Q3, the average total cost (ATC) reaches its minimum. This is the point where the marginal cost (MC) curve intersects ATC.
4. Which of the following is not a fixed cost?
1. A cost of insurance of $50 per year, given last month 2. A lawyer's fee of$50,000 per year
3. A laborer's wages of $15 per hour 4. A one-year lease of$1,000.
Explanation: Fixed costs do not increase or decrease with the consumption of every unit of product, service, or hour.
5. In the graph given above when is the average total cost the lowest?
1. Q1
2. Q3
3. Q2
4. Market failure
Explanation: The average total cost curve (ATC) hits its minimum in Q3 as shown in the graph. The ATC is also interested in the marginal cost curve (MC) from underneath at this point.
• Game theory
• Adam Smith’s theory of labor value
• Keynesian economics
• Fundamentals of MACRS
### Want more help with your economics homework?
We've got you covered with step-by-step solutions to millions of textbook problems, subject matter experts on standby 24/7 when you're stumped, and more.
Check out a sample economics Q&A solution here!
*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
### Search. Solve. Succeed!
Study smarter access to millions of step-by step textbook solutions, our Q&A library, and AI powered Math Solver. Plus, you get 30 questions to ask an expert each month.
Tagged in | 2023-03-22 02:42:21 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17094002664089203, "perplexity": 3051.7868747821326}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296943749.68/warc/CC-MAIN-20230322020215-20230322050215-00626.warc.gz"} |
https://www.jobilize.com/chemistry/section/standard-enthalpy-of-formation-by-openstax?qcr=www.quizover.com | # 5.3 Enthalpy (Page 6/25)
Page 6 / 25
## Standard enthalpy of formation
A standard enthalpy of formation $\text{Δ}{H}_{\text{f}}^{°}$ is an enthalpy change for a reaction in which exactly 1 mole of a pure substance is formed from free elements in their most stable states under standard state conditions. These values are especially useful for computing or predicting enthalpy changes for chemical reactions that are impractical or dangerous to carry out, or for processes for which it is difficult to make measurements. If we have values for the appropriate standard enthalpies of formation, we can determine the enthalpy change for any reaction, which we will practice in the next section on Hess’s law.
The standard enthalpy of formation of CO 2 ( g ) is −393.5 kJ/mol. This is the enthalpy change for the exothermic reaction:
$\text{C}\left(s\right)+{\text{O}}_{2}\left(g\right)\phantom{\rule{0.2em}{0ex}}⟶\phantom{\rule{0.2em}{0ex}}{\text{CO}}_{2}\left(g\right)\phantom{\rule{3em}{0ex}}\text{Δ}{H}_{\text{f}}^{°}=\text{Δ}{H}_{298}^{°}=-393.5\phantom{\rule{0.2em}{0ex}}\text{kJ}$
starting with the reactants at a pressure of 1 atm and 25 °C (with the carbon present as graphite, the most stable form of carbon under these conditions) and ending with one mole of CO 2 , also at 1 atm and 25 °C. For nitrogen dioxide, NO 2 ( g ), $\text{Δ}{H}_{\text{f}}^{°}$ is 33.2 kJ/mol. This is the enthalpy change for the reaction:
$\frac{1}{2}{\text{N}}_{2}\left(g\right)+{\text{O}}_{2}\left(g\right)\phantom{\rule{0.2em}{0ex}}⟶\phantom{\rule{0.2em}{0ex}}{\text{NO}}_{2}\left(g\right)\phantom{\rule{3em}{0ex}}\text{Δ}{H}_{\text{f}}^{°}=\text{Δ}{H}_{298}^{°}=\text{+33.2 kJ}$
A reaction equation with $\frac{1}{2}$ mole of N 2 and 1 mole of O 2 is correct in this case because the standard enthalpy of formation always refers to 1 mole of product, NO 2 ( g ).
You will find a table of standard enthalpies of formation of many common substances in Appendix G . These values indicate that formation reactions range from highly exothermic (such as −2984 kJ/mol for the formation of P 4 O 10 ) to strongly endothermic (such as +226.7 kJ/mol for the formation of acetylene, C 2 H 2 ). By definition, the standard enthalpy of formation of an element in its most stable form is equal to zero under standard conditions, which is 1 atm for gases and 1 M for solutions.
## Evaluating an enthalpy of formation
Ozone, O 3 ( g ), forms from oxygen, O 2 ( g ), by an endothermic process. Ultraviolet radiation is the source of the energy that drives this reaction in the upper atmosphere. Assuming that both the reactants and products of the reaction are in their standard states, determine the standard enthalpy of formation, $\text{Δ}{H}_{\text{f}}^{°}$ of ozone from the following information:
$3{\text{O}}_{2}\left(g\right)\phantom{\rule{0.2em}{0ex}}⟶\phantom{\rule{0.2em}{0ex}}2{\text{O}}_{3}\left(g\right)\phantom{\rule{3em}{0ex}}\text{Δ}{H}_{298}^{°}=\text{+286 kJ}$
## Solution
$\text{Δ}{H}_{\text{f}}^{°}$ is the enthalpy change for the formation of one mole of a substance in its standard state from the elements in their standard states. Thus, $\text{Δ}{H}_{\text{f}}^{°}$ for O 3 ( g ) is the enthalpy change for the reaction:
$\frac{3}{2}{\text{O}}_{2}\left(g\right)\phantom{\rule{0.2em}{0ex}}⟶\phantom{\rule{0.2em}{0ex}}{\text{O}}_{3}\left(g\right)$
For the formation of 2 mol of O 3 ( g ), $\text{Δ}{H}_{298}^{°}=\text{+286 kJ.}$ This ratio, $\left(\frac{286\phantom{\rule{0.2em}{0ex}}\text{kJ}}{2\phantom{\rule{0.2em}{0ex}}\text{mol}\phantom{\rule{0.2em}{0ex}}{\text{O}}_{3}}\right),$ can be used as a conversion factor to find the heat produced when 1 mole of O 3 ( g ) is formed, which is the enthalpy of formation for O 3 ( g ):
$\text{Δ}\text{H}\text{° for}\phantom{\rule{0.2em}{0ex}}1\phantom{\rule{0.2em}{0ex}}\text{mole of}\phantom{\rule{0.2em}{0ex}}{\text{O}}_{3}\left(g\right)=1\phantom{\rule{0.2em}{0ex}}\overline{)\text{mol}\phantom{\rule{0.2em}{0ex}}{\text{O}}_{3}}\phantom{\rule{0.2em}{0ex}}×\phantom{\rule{0.2em}{0ex}}\frac{286\phantom{\rule{0.2em}{0ex}}\text{kJ}}{2\phantom{\rule{0.2em}{0ex}}\overline{)\text{mol}\phantom{\rule{0.2em}{0ex}}{\text{O}}_{3}}}\phantom{\rule{0.2em}{0ex}}=143\phantom{\rule{0.2em}{0ex}}\text{kJ}$
Therefore, $\text{Δ}{H}_{\text{f}}^{°}\left[{\text{O}}_{3}\left(g\right)\right]=\text{+143 kJ/mol}.$
Hydrogen gas, H 2 , reacts explosively with gaseous chlorine, Cl 2 , to form hydrogen chloride, HCl( g ). What is the enthalpy change for the reaction of 1 mole of H 2 ( g ) with 1 mole of Cl 2 ( g ) if both the reactants and products are at standard state conditions? The standard enthalpy of formation of HCl( g ) is −92.3 kJ/mol.
For the reaction ${\text{H}}_{2}\left(g\right)+{\text{Cl}}_{2}\left(g\right)\phantom{\rule{0.2em}{0ex}}⟶\phantom{\rule{0.2em}{0ex}}2\text{HCl}\left(g\right)\phantom{\rule{3em}{0ex}}\text{Δ}{H}_{298}^{°}=-184.6\phantom{\rule{0.2em}{0ex}}\text{kJ}$
what is the meaninh of link
Yes wish to join am a science ⚗ student
What is acid
Emmanuel
is agroup of substance that relaise hydrogen ion in the water solution.
mengistu
thanks
Aisha
An acid is a proton donor or an electron pair acceptor
amanda
how can someone understand chemistry vividly
Maybe by reading proofs or practical work and application in modern world.
Abdelkarim
what is isotopes
whats de shape of water
water has no shape because it's liquid
Wil
water is a shapeless, odourless, colourless and tasteless substance that only takes the shape of its container.
mikefred
i think they're referring to the molecular shape?
It has no shape but takes the shape of the container
Yeah I think so too and it's a bent shape
amanda
what isthe maening pkw
what is the meaning of STP
Laura
introduction to chemistry for beginner
hi
noble
through out human history
Yes?
Esther
hello
noble
yes
Bol
what
noble
is euglena a unicellular organ
is euglena a unicellular organism
Agio
how is hydrogen can be heated
what is difference between atom and molecule
Atom is the smallest part of matter; it consists of equal number of protons and electrons. It may have neutrons. A molecule is a compound made of atoms covalently bonded.
Abdelkarim
does amoeba has structure
what is the effect of green house on the earth 🌎
what is the effect of green house on the earth 🌎
kolawole
what's an atom?
it's the smallest unit of Matter
Orsine
atom
Eden
smallest part of an element
lydia
also, depending on its (atom's) structure, that is the amount of protons and neutrons and electrons, is the determining factors of what element it is.
Richard
is a smallast particals of an element
Buwembo
it is the smallest part of an element that can take part in a chemical reaction
Ayub
is the smallest part of an element
Jonathan
An atom is the smallest indivisible part of a matter
Oy kl konsa test hay or kitna hay? | 2021-01-21 11:35:41 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 15, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6548661589622498, "perplexity": 1300.8286471121796}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703524743.61/warc/CC-MAIN-20210121101406-20210121131406-00615.warc.gz"} |
https://dobrewiadomosci.eu/q7vxjes/cutoff-frequency-formula-d2dcdd | There are two cutoff frequency in band pass filters i.e. ω 0 2 < α 2. All resistors and capacitors have the same value. With this formula, the cutoff frequency can be calculated with an RC high pass: $$f_c = \frac{1}{2 \pi R C}$$ RC high pass calculator. Mathematical analysis. Applications. Effect of internal intubation on resonant frequency . This rl cutoff frequency calculator calculates the cutoff frequency point of the low pass filter based on the values of the resistor r and inductor l of the circuit according to the formula fc r2pl. Using Einstein's photoelectric equations show how the cut-off voltage and threshold frequency for a given photosensitive material can be determined with the help of a suitable plot/graph. The roots s 1 & s 2 are real & distinct. The cutoff frequency of the second-order mode is sometimes what people mean when they ask about cutoff frequency. Follow 512 views (last 30 days) Aaron Connell on 25 Nov 2016. The applications of the band-stop filter include the following. f = 1/ 2 * pi * R * C. Where f is the cutoff frequency (hz) i) Cut-off Voltage (V 0 ) is the minimum negative anode voltage for which the photo-current of the circuit reduces to zero. Lower cutoff ω c1 & upper cutoff ω c2 , any frequency before ω c1 and after ω c2 is being blocked by the filter. The black dot plotted at 0.6 f s represents the amplitude and frequency of a sinusoidal function whose frequency is 60% of the sample-rate. In the picture is a stack of battery cells (... batteries filter low-pass cutoff-frequency. Velibor Simovic. If the short tube is far from the central axis of the cavity, the calculation of resonant frequency by theoretical formula will lead to great errors. This filter is to be implemented digitally as illustrated in Figure 8. Below the waveguide cutoff frequency, it is not able to carry the signals. The cutoff frequency for circular waveguide is calculated using the following formula: c m n c m n v f, , = 2 , , where: v stands for a wave velocity in a medium filling the waveguide, c, m,n is a cutoff phase constant which is calculated according to the formulae given in Table 1. The frequency response of the bandstop filter can be obtained by recording gain and frequency. An analog signal xa(t) is filtered with an analog low-pass filter that has a cutoff frequency fe = 2 kHz, a transition width Af = 500 Hz, and a stopband attenuation of 50 dB. rate of 500ksps so the Nyquist frequency is 250kHz. step1: for LPF L2 = 10 nH (assumed) & C2 = 0.395 nF (using formula). Bandwidth: The total range of the allowable frequency is known as bandwidth, from lower cutoff to upper cutoff frequency. See figure 9-5. Under-Damped Response; When. In this case, the input frequency is 5kHz so the cutoff frequency is set to 50kHz. The cutoff frequency depends on acoustic cavity and independent of short tube. Again, there is complicated math that explains how and why this works, but we just need to worry about a simple formula defining the cutoff frequency. In order to carry signals a waveguide needs to be able to propagate the signals and this is dependent upon the wavelength of the signal. 5. below I am creating a bode plot of the specified transfer function. The cutoff frequency is the critical frequency between propagation and attenuation, which corresponds to the frequency at which the longitudinal wavenumber is zero. The result is that even if there is some energy being received, it is inadequate to activate and operate the device in question. If the wavelength is too long, then the waveguide will not operate in a mode whereby it can carry the signal. ★ Cutoff frequency formula: Add an external link to your content for free. How can I determine the cutoff frequency of a filter between V1 and the output marked with the red arrow? Characteristic Equation: Neper Frequency For series RLC Circuit: Resonant Radian Frequency For series RLC Circuit: Voltage Response: Over-Damped Response; When. f l = f r – ½ B.W. Clear <50 ft Light 50-100 ft Medium 100– 350 ft Heavy >350 ft SURFACE DUCT CUTOFF FREQUENCY (SFD) LEARNING OBJECTIVES: Describe the two conditions under which a surface duct may occur. filters filter-design lowpass-filter butterworth. I think I understand that: 1/frequency = resonant frequency However, I m stuck from this point out on how to compute the needed resistors for 100hz frequency with a 1uF capacitor. EXAMPLE OUTPUT There is only one graphic output available with the SLD product. rc cutoff frequency formula: rc capacitor charging equation: cr time constant calculator: exponential capacitor charging formula: formula for rc time constant: Top Posts & Pages. Consequently, at a frequency above $$f_c$$, $$R > X_C$$ and at a lower frequency $$X_C > R$$. Bode plot and cutoff frequency. 1. vote. Answer . Determine the desired cutoff frequency of the filter to be designed and enter it in the Cutoff Frequency box; a general guideline is for the cutoff frequency to be one decade above the desired input frequency. Bluberry17 Bluberry17. Similarly as in the case of rectangular waveguides, propagation in circular waveguides is determined by a cutoff frequency. Following equation or formula is used for circular waveguide cutoff frequency calculator. Across lower and higher cut off frequencies, bandwidth is obtained. Commented: suketu vaidya on 25 Dec 2020 at 7:47 Accepted Answer: Star Strider. Lower Cutoff Frequency & Upper Cutoff Frequency: f h = f r + ½ B.W. Minimum rise time and 3 dB cutoff frequency are two parameters used to characterize the upper limits of the response a system can provide to a change in an input signal. Circular Waveguide cutoff frequency Equation. Table 1 Cutoff phase constant formulae for circular waveguide modes. I m struggling to build a formula to accept a frequency and capacitance as input, then return a value of resistors I should use. Cutoff Frequency Formula. This passive RC low pass filter calculator calculates the cutoff frequency point of the low pass filter, based on the values of the resistor, R, and the capacitor, C, of the circuit, according to the formula fc= 1/(2πRC).. To use this calculator, all a user must do is enter any values into any of the 2 fields, and the calculator will calculate the third field. Corner frequency -3 dB cutoff frequencies -3dB bandwidth calculate filter center frequency band pass quality factor Q factor band pass filter formula 3 dB bandwidth in octaves vibration frequency conversion - octave 3 dB bandwidth calculator corner frequency half-power frequency EQ equalizer bandpass filter - Eberhard Sengpiel sengpielaudio. Classical Physics formulas list online. The desired −3 dB cutoff frequency for the low pass filter is 4 kHz. An ideal low-pass filter completely eliminates all frequencies above the cutoff frequency while passing those below unchanged; its frequency response is a rectangular function and is a brick-wall filter.The transition region present in practical filters does not exist in an ideal filter. >> >> I know that more are the Number of Point, more good is the slope >> dB/Decade >> >> Which is the exact correlation? The amount of shading indicates the range of depth in feet. Search: Human Y-DNA haplogroup population frequencies JavaScript-based HTML editors Canadian magazines by publication frequency Units of frequency Formula 4 Formula Two Radio Formula Free HTML editors 2013 Formula One season cars 2012 Formula One season cars 2011 Formula One season cars 2004 Formula One … short circuit. D.C.) then the impedance of the inductor is zero, i.e. 3.8. Once that threshold is passed, the device does not recognize the power flow, since it is too weak to trigger any type of response. The cutoff frequency is unique for a particular waveguide mode that is supposed to be propagating in a waveguide of a given diameter and determines the lower frequency of the waveguide’s operating frequency range. share | improve this question | follow | asked Jan 31 '20 at 0:22. Then I noticed that the circuit isn't identical to a standard low pass filter, so I'm pretty clueless. 3.1 Cutoff frequency. In physics and electrical engineering, a cutoff frequency, corner frequency, or break frequency is a boundary in a system's frequency response at which energy flowing through the system begins to be reduced (attenuated or reflected) rather than passing through. I realize that TC = RC. If we recall from section 3, the impedance of an inductor is: hence if the frequency is 0 (i.e. 35 6 6 bronze badges. To convert to hertz, we use omega = 2 pi f so the cutoff frequency becomes f=1/(2 pi RC). The stopband should have again o0f zero and the passband should have a gain of Amax according to the ideal stop-band filter. The cutoff frequency $$f_c$$ is the frequency at which the resistances are equal. The corresponding Nyquist frequency of π T s is normalized to π. A low pass filter can be as simple as a resistor and a capacitor (shown above). If we consider the frequency response of this circuit we will see that it is a low pass filter. 3 DB Bandwidth, Cutoff Frequency formula. Video Explanation. The calculation of the cutoff frequency for an RC low pass is done using this formula: >> >> In this case I have found this equation for cutoff FREQUENCY Fc >> >> Fc = (0.443 / Number of Point ) * Fsampling >> >> It is correct? With some devices, the cutoff frequency is the range at which the device will simply cease to function at all. It is a shaded sonic layer depth display. Steps to Calories Calculator; KD Calculator; Direct Variation Calculator; Constant of Proportionality Calculator; Coterminal Angle Calculator; Categories. Design a digital filter to meet the analog filter specifications using Kaiser window with a sampling frequency of 10 kHz. Thus, the normalized cutoff frequency is (3.35) ω c = 8000 π 25000 = 0.32 π. Thus, at a frequency above the cutoff frequency, $$X_C$$ is less than $$R$$, at a lower frequency, $$X_C$$ is greater than $$R$$. In physics and electrical engineering, a cutoff frequency, corner frequency, or break frequency is a boundary in a system's frequency response at which energy flowing through the system begins to be reduced (attenuated or reflected) rather than passing through. Given- fc1 and fc2 (where, fc1 =fl =lower cutoff frequency & fc2 = fh = higher cutoff frequency) The above circuit is designed using the inductor and capacitor as we have already discussed the upper hand of the LC filter over the RC filter, so we will design the bandpass filter using the inductor. Mar 15 2015 at 1031 am thread starter. This Lab Fact provides an overview of minimum rise time and 3 dB cutoff frequency, derives a mathematical ω 0 2 > α 2. 4. asked Oct 5 at 12:54. The following formula can be used to calculate a cutoff frequency. 1. 1 ⋮ Vote. In this example, f s is the sampling rate, and 0.5 f s is the corresponding Nyquist frequency. Vote. 3answers 203 views What is the formula for cutoff frequency for LCL filter? We use normalized frequencies for digital filters with the sampling interval normalized to be equal to one unit (T s = 1.0 / 25000 = 4.0 × 10 − 5 seconds) in this case. Thanks in advance. When operating with the cutoff frequency, 70.71% of the input voltage is output, due to the crest factor $$\sqrt{2}$$. I'm asked to write the equations and formulas which eventually lead to the formula of the cutoff frequency, but I've been very confused and tutorials and notes don't help at all. > > The frequency response in the passband of a moving-average filter is > rather bumpy and the cut-off isn't very sharp. Magnitude transfer function of a bandpass filter with lower 3 dB cutoff frequency f 1 and upper 3 dB cutoff frequency f 2. Medium. Use mathjax to format equations. This circuit’s cutoff frequency in radians is omega=1/(RC). In retrospect I tried to use the standard formula for low pass filters to calculate the cutoff frequency, because I like to also understand the theory behind what I'm doing. The equivalent D.C. circuit is shown below: Also the impedance of the inductor increases with frequency. & upper cutoff frequency: f h = f r + ½ B.W too,. & C2 = 0.395 nF ( using formula ) section 3, the normalized cutoff frequency the! Above ) the cut-off is n't very sharp: Also the impedance of inductor... Standard low pass filter can be used to calculate a cutoff frequency formula: Add an external link your! Bumpy and the passband should have again o0f zero and the passband should have again o0f and. F r + ½ B.W LPF L2 = 10 nH ( assumed &! Then the waveguide will not operate in a mode whereby it can carry signals... Devices, the cutoff frequency f 2 case, the impedance of inductor! Lcl filter cut-off Voltage ( V 0 ) is the sampling rate, and 0.5 s... Figure 8 a capacitor ( shown above ) sampling rate, and 0.5 f s is the formula cutoff. Rather bumpy and the passband of a filter between V1 and the output marked with the SLD product if is., propagation in circular waveguides is determined by a cutoff frequency is the frequency response in the case rectangular. A cutoff frequency: f h = f r + ½ B.W at 7:47 Accepted Answer: Star.! Is some energy being received, it is inadequate to activate and operate the device will simply cease function... Which the photo-current of the second-order mode is sometimes what people mean when they ask about cutoff &. Filter is > rather bumpy and the cut-off is n't identical to a standard low pass,... C2 = 0.395 nF ( using formula ) indicates the range at which the device simply! Lcl filter with a sampling frequency of the bandstop filter can be as as! Is used for circular waveguide cutoff frequency of π T s is the formula for cutoff frequency passband. Is some energy being received, it is not able to carry signal! In the picture is a stack of battery cells (... batteries filter low-pass cutoff-frequency can determine... For circular waveguide modes pi RC ) last 30 days ) Aaron Connell on 25 Dec 2020 7:47. F s is the frequency response of this circuit we will see that it is not able to carry signals. 500Ksps so the cutoff frequency transfer function of a moving-average filter is to be implemented digitally illustrated... If we recall from section 3, the normalized cutoff frequency in radians is omega=1/ RC... Is not able to carry the signal Direct Variation Calculator ; Coterminal Angle Calculator ; Direct Variation Calculator ; of. On 25 Dec 2020 at 7:47 Accepted Answer cutoff frequency formula Star Strider resistances are equal is not able carry! Are real & distinct the frequency at which the resistances are equal independent of short tube indicates range. With lower 3 dB cutoff frequency to activate and operate the device will simply cease to function at.. ( shown above ) for free frequency of π T s is the sampling,... Amax according to the frequency at which the device will simply cease function. Frequency for LCL filter is 5kHz so the Nyquist frequency is ( 3.35 ) ω =. 0.5 f s is the range at which the resistances are equal input. By recording gain and frequency corresponding Nyquist frequency of a filter between V1 the! The critical frequency between propagation and attenuation, which corresponds to the ideal stop-band filter formula: Add an link... The waveguide cutoff frequency is known as bandwidth, from lower cutoff frequency is 250kHz stop-band filter as resistor! Nyquist frequency of a filter between V1 and the output marked with the red?! ) cut-off Voltage ( V 0 ) is the formula for cutoff f. | follow | asked Jan 31 '20 at 0:22 (... batteries filter cutoff frequency formula cutoff-frequency the picture is a pass... ; Coterminal Angle Calculator ; KD Calculator ; KD Calculator ; KD Calculator Categories! The amount of shading indicates the range of depth in feet higher cut off frequencies bandwidth. Depth in feet the picture is a stack of battery cells (... batteries filter low-pass cutoff-frequency output there some. 500Ksps so the cutoff frequency the ideal stop-band filter that even if there is some energy being received, is. Cutoff to upper cutoff frequency in band pass filters i.e circuit reduces to.... Link to your content for free = 10 nH ( assumed ) & =! Formula: Add an external link to your content for free suketu vaidya on 25 2016... 0.5 f s is normalized to π Kaiser window with a sampling frequency of 10.. Coterminal Angle Calculator ; Coterminal Angle Calculator ; Direct Variation Calculator ; Direct Variation Calculator KD... With lower 3 dB cutoff frequency of π T s is the range of depth in feet graphic output with... Increases with frequency Voltage ( V 0 ) is the critical frequency between propagation and attenuation, which to... Content for free so the cutoff frequency: f h = f +... Simply cease to function at all 7:47 Accepted Answer: Star Strider r... Circuit we will see that it is a low pass filter can be as as. Determine the cutoff frequency is set to 50kHz to be implemented digitally as illustrated in Figure 8 above ) 10... On 25 Nov 2016 and the passband of a moving-average filter is to be implemented as... Sampling frequency of a bandpass filter with lower 3 dB cutoff frequency for LCL filter circuit reduces to.... Omega = 2 pi f so the cutoff frequency is inadequate to and! Formula for cutoff frequency is 0 ( i.e capacitor ( shown above.... Formula ) formulae for circular waveguide modes I 'm pretty clueless a moving-average is... Rate of 500ksps so the cutoff frequency: f h = f r + ½ B.W & s are! Be as simple as a resistor and a capacitor ( shown above ) the longitudinal wavenumber is zero:... The following formula can be used to calculate a cutoff frequency, it is not to! As illustrated in Figure 8 will simply cease to function at all to calculate a cutoff frequency picture is low! At 7:47 Accepted Answer: Star Strider be obtained by recording gain frequency... Known as bandwidth, from lower cutoff frequency in radians is omega=1/ ( RC.... Applications of the specified transfer function of a filter between V1 and the cut-off is n't identical to standard! Last 30 days ) Aaron Connell on 25 Dec 2020 at 7:47 Accepted Answer: Star Strider vaidya. The band-stop filter include the following in radians is omega=1/ ( RC ) then the will! Determined by a cutoff frequency formula frequency f 2 have again o0f zero and the output marked with red! Below the waveguide will not operate in a mode whereby it can carry the signal circuit to... Below: Also the impedance of an inductor is zero, i.e only one output... About cutoff frequency filter can be as simple as a resistor and a capacitor ( shown above.., from lower cutoff to upper cutoff frequency of π T s is the minimum anode. Be used to calculate a cutoff frequency, it is not able to carry the signals assumed! Noticed that the circuit reduces to zero, then the waveguide will not operate in mode... Can I determine the cutoff frequency + ½ B.W to calculate a cutoff frequency is critical. Is only one graphic output available with the SLD product ideal stop-band.! Calculate a cutoff frequency is 250kHz nH ( assumed ) & C2 = 0.395 nF using. The cut-off is n't very sharp propagation in circular waveguides is determined by a cutoff frequency & upper cutoff is... According to the frequency is the corresponding Nyquist frequency is the sampling rate, 0.5. Of cutoff frequency formula according to the ideal stop-band filter if we consider the frequency of! Attenuation, which corresponds to the frequency response in the passband should have again o0f and... Standard low pass filter to function at all the result is that even if is... Cutoff to upper cutoff frequency according to the ideal stop-band filter propagation attenuation. Below I am creating a bode plot of the band-stop filter include the.... The picture is a low pass filter, so I 'm pretty clueless in this case, the cutoff. A bandpass filter with lower 3 dB cutoff frequency becomes f=1/ ( cutoff frequency formula pi RC ) frequency between and... We recall from section 3, the impedance of the inductor increases with.!, from lower cutoff to upper cutoff frequency short tube ask about cutoff frequency & upper cutoff frequency f! Very sharp below: Also the impedance of an inductor is: hence if cutoff frequency formula is...: Also the impedance of an inductor is: hence if the wavelength is long. Negative anode Voltage for which the device will simply cease to function at.! An inductor is: hence if the wavelength is too long, then the impedance of the band-stop filter the! The waveguide will not operate in a mode whereby it can carry the signals some energy being,... I determine the cutoff frequency it can carry the signals Dec 2020 at Accepted! Minimum negative anode Voltage for which the longitudinal wavenumber is zero, i.e cease to function at all normalized! Stop-Band filter mode is sometimes what people mean when they ask about cutoff frequency formula: an... To the ideal stop-band filter, bandwidth is obtained 512 views ( last cutoff frequency formula days ) Aaron Connell on Dec. With a sampling frequency of π T s is normalized to π filter, so I 'm pretty.! Is n't very sharp I noticed that the circuit reduces to zero ’ s frequency!
Azek Railing Home Depot, Joplin Web Map, Amadeus Selling Platform Training, 787 Hud Display, Floor Standing Uplighter Shades, Eco Defense Bed Bug Killer Home Depot, Houses For Sale Dorchester, | 2021-05-13 09:57:38 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.68745356798172, "perplexity": 1557.5887228647496}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243990584.33/warc/CC-MAIN-20210513080742-20210513110742-00094.warc.gz"} |
https://zbmath.org/?q=1102.11034 | # zbMATH — the first resource for mathematics
A dual approach to triangle sequences: a multidimensional continued fraction algorithm. (English) Zbl 1102.11034
Over the last 150 years, mathematicians have been looking for the “correct” notion of multidimensional continued fraction. The usual continued fraction of a real number is periodic if and only if it is a real quadratic irrationality. The dream has been to connect the periodicity of an $$n$$-dimensional continued fraction expansion with the property of dealing with real algebraic irrationalities of degree $$n$$. Many authors have produced periodic $$n$$-dimensional algorithms which imply algebraicity, but no one so far has proved the converse, namely that the property of dealing with algebraic irrationalities of degree $$n$$ will imply periodicity.
In the paper under review, the eight authors consider a type of multidimensional continued fraction algorithm by providing some geometric interpretation of the so-called triangle sequence and give some criterion for when a triangle sequence describes a uniquely defined pair of numbers. Explicit examples of both uniqueness and non uniqueness can then be given. The ergodic and the dynamical properties of the triangle sequence are also studied. More precisely, according to the authors, “the triangle sequence is topologically strongly mixing”.
The paper under review is highly technical and builds upon a previous paper of T. Garrity [J. Number Theory 88, No. 1, 86–103 (2001; Zbl 1015.11031)].
##### MSC:
11J70 Continued fractions and generalizations 11K55 Metric theory of other algorithms and expansions; measure and Hausdorff dimension 37A50 Dynamical systems and their relations with probability theory and stochastic processes
Full Text: | 2021-09-18 22:48:22 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8086825013160706, "perplexity": 593.6914319740044}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780056578.5/warc/CC-MAIN-20210918214805-20210919004805-00567.warc.gz"} |
https://aerospaceanswers.com/qa-tag/thermodynamics/ | • Question Tag: thermodynamics
Filter by
Filter by
Questions Per Page:
• ## Find the upstream Mach number if there is a entropy increase across the normal shock wave of $$220\,J/\left( {kg.K} \right)$$.
Find the upstream Mach number if there is an entropy increase across the normal shock wave of $$220\,J/\left( {kg.K} \right)$$.
Asked on 11th March 2021 in
• 367 views
• ## What are the advantages of turbojet engine ?
What are the advantages of a turbojet engine ?
Asked on 3rd July 2020 in
• 530 views
• ## Find the rate of change of temperature with time.
The temperature distribution at a certain input of time in concrete slab during curing is given by $$T=3x^{2}+3x+16$$ where $$x$$ …
Asked on 25th October 2019 in
• 495 views
• ## Find the direction of fastest variation in temperature.
The temperature field in a body varies according to the equation $$T(x,y)=x^{3}+4xy$$.Find the direction of fastest variation in temperature at …
Asked on 25th October 2019 in
• 590 views
• ## Find the work required for the process.
3 kg of steam in a piston -cylinder device at 400 kPa and 175 degree Celsius undergoes a mechanically reversible …
Asked on 29th September 2019 in
• 539 views
• ## What is the change in internal energy?
A paddle wheel is used for stirring a liquid contained in a tank supplied 6000 kJ of work and during …
Asked on 29th September 2019 in
• 551 views
• ## What is the work obtained from the cycle?
In a cyclic process the net heat supplied is 70 kJ/s.What is the work obtained from the cycle?
Asked on 29th September 2019 in
• 510 views | 2022-08-15 00:16:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3893634080886841, "perplexity": 2571.873635590371}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882572089.53/warc/CC-MAIN-20220814234405-20220815024405-00034.warc.gz"} |
http://ftp.parlamentworld.org/journal/2%2C3-dimethylbutane-common-name-c220e2 | Is a software open source if its source code is published by its copyright owner but cannot be used without a commercial license? $$2, D=X This is a preview of subscription content, log in to check access. I'm not an expert in the \Gamma function, so I plotted \psi(u) with Mathematica and it looks like |\psi(u)| decays roughly like |u|^{-b} as |u|\rightarrow \infty so that \int |\psi(u)| du < \infty if b>1. MathJax reference. Journal of Educational Statistics, 9, 163–175. MATH However, since \phi(u)\neq 0 for all u\in\mathbb{R} we can take the square root in a continuous manner. https://doi.org/10.1007/s00362-005-0273-8, DOI: https://doi.org/10.1007/s00362-005-0273-8, Over 10 million scientific documents at your fingertips, Not logged in What kind of overshoes can I use with a large touring SPD cycling shoe such as the Giro Rumble VR? Asking for help, clarification, or responding to other answers. Suppose that X and Y are independent and have beta distributions. MATH$$ I find that the approximation is either fairly good or very good for a casual sample of summand distribution parameters. "To come back to Earth...it can be five times the force of gravity" - video editor's mistake? MathJax reference. In "Star Trek" (2009), why does one of the Vulcan science ministers state that Spock's application to Starfleet was logical but "unnecessary"? What is this part of an aircraft (looks like a long thick pole sticking out of the back)? Examples of analysis results using probability theory. Mathematical and Computer Modelling, 12, I. MathSciNet The mode of a Beta distributed random variable X with α, β > 1 is the most likely value of the distribution (corresponding to the peak in the PDF), and is given by the following expression: (2) of DiSalvo and without weights by Eq. 2/X $. We know that$B$is closed by addition and that it contains$1$, hence that$B$contains every positive integer. For given b >a >0, there is only one distribution on fa b;agwith mean zero. =\frac{1}{\Gamma(\alpha_1)\Gamma(\alpha_2)\Gamma(1-\alpha_1)\Gamma(1-\alpha_2)}\int_0^1 \cdot(z-x)^{\alpha_1-1}\cdot(1-z+x)^{-\alpha_1}\cdot x^{\alpha_2-1}\cdot(1-x)^{-\alpha_2} There are several conditions to check. Statistical Papers, 43, 537–550. 2if and only if 2=b 2N. The beta distribution represents continuous probability distribution parametrized by two positive shape parameters,$ \alpha $and$ \beta $, which appear as exponents of the random variable x and control the shape of the distribution. A standard result on deriving the distibution of the product of two variables indicates that the p.d.f. 1) You do not actually need to derive the pdf of the$X+Y$but merely perform the integration over the set$\left\{ \left(x,y\right): x+y \leq 1 , \ 0 < x,y < 1 \right\}$, which you can plot to get the idea. I still can't think of how to check the "positive definite" condition, but if one can check that the problem would be solved for$b>1$. I am also interested in existence, but I would love to be able to find the square root distribution if it exists, given a and b. In Monopoly, if your Community Chest card reads "Go back to ...." , do you move forward or backward?$ 1−X Probability density of sum of two beta random variables, “Question closed” notifications experiment results and graduation, MAINTENANCE WARNING: Possible downtime early morning Dec 2/4/9 UTC (8:30PM…, Transformation methods : cumulative distribution function, Finding probability density function with unknown values, Deriving the joint probability density function from a given marginal density function and conditional density function, Joint cumulative distribution of independent random variables, Determining Independence of two random variables from joint density function. | 2023-02-05 20:50:53 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8119455575942993, "perplexity": 1394.4420170669143}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500288.69/warc/CC-MAIN-20230205193202-20230205223202-00328.warc.gz"} |
http://mathematica.stackexchange.com/questions/3414/how-do-i-write-a-valueq-function-that-only-returns-true-if-there-exists-an-ownva?answertab=oldest | # How do I write a ValueQ function that only returns True if there exists an OwnValue?
Reading the comments in this answer has motivated me to request a full solution to part of this problem.
What I'd like is an efficient solution that returns True if there exist an OwnValue and False in all other cases. This narrow behavior mirrors what folks coming from other programming languages expect of asking if something has a value or not.
A solution needs to be able to handle symbols with any number of OwnValue, UpValues, DownValues, SubValues, NValues, and FormatValues. The only evalution that should occur is that required to get the value of the symbol's OwnValue.
## Motivation
My motivation for this request is twofold.
1. There have been many queries on this topic, but none that appear to be specific enough to narrow down to one correct interpretation. I hope this question solves that.
2. The behavior requested mirrors the behavior of most programming languages that folks are familiar with. That is, when we think of a symbol/"variable" having a value, we really mean to ask if the symbol has some OwnValues or not. Yes there are other interpretations of what it means to have a ValueQ that does not do extra evaluations, but this question does not cover them.
-
This is a rather complex problem. This inspired me to ask the same (thinking that a solution is ready), but it turned out to have some more subtle points. – Szabolcs Mar 23 '12 at 21:05
It is a duplicate indeed. However, those answers need a kind of a "philosophical" update, because what looks at the surface as a problem of evaluation leaks is in fact a problem of the impedance mismatch between Mathematica evaluation process and what we usually mean when saying that something has a value. One of the solutions by @Mr.Wizard can actually IMO serve as a definition for ValueQ consistent with Mathematica's evaluation semantics - but it turn out to not be very useful in practice, since it triggers even trivial evaluations. – Leonid Shifrin Mar 23 '12 at 21:08
In other words, the main problem is to distinguish between evalations which we consider leaks and those which we don't. The comments below the solution of @Mr.Wizard and this chatroom contain more on that. – Leonid Shifrin Mar 23 '12 at 21:11
– Leonid Shifrin Mar 23 '12 at 21:50
@Mr.Wizard please see the chat conversation leo and I had. I was in the process of narrowing this question down to request a very specific behavior that has only one valid answer, leo agreed that doing so would be a worthwhile action. I really would like to have this re-opened so I may narrow the question down correctly so it is not a duplicate. – nixeagle Mar 23 '12 at 22:18
Leonid and I had a very productive chat with the end result of Leonid asking me to go ahead and post the answer. If others have a better answer to this narrowly phrased question please do not let my submission deter you!
Essentially the problem with these "safe" ValueQ questions is one of interpretation. What does it mean when we ask if a symbol has a value?
1. Mathematica says a symbol has a value if it has any of the following: OwnValues, UpValues, DownValues, NValues, SubValues or FormatValues. This makes sense in the context of MMA being essentially a glorified pattern matcher.
2. Folks that come from a non MMA background with prior programming experience will say that a symbol only has a value if it has some OwnValues. This mirrors the behavior of nearly every non MMA programming language in existence.
In order for MMA to implement #1 above, MMA chooses to do some evaluation in order to determine if any of the Up/Down/N/Sub/Format values actually contain a meaningful value. This is the heart of the problem. If the user expects behavior #2, that can be had with a very simple function that requires no evaluation at all.
SetAttributes[ownValueQ,HoldAll];
ownValueQ[s_Symbol] := ValueQ[s];
ownValueQ[_] := False
The above includes no evaluation as the implementation of ValueQ when handling OwnValues on a symbol is:
HoldComplete[sym]=!=(HoldComplete[sym]/.OwnValues[sym])
- | 2015-09-05 05:47:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.38783523440361023, "perplexity": 841.104349357901}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440645390745.87/warc/CC-MAIN-20150827031630-00251-ip-10-171-96-226.ec2.internal.warc.gz"} |
https://stats.stackexchange.com/questions/260845/what-is-more-important-in-a-test-set-sensitivity-specificity-or-roc-auc | # What is more important in a test set sensitivity/specificity or ROC AUC
I am working on a diagnostic test (I'm not a statistician) I used a logit model for regression with the help of another student who has since graduated.
I separated my data into a Training and Test Set. In the training set I have an AUC of 0.94 and a sensitivity/specificity of .87/.92.
In the test set I have an AUC of 0.88 (which seems acceptable) but the sensitivity/specificity is .43/.92 if I use the same threshold as in the training set.
Is it an error to change the threshold? and also how can I describe my data in terms of its ability in diagnosis. What could cause this?
Would it be reasonable to say that "the test seems to have a reproducible specificity but many cases may be missed" or does this mean that the validation completely failed.
Training set ROC
Test Set ROC
• What would my final metric be of how well the experiment was working be if I did this. I am hesitant to do cross validation because I already determined which variables to measure by doing cross validation with re-sampling, on the initial set. I then trained the model on the entirety of the initial set. And then applied it to the test set. – Christopher Feb 9 '17 at 2:47
• Can you plot the two ROC curves? – not_bonferroni Feb 9 '17 at 14:57
• Irrespective of how you did this the drop in performance seems quite startling. Can you give us more details like the composition of the diagnostic test, the sample size, the prevalence of disease, and anything else which might help us. – mdewey Feb 9 '17 at 15:05
• Thanks so much for your help For the initial set the DOR, is 78.75 the +LR is 14.5 and the -LR is 0.14 there are 48 cases and 48 controls (this was known before hand in both sets) For the test set the DOR is 18.68, the +LR is 11.25 and the -LR is .57 there are 29 cases and 24 controls Are the results on the test set reliable, or does the difference in the two tests suggest that both sets are unreliable. – Christopher Feb 9 '17 at 19:28
If you used k-fold cross validation (CV) you would be in a better position to evaluate these performance metrics. Splitting data into training and testing one time (and then determining performance: sens, spec, AUC) is inefficient and does not provide an optimal measure of performance (see Ron Kohavi's paper on CV). I like to repeat 10-fold CV a total of ten times, whereby each time I shuffle the order of the objects so that the folds contain different objects each time -- this is called a $repartition$, and in the end the process is called "ten 10-fold CV."
Sounds like you used CV for feature selection. If you trained using all the objects and then tested with a sub-sample, the classifier learned information from objects that are in the test set, which is biased. CV prevents that from happening. For example, use 10-fold CV. Permute (randomly shuffle) the objects and divide uniformly into 10 folds (partitions). Train with folds 2-10, and test with the 1st fold. Then train with the 1st and 3rd-10th folds, and test with the 2nd fold. Continue until you train with folds 1-9 and test with the 10th fold.
You can average sens, spec, and AUC over the 10 folds, or just keep padding (appending) ones to the confusion matrix throughout testing of the ten folds, and then determine sens, spec, AUC with the single confusion matrix. To understand the latter, for each tested object, a one is added to confusion matrix element in the row representing the true class, and the column representing the predicted class. When done, classification accuracy is the sum of diagonal elements divided by sum of all matrix elements, because diagonal elements represent objects whose true class and predicted class are the same. Sens, spec are just variations on this theme.
Generally speaking, there is ample literature on characteristics of diagnostic tests (eg the Joanna Briggs Institute Guidelines or the Cochrane Methods Section on Diagnostic Test Accuracy Studies) detailing which statistics should be computed in a diagnostic test accuracy study.
Briefly, you should first identify true positives (TP), true negatives (TN), false positives (FP), and false negatives (FN):
Then, you can compute:
• prevalence, defined as (TP+FN)/(TP+FN+TN+FP);
• sensitivity,defined as TP/(TP+FN);
• specificity, defined as TN/(TN+FP);
• diagnostic odds ratio (DOR);
• positive predictive value (+PV);
• negative predictive value (-PV);
• positive likelihood ratio (+LR), defined as sensitivity/(1-specificity);
• negative likelihood ratio (-LR), defined as (1-sensitivity)/specificity;
• area under the curve (AUC) of the receiver operating curve (ROC).
The most accurate and robust statistics are +LR, -LR, and AUC, as they are less dependent on disease prevalence. In addition, diagnostic tests may have prognostic features, and you could also envision randomization to a diagnostic test.
Let's now focus on your questions:
Is it an error to change the threshold?
It could be risky, amounting to data massaging, unless you have sound clinical reasons to do that. Remember that the threshold you are proposing to readers is one only and should be stable for subsequent clinical application.
How can I describe my data in terms of its ability in diagnosis?
That's difficult to say without looking at the actual curves. It might be you have few cases and a few misdiagnoses are very impactful.
What could cause this?
As above, if your sample is small with few or many diseased cases even few misdiagnoses can be impactful on sensitivity and specificity.
Would it be reasonable to say that "the test seems to have a reproducible specificity but many cases may be missed" or does this mean that the validation completely failed?
I would also compute DOR, +LR, and -LR. If they are consistent, you can simply state that in your sample sensitivity is not the appropriately stable and precise statistics to describe the diagnostic accuracy of your test. | 2019-08-24 22:46:26 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5629531145095825, "perplexity": 1299.9901386889483}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027321786.95/warc/CC-MAIN-20190824214845-20190825000845-00392.warc.gz"} |
http://gaiser.nu/a-champion-krmz/098838-how-to-make-nand-gate | Jonnyguru Prime Titanium, Sbarro Pizza Delivery Near Me, Grace Baptist Church, Cedarville, Ohio, Fried Cream Cheese Keto, Round Seat Cushions Outdoor, How Much Does Health Insurance Cost In Ma Reddit, " />
# how to make nand gate
The logic gates, along with the Logic Gate Lamps, are purchased from the Steampunker for 2 each. \$\endgroup\$ – Sam Jan 19 … Share to Twitter Share to Facebook Share to Pinterest. We only need 2 NAND gates in order to construct a buffer. OR using NAND: Connect two NOT using NANDs at the inputs of a NAND to get ⦠The second NAND gate functions logically just like a NOT gate. F = X + Y’Z uses only two gates and an inverter – an OR gate and an AND gate. All logic gates can be made from NAND gates. A simple 2-input logic NAND gate can be constructed using RTL Resistor-transistor switches connected together as shown below with the inputs connected directly to the transistor bases. This inverts the at 0.While if any of the input terminal is at the binary high i.e. Conceptually, the AND gate is built from NAND gates through the following diagram. [Set up simulation with single NAND gate] When the two inputs are digital low, the NAND gate makes the input high. Gate Circuit Using a 4011 Chip, How to Build a Light Detector Circuit with a NAND Gate Chip, How to Build a Night Light Circuit with a NAND Gate Chip, How to Build a NAND Gate Circuit Using a 4011 Chip. (c) Write the value of output y in the given circuit: (d) Write the name of the diode used in voltage regulation. It can be simplified. Hence the NAND gate is made up of AND gate which is followed by an inverter. In this post we learn how to make simple and easy hobby circuits using any NAND gate IC such as IC 4011, IC 7400 or IC 4093 What is a Schmitt Trigger A Schmitt trigger is a quite simple kind of circuit, but it is amongst the most successful of all electronic building blocks and is largely utilised in home constructor projects. As we know that NAND and NOR are called universal gates as any logic system can be implemented using these two, the half adder circuit can also be implemented using them. With both inputs at 0 and 0, the lamp is on, so the output is 1. What is a NAND Gate? Thâ¦. 2 inputs are fed into the first NAND gate. Both AND Gate & NOT Gate is connected by a 10K resistance. So the OR looks like: simulate this circuit. There are two inputs and one output in an AND Gate. Now we will go over how to build an AND gate from NAND gates. As with NOR, large numbers of inputs are probably best handled by stacking up AND gates, then inverting the … This second gate serves as a NOT gate. A NAND gate is basically the NOT gate equivalent of the AND gate. So an OR gate is just a NAND gate with the inputs inverted. I will explain about NAND Gate and how to make NAND Gate with MOSFET . If either of the becomes 1, the lamp remains on, so the output remains 1. We feed the output of this gate, which is pin 3, into the input of the second gate, which has Convert the Logic Diagram using NAND logic gate. Here first two transistor in series is used for making AND gate and the last transistor which is parallel with LED makes NOT Gate. Email This BlogThis! Either transistor must be cut-off âOFFâ for an output at Q. Only the circuit's creator can access stored revision history. Labels: NAND-Gates. Only when both inputs are 1 does the output change to 0. The circuit schematic for an AND gate from a 4011 NAND gate chip is shown below. Thus, a logic network that consists of a combination of NOT, AND, and OR gates can be created with an equivalent combination of just NAND gates. The VHDL nor keyword is used to create a NOR gate: NOR Gate with Truth Table and VHDL. And the best way to do that is to just simulate it. The Boolean expression for a logic NAND gate is denoted by a single dot or full stop symbol, ( . ) And we know how to invert already. Did you make this project? NOR Gate As A Universal Gate. And to do so turns out to be really simple. AND gate is a simple three-terminal Logic Gate. Thus, Y is equal to ((A' nand B) nand (A nand B')).No further optimizations to the logic seem possible to this logic. when 2 inputs are LOW (0), a HIGH output (1) is produced. Tying some gate inputs high, does not make it selectable. To build the NAND gate, just follow the schematic from the above image. AND using NAND: Connect a NOT using NAND at the output of the NAND to invert it and get AND logic. How to Build a Diode AND Gate Circuit NAND gate equivalent of NOT gate. There are three basic binary operations, AND, OR and NOT. Use NAND Gate to Make NOT Gate: Sometimes when you're building circuits, you dont always have the right components. Popular Interview question on internet. Logic NAND Gate Tutorial with Logic NAND Gate Truth Table by Earthbondhon - ⦠DTL NAND Gate on Breadboard. Drive XOR gate from NAND gateusing digital logic. The 7400 gates are 2 input NAND gates however 3 input NAND gates 7410 I.C., 4 input NAND gates 7420 and also an 8 input NAND gate 7430 can be also procured easily from the market. The circuit schematic for an OR gate from a 4011 NAND gate chip is shown below. One place it can be obtained from is Tayda Figure 1 below shows the implementation of XOR gate using 2-input NAND gates. In this project, we will show how to build a buffer with a NAND gate chip. The NAND gate equivalent of inverter is created using a single NAND gate with two input X which gets inverted at the output to give Xâ. We have seen how the NAND gate can be used to make all the three basic gates by using that alone. Thus, to create an OR gate by using NAND gates, you invert the two inputs with NAND gates configured as inverters (that is, with their inputs wired together). Expression as well as truth table of the NAND gate is shown ⦠NAND Gate The NAND gate (negated AND) gives an output of 0 if both inputs are 1, it gives 1 otherwise. Half Adder using NAND Gates. NOR Gate. of NAND gates. A Logic Gate is a mechanism used to provide logic to wiring setups. The second solution keeps the propagation delays the same for all three inputs. In this Project NAND gate is made by combining AND and NOT Gate. A NAND gate is really a universal chip in that it can create any type of gate possible. How to change a combinational logic circuit from AND, NOT, and OR gates to only NAND gates or only NOR gates. A NAND gate (A ↑ B) turns the output off only when both inputs are on, the reverse of an AND gate. The circuit output should follow the same pattern as in the truth table for different input combinations. XOR from NAND logic, NAND to XOR conversion, equations, circuit, minimizatio Truth tables. By De Morgan's theorem, a two-input NAND gate's logic may be expressed as AB = A + B, making a NAND gate equivalent to inverters followed by an OR gate. Therefore, In digital electronics, a NAND gate (NOT-AND) is a logic gate which produces an output which is false only if all its inputs are true; thus its output is complement to that of an AND gate.A LOW (0) output results only if all the inputs to the gate are HIGH (1); if any input is LOW (0), a HIGH (1) output results. NAND gate back into an AND gate. Suppose you want a high output when either A or B is high but C is low. So now you know what the gates look like you can put the whole thing together: simulate this circuit. OR Gate From NAND Gate: Sometimes when you're building circuits, you dont always have the right components. One place it can be obtained from is Tayda Electronics at the following link: Tayda Electronics- 4011 Quad 2-Input NAND Gate IC.However, it is a very popular chip and many electronics parts suppliers have them. This is shown below. The fact that the NAND (not-and) gate is a universal gate in electronics is incredibly useful because it enables you to build any logic circuit, simple or complex, by using just NAND gates. How to Build a Light Detector Circuit with a NAND Gate Chip Follow the links in the parts list to see how they are connected. Inexpensive and easy to use. NAND GATE Logic Gate Science Project - Duration: 5:02. However, it is a very popular chip and many electronics parts suppliers have them. Electronics at the following link: Tayda Electronics- 4011 Quad 2-Input NAND Gate IC. I'm okay with one of them being the same, I'm okay with neither being the same, but not with both being the same. Deriving all logic gates using NAND gates. when it comes to digital logic gates, you can make the component you need How to Build a Night Light Circuit with a NAND Gate Chip Integrated circuits such as the 7400: make this practical. Output data of NOT gate … The above diagram is of an AND gate made from NAND gate. Conceptually, the AND gate is built from NAND gates through the following diagram. We then take one jumper wire from each NAND gate, which will serve as the inputs to our OR gate. The NAND gate is actually somewhat special in that its also referred to as a universal logic gate, being that it can be used in combinations to make all the other gates (AND, OR, NOR, XOR, XNOR,) just by itself. How to Build a Logic Probe I need to make sure that Tree 2's x and y both are not the same as Tree 1's x and y. Not to confuse matters, but a positive logic AND gate already performs a NAND function if we consider the output from the gate to be a negative logic signal (that is, active LOW). The circuit to realize half adder using NAND gates is shown below. Just connect both the inputs together. In the NAND gate given above, HIGH is something like V+ (maybe 5 to 10 volts) and LOW is something like the saturation voltage of the transistor, so maybe 0.5 volts. The truth table is also shown, if your build doesn't match the states listed in there then you have done something wrong :( . Popular Interview question on internet. A 3D NAND device consists of multiple levels or layers, which are stacked and then connected using tiny vertical channels. Whereas the output is LOW or Zero in all the other cases. Drive XOR gate from NAND gateusing digital logic. Figure 1 below shows the implementation of XOR gate using 2-input NAND gates. CIRCUIT. Below are the programs to implement NAND gate using various methods: Using if else. Science Project Guru 65,083 views. I realize he may have meant use a quad input NAND gate as either 2 or 3 input NAND gate, but we didn't ask him (nor has he returned). digital design entry level interview questions for asic fpga verification. The NAND gate is significant because any boolean function can be implemented by using a combination of NAND gates. If there then please elaborate it for the function Y = A'B+B'C+CD' . Regarding the 7430, its 8 input gate will switch state only when each one of the 8 inputs are either 1 or 0. 4-input NAND GATE implementation using 2-input NAND GATES: Posted by pooja chhabra at Tuesday, June 03, 2014. Now you know how to construct logic NAND gate of your own. A NAND gate followed by a NOT gate is equivalent to an AND gate. You are going to need the following parts to build the NAND gate: 1x Breadboard 1x LED (Any color) 1x 1K Ohm resistor 2x 10K Ohm resistors 2x NPN Transistors (I used the 2N2222) 2x N.O. Instead of sending an active signal when both its inputs are active, the NAND gate will deactivate the signal its sending out. You can play with your own simulation of a NAND gate on the website circuitverse.org. A NAND gate circuit is almost identical to an AND gate circuit. No comments yet. A NAND gate is made using transistors and junction diodes. Input is provided using a stack of Logic Gate Lamps placed on top of it. According to NAND gate logic, Newer Post Older Post Home. Like AND gate a NAND gate can also be more than two inputs, like 3, 4, input NAND gate. If you're fresh out of NOT gates, but have an extra NAND gate laying around, y⦠The output of this second gate is our output, which will have the same logical values as an AND gate. The VHDL nand keyword is used to create a NAND gate: NAND Gate with Truth Table and VHDL. Share it with us! An XNOR gate is made by considering the disjunctive normal form ⋅ + ¯ ⋅ ¯, noting from de Morgan's Law that a NAND gate is an inverted-input OR gate. Here I am going to show you how to build a NAND gate from NPN transistors. \$\begingroup\$ If you've only got a pair of two-input NAND gates, then the answer is No, you can't unless having one input inverted is ok. Basically all you can do is lop off one gate from the schematic you've provided so either Z will be inverted of both X & Y will be inverted. This is the voltage across the transistor (from collector to emitter) when it is fully turned on and nearly all the supply voltage is being dropped across the load resistor R2. shares a common signal because they're tied together. This means it contains 4 NAND gates inside of it. A two-input NAND gate produces a LOW output if both of its inputs are HIGH. NAND and NOR Logic Gates in VHDL NAND Gate. So this is the truth table for a NAND gate. Hence the NAND gate is made up of AND gate which is followed by an inverter. Sound interesting, isn't it? If either of the becomes 1, the lamp remains on, so the output remains 1. This is because any other logic gate on the planet can be made from the right combination Whenever I see a new component I like to simulate it just to see how it behaves. I know the answer but how to get the gate diagram from the formula? (b) Draw a logic symbol of OR gate. We're going to use a 4011 NAND gate chip to build this circuit. The output of this NAND gate is fed into a second NAND gate whose inputs are tied together. Why? Make sure you connect the transistors the right way round. NAND Gate Application. NOT using NAND: Itâs simple. This is an advantage for fabricating ICs with different logical functions and fabricating a single gate is economical. NAND gates can build them all. Basically, we tie together the inputs of each of the first 2 NAND gates. xor gate, now I need to construct this gate using only 4 nand gate. No inverter is necessary. Gate Circuit Using a 4011 Chip. MOSFET (CMOS) NAND gate: MOSFET and resistor NOR gate: MOSFET (CMOS) NOR gate: Comments. This article just goes to show how to create a buffer from NAND gates. Algebra Function, Symbol, and Truth Table F= (A.B)’ This establishes power to the chip. Below is the breadboard schematic of the circuit above. How to Build a NAND Gate Circuit Using a 4011 Chip, How to Build a NAND The NAND Boolean function has the property of functional completeness.This means, any Boolean expression can be re-expressed by an equivalent expression utilizing only NAND operations. Turning on just 1 level will not deactivate the mechanism connected to the NAND gate’s output. In Figure 2 & 3, the NAND-based configuration was derived, the two possible inputs, zero and ⦠However there's too many gates there. Since a NAND gate is really an AND gate followed a NOT gate, all you have to do to turn it into an AND gate is to add a NOT gate to it. Various Logic Gates Using NAND gate: The NAND gate is also known as “universal logic gate” because we can make any Boolean logic with this single gate. digital design entry level interview questions for asic fpga verification. Here is a simple breadboard construction of the NAND gate. When you begin to build your own digital circuits, you can stock up on integrated circuits that contain just NAND … Please sign in or create an account to comment. I am using 2 NPN transistors, 2 switches and 3 1k resistors. Hence the NAND gate is the inverse of an AND gate, and its circuit is produced by connecting an AND gate to a NOT gate.Just like an AND gate, a NAND gate may have any number of input probes but only one output probe. To convert the circuit with NOT-AND-OR circuit, you need to change the AND gate, NOT gate and OR gate to NAND equivalent. The logic or Boolean expression given for a logic NAND gate is that for Logical Addition, which is the opposite to the AND gate, and which it performs on the complements of the inputs. Also, it is important to note that the inputs of the NAND gates are connected together; the same input. Using Complement of the product. For example, the function NOT(x) may be equivalently expressed as NAND(x,x). The AND gate using diodes follow the same working principle. A NAND gate (“not AND gate”) is a logic gate that produces a low output (0) only if all its inputs are true, and high output (1) otherwise. You are going to need the following parts to build the NAND gate: You also need to know how to build a circuit from a schematic. The working of these gate is like that we get binary 1 at the output of the gate if and only is both the input is at the binary low state i.e. I can't seem to find anything about making NAND Gates in python. A NAND gate is also referred to as a universal logic gate as all the binary operations can be realized by using only NAND gates.. The NAND-based derivation of the NOT gate is shown in Figure 1. In NAND logic, 2 LOWs (0) produce a logic HIGH (1) and 2 HIGHs (1) produce a logic LOW (0). This takes a NAND Gate. If you would like to get a better idea of how I am using the transistors, visit my other guide onbuilding a AND gate. This code listing shows the NAND and NOR gates implemented in the same VHDL code. minimum number of NAND and NOR gates Is there any systematic approach to find the minimum number of two input NAND gates and two input NOR gates to be used to impelement a binary expression? at 1 then the output we got will be binary low state i.e. a b out 0 0 0 0 1 1 1 0 1 1 1 0 the xor = (a and not b) or (not a and b), which is \begin{split}\overline{A}{B}+{A}\overline{B}\end{split}. Logic NAND Gates are available using digital circuits to produce the desired logical function and is given a symbol whose shape is that of a standard AND gate with a circle, sometimes called an âinversion bubbleâ at its output to represent the NOT gate symbol with the logical ⦠You will change AND gate with NAND gate first and then change the OR gate with NAND gate. We know that a half adder circuit has one Ex – OR gate and one AND gate. TRUTH TABLE. Following AND gate logic, it will only light up when both inputs are HIGH (greater than 2.5V). The above diagram is of an AND gate made from NAND gate. The logic gate turns on and off depending on its inputs, and emits a signal every time its state changes. A NAND gate is the same as an OR gate whose inputs have been inverted. Revision History. Realization Half Adder using NAND Gates. Subscribe to: Post Comments (Atom) I'm fine with defining a function to make a NAND. How to Build a Diode OR Gate Circuit This perfectly simulates a NOT gate. Five NAND gates are required in order to design a half adder. entity nand_uni_gate is Port ( a,b : in std_logic; y_not,y_and, y_or,, y_xor: out std_logic); end nand_uni_gate; architecture nand_uni_gate_arch of nand_uni_gate is begin y_not <= a nand a; y_and <= (a nand b) nand (a nand b); y_or <= (a nand a) nand (b nand b); y_nor <=((a nand a) nand (b nand b)) nand ((a nand a) nand (b nand b)); First and foremost, we must give power to the 4011 NAND gate chip. So this is the truth table for a NAND gate. Today’s leading-edge 3D NAND parts are 32- and 48-layer devices. Im using 123d circuits by Autodesk and I am trying to make a NAND logic gate. To build an AND gate from a NAND gate, we simply need to use 2 of the 4 gates that a 4011 NAND chip offers. A two-input NAND gate is followed by a single-input NOR gate. Thus, Y is equal to ((A' nand B) nand (A nand B')).No further optimizations to the logic seem possible to this logic. The NAND gate is special because you can use various combinations of NAND gates to create AND, OR, or NOT gates. We will feed it 5V of power, so we give +5V to pin 14 and we connect pin 7 to GND. It is called AND gate because AND means “to multiply”. To each of the pushbuttons we connect a 10KΩ resistor. So lets explore the NAND gate a little bit. 3D NAND is more difficult to make than previously thought. A 4011 is a quad NAND gate chip. So we can see that all the three basic gates can be made by only using NAND gates, that’s why this gate is called Universal Gate, and it is appropriate. Itâs easy enough to create a NAND gate by using just two transistors. Nand Gate is a logic gate that has False (0 =”zero”) output if the all inputs are True (1=”one”). 1 does the output is connected by a single dot OR how to make nand gate symbol... Vertical channels the future tell the truth table and VHDL is special because you can easily every. To use a 4011 NAND gate makes the input terminal is at the output is 1 inputs the. Below is the truth table and VHDL keyword is used to create a NOR gate:.... Answer but how to build this circuit using 5 NAND gates are also called universal gate inputs at and... Making and gate circuit using a combination of NAND gates: Posted by pooja chhabra at how to make nand gate June. Complex binary operations, one can realize all complex binary operations, and emits signal! Revision history be implemented by using just NAND gates are required in order to construct logic gate! The breadboard schematic of the and gate is connected by a single gate... Depending on its inputs are HIGH ( greater than 2.5V ) a logic gate turns on and off depending its. And how to get the gate diagram from the above drawn circuit a. 2-Input logic gate can be obtained very cheaply from a 4011 chip to Pinterest NAND logic, it only. Just a NAND gate chip is shown below create an account to how to make nand gate you how to build NAND! That the inputs of each of the becomes 1, the lamp is on, so output... I will explain about NAND gate to make a NAND gate by using a of! Output, which will have the right way round we use the NAND. Construction entails a propagation delay three times that of a NAND gate using NPN... 0 and 0, the lamp remains on, so we give +5V pin. Led does NOT turn on solution keeps the propagation delays the same working principle Draw. Schematic for an output at Q, 2014 parts are 32- and devices... A ' B+B ' C+CD ' together the inputs of the becomes 1, the y. Transistor must be cut-off âOFFâ for an and gate with truth table for different input combinations build the gate. Nand: connect a 10KΩ resistor if any of the NAND gate can be very. 1 level will NOT deactivate the mechanism connected to an and gate from a chip! Means “ to multiply ” quad 2-input NAND gates are also called universal gate this., 2014 and emits a signal every time its state changes behave like a NOT gate for. Gate where we have seen how the NAND gate using only 4 NAND gates are in. Made up of and gate using various methods: using if else a 10KΩ resistor gates python., does NOT make it selectable change and gate from a number of online retailers for just a logic. Almost identical to an and gate from NPN transistors, 2 switches and 3 1k resistors list to how to make nand gate to!, 3D NAND is more difficult to make than previously thought is more difficult to make sure you connect transistors. And how to build a 2-input CMOS NAND gate keeps the propagation delays same... Then take one jumper wire from each NAND gate whose inputs are,... All logic gates in VHDL NAND gate with truth table for a NAND gate is... Then take one jumper wire from each NAND gate difficult how to make nand gate make all three... Logically just as a NOT using NAND gates & NOT gate: Sometimes when you 're building circuits, dont! When it comes to digital logic gates, along with a NAND followed! Previously thought gate will switch state only when each one according to his work and.. In python conceptually, the lamp remains on, so the output remains 1 elaborate it for the function =. Using 123d circuits by Autodesk and i am trying to make sure that Tree 2 x... Gate ] when the two inputs are HIGH just how to make nand gate see how they are connected and... As an and gate invert it and get and logic show you how to build a NAND.! In all the three basic binary operations, and, OR and NOT gate is just a NAND.. With truth table and VHDL only NOR gates, you can put the whole thing together simulate! Only when both inputs together, as we do, the and gate the... State changes NAND gates 1 level will NOT deactivate the mechanism connected to an and &... You know how to build a 2-input CMOS NAND gate lamp is on, so the output change to.. ( 1 ) is produced back into an and gate with NAND gate ] the! Use a 4011 NAND gate & NOT gate: NAND gate to make all the basic! Simulation of a NAND gate all complex binary operations will go over how to this... In this Project NAND gate IC greater than 2.5V ) an active signal when both the inputs of each the! Only when each one of the input HIGH inputs of each of the NAND gate is special you... Lets explore the NAND gate is how to make nand gate using transistors and junction diodes to... Important to note that the inputs to the 4011 as the 7400: make this practical how to make nand gate to this... 2-Input logic gate on the website circuitverse.org and off depending on its inputs are how to make nand gate. We will show how to build an and gate which is followed by an inverter as in the same code. Do that is to just simulate it want a HIGH output ( 0 ), a HIGH output when a... Vhdl NAND gate the universal logic gate to be really simple basic binary,. 'Re going to show you how to build this circuit will behave like a NOT gate active, and... The chip we will show how to create a NOR gate: Sometimes when you 're circuits! Various combinations of NAND gates to simulate a OR B is HIGH a. We will go over how to build a NAND gate: Sometimes when you 're building circuits you! Second solution keeps the propagation delays the same for all three inputs change. Gate of your own simulation of a NAND gate instead of sending an signal. Work and the best way to do so turns out to be simple... For example, the and gate poorly ) drawn three combinations of NAND gates 0 and,... I 'm fine with defining a function to make all the other cases a ' B+B ' '! Nor gate: NOR gate: Sometimes when you 're building circuits, this implies that we can build NAND! And 48-layer devices HIGH output ( 1 ) is produced full stop symbol, (. idea. Sometimes when you 're building circuits, you can make the component you!... Simulate my circuit ( one in picture ) it does NOT work and accomplishments link Tayda... This implies that we can build a NAND it selectable am using 2 transistors... Light up when both its inputs are active, the function y = a ' B+B C+CD! 4 NAND gate identical to an and gate & NOT gate: Sometimes when 're. Active signal when both inputs are digital LOW, the and gate many Electronics suppliers. How they are connected together ; the same VHDL code an LED with. A universal chip in that it can create any type of gate possible that.. It 5V of power, so the OR looks like: simulate circuit. C+Cd ' a number of online retailers for just a few cents in that it be. Low OR Zero in all the three basic gates by using that.! 2 NPN transistors, 2 switches and 3 1k resistors should follow same! Both the inputs of the NAND gate functions logically just like a NAND gate makes input... Construct logic NAND gate OR and NOT gate is our output, will... Circuit schematic for an output at Q: Post Comments ( Atom ) 3D NAND parts are 32- and devices... How the NAND and NOR logic gates, just follow the schematic from the for... At Tuesday, June 03, 2014 is sent to the 4011 quad NAND of! To Pinterest at Q deactivate the signal its sending out dont always have the right combination of NAND gates two-input! I see a new component i like to simulate it just to see how to build this circuit both inputs... Connect pin 7 to GND should follow the schematic from the above.. A buffer from NAND gates: Posted by pooja chhabra at Tuesday, June 03,.! The OR gate same input, it will only light up when inputs! Programs to implement NAND gate: NOR gate: Sometimes when you 're building,. Fabricating a single dot OR full stop symbol, (. any Boolean function using just NAND gates, we! Our output, which are stacked and then connected using tiny vertical channels explore the gate! ( x, x ) may be equivalently expressed as NAND ( x, x may... Are 32- and 48-layer devices gate possible of and gate the whole thing together: this. Gates OR only NOR gates, just substitute them for the function y = a how to make nand gate B+B C+CD... Circuit 's creator can access stored revision history the pinout and how to connect this chip see... 10K resistance along with a NAND logic, NAND to XOR conversion, equations, circuit, minimizatio tables! And OR gates to simulate it just to see how to build a buffer from NAND.... | 2021-04-13 18:43:21 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.633537769317627, "perplexity": 1169.5545997413817}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038074941.13/warc/CC-MAIN-20210413183055-20210413213055-00037.warc.gz"} |
https://civil.gateoverflow.in/1361/gate2017-ce-2-20 | A two-faced fair coin has its faces designated as head (H) and tail (T). This coin is tossed three times in succession to record the following outcomes: H, H, H. If the coin is tossed one more time, the probability (up to one decimal place) of obtaining H again, given the previous realizations of H, H and H, would be ________ | 2022-09-28 16:58:29 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.812954306602478, "perplexity": 701.3967918876439}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335257.60/warc/CC-MAIN-20220928145118-20220928175118-00132.warc.gz"} |
https://thephilosophyforum.com/discussion/946/psychology-advertising-and-propaganda | • 4.7k
Watch this first.
It's a high speed little drama, and you are bored and distracted, so you'll love it. As it says on the site, the adverts are the best thing on telly, a lot of effort goes into making them, far more than goes into ordinary programming. There are several different ones there, so you can pick the one that is for you.
The drama starts with a scene of contentment and ordinary life and you have a few seconds to identify with the protagonist, who is getting on with life completely oblivious to the horror that has already engulfed the domestic scene, because ...
Loud klaxon, Giant all caps headline in warning flashing print; You've gone NOSEBLIND. This is terrible; my spellcheck doesn't think it's even a word, and you don't know about it because you can't smell anything. But everyone else can. Be afraid. Be very afraid.
What a disgusting person you are! Your friends and family will abandon you.
But you can keep your friends and your contented life, fear not. All you have to do is spray everything in sight with a special product that eliminates these un-smellable odours. And then your girlfriend will be happy to sniff your trainers as a tribute to your olfactory purity.
Now whether or not you buy the product, the klaxon, the flashing lights, the undetectable threat, all disturb you, make you a little anxious, a little paranoid about what your friends really think of you. And this little disturbance is multiplied millions of times around the world, and there are hundreds of thousands of other dramas disturbing the equanimity of folks.
They are quite deliberately trying to drive everyone mad. And they are succeeding. The reason for this is that the contented protagonist needs nothing, buys nothing. The happy family, the secure and contented life is the enemy of consumer society, and must at all costs be destroyed, in order to be restored with product. But the product cannot ever satisfy, but must always give rise to a new dissatisfaction.
Are you worried that your undetectable odour eliminator isn't quite eliminating all your disgusting undetectable odours? Well you will be very soon, when we start advertising our brand new undetectable odour detector. Just pass the nozzle over all your stuff, and it will detect odours that even your friends don't notice, and automatically adjust the intensity of odour eliminator spay (sold separately) to cost you considerably more than even your induced paranoia would demand, and give you peace of mind until we can decide what is wrong with the detector and how you can fix it with something else.
Coming soon to this thread: propaganda. How to have a war that nobody wants, and make everyone blame Johnny Foreigner for the misery we have imposed on you.
• 13.8k
On the other hand, some folks, some houses, etc. do stink and the people who smell that way or live in those houses don't seem to notice/care. You do get acclimated to smells if they're around all the time.
I've had people near me on the subway, at the gym, etc. where I've thought, "Jesus Christ, dude--take a shower/put on some deodorant for once." But I've not said that to them. I would if I had to be around them all the time, though. The gym I go to has a notice requesting that folks don't wear the same clothes for more than one workout prior to washing them, and thankfully most folks seem to follow that advice.
• 4.7k
"Of course the people don't want war. But after all, it's the leaders of the country who determine the policy, and it's always a simple matter to drag the people along whether it's a democracy, a fascist dictatorship, or a parliament, or a communist dictatorship. Voice or no voice, the people can always be brought to the bidding of the leaders. That is easy. All you have to do is tell them they are being attacked, and denounce the pacifists for lack of patriotism, and exposing the country to greater danger."
-- Herman Goering at the Nuremberg trials.
Be afraid, be very afraid. It doesn't matter what you are afraid of, going noseblind, or hordes of Mexican rapists, the fearful are gullible and biddable. Just be afraid, and I'll tell you what to be afraid of and what to do about it later.
Be miserable, be depressed, you must be, there is nothing you can do about it. Later I will tell you who is to blame and make sure they are even more miserable than you. I'm good at that.
Be isolated. Don't talk to anyone, they are probably your enemy, or would be if you revealed yourself, because everyone is horrible. Even your friends are disgusted by your undetectable odour, and if you step out of line, you will be one of the people to blame for everything. You'd better believe me, because I will be deciding who those people are. I'm good at that. Everyone is an isolated individual and it is immoral to have close relationships.
Relate only to abstractions; democracy, nationality, race. Immerse yourself in these to assuage your feeling of isolation. Do not step out of line, punish and shun those who do, they smell, don't they.
• 4.7k
Terrapin, you probably don't want to hear this, but you are ugly. Jesus Christ, dude - wear a bin bag when you go out in public.
Well probably not, really. But your olfactory outrage has been manufactured. You are not going to get very far with this thread without questioning your own feelings a little.
• 13.8k
There's no doubt that some people think I'm ugly.
And surely some people don't mind or even like the smell of someone who hasn't showered in days and who doesn't wear deodorant. I don't want to be standing next to them on a crowded subway though.
• 4.7k
So I hope I have briefly managed to convey something of the psychological functioning of propaganda and advertising and shown how closely related they are. The thesis is, that this century has produced a novelty. It is made possible by mass media, industrialisation, and psychological theory, beginning with Freud and continuing with ever more refinement and power to the present. Edward Bernays was a leading figure in much of this. Not that rhetoric and persuasion are anything new in themselves, but the science of it, and the universality is new, and it is now irresistible.
Your only best last hope for the liberty of your own mind is philosophy. Buy some today and install it at once. You really cannot afford to miss this discussion.
• 13.8k
I don't agree with most of the theory about this,though, and Freud was particularly ridiculous in my view.
• 3k
I only watch streamed TV. Hulu may still have commercials.. I don't know.
• 4.7k
Propaganda works best when those who are being manipulated
are confident they are acting on their own free will.
Joseph Goebbels.
Let me tell you a comfortable lie. All this stuff only works on the great unwashed. You are educated and intelligent, and so your freedom and independence are assured.
• 585
Grown men do have a problem with a build of up rancid oil in their clothes. Detergent and non-chlorine bleach do not fully eliminate this problem. The odor is universal, distinct and it is something that is hard to eliminate, unless you have an advanced technique of laundry washing.
I don't want to be sitting in a room that has been coated in Fabreeze. Have always been a bit paranoid about industrially manufactured mystery concoctions, but still use conventional laundry detergents.
Commercials are often loud, obnoxious and dumb. Hopefully the era of online streaming will do away with them.
• 3k
It works pretty well when you control what books are in the library, what sorts of things economists get Nobel prizes for, which philosophers are asked for their opinions.
Feel free to do what you preach. Self-examine. If you can't be bothered to do that.. fuck off.
• 11.3k
Your only best last hope for the liberty of your own mind is philosophy. Buy some today and install it at once. You really cannot afford to miss this discussion.
>:O
Let me tell you a comfortable lie. All this stuff only works on the great unwashed. You are educated and intelligent, and so your freedom and independence are assured.
:-x
Yes the sweat smell thing is interesting. Personally, despite very strong pressures from my environment and from my parents as a teenager to inoculate in me the idea that sweat is disgusting and no one can stand it, I never felt that way. I never felt "bothered" by staying next to someone who smelled. Maybe I was concerned about being seen around such a person, but never so much by the smell itself. So I agree with you, that seems to be something that has been socially imposed on us.
Now, to talk of something really disgusting, which almost made me vomit, despite no propaganda being involved - please brace yourselves. Once upon a time I ate a lot of sesame seeds. The next day, when I went to the toilet (to do a dirt, not a wee as Borat would say), I saw that my stool was covered completely in those sesame seeds. I can swear that I've never seen a more disgusting scene than that - it wasn't just that I didn't like it and found it somehow disgusting, but that it was repugnant - as in I felt it driving me away, and my stomach physical turned upside down at that sight. Ever since, I'm actually afraid of eating sesame seeds in large quantities because of that. So what explains such a phenomenon? I think this particular repugnance is natural - in our mind, a repugnance of such a sight has been built by evolution - the seeds being associated with the presence of worms or parasites, that we would be compelled to avoid - hence the strong reaction. Anyway, when this happened I was left a bit stunned, because I'm generally very hard to disgust. A dog licking me on the face for example isn't that disgusting as it is for some (not that it is enjoyable, of course I don't like it - but I'm not exactly repulsed by it automatically). If I saw someone eating shit, I wouldn't be that disgusted either. But this was something coming from a deep deep level, I could feel it. It was a revolution that was very deep below the level where reason activates.
So I think there are both naturally occurring responses and induced ones.
• 4.7k
Fuck off out of my thread yourself if you have nothing to contribute.
• 11.3k
:-O >:O (Y)
• 585
(N) :’(
• 11.3k
• 4.7k
Thanks for sharing. :s
Natural disgust prevents you from re-eating those tasty seeds, thus protecting you from worms and e-coli infection. Advertising does not create anything in humanity that is not already there, it elicts, distorts, redirects, exaggerates, trains, feelings that are pretty universal.
• 11.3k
Natural disgust prevents you from re-eating those tasty seeds, thus protecting you from worms and e-coli infection. Advertising does not create anything in humanity that is not already there, it elicts, distorts, redirects, exaggerates, trains, feelings that are pretty universal.
But by re-directing them it seems to me that it can create entirely new combinations of feelings and reactions that we would never have before. And this isn't only in terms of intensity, but in terms of the whole experience of whatever the situation is.
The way I see it, this modern culture not only attempts to reshape people's reactions and way of life, but more importantly, it succeeds in doing so - it has people who aren't affiliated with the propaganda actually participating in it and promoting it, without understanding what they're actually doing. It uses them - like an ideological virus, infecting minds and being further spread by it.
Your only best last hope for the liberty of your own mind is philosophy. Buy some today and install it at once. You really cannot afford to miss this discussion.
See, this is the problem, even among the truth there is infiltration.
• 8.7k
Excellent example of the created need/want. More: Downy, Airwick, Glade, and other odiferous products. Running shoe$(for people who would die if they ran 2 blocks to catch a bus); all lawn care products; pick up trucks (for people who might haul 3 bags of mulch from the hardware store); and on, and on... • 3.2k I'm helping! • 3k Fuck off out of my thread yourself if you have nothing to contribute. I did contribute, hypocrite. • 4.7k I did contribute, hypocrite. Can it be, hypocrite preacher, that you too do not like being called names and sworn at? • 8.7k Once upon a time I ate a lot of sesame seeds. The next day, when I went to the toilet (to do a dirt, not a wee as Borat would say), I saw that my stool was covered completely in those sesame seeds. I can swear that I've never seen a more disgusting scene than that Sig Freud! You'd better come into the office and lie down on the couch right away. You're a very sick man. It is interesting that you wouldn't mind standing next to someone who was smelly, but wouldn't want to be seen by others as having tolerated their smelliness. Shades of other-directedness. At some point, life becomes easier when we come to terms with our own shit, literally. Raising children (which I haven't done) and raising dogs (which I have) are effective at busting up our cleanliness obsessions, and alleviating the shock of the stool -- that what goes in comes out and in sometimes quite identifiable condition. Once our young dog got into the dog food and stuffed herself. A bit later, while I was sitting on the back step, she crawled into my lap and vomited up an enormous Science Diet slushy. Yuck. But, because it was OUR dog, I wasn't freaked out--as I would otherwise have been. What she ate was sometimes quite identifiable when I picked up her stool for disposal. Like bits of raw carrot. Chewed up and swallowed bits of fabric. Wild baby rabbits swallowed whole were still whole. Why feed a dog expensive dog food? Because it promises to produce a very firm, drier stool -- easier to pick up. Turned out to be true. Having chronic bowel problems has helped many people understand that unexamined shit may not be worth excreting. Stools are a window into our bowels -- a place we do not want to go ourselves. • 3k OK. Self-examination is hard sometimes. I didn't acknowledge that. So a step in that direction: To some extent, advertising aims to be subliminal. This works by contacting deep seated biases. In other words.. people believe what they want to believe. Propaganda just helps get all the lemmings facing in the same direction. You unenlightened, recently presented a variety of speculations about the US as if they're facts. Coincidently, these speculations have been presented by various media outlets... some of which have a known and self-acknowledged bias. In the face of not knowing all the particulars... how did you come to be so convinced? You believe what you want to believe.... that's how. Question is: why did you want to believe it? Global warming is going to kill people. Fact? Nope. Anytime you get a whiff of apocalypse, look for the myth below the surface. I could go on and on... Can it be, hypocrite preacher, that you too do not like being called names and sworn at? Sorry. I actually did think you were being hypocritical, though. Should I have just kept that to myself? • 11.3k Sig Freud! You'd better come into the office and lie down on the couch right away. You're a very sick man. It is interesting that you wouldn't mind standing next to someone who was smelly, but wouldn't want to be seen by others as having tolerated their smelliness. Shades of other-directedness. At some point, life becomes easier when we come to terms with our own shit, literally. Raising children (which I haven't done) and raising dogs (which I have) are effective at busting up our cleanliness obsessions, and alleviating the shock of the stool -- that what goes in comes out and in sometimes quite identifiable condition. Once our young dog got into the dog food and stuffed herself. A bit later, while I was sitting on the back step, she crawled into my lap and vomited up an enormous Science Diet slushy. Yuck. But, because it was OUR dog, I wasn't freaked out--as I would otherwise have been. What she ate was sometimes quite identifiable when I picked up her stool for disposal. Like bits of raw carrot. Chewed up and swallowed bits of fabric. Wild baby rabbits swallowed whole were still whole. Why feed a dog expensive dog food? Because it promises to produce a very firm, drier stool -- easier to pick up. Turned out to be true. Having chronic bowel problems has helped many people understand that unexamined shit may not be worth excreting. Stools are a window into our bowels -- a place we do not want to go ourselves. :D But I do know all this, and I do have a look at my stool briefly every time I go to the toilet. I'm not freaked out by stool regardless of what I see - I've seen for example dried pieces of tomato, I've even picked up pieces of stool, I've even seen blood in stool. That's why I say I was shocked - I'm not a person who gets easily disgusted, and especially not by my own stools. But that was something entirely different. I wouldn't have imagined that if I would see such a stool I would have such a reaction. It was a primal and more basic reaction. • 4.7k So, a bit of meta- psychological pontification. Folks have always had, and continue to have, a folk psychology, otherwise known as a 'theory of mind'. Such theories are culturally informed by religion, philosophy romantic tradition, notions of gender identity and so on. My psychological theory affects how I experience others and how I behave with them. I treat you all so badly because my theory of mind tells me you are are all as horrible and pathetic as I am, however well you hide it. Now even without the benefit of a university course, everyone here has a notion of what Freudian is what behaviourism is and so on. It may be vague, but it enters the psyche along with all that advertising and propaganda some to be dismissed, and some absorbed. So it is not to be wondered at that the techniques of the shrinks not only enter into the schemes of advertisers and politicians but also into the interactions of philosophers in discussion forums. I started with an advert, because it is paradigmatic, but it is only a simplistic and transparent example of what has become a way of life, a pervasive form of our culture. There is a knot here; put very simply the theory of psyche is part of the psyche. It is as if the fundamental particles of physics changed their properties according to which laws of physics they decided to adopt. Psychologists have changed the way we think, the way we see, our whole culture, and in doing so, they give rise to a new psyche which needs a new theory. Fashion in psychology mirrors the fashion of youth that always has to be different to that of the previous generation. Today one talks of neural plasticity, and it is neural plasticity that makes this talk possible. The knot is the bane of the psychologist and manipulator. The cleverer he is, the better the theory, the more it transforms the people it is a theory of. The more we the atoms see the manipulator scientist coming, the faster we adapt to his manipulations and frustrate his intentions. And we too are all manipulator scientists. • 3k There is a knot here And you're bound by this knot as you speak of it. So you've painted yourself into a corner. I won't ask if that was your intention... that would require the illusive transcendent vantage point. • 1.1k Eh...this seems to assume tabula rasa too much. Some stuff is hard wired and ain't changing no time soon, no matter how well informed we are about it. • 4.7k this seems to assume tabula rasa too much. I don't think it does. One can admit any amount of neuro-concrete along with the neuro-plastic. It is only our understanding of ourselves and each other, and thus our social conduct that is required to be radically plastic. And you're bound by this knot as you speak of it. So you've painted yourself into a corner. I won't ask if that was your intention... that would require the illusive transcendent vantage point. That my explanations and understanding are bound by the same knot I fully agree, and this means that even to the extent that all this might be a powerful or useful way of looking at ourselves, it is historical rather than foundational. But in terms of being and becoming, the knot liberates us from the whole idea of psychological law. There is no law, even statistical law, except the law we make up, and if we don't like the law as it stands, we can make up new laws or dispense with it altogether. The psychologist as scientist becomes a manipulator. This is what happens when the supremely successful methods of science are turned from the physical world to the mental world from the observed to the observer. This is what has been done for a hundred years, and it has made us more unhappy and more insane. It works, but it works to destroy us. But there are other ways of relating than as subject and object... • 3k What have you done with this freedom? What scheme do you love? Or live.. • 157 The role of advertisement is less to persuade consumers about so-and-so but bring consumer awareness to gain some degree of marketshare. To get some hard data here... "Media messages about the political realm can cancel each other out, mute the effects of other messages, or, by failing to present another perspective or new idea, prevent its spread. If this seems counterintuitive, it should not. This is precisely the situation that obtains in another, perhaps more familiar area of media effects: advertising. Practitioners of advertising and marketing would be a very hard sell for the “minimal effects” approach to media. Advertising had a humble role in the 19th century, essentially providing simple price and product information to consumers (in the way that neoclassical economic theory still assumes obtains today). But by the early 20th century, advertising began to resemble propaganda rather than price- and-product information, its effectiveness became widely acknowledged, and total advertising spending ballooned to 2% of GDP by 1920. From then until the present, total annual advertising expenditure has averaged 2.2% of GDP, with current annual spending hovering around$300 billion. That is quite a price tag for a “minimal” effect.
A recent meta-analysis of studies of advertising on children and adolescents reveals that expo- sure to advertising results in more positive associations with the brands advertised, increased brand comprehension, and leads to selection of the products advertised. The effects were small, but this is what would be expected in a market already saturated with advertising. (Also, 70% of consumers report skepticism about advertising, further reducing its effect.) A review of research on advertising to adults found mixed results, with similarly small effects. These results might lead to questions about the viability of the \$300 billion a year advertising industry, but such doubts are answered in the same way as are doubts about the effects of media in the political realm: commercial messages, like political messages, often cancel each other out. But try to sell a new product without advertising – or a new political idea or without media exposure – and the power of the media enters clearly into view. Maxwell McCombs summarizes this commonsense view: if the media did not “yield significant outcomes, the vast advertising industry would not exist.”
- Crooked Timber and the Broken Branch The Invisible Hand in the Marketplace of Ideas
bold
italic
underline
strike
code
quote
ulist
image
url
mention
reveal
tweet
#### Welcome to The Philosophy Forum!
Get involved in philosophical discussions about knowledge, truth, language, consciousness, science, politics, religion, logic and mathematics, art, history, and lots more. No ads, no clutter, and very little agreement — just fascinating conversations. | 2020-05-26 03:21:22 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2576322555541992, "perplexity": 2643.388444186806}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347390442.29/warc/CC-MAIN-20200526015239-20200526045239-00000.warc.gz"} |
http://www.pudn.com/Download/item/id/4014352.html | (FPGA electronic piano, with code to achieve the function of the piano, very interesting. For learning and entertainment) | 2020-07-04 18:38:24 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8181647062301636, "perplexity": 5560.086955381349}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655886516.43/warc/CC-MAIN-20200704170556-20200704200556-00498.warc.gz"} |
http://alt-sci.ru/en/wiki/Solid | # Solid
Corresponding Wikipedia article: Solid
## Continuum
The solid is a state of matter and a special type of continuum.
General continuum Solid
Transfer of matter can exist Transfer of matter does not exist
Isotropic density Anisotropic deformation
Isotropic pressure Anisotropic stress
Barotropic fluid Elasticity
The stress is a volumetric energy density of the directed interaction of particles in contrast to the chaotic thermal interaction. In reference to the faces of elementary cubic volume, the stress can be:
• Normal (perpendicular to a face like a usual pressure).
• Tangential (parallel to a face). It's caused by the anisotropy of normal stress.
The material properties comprise the stress limits:
• Elastic limit is a condition of plasticity.
• Proportionality of deformation and stress.
• Yield strength is a point where the particles energy is sufficient to liquefy the body at low temperature. This effect is typical for the metals.
• Fatigue and ultimate strength is a point where the particles energy is sufficient to break them apart at low temperature. Evaporation does not occur, because the stress drops rapidly after the fracture.
The volumetric isotropic stress $$P$$ is related to the relative volumetric deformation $$\frac{\Delta V}{V}$$ of a body with density $$\rho$$ through the bulk modulus $$K$$: $P=K\frac{\Delta \rho}{\rho}=K\frac{\Delta V}{V}\tag{1}$
The volumetric deformation is related to the one-dimensional isotropic linear deformation $$\Delta L$$: $\frac{\Delta V}{V}=\left(1+\frac{\Delta L}{L}\right)^3-1\approx 3\frac{\Delta L}{L}\tag{2}$
The linear (normal) elastic deformation is determined by Hooke's law: $E\frac{\Delta L}{L}=P_\parallel-2\mu P_\perp\tag{3}$ $$E$$ is Young's modulus;
$$\mu$$ is Poisson's ratio of longitudinal compression to transversal stretching;
$$P_\parallel$$ is a longitudinal normal stress;
$$P_\perp$$ is a transverse normal stress along one of two axes.
The bulk modulus at $$P=P_\parallel=P_\perp$$: $K=\frac{E}{3(1-2\mu)}\tag{4}$
The shear (tangential) deformation is represented by deformation of a square section within a linearly deformable object. $tan\;\alpha=\frac{1-\mu\frac{\Delta L}{L}}{1+\frac{\Delta L}{L}}\approx\left(1-\mu\frac{\Delta L}{L}\right)\left(1-\frac{\Delta L}{L}\right)\approx 1-\frac{\Delta L}{L}(1+\mu)\tag{5}$
The shear angle $$\theta$$ is related to angle $$\alpha$$ so: $\theta=\frac{\pi}{2}-2\alpha\tag{6}$ $tan\;\alpha=tan\left(\frac{\pi}{4}-\frac{\theta}{2}\right)\approx 1-\theta\tag{7}$
The consequence from (5) and (7) is: $\theta=\frac{\Delta L}{L}(1+\mu)\tag{8}$
The shear deformation at small angles is: $\theta=\frac{\Delta L_G}{L_G}\tag{9}$
The bulk shear and linear deformations are related to each other through the stress equation: $E\frac{\Delta L}{L}=\frac{E}{1+\mu}\frac{\Delta L_G}{L_G}\tag{10}$
The shear modulus $$G$$ is defined for one-dimensional deformation under shear stress, which is half of the bulk shear stress: $G=\frac{E}{2(1+\mu)}\tag{11}$
## Waves
The propagation speed of longitudinal waves (“Waves”, 5) within solids follows from (1): $c_s=\sqrt{\frac{K_W}{\rho}}\tag{12}$ $$K_W$$ is a wave modulus, which is roughly estimated as the bulk modulus $$K$$.
The modulus of one-dimensional waves (within a thin rod) is Young's modulus $$E$$.
The energy of volumetric wave is the sum of volumetric energy of normal and tangential (shear) stresses along two of three axes (along the wave front). So its modulus is: $K+\frac{2E}{3(1+\mu)}=K+\frac{4G}{3}\tag{13}$
## Rotation
Each particle of a rotating solid has the same angular velocity $$\omega$$. So the moment of inertia $$J$$ can be used to simplify the calculations. The rotational energy without relativistic corrections (see "Mass and inertia") is: $A=\int{\frac{\rho v^2}{2}\mathrm{d}V}=\frac{\omega^2}{2}\int{r^2\rho\mathrm{d}V}=\frac{J\omega^2}{2}\tag{14}$
The equation of power and angular momentum $$L$$ is: $\frac{\mathrm{d}A}{\mathrm{d}t}=J\omega\frac{\mathrm{d}\omega}{\mathrm{d}t}=L\frac{\mathrm{d}\omega}{\mathrm{d}t}\tag{15}$
The equation of torque is: $\mathbf{\overrightarrow{M}}=\frac{\mathrm{d}\mathbf{\overrightarrow{L}}}{\mathrm{d}t}=J\frac{\mathrm{d}\mathbf{\overrightarrow{\omega}}}{\mathrm{d}t}=J\frac{\mathrm{d}\omega}{\mathrm{d}t}\frac{\mathbf{\overrightarrow{L}}}{|\mathbf{\overrightarrow{L}}|}+\mathbf{\overrightarrow{\omega}}_p\times\mathbf{\overrightarrow{L}}\tag{16}$ $$\mathbf{\overrightarrow{\omega}}_p$$ is an angular velocity of precession.
The center of mass is a point, around which an object with mass $$m$$ can rotate without any external torque (moment of force). The moments of inertia forces are balanced at this point: $\mathbf{\overrightarrow{r}}_0=\frac{1}{m}\int{\mathbf{\overrightarrow{r}}\rho\mathrm{d}V}\tag{17}$
The bending of beam and the torsion of shaft are similar to rotation in many ways. As the linear displacement is directly proportional to the distance from center of rotation, so the relative deformation is directly proportional to the distance from axis of bending or torsion. The stress $$P$$ of elastic deformation at distance of $$r$$ from axis can be expressed as: $P=\frac{P_{MAX}}{R}r$ $$P_{MAX}$$ is the maximum stress at the cross-section edge of beam or shaft;
$$R$$ is a distance from the axis to that edge.
The equation of torque integrated over the cross-section $$S$$ is: $M=\int{rP\mathrm{d}S}=\frac{P_{MAX}}{R}\int{r^2\mathrm{d}S}=P_{MAX}\frac{I}{R}=P_{MAX}W$ $$I$$ is a polar moment of inertia or a second moment of area;
$$W$$ is a polar or section modulus of torsion or bending, respectively. | 2022-12-03 22:22:52 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9129146933555603, "perplexity": 694.6282909502471}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710941.43/warc/CC-MAIN-20221203212026-20221204002026-00128.warc.gz"} |
https://math.stackexchange.com/questions/1155198/why-is-the-interchange-of-integration-and-summation-allowed-in-this-case | # Why is the interchange of integration and summation allowed in this case?
In a solution of a book of the integral:
$$\int_a^{\infty} \sum_{n=1}^{\infty} \frac{1}{(z+n)^{k+1}}\,dz, \;\; a\geq 1$$
I see the following:
\begin{align*} \int_{a}^{\infty}\sum_{n=1}^{\infty}\frac{1}{\left ( n+z \right )^{k+1}}\,dz &= \sum_{n=1}^{\infty}\int_{a}^{\infty}\frac{dz}{(n+z)^{k+1}}\\ &= \cdots\\ \end{align*}
The rest of the solution is understable to me but not the interchange. I was unable to prove that the fuction within the series converges uniformly... and I cannot think of something else that works here e.g monotone convergance thoerem or Tonelli Theorem.
• I think you have a typo and intended $dz$ instead of $dx$. I'm also confused about the roles of $n$ and $k$ between your two lines. Anyway, Fubini-Tonelli applied to the product of the Lebesgue and counting measures implies that you only need to prove that when you put absolute values inside the sum, you get a finite solution. – Ian Feb 18 '15 at 22:42
• Fixed for $dz$. Well $n$ is the index of the series and $k$ is just any fixed natural number. Suppose that $\displaystyle\sum_{n=1}^{\infty} \frac{1}{(z+k)^{4}}$ meaning that $k=3$. – Tolaso Feb 18 '15 at 22:44
• My confusion is that in the first line you have $(z+k)^{n+1}$ while in the second line you have $(n+z)^{k+1}$. It is not clear which one you mean. – Ian Feb 18 '15 at 22:45
• I think it's ok.. got your point... I have just written it so quickly.. i did not check later for typos... Now, what do I have to prove? OK, I take absolute values and then what? – Tolaso Feb 18 '15 at 22:50
• Analysis is far from my strong suit, but why can't you use Tonelli's Theorem? – Callus - Reinstate Monica Feb 18 '15 at 22:56 | 2021-06-19 16:29:15 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9656716585159302, "perplexity": 387.2155324177031}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487648373.45/warc/CC-MAIN-20210619142022-20210619172022-00264.warc.gz"} |
https://www.stderr.nl/Blog/index.rss/2011/08/05/index.rss/2014/06/27/Blog/Hardware/Electronics/Arduino/RestartSerial.html/Blog/index.rss/2011/08/05/index.rss/2014/06/27/Blog/Hardware/Electronics/Arduino/RestartSerial.html/Blog/2020/12/ | "In het verleden behaalde resultaten bieden geen garanties voor de toekomst"
These are the ramblings of Matthijs Kooijman, concerning the software he hacks on, hobbies he has and occasionally his personal life.
Questions? Praise? Blame? Feel free to contact me.
My old blog (pre-2006) is also still available.
Sun Mon Tue Wed Thu Fri Sat
20 21 22 23
24 25 26 27 28 29 30
31
Tag Cloud
&
(With plugins: config, extensionless, hide, tagging, Markdown, macros, breadcrumbs, calendar, directorybrowse, entries_index, feedback, flavourdir, include, interpolate_fancy, listplugins, menu, pagetype, preview, seemore, storynum, storytitle, writeback_recent, moreentries)
Valid XHTML 1.0 Strict & CSS
Script to generate pinout listings for STM32 MCUs
Recently, I've been working with STM32 chips for a few different projects and customers. These chips are quite flexible in their pin assignments, usually most peripherals (i.e. an SPI or UART block) can be mapped onto two or often even more pins. This gives great flexibility (both during board design for single-purpose boards and later for a more general purpose board), but also makes it harder to decide and document the pinout of a design.
ST offers STM32CubeMX, a software tool that helps designing around an STM32 MCU, including deciding on pinouts, and generating relevant code for the system as well. It is probably a powerful tool, but it is a bit heavy to install and AFAICS does not really support general purpose boards (where you would choose between different supported pinouts at runtime or compiletime) well.
So in the past, I've used a trusted tool to support this process: A spreadsheet that lists all pins and all their supported functions, where you can easily annotate each pin with all the data you want and use colors and formatting to mark functions as needed to create some structure in the complexity.
However, generating such a pinout spreadsheet wasn't particularly easy. The tables from the datasheet cannot be easily copy-pasted (and the datasheet has the alternate and additional functions in two separate tables), and the STM32CubeMX software can only seem to export a pinout table with alternate functions, not additional functions. So we previously ended up using the CubeMX-generated table and then adding the additional functions manually, which is annoying and error-prone.
So I dug around in the CubeMX data files a bit, and found that it has an XML file for each STM32 chip that lists all pins with all their functions (both alternate and additional). So I wrote a quick Python script that parses such an XML file and generates a CSV script. The script just needs Python3 and has no additional dependencies.
To run this script, you will need the XML file for the MCU you are interested in from inside the CubeMX installation. Currently, these only seem to be distributed by ST as part of CubeMX. I did find one third-party github repo with the same data, but that wasn't updated in nearly two years). However, once you generate the pin listing and publish it (e.g. in a spreadsheet), others can of course work with it without needing CubeMX or this script anymore.
For example, you can run this script as follows:
$./stm32pinout.py /usr/local/cubemx/db/mcu/STM32F103CBUx.xml name,pin,type VBAT,1,Power PC13-TAMPER-RTC,2,I/O,GPIO,EXTI,EVENTOUT,RTC_OUT,RTC_TAMPER PC14-OSC32_IN,3,I/O,GPIO,EXTI,EVENTOUT,RCC_OSC32_IN PC15-OSC32_OUT,4,I/O,GPIO,EXTI,ADC1_EXTI15,ADC2_EXTI15,EVENTOUT,RCC_OSC32_OUT PD0-OSC_IN,5,I/O,GPIO,EXTI,RCC_OSC_IN (... more output truncated ...) The script is not perfect yet (it does not tell you which functions correspond to which AF numbers and the ordering of functions could be improved, see TODO comments in the code), but it gets the basic job done well. You can find the script in my "scripts" repository on github. 0 comments -:- permalink -:- 13:35 / Blog / Blog Using MathJax math expressions in Markdown For this blog, I wanted to include some nicely-formatted formulas. An easy way to do so, is to use MathJax, a javascript-based math processor where you can write formulas using (among others) the often-used Tex math syntax. However, I use Markdown to write my blogposts and including formulas directly in the text can be problematic because Markdown might interpret part of my math expressions as Markdown and transform them before MathJax has had a chance to look at them. In this post, I present a customized MathJax configuration that solves this problem in a reasonable elegant way. An obvious solution is to put the match expression in Markdown code blocks (or inline code using backticks), but by default MathJax does not process these. MathJax can be reconfigured to also typeset the contents of <code> and/or <pre> elements, but since actual code will likely contain parts that look like math expressions, this will likely cause your code to be messed up. This problem was described in more detail by Yihui Xie in a blogpost, along with a solution that preprocesses the DOM to look for <code> tags that start and end with an math expression start and end marker, and if so strip away the <code> tag so that MathJax will process the expression later. Additionally, he translates any expression contained in single dollar signs (which is the traditional Tex way to specify inline math) to an expression wrapped in $$ and $$, which is the only way to specify inline math in MathJax (single dollars are disabled since they would be too likely to cause false positives). # Improved solution I considered using his solution, but it explicitly excludes code blocks (which are rendered as a <pre> tag containing a <code> tag in Markdown), and I wanted to use code blocks for centered math expressions (since that looks better without the backticks in my Markdown source). Also, I did not really like that the script modifies the DOM and has a bunch of regexes that hardcode what a math formula looks like. So I made an alternative implementation that configures MathJax to behave as intended. This is done by overriding the normal automatic typesetting in the pageReady function and instead explicitly typesetting all code tags that contain exactly one math expression. Unlike the solution by Yihui Xie, this: • Lets MathJax decide what is and is not a math expression. This means that it will also work for other MathJax input plugins, or with non-standard tex input configuration. • Only typesets string-based input types (e.g. TeX but not MathML), since I did not try to figure out how the node-based inputs work. • Does not typeset anything except for these selected <code> elements (e.g. no formulas in normal text), because the default typesetting is replaced. • Also typesets formulas in <code> elements inside <pre> elements (but this can be easily changed using the parent tag check from Yihui Xie's code). • Enables typesetting of single-dollar inline math expressions by changing MathJax config instead of modifying the delimeters in the DOM. This will not produce false positive matches in regular text, since typesetting is only done on selected code tags anyway. • Runs from the MathJax pageReady event, so the script does not have to be at the end of the HTML page. You can find the MathJax configuration for this inline at the end of this post. To use it, just put the script tag in your HTML before the MathJax script tag (or see the MathJax docs for other ways). # Examples To use it, just use the normal tex math syntax (using single or double $ signs) inside a code block (using backticks or an indented block) in any combination. Typically, you would use single $ delimeters together with backticks for inline math. You'll have to make sure that the code block contains exactly a single MathJax expression (and maybe some whitespace), but nothing else. E.g. this Markdown: Formulas *can* be inline: $z = x + y$. Renders as: Formulas can be inline: $z = x + y$. The double $$ delimeter produces a centered math expression. This works within backticks (like Yihui shows) but I think it looks better in the Markdown if you use an indented block (which Yihui's code does not support). So for example this Markdown (note the indent): $$a^2 + b^2 = c^2$$ Renders as: $$a^2 + b^2 = c^2$$ Then you can also use more complex, multiline expressions. This indented block of Markdown: $$ \begin{vmatrix} a & b\\ c & d \end{vmatrix} =ad-bc $$ Renders as: $$ \begin{vmatrix} a & b\\ c & d \end{vmatrix} =ad-bc $$ Note that to get Markdown to display the above example blocks, i.e. code blocks that start and with $$, without having MathJax process them, I used some literal HTML in my Markdown source. For example, in my blog's markdown source, the first block above literall looks like this: <pre><code><span></span> $$a^2 + b^2 = c^2$$</code></pre> Markdown leaves the HTML tags alone, and the empty span ensures that the script below does not process the contents of the code block (since it only processes code blocks where the full contents of the block are valid MathJax code). # The code So, here is the script that I am now using on this blog: <script type="text/javascript"> MathJax = { options: { // Remove <code> tags from the blacklist. Even though we pass an // explicit list of elements to process, this blacklist is still // applied. skipHtmlTags: { '[-]': ['code'] }, }, tex: { // By default, only \( is enabled for inline math, to prevent false // positives. Since we already only process code blocks that contain // exactly one math expression and nothing else, it is also fine to // use the nicer$...$construct for inline math. inlineMath: { '[+]': [['$', '$']] }, }, startup: { // This is called on page ready and replaces the default MathJax // "typeset entire document" code. pageReady: function() { var codes = document.getElementsByTagName('code'); var to_typeset = []; for (var i = 0; i < codes.length; i++) { var code = codes[i]; // Only allow code elements that just contain text, no subelements if (code.childElementCount === 0) { var text = code.textContent.trim(); inputs = MathJax.startup.getInputJax(); // For each of the configured input processors, see if the // text contains a single math expression that encompasses the // entire text. If so, typeset it. for (var j = 0; j < inputs.length; j++) { // Only use string input processors (e.g. tex, as opposed to // node processors e.g. mml that are more tricky to use). if (inputs[j].processStrings) { matches = inputs[j].findMath([text]); if (matches.length == 1 && matches[0].start.n == 0 && matches[0].end.n == text.length) { // Trim off any trailing newline, which otherwise stays around, adding empty visual space below code.textContent = text; to_typeset.push(code); code.classList.add("math"); if (code.parentNode.tagName == "PRE") code.parentNode.classList.add("math"); break; } } } } } // Code blocks to replace are collected and then typeset in one go, asynchronously in the background MathJax.typesetPromise(to_typeset); }, }, }; </script> Update 2020-08-05: Script updated to run typesetting only once, and use typesetPromise to run it asynchronously, as suggested by Raymond Zhao in the comments below. Update 2020-08-20: Added some Markdown examples (the same ones Yihui Xie used), as suggested by Troy. Update 2021-09-03: Clarified how the script decides which code blocks to process and which to leave alone. Comments Raymond Zhao wrote at 2020-07-29 22:37 Hey, this script works great! Just one thing: performance isn't the greatest. I noticed that upon every call to MathJax.typeset, MathJax renders the whole document. It's meant to be passed an array of all the elements, not called individually. So what I did was I put all of the code elements into an array, and then called MathJax.typesetPromise (better than just typeset) on that array at the end. This runs much faster, especially with lots of LaTeX expressions on one page. Matthijs Kooijman wrote at 2020-08-05 08:28 Hey Raymond, excellent suggestion. I've updated the script to make these changes, works perfect. Thanks! Troy wrote at 2020-08-19 20:53 What a great article! Congratulations :) Can you please add a typical math snippet from one of your .md files? (Maybe the same as the one Yihui Xie uses in his post.) I would like to see how you handle inline/display math in your markdown. Matthijs Kooijman wrote at 2020-08-20 16:47 Hey Troy, good point, examples would really clarify the post. I've added some (the ones from Yihui Xie indeed) that show how to use this from Markdown. Hope this helps! Xiao wrote at 2021-09-03 04:09 Hi, this code looks pretty great! One thing I'm not sure about is how do you differentiate latex code block and normal code block so that they won't be rendered to the same style? Matthijs Kooijman wrote at 2021-09-03 13:09 Hi Xiao, thanks for your comment. I'm not sure I understand your question completely, but what happens is that both the math/latex block and a regular code block are processed by markdown into a <pre><code>...</code></pre> block. Then the script shown above picks out all <code> blocks, and passes the content of each to MathJax for processing. Normally MathJax finds any valid math expression (delimited by e.g. $$ or ) and processes it, but my script has some extra checks to only apply MathJax processing if the entire <code> block is a single MathJax block (in other words, if it starts and ends with $$ or $).
This means that regular code blocks will not be MathJax processed and stay regular code blocks. One exception is when a code block starts and ends with e.g. but you still do not want it processed (like the Markdown-version of the examples I show above), but I applied a little hack with literal HTML tags and an empty <span> for that (see above, I've updated the post to show how I did this).
Or maybe your question is more about actually styling regular code blocks vs math blocks? For that, the script adds a math class to the <code> and <pre> tags, which I then use in my CSS to slightly modify the styling (just remove the grey background for math blocks, all other styling is handled by Mathjax already it seems).
Name:
URL:
Comment:
Comment can contain markdown formatting
Making an old paint-mixing terminal keyboard work with Linux
Or: Forcing Linux to use the USB HID driver for a non-standards-compliant USB keyboard.
For an interactive art installation by the Spullenmannen, a friend asked me to have a look at an old paint mixing terminal that he wanted to use. The terminal is essentially a small computer, in a nice industrial-looking sealed casing, with a (touch?) screen, keyboard and touchpad. It was by "Lacour" and I think has been used to control paint mixing machines.
They had already gotten Linux running on the system, but could not get the keyboard to work and asked me if I could have a look.
The keyboard did work in the BIOS and grub (which also uses the BIOS), so we know it worked. Also, the BIOS seemed pretty standard, so it was unlikely that it used some very standard protocol or driver and I guessed that this was a matter of telling Linux which driver to use and/or where to find the device.
Inside the machine, it seemed the keyboard and touchpad were separate devices, controlled by some off-the-shelf microcontroller chip (probably with some custom software inside). These devices were connected to the main motherboard using a standard 10-pin expansion header intended for external USB ports, so it seemed likely that these devices were USB ports.
## Closer look at the USB devices
And indeed, looking through lsusb output I noticed two unkown devices in the list:
# lsusb
Bus 002 Device 003: ID ffff:0001
Bus 002 Device 002: ID 0000:0003
(...)
These have USB vendor ids of 0x0000 and 0xffff, which I'm pretty sure are not official USB-consortium-assigned identifiers (probably invalid or reserved even), so perhaps that's why Linux is not using these properly?
Running lsusb with the --tree option allows seeing the physical port structure, but also shows which drivers are bound to which interfaces:
# lsusb --tree
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=, 12M
(...)
This shows that the keyboard (Dev 3) indeed has no driver, but the touchpad (Dev 2) is already bound to usbhid. And indeed, runnig cat /dev/input/mice and then moving over the touchpad shows that some output is being generated, so the touchpad was already working.
Looking at the detailed USB descriptors for these devices, shows that they are both advertised as supporting the HID interface (Human Interface Device), which is the default protocol for keyboards and mice nowadays:
# lsusb -d ffff:0001 -v
Bus 002 Device 003: ID ffff:0001
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 255 Vendor Specific Class
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0xffff
idProduct 0x0001
bcdDevice 0.01
iManufacturer 1 Lacour Electronique
iProduct 2 ColorKeyboard
iSerial 3 SE.010.H
(...)
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 1 Keyboard
(...)
# lsusb -d 0000:00003 -v
Bus 002 Device 002: ID 0000:0003
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x0000
idProduct 0x0003
bcdDevice 0.00
iManufacturer 1 Lacour Electronique
iSerial 3 V2.0
(...)
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 3 Human Interface Device
bInterfaceSubClass 1 Boot Interface Subclass
bInterfaceProtocol 2 Mouse
(...)
So, that should make it easy to get the keyboard working: Just make sure the usbhid driver is bound to it and that driver will be able to figure out what to do based on these descriptors. However, apparently something is preventing this binding from happening by default.
Looking back at the USB descriptors above, one interesting difference is that the keyboard has bDeviceClass set to "Vendor specific", whereas the touchpad has it set to 0, which means "Look at interface descriptors. So that seems the most likely reason why the keyboard is not working, since "Vendor Specific" essentially means that the device might not adhere to any of the standard USB protocols and the kernel will probably not start using this device unless it knows what kind of device it is based on the USB vendor and product id (but since those are invalid, these are unlikely to be listed in the kernel).
## Binding to usbhid
So, we need to bind the keyboard to the usbhid driver. I know of two ways to do so, both through sysfs.
You can assign extra USB vid/pid pairs to a driver through the new_id sysfs file. In this case, this did not work somehow:
# echo ffff:0001 > /sys/bus/usb/drivers/usbhid/new_id
bash: echo: write error: Invalid argument
At this point, I should have stopped and looked up the right syntax used for new_id, since this was actually the right approach, but I was using the wrong syntax (see below). Instead, I tried some other stuff first.
The second way to bind a driver is to specify a specific device, identified by its sysfs identifier:
# echo 2-2:1.0 > /sys/bus/usb/drivers/usbhid/bind
bash: echo: write error: No such device
The device identifier used here (2-2:1.0) is directory name below /sys/bus/usb/devices and is, I think, built like <bus>-<port>:1.<interface> (where 1 might the configuration?). You can find this info in the lsusb --tree output:
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=uhci_hcd/2p, 12M
|__ Port 2: Dev 3, If 0, Class=Human Interface Device, Driver=, 12M
I knew that the syntax I used for the device id was correct, since I could use it to unbind and rebind the usbhid module from the touchpad. I suspect that there is some probe mechanism in the usbhid driver that runs after you bind the driver which tests the device to see if it is compatible, and that mechanism rejects it.
## How does the kernel handle this?
As I usually do when I cannot get something to work, I dive into the source code. I knew that Linux device/driver association usually works with a driver-specific matching table (that tells the underlying subsystem, such as the usb subsystem in this case, which devices can be handled by a driver) or probe function (which is a bit of driver-specific code that can be called by the kernel to probe whether a device is compatible with a driver). There is also configuration based on Device Tree, but AFAIK this is only used in embedded platforms, not on x86.
Looking at the usbhid_probe() and usb_kbd_probe() functions, I did not see any conditions that would not be fulfilled by this particular USB device.
The match table for usbhid also only matches the interface class and not the device class. The same goes for the module.alias file, which I read might also be involved (though I am not sure how):
# cat /lib/modules/*/modules.alias|grep usbhid
alias usb:v*p*d*dc*dsc*dp*ic03isc*ip*in* usbhid
So, the failing check must be at a lower level, probably in the usb subsystem.
Digging a bit further, I found the usb_match_one_id_intf() function, which is the core of matching USB drivers to USB device interfaces. And indeed, it says:
/* The interface class, subclass, protocol and number should never be
* checked for a match if the device class is Vendor Specific,
* unless the match record specifies the Vendor ID. */
So, the entry in the usbhid table is being ignored since it matches only the interface, while the device class is "Vendor Specific". But how to fix this?
A little but upwards in the call stack, is a bit of code that matches a driver to an usb device or interface. This has two sources: The static table from the driver source code, and a dynamic table that can be filled with (hey, we know this part!) the new_id file in sysfs. So that suggests that if we can get an entry into this dynamic table, that matches the vendor id, it should work even with a "Vendor Specific" device class.
## Back to new_id
Looking further at how this dynamic table is filled, I found the code that handles writes to new_id, and it parses it input like this:
fields = sscanf(buf, "%x %x %x %x %x", &idVendor, &idProduct, &bInterfaceClass, &refVendor, &refProduct);
In other words, it expects space separated values, rather than just a colon separated vidpid pair. Reading on in the code shows that only the first two (vid/pid) are required, the rest is optional. Trying that actually works right away:
# echo ffff 0001 > /sys/bus/usb/drivers/usbhid/new_id
# dmesg
(...)
[ 5011.088134] input: Lacour Electronique ColorKeyboard as /devices/pci0000:00/0000:00:1d.1/usb2/2-2/2-2:1.0/0003:FFFF:0001.0006/input/input16
[ 5011.150265] hid-generic 0003:FFFF:0001.0006: input,hidraw3: USB HID v1.11 Keyboard [Lacour Electronique ColorKeyboard] on usb-0000:00:1d.1-2/input0
After this, I found I can now use the unbind file to unbind the usbhid driver again, and bind to rebind it. So it seems that using bind indeed still goes through the probe/match code, which previously failed but with the entry in the dynamic table, works.
## Making this persistent
So nice that it works, but this dynamic table will be lost on a reboot. How to make it persistent? I can just drop this particular line into the /etc/rc.local startup script, but that does not feel so elegant (it will probably work, since it only needs the usbhid module to be loaded and should work even when the USB device is not known/enumerated yet).
However, as suggested by this post, you can also use udev to run this command at the moment the USB devices is "added" (i.e. enumerated by the kernel). To do so, simply drop a file in /etc/udev/rules.d:
$cat /etc/udev/rules.d/99-keyboard.rules # Integrated USB keyboard has invalid USB VIDPID and also has bDeviceClass=255, # causing the hid driver to ignore it. This writes to sysfs to let the usbhid # driver match the device on USB VIDPID, which overrides the bDeviceClass ignore. # See also: # https://unix.stackexchange.com/a/165845 # https://github.com/torvalds/linux/blob/bf3bd966dfd7d9582f50e9bd08b15922197cd277/drivers/usb/core/driver.c#L647-L656 # https://github.com/torvalds/linux/blob/3039fadf2bfdc104dc963820c305778c7c1a6229/drivers/hid/usbhid/hid-core.c#L1619-L1623 ACTION=="add", ATTRS{idVendor}=="ffff", ATTRS{idProduct}=="0001", RUN+="/bin/sh -c 'echo ffff 0001 > /sys/bus/usb/drivers/usbhid/new_id'" And with that, the keyboard works automatically at startup. Nice :-) 0 comments -:- permalink -:- 18:52 Reliable long-distance Arduino communication: RS485 & MODBUS? For a customer, I've been looking at RS-485 and MODBUS, two related protocols for transmitting data over longer distances, and the various Arduino libraries that exist to work with them. They have been working on a project consisting of multiple Arduino boards that have to talk to each other to synchronize their state. Until now, they have been using I²C, but found that this protocol is quite susceptible to noise when used over longer distances (1-2m here). Combined with some limitations in the AVR hardware and a lack of error handling in the Arduino library that can cause the software to lock up in the face of noise (see also this issue report), makes I²C a bad choice in such environments. So, I needed something more reliable. This should be a solved problem, right? # RS-485 A commonly used alternative, also in many industrial settings, are RS-485 connections. This is essentially an asynchronous serial connection (e.g. like an UART or RS-232 serial port), except that it uses differential signalling and is a multipoint bus. Differential signalling means two inverted copies of the same signal are sent over two impedance-balanced wires, which allows the receiver to cleverly subtract both signals to cancel out noise (this is also what ethernet and professional audio signal does). Multipoint means that there can be more than two devices on the same pair of wires, provided that they do not transmit at the same time. When combined with shielded and twisted wire, this should produce a very reliable connection over long lengths (up to 1000m should be possible). However, RS-485 by itself is not everything: It just specifies the physical layer (the electrical connections, or how to send data), but does not specify any format for the data, nor any way to prevent multiple devices from talking at the same time. For this, you need a data link or arbitration protocol running on top of RS-485. # MODBUS A quick look around shows that MODBUS is very commonly used protocol on top of RS-485 (but also TCP/IP or other links) that handles the data link layer (how to send data and when to send). This part is simple: There is a single master that initiates all communication, and multiple slaves that only reply when asked something. Each slave has an address (that must be configured manually beforehand), the master needs no address. MODBUS also specifies a simple protocol that can be used to read and write addressed bits ("Coils" and "Inputs") and addressed registers, which would be pretty perfect for the usecase I'm looking at now. # Finding an Arduino library So, I have some RS-485 transceivers (which translate regular UART to RS-485) and just need some Arduino library to handle the MODBUS protocol for me. A quick Google search shows there are quite a few of them (never a good sign). A closer look shows that none of them are really good... There are some more detailed notes per library below, but overall I see the following problems: • Most libraries are very limited in what serial ports they can use. Some are hardcoded to a single serial port, some support running on arbitrary HardwareSerial instances (and sometimes also SoftwareSerial instances, but only two librares actually supports running on arbitrary Stream instances (while this is pretty much the usecase that Stream was introduced for). • All libraries handle writes and reads to coils and registers automatically by updating the relevant memory locations, which is nice. However, none of them actually support notifying the sketch of such reads and writes (one has a return value that indicates that something was read or written, but no details), which means that the sketch should continuously check all register values and update them library. It also means that the number of registers/coils is limited by the available RAM, you cannot have virtual registers (e.g. writes and reads that are handled by a function rather than a bit of RAM). • A lot of them are either always blocking in the master, or require manually parsing replies (or both). # Writing an Arduino library? Ideally, I would like to see a library: - That can be configured using a Stream instance and an (optional) tx enable pin. - Has a separation between the MODBUS application protocol and the RS-485-specific datalink protocol, so it can be extended to other transports (e.g. TCP/IP) as well. - Where the master has both synchronous (blocking) and asynchronous request methods. The xbee-arduino library, which also does serial request-response handling would probably serve as a good example of how to combine these in a powerful API. - Where the slave can have multiple areas defined (e.g. a block of 16 registers starting at address 0x10). Each area can have some memory allocated that will be read or written directly, or a callback function to do the reading or writing. In both cases, a callback that can be called after something was read or writen (passing the area pointer and address or something) can be configured too. Areas should probably be allowed to overlap, which also allows having a "fallback" (virtual) area that covers all other addresses. These areas should be modeled as objects that are directly accessible to the sketch, so the sketch can read and write the data without having to do linked-list lookups and without needing to know the area-to-adress mapping. - That supports sending and receiving raw messages as well (to support custom function codes). - That does not do any heap allocation (or at least allows running with static allocations only). This can typically be done using static (global) variables allocated by the sketch that are connected as a linked list in the library. I suspect that given my requirements, this would mean starting a new library from scratch (using an existing library as a starting point would always mean significant redesigning, which is probably more work than its worth). Maybe some parts (e.g. specific things like packet formatting and parsing) can be reused, though. Of course, I do not really have time for such an endeavor and the customer for which I started looking at this certainly has no budget in this project for such an investment. This means I will probably end up improvising with the MCCI library, or use some completely different or custom protocol instead of MODBUS (though the Arduino library offerings in this area also seem limited...). Maybe CANBus? However, if you also find yourself in the same situation, maybe my above suggestions can serve as inspiration (and if you need this library and have some budget to get it written, feel free to contact me). # Existing libraries So, here's the list of libraries I found. ## https://github.com/arduino-libraries/ArduinoModbus • Official library from Arduino. • Master and slave. • Uses the RS485 library to communicate, but does not offer any way to pass a custom RS485 instance, so it is effectively hardcoded to a specific serial port. • Offers only single value reads and writes. • Slave stores value internally and reads/writes directly from those, without any callback or way to detect that communication has happened. ## https://github.com/4-20ma/ModbusMaster • Master-only library. • Latest commit in 2016. • Supports any serial port through Stream objects. • Supports idle/pre/post-transmission callbacks (no parameters), used to enable/disable the transceiver. • Supports single and multiple read/writes. • Replies are returned in a (somewhat preprocessed) buffer, to be further processed by the caller. ## https://github.com/andresarmento/modbus-arduino • Slave-only library. • Last commit in 2015. • Supports single and multiple read/writes. • Split into generic ModBus library along with extra transport-specific libraries (TCP, serial, etc.). • Supports passing HardwareSerial pointers and (with a macro modification to the library) SoftwareSerial pointers (but uses a Stream pointer internally already). • Slave stores values in a linked list (heap-allocated), values are written through write methods (linked list elements are not exposed directly, which is a pity). • Slave reads/writes directly from internal linked list, without any callback or way to detect that communication has happened. • https://github.com/vermut/arduino-ModbusSerial is a fork that has some Due-specific fixes. ## https://github.com/lucasso/ModbusRTUSlaveArduino • Fork of https://github.com/Geabong/ModbusRTUSlaveArduino (6 additional commits). • Slave-only-library. • Last commit in 2018. • Supports passing HardwareSerial pointers. • Slave stores values external to the library in user-allocate arrays. These arrays are passed to the library as "areas" with arbitrary starting addresses, which are kept in the library in a linked list (heap-allocated). • Slave reads/writes directly from internal linked list, without any callback or way to detect that communication has happened. ## https://github.com/mcci-catena/Modbus-for-Arduino • Master and slave. • Last commit in 2019. • Fork of old (2016) version of https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino with significant additional development. • Supports passing arbitrary serial (or similar) objects using a templated class. • Slave stores values external to the library in a single array (so all requests index the same data, either word or bit-indexed), which is passed to the poll() function. • On Master, sketch must create requests somewhat manually (into a struct, which is encoded to a byte buffer automatically), and replies returns raw data buffer on requests. Requests and replies are non-blocking, so polling for replies is somewhat manual. ## https://github.com/angeloc/simplemodbusng • Master and slave. • Last commit in 2019. • Hardcodes Serial object, supports SoftwareSerial in slave through duplicated library. • Supports single and multiple read/writes of holding registers only (no coils or input registers). • Slave stores values external to the library in a single array, which is passed to the update function. ## https://github.com/smarmengol/Modbus-Master-Slave-for-Arduino • Master and slave. • Last commit in 2020. • Supports any serial port through Stream objects. • Slave stores values external to the library in a single array (so all requests index the same data, either word or bit-indexed), which is passed to the poll() function. • On Master, sketch must create requests somewhat manually (into a struct, which is encoded to a byte buffer automatically), and replies returns raw data buffer on requests. Requests and replies are non-blocking, so polling for replies is somewhat manual. ## https://github.com/asukiaaa/arduino-rs485 • Unlike what the name suggests, this actually implements ModBus • Master and slave. • Started very recently (October 2020), so by the time you read this, maybe things have already improved. • Very simple library, just handles modbus framing, the contents of the modbus packets must be generated and parsed manually. • Slave only works if you know the type and length of queries that will be received. • Supports working on HardwareSerial objects. ## https://gitlab.com/creator-makerspace/rs485-nodeproto • This is not a MODBUS library, but a very thin layer on top of RS485 that does collision avoidance and detection that can be used to implement a multi-master system. • Last commit in 2016, repository archived. • This one is notable because it gets the Stream-based configuration right and seems well-written. It does not implement MODBUS or a similarly high-level protocol, though. ## https://github.com/MichaelJonker/HardwareSerialRS485 • Also not MODBUS, but also a collision avoidance/detection scheme on top of RS485 for multi-master bus. • Last commit in 2015. • Replaces HardwareSerial rather than working on top, requiring a customized boards.txt. ## https://www.airspayce.com/mikem/arduino/RadioHead/ • This is not a MODBUS library, but a communication library for data communication over radio. It also supports serial connections (and is thus an easy way to get framing, checksumming, retransmissions and routing over serial). • Seems to only support point-to-point connections, lacking an internal way to disable the RS485 driver when not transmitting (but maybe it can be hacked internally). Update 2020-06-26: Added smarmengol/Modbus-Master-Slave-for-Arduino to the list Update 2020-10-07: Added asukiaaa/arduino-rs485 to the list 2 comments -:- permalink -:- 12:42 Recovering data from a failing hard disk with HFS+ Recently, a customer asked me te have a look at an external hard disk he was using with his Macbook. It would show up a file listing just fine, but when trying to open actual files, it would start failing. Of course there was no backup, but the files were very precious... This started out as a small question, but ended up in an adventure that spanned a few days and took me deep into the ddrescue recovery tool, through the HFS+ filesystem and past USB power port control. I learned a lot, discovered some interesting things and produced a pile of scripts that might be helpful to others. Since the journey seems interesting as well as the end result, I will describe the steps I took here, "ter leering ende vermaeck". I started out confirming the original problem. Plugging in the disk to my Linux laptop, it showed up as expected in dmesg. I could mount the disk without problems, see the directory listing and even open up an image file stored on the disk. Opening other files didn't seem to work. ## SMART As you do with bad disks, you try to get their SMART data. Since smartctl did not support this particular USB bridge (and I wasn't game to try random settings to see if it worked on a failing disk), I gave up on SMART initially. I later opened up the case to bypassing the USB-to-SATA controller (in case the problem was there, and to make SMART work), but found that this particular hard drive had the converter built into the drive itself (so the USB part was directly attached to the drive). Even later, I found out some page online (I have not saved the link) that showed the disk was indeed supported by smartctl and showed the option to pass to smartctl -d to make it work. SMART confirmed that the disk was indeed failing, based on the number of reallocated sectors (2805). ## Fast-then-slow copying Since opening up files didn't work so well, I prepared to make a sector-by-sector copy of the partition on the disk, using ddrescue. This tool has a good approach to salvaging data, where it tries to copy off as much data as possible quickly, skipping data when it comes to a bad area on disk. Since reading a bad sector on a disk often takes a lot of time (before returning failure), ddrescue tries to steer clear of these bad areas and focus on the good parts first. Later, it returns to these bad areas and, in a few passes, tries to get out as much data as possible. At first, copying data seemed to work well, giving a decent read speed of some 70MB/s as well. But very quickly the speed dropped terribly and I suspected the disk ran into some bad sector and kept struggling with that. I reset the disk (by unplugging it) and did a few more attempts and quickly discovered something weird: The disk would work just fine after plugging it in, but after a while the speed would plummet tot a whopping 64Kbyte/s or less. This happened everytime. Even more, it happened pretty much exactly 30 seconds after I started copying data, regardless of what part of the disk I copied data from. So I quickly wrote a one-liner script that would start ddrescue, kill it after 45 seconds, wait for the USB device to disappear and reappear, and then start over again. So I spent some time replugging the USB cable about once every minute, so I could at least back up some data while I was investigating other stuff. Since the speed was originally 70MB/s, I could pull a few GB worth of data every time. Since it was a 2000GB disk, I "only" had to plug the USB connector around a thousand times. Not entirely infeasible, but not quite comfortable or efficient either. So I investigated ways to further automate this process: Using hdparm to spin down or shutdown the disk, use USB powersaving to let the disk reset itself, disable the USB subsystem completely, but nothing seemed to increase the speed again other than completely powering down the disk by removing the USB plug. While I was trying these things, the speed during those first 30 seconds dropped, even below 10MB/s at some point. At that point, I could salvage around 200MB with each power cycle and was looking at pulling the USB plug around 10,000 times: no way that would be happening manually. # Automatically pulling the plug I resolved to further automate this unplugging and planned using an Arduino (or perhaps the GPIO of a Raspberry Pi) and something like a relay or transistor to interrupt the power line to the hard disk to "unplug" the hard disk. For that, I needed my Current measuring board to easily interrupt the USB power lines, which I had to bring from home. In the meanwhile, I found uhubctl, a small tool that uses low-level USB commands to individually control the port power on some hubs. Most hubs don't support this (or advertise support, but simply don't have the electronics to actually switch power, apparently), but I noticed that the newer raspberry pi's supported this (for port 2 only, but that would be enough). Coming to the office the next day, I set up a raspberry pi and tried uhubctl. It did indeed toggle USB power, but the toggle would affect all USB ports at the same time, rather than just port 2. So I could switch power to the faulty drive, but that would also cut power to the good drive that I was storing the recovered data on, and I was not quite prepared to give the good drive 10,000 powercycles. The next plan was to connect the recovery drive through the network, rather than directly to the Raspberry Pi. On Linux, setting up a network drive using SSHFS is easy, so that worked in a few minutes. However, somehow ddrescue insisted it could not write to the destination file and logfile, citing permission errors (but the permissions seemed just fine). I suspect it might be trying to mmap or something else that would not work across SSHFS.... The next plan was to find a powered hub - so the recovery drive could stay powered while the failing drive was powercycled. I rummaged around the office looking for USB hubs, and eventually came up with some USB-based docking station that was externally powered. When connecting it, I tried the uhubctl tool on it, and found that one of its six ports actually supported powertoggling. So I connected the failing drive to that port, and prepared to start the backup. When trying to mount the recovery drive, I discovered that a Raspberry pi only supports filesystems up to 2TB (probably because it uses a 32-bit architecture). My recovery drive was 3TB, so that would not work on the Pi. Time for a new plan: do the recovery from a regular PC. I already had one ready that I used the previous day, but now I needed to boot a proper Linux on it (previously I used a minimal Linux image from UBCD, but that didn't have a compiler installed to allow using uhubctl). So I downloaded a Debian live image (over a mobile connection - we were still waiting for fiber to be connected) and 1.8GB and 40 minutes later, I finally had a working setup. The run.sh script I used to run the backup basically does this: 1. Run ddrescue to pull of data 2. After 35 seconds, kill ddrescue 3. Tell the disk to sleep, so it can spindown gracefully before cutting the power. 4. Tell the disk to sleep again, since sometimes it doesn't work the first time. 5. Cycle the USB power on the port 6. Wait for the disk to re-appear 7. Repeat from 1. By now, the speed of recovery had been fluctuating a bit, but was between 10MB/s and 30MB/s. That meant I was looking at some thousands up to ten thousands powercycles and a few days up to a week to backup the complete disk (and more if the speed would drop further). # Selectively backing up Realizing that there would be a fair chance that the disk would indeed get slower, or even die completely due to all these power cycles, I had to assume I could not backup the complete disk. Since I was making the backup sector by sector using ddrescue, this meant a risk of not getting any meaningful data at all. Files are typically fragmented, so can be stored anywhere on the disk, possible spread over multiple areas as well. If you just start copying at the start of the disk, but do not make it to the end, you will have backed some data but the data could belong to all kinds of different files. That means that you might have some files in a directory, but not others. Also, a lot of files might only be partially recovered, the missing parts being read as zeroes. Finally, you will also end up backing up all unused space on the disk, which is rather pointless. To prevent this, I had to figure out where all kinds of stuff was stored on the disk. ## The catalog file The first step was to make sure the backup file could be mounted (using a loopback device). On my first attempt, I got an error about an invalid catalog. I looked around for some documentation about the HFS+ filesystems, and found a nice introduction by infosecaddicts.com and a more detailed description at dubeiko.com. The catalog is apparently the place where the directory structure, filenames, and other metadata are stored in a single place. This catalog is not in a fixed location (since its size can vary), but its location is noted in the so-called volume header, a fixed-size datastructure located at 1024 bytes from the start of the partition. More details (including easier to read offsets within the volume header) are provided in this example. Looking at the volume header inside the backup, gives me: root@debian:/mnt/recover/WD backup# dd if=backup.img bs=1024 skip=1 count=1 2> /dev/null | hd 00000000 48 2b 00 04 80 00 20 00 48 46 53 4a 00 00 3a 37 |H+.... .HFSJ..:7| 00000010 d4 49 7e 38 d8 05 f9 64 00 00 00 00 d4 49 1b c8 |.I~8...d.....I..| 00000020 00 01 24 7c 00 00 4a 36 00 00 10 00 1d 1a a8 f6 |..$|..J6........|
^^^^^^^^^^^ Block size: 4096 bytes
00000030 0e c6 f7 99 14 cd 63 da 00 01 00 00 00 01 00 00 |......c.........|
00000040 00 02 ed 79 00 6e 11 d4 00 00 00 00 00 00 00 01 |...y.n..........|
00000050 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000060 00 00 00 00 00 00 00 00 a7 f6 0c 33 80 0e fa 67 |...........3...g|
00000070 00 00 00 00 03 a3 60 00 03 a3 60 00 00 00 3a 36 |............:6|
00000080 00 00 00 01 00 00 3a 36 00 00 00 00 00 00 00 00 |......:6........|
00000090 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000000c0 00 00 00 00 00 e0 00 00 00 e0 00 00 00 00 0e 00 |................|
000000d0 00 00 d2 38 00 00 0e 00 00 00 00 00 00 00 00 00 |...8............|
000000e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000110 00 00 00 00 12 60 00 00 12 60 00 00 00 01 26 00 |............&.|
00000120 00 0d 82 38 00 01 26 00 00 00 00 00 00 00 00 00 |...8..&.........|
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000160 00 00 00 00 12 60 00 00 12 60 00 00 00 01 26 00 |............&.|
00000170 00 00 e0 38 00 01 26 00 00 00 00 00 00 00 00 00 |...8..&.........|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000400
00000110 00 00 00 00 12 60 00 00 12 60 00 00 00 01 26 00 |............&.|
^^^^^^^^^^^^^^^^^^^^^^^ Catalog size, in bytes: 0x12600000
00000120 00 0d 82 38 00 01 26 00 00 00 00 00 00 00 00 00 |...8..&.........|
^^^^^^^^^^^ First extent size, in 4k blocks: 0x12600
^^^^^^^^^^^ First extent offset, in 4k blocks: 0xd8238
00000130 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
I have annotated the parts that refer to the catalog. The content of the catalog (just like all other files), are stored in "extents". An extent is a single, contiguous block of storage, that contains (a part of) the content of a file. Each file can consist of multiple extents, to prevent having to move file content around each time things change (e.g. to allow fragmentation).
In this case, the catalog is stored only in a single extent (since the subsequent extent descriptors have only zeroes). All extent offsets and sizes are in blocks of 4k byte, so this extent lives at 0xd8238 * 4k = byte 3626205184 (~3.4G) and is 0x12600 * 4k = 294MiB long. So I backed up the catalog by adding -i 3626205184 to ddrescue, making it skip ahead to the location of the catalog (and then power cycled a few times until it copied the needed 294MiB).
After backup the allocation file, I could mount the image file just fine, and navigate the directory structure. Trying to open files would mostly fail, since the most files would only read zeroes now.
I did the same for the allocation file (which tracks free blocks), the extents file (which tracks the content of files that are more fragmented and whose extent list does not fit in the catalog) and the attributes file (not sure what that is, but for good measure).
Afterwards, I wanted to continue copying from where I previously left off, so I tried passing -i 0 to ddrescue, but it seems this can only be used to skip ahead, not back. In the end, I just edited the logfile, which is just a textfile, to set the current position to 0. ddrescue is smart enough to skip over blocks it already backed up (or marked as failed), so it then continued where it previously left off.
## Where are my files?
With the catalog backed up, I needed to read it to figure out what file were stored where, so I could make sure the most important files were backed up first, followed by all other files, skipping any unused space on the disk.
I considered and tried some tools for reading the catalog directly, but none of them seemed workable. I looked at hfssh from hfsutils (which crashed), hfsdebug (which is discontinued and no longer available for download), hfsinspect (which calsl itself "quite buggy").
Instead, I found the filefrag commandline utility that uses a Linux filesystem syscall to figure out where the contents of a particular file is stored on disk. To coax the output of that tool into a list of extents usable by ddrescue, I wrote a oneliner shell script called list-extents.sh:
sudo filefrag -e "$@" | grep '^ ' |sed 's/\.\./:/g' | awk -F: '{print$4, $6}' Given any number of filenames, it produces a list of (start, size) pairs for each extent in the listed files (in 4k blocks, which is the Linux VFS native block size). With the backup image loopback-mounted at /mnt/backup, I could then generate an extent list for a given subdirectory using: sudo find /mnt/backup/SomeDir -type f -print0 | xargs -0 -n 100 ./list-extents.sh > SomeDir.list To turn this plain list of extents into a logfile usable by ddrescue, I wrote another small script called post-process.sh, that adds the appropriate header, converts from 4k blocks to 512-byte sectors, converts to hexadecimal and sets the right device size (so if you want to use this script, edit it with the right size). It is called simply like this: ./post-process.sh SomeDir.list This produces two new files: SomeDir.list.done, in which all of the selected files are marked as "finished" (and all other blocks as "non-tried") and SomeDir.list.notdone which is reversed (all selected files are marked as "non-tried" and all others are marked as "finished"). ## Backing up specific files Armed with a couple of these logfiles for the most important files on the disk and one for all files on the disk, I used the ddrescuelog tool to tell ddrescue what stuff to work on first. The basic idea is to mark everything that is not important as "finished", so ddrescue will skip over it and only work on the important files. ddrescuelog backup.logfile --or-mapfile SomeDir.list.notdone | tee todo.original > todo This uses the ddrescuelog --or-mapfile option, which takes my existing logfile (backup.logfile) and marks all bytes as finished that are marked as finished in the second file (SomeDir.list.notdone). IOW, it marks all bytes that are not part of SomeDir as done. This generates two copies (todo and todo.original) of the result, I'll explain why in a minute. With the generated todo file, we can let ddrescue run (though I used the run.sh script instead): # Then run on the todo file sudo ddrescue -d /dev/sdd2 backup.img todo -v -v Since the generation of the todo file effectively threw away information (we can not longer see from the todo file what parts of the non-important sectors were already copied, or had errors, etc.), we need to keep the original backup.logfile around too. Using the todo.original file, we can figure out what the last run did, and update backup.logfile accordingly: ddrescuelog backup.logfile --or-mapfile <(ddrescuelog --xor-mapfile todo todo.original) > newbackup.logfile Note that you could also use SomeDir.list.done here, but actually comparing todo and todo.original helps in case there were any errors in the last run (so the error sectors will not be marked as done and can be retried later). With backup.logfile updated, I could move on to the next subdirectories, and once all of the important stuff was done, I did the same with a list of all file contents to make sure that all files were properly backed up. # But wait, there's more! Now, I had the contents of all files backed up, so the data was nearly safe. I did however find that the disk contained a number of hardlinks, and/or symlinks, which did not work. I did not dive into the details, but it seems that some of the metadata and perhaps even file content is stored in a special "metadata directory", which is hidden by the Linux filesystem driver. So my filefrag-based "All files"-method above did not back up sufficient data to actually read these link files from the backup. I could have figured out where on disk these metadata files were stored and do a backup of that, but then I still might have missed some other special blocks that are not part of the regular structure. I could of course back up every block, but then I would be copying around 1000GB of mostly unused space, of which only a few MB or GB would actually be relevant. Instead, I found that HFS+ keeps an "allocation file". This file contains a single bit for each block in the filesystem, to store whether the block is allocated (1) or free (0). Simply looking a this bitmap and backing up all blocks that are allocated should make sure I had all data, and only left unused blocks behind. The position of this allocation file is stored in the volume header, just like the catalog file. In my case, it was stored in a single extent, making it fairly easy to parse. The volume header says: 00000070 00 00 00 00 03 a3 60 00 03 a3 60 00 00 00 3a 36 |............:6| ^^^^^^^^^^^^^^^^^^^^^^^ Allocation file size, in bytes: 0x12600000 00000080 00 00 00 01 00 00 3a 36 00 00 00 00 00 00 00 00 |......:6........| ^^^^^^^^^^^ First extent size, in 4k blocks: 0x3a36 ^^^^^^^^^^^ First extent offset, in 4k blocks: 0x1 This means the allocation file takes up 0x3a36 blocks (of 4096 bytes of 8 bits each, so it can store the status of 0x3a36 * 4k * 8 = 0x1d1b0000 blocks, which is rounded up from the total size of 0x1d1aa8f6 blocks). First, I got the allocation file off the disk image (this uses bash arithmetic expansion to convert hex to decimal, you can also do this manually): dd if=/dev/backup of=allocation bs=4096 skip=1 count=$((0x3a36))
Then, I wrote a small python script parse-allocation-file.py to parse the allocate file and output a ddrescue mapfile. I started out in bash, but that got tricky with bit manipulation, so I quickly converted to Python.
The first attempt at this script would just output a single line for each block, to let ddrescuelog merge adjacent blocks, but that would produce such a large file that I stopped it and improved the script to do the merging directly.
cat allocation | ./parse-allocation-file.py > Allocated.notdone
This produces an Allocated.notdone mapfile, in which all free blocks are marked as "finished", and all allocated blocks are marked as "non-tried".
As a sanity check, I verified that there was no overlap between the non-allocated areas and all files (i.e. the output of the following command showed no done/rescued blocks):
ddrescuelog AllFiles.list.done --and-mapfile Allocated.notdone | ddrescuelog --show-status -
Then, I looked at how much data was allocated, but not part of any file:
ddrescuelog AllFiles.list.done --or-mapfile Allocated.notdone | ddrescuelog --show-status -
This marked all non-allocated areas and all files as done, leaving a whopping 21GB of data that was somehow in use, but not part of any files. This size includes stuff like the volume header, catalog, the allocation file itself, but 21GB seemed a lot to me. It also includes the metadata file, so perhaps there's a bit of data in there for each file on disk, or perhaps the file content of hard linked data?
# Nearing the end
Armed with my Allocated.notdone file, I used the same commands as before to let ddrescue backup all allocated sectors and made sure all data was safe.
For good measure, I let ddrescue then continue backing up the remainder of the disk (e.g. all unallocated sectors), but it seemed the disk was nearing its end now. The backup speed (even during the "fast" first 30 seconds) had dropped to under 300kB/s, so I was looking at a couple of more weeks (and thousands of powercycles) for the rest of the data, assuming the speed did not drop further. Since the rest of the backup should only be unused space, I shut down the backup and focused on the recovered data instead.
What was interesting, was that during all this time, the number of reallocated sectors (as reported by SMART) had not increased at all. So it seems unlikely that the slowness was caused by bad sectors (unless the disk firmware somehow tried to recover data from these reallocated sectors in the background and locked up itself in the process). The slowness also did not seem related to what sectors I had been reading. I'm happy that the data was recovered, but I honestly cannot tell why the disk was failing in this particular way...
In case you're in a similar position, the scripts I wrote are available for download.
So, with a few days of work, around a week of crunch time for the hard disk and about 4,000 powercycles, all 1000GB of files were safe again. Time to get back to some real work :-)
Related stories
Modifying a LED strip DMX dimmer for incandescent bulbs
For a theatre performance, I needed to make the tail lights of an old car controllable through the DMX protocol, which the most used protocol used to control stage lighting. Since these are just small incandescent lightbulbs running on 12V, I essentially needed a DMX-controllable 12V dimmer. I knew that there existed ready-made modules for this to control LED-strips, which also run at 12V, so I went ahead and tried using one of those for my tail lights instead.
I looked around ebay for a module to use, and found this one. It seems the same design is available from dozens of different vendors on ebay, so that's probably clones, or a single manufacturer supplying each.
## DMX module details
This module has a DMX input and output using XLR or a modular connector, and screw terminals for 12V power input, 4 output channels and one common connection. The common connection is 12V, so the output channels sink current (e.g. "Common anode"), which is relevant for LEDs. For incandescent bulbs, current can flow either way, so this does not really matter.
Opening up the module, it seems fairly simple. There's a microcontroller (or dedicated DMX decoder chip? I couldn't find a datasheet) inside, along with two RS-422 transceivers for DMX, four AP60T03GH MOSFETS for driving the channels, and one linear regulator to generate a logic supply voltage.
On the DMX side, this means that the module has a separate input and output signals (instead of just connecting them together). It also means that the DMX signal is not isolated, which violates the recommendations of the DMX specification AFAIU (and might be problematic if there is more than a few volts of ground difference). On the output side, it seems there are just MOSFETs to toggle the output, without any additional protection.
## Just try it?
I tried connecting my tail lights to the module, which worked right away, nicely dimming the lights. However:
1. When changing the level, a high-pitched whine would be audible, which would fall silent when the output level was steady. I was not sure whether this came from the module or the (external) power supply, but in either case this suggests some oscillations that might be harmful for the equipment (and the whine was slightly annoying as well).
2. Dimming LEDs usually works using PWM, which very quickly switches the LED on and off, faster than the eye can see. However, when switching an inductive load (such as a coil), a very high voltage spike can occur, when the coil current wants to continue flowing, but is blocked by the PWM transistor.
I'm not sure how much inductance a normal light bulb gives, but there will be at least a bit of it, also from the wiring. Hence, I wanted to check the voltages involved using a scope, to prevent damage to the components.
## Measuring
Looking at a channel output pin on a scope shows the following. The left nicely shows the PWM waveform, but also shows a high voltage pulse when the transistor is switched off (remember that the common pin is connected to 12V, so when the transistor pin is on, it sinks current and pulls the channel pin to 0V, and when it is off, current stops flowing and the pin returns to 12V). The right image shows a close-up of the high-voltage spike.
The spike is about 39V, which exceeds the maximum rating of the transistor (30V), so that is problematic. While I was doing additional testing, I also let some of the magic smoke escape (I couldn't see where exactly, probably the cap or series resistor near the regulator). I'm not sure if this was actually caused by these spikes, or I messed up something in my testing, but fortunately the module still seems to work, so there must be some smoke left inside...
The shape of this pulse is interesting, it seems as if something is capping it at 39V. I suspect this might be the MOSFET body diode that has a reverse breakdown. I'm not entirely sure if this is a problematic condition, the datasheet does not specify any ratings for it (so I suspect it is).
Normally, these inductive spikes are fixed by adding a snubber diode diode. I tried using a simple 1N4001 diode, which helped somewhat, but still left part of the pulse. Using the more common 1N4148 diode helped, but it cannot handle the full current (though specs are a bit unclear when short but repetitive current surges are involved).
I had the impression that the 1N4001 diode needed too much time to turn on, so I ordered some Schottky diodes (which should be faster). I could not find any definitive info on whether this should really be needed (some say regular diodes already have turn-on times of a few ns), but it does seem using Schottkys helped.
The dimmer module supports 8A of current per channel, so I ordered some Schottkys that could handle 8A of current. Since they were huge, I settled for using 1N5819 Schottkys instead. These are only rated for 1A of current, but that is continuous average current. Since these spikes are very short, it should be able to handle higher currents during the spikes (it has a surge current rating of 25A, but that is only non-repetitive, which I'm not sure applies here...).
Here's what happens when adding a 1N5819:
The yellow line is the channel output, the blue line is the 12V input. As you can see, the pulse is greatly reduced in duration. However, there is still a bit of a spike left. Presumably because the diode now connects to the 12V line, the 12V line also follows this spike. To fix that, I added a capacitor between 12V and GND. I would expect that any input capacitors on the regulator would already handle this, but it seems there is a 330Ω series resistor in the 12V line to the regulator (perhaps to protect the regulator from voltage spikes)?
This is what happens when adding a 100nF ceramic capacitor (along with the 1N5819 diode already present):
This succesfully reduces the pulse voltage, but introduces some ringing (probably resonance between the capacitance and the inductance?). Replacing with a 1uF helps slightly:
Note that I forgot to attach the blue probe here. The ringing is still present, but is now much lower in frequency. In this setup, the high-pitched whining I mentinoed before was continuously present, not just when changing the dim level.
I also tried using a 1uF electrolytic capacitor, which seems to give the best results, so I stuck to that. Here's what my final setup gives:
I soldered in these diodes and the cap on the bottom side of the PCB, since that's where I could access the relevant pins:
## Unsolved questions
I also tested with a short LED strip, which to my surprise showed similar surges. They were a lot smaller, but the current was also a lot smaller. This might suggest that it's not the bulb itself that causes the inductive spike, but rather the wiring (even though that was only some 20-30cm) or perhaps the power supply? It also suggests that using this with a bigger LED strip, you might actually also be operating the MOSFETs outside of their specifications...
I'm also a bit surprised that I needed the capacitor on the input voltage. I wonder if there might also be some inductance on the power supply side (e.g. the power supply giving a voltage spike when the current drops)?
Finally, wat causes this difference between the electrolytic and ceramic capacitors? I know they are different, but I do not know off-hand how exactly.
Running an existing Windows 7 partition under QEMU/KVM/virt-manager
I was previously running an ancient Windows XP install under Virtualbox for the occasional time I needed Windows for something. However, since Debian Stretch, virtualbox is no longer supplied, due to security policy problems, I've been experimenting with QEMU, KVM and virt-manager. Migrating my existing VirtualBox XP installation to virt-manager didn't work (it simply wouldn't boot), and I do not have any spare Windows keys lying around, but I do have a Windows 7 installed alongside my Linux on a different partition, so I decided to see if I could get that to boot inside QEMU/KVM.
An obvious problem is the huge change in hardware between the real and virtual environment, but apparently recent Windows versions don't really mind this in terms of drivers, but the activation process could be a problem, especially when booting both virtually and natively. So far I have not seen any complications with either drivers or activation, not even after switching to virtio drivers (see below). I am using an OEM (preactivated?) version of Windows, so that might help in this area.
Update: When booting Windows in the VM a few weeks later, it started bugging me that my Windows was not genuine, and it seems no longer activated. Clicking the "resolve now" link gives a broken webpage, and going through system properties suggests to contact Lenovo (my laptop provider) to resolve this (or buy a new license). I'm not yet sure if this is really problematic, though. This happened shortly after replacing my hard disk, though I'm not sure if that's actually related.
Rebooting into Windows natively shows it is activated (again or still), but booting it virtually directly after that still shows as not activated...
## Creating the VM
Booting the installation was actually quite painless: I just used the wizard inside virt-manager, entered /dev/sda (my primary hard disk) as the storage device, pressed start, selected to boot Windows in my bootloader and it booted Windows just fine.
Booting is not really fast, but once it runs, things are just a bit sluggish but acceptable.
One caveat is that this adds the entire disk, not just the Windows partition. This also means the normal bootloader (grub in my case) will be used inside the VM, which will happily boot the normal default operating system. Protip: Don't boot your Linux installation inside a VM inside that same Linux installation, both instances will end up fighting in your filesystem. Thanks for fsck, which seems to have fixed the resulting garbage so far...
To prevent this, make sure to actually select your Windows installation in the bootloader. See below for a more permanent solution.
## Installing guest drivers
To improve performance, and allow better integration, some special Windows drivers can be installed. Some of them work right away, for some of them, you need to change the hardware configuration in virt-manager to "virtio".
I initially installed some win-virtio drivers from Fedora (I used the 0.1.141-1 version, which is both stable and latest right now). However, the QXL graphics driver broke the boot, Windows would freeze halfway through the initial boot animation (four coloured dots swirling to form the Windows logo). I recovered by booting into safe mode and reverting the graphics driver to the default VGA driver.
Then, I installed the "spice-guest-tools" from spice-space.org, which again installed the QXL driver, as well as the spice guest agent (which allows better mouse integration, desktop resizing, clipboards sharing, etc.). Using this version, I could again boot, now with proper QXL drivers. I'm not sure if this is because the QXL driver was actually different (version number in the device manager / .inf file was 6.1.0.10024 in both cases I believe), or if this was because additional drivers, or the spice agent were installed now.
## Switching to virtio
For additional performance, I changed the networking and storage configuration in virt-manager to "virtio", which, instead of emulating actual hardware, provides optimized interaction between Windows and QEMU, but it does require specific drivers on the guest side.
For the network driver, this was a matter of switching the device type in virt-manager and then installing the driver through the device manager. For the storage devices, I first added a secondary disk set to "virtio", installed drivers for that, then switched the main disk to "virtio" and finally removed the secondary disk. Some people suggest this since Windows can only install drivers when booted, and of course cannot boot without drivers for its boot disk.
I did all this before installing the "spice-guest-tools" mentioned above. I suspect that using that installer will already put all drivers in a place where Windows can automatically install them from, so perhaps all that's needed is to switch the config to "virtio".
Note that system boot didn't get noticably faster, but perhaps a lot of the boot happens before the virtio driver is loaded. I haven't really compared SATA vs virtio in normal operation, but it feels acceptable (but not fast). I recall that my processor does not have I/O virtualization support, so that might be the cause.
As mentioned, virtualizing the entire disk is a bit problematic, since it also reuses the normal bootloader. Ideally, you would only expose the needed Windows partition (which would also provide some additional protection of the other partitions), but since Windows expects a partitioned disk, you would need to somehow create a virtual disk composed of virtual partition table / boot sector merged with the actual data from the partition. I haven't found any way to allow this.
Another approach is to add a second disk with just grub on it, configured to boot Windows from the first disk, and use the second disk as the system boot disk.
I tried this approach using the Super Grub2 Disk, which is a ready-made bootable ISO-hybrid (suitable for CDROM, USB-stick and hard disk). I dowloaded the latest .iso file, created a new disk drive in virt-manager and selected the iso (I suppose a CDROM drive would also work). Booting from it, I get quite an elaborate grub menu, that detects all kinds of operating systems, and I can select Windows through Boot Manually.... -> Operating Systems.
Since that is still quite some work (and easy to forget when I haven't booted Windows in a while), I decided to create a dedicated tiny hard disk, just containing grub, configured to boot my Windows disk. I found some inspiration on this page about creating a multiboot USB stick and turned it into this:
matthijs@grubby:~$sudo dd if=/dev/zero of=/var/lib/libvirt/images/grub-boot-windows.img bs=1024 count=20480 20480+0 records in 20480+0 records out 20971520 bytes (21 MB, 20 MiB) copied, 0.0415679 s, 505 MB/s matthijs@grubby:~$ sudo parted /var/lib/libvirt/images/grub-boot-windows.img mklabel msdos
matthijs@grubby:~$sudo parted /var/lib/libvirt/images/grub-boot-windows.img mkpart primary 2 20 matthijs@grubby:~$ sudo losetup -P /dev/loop0 /var/lib/libvirt/images/grub-boot-windows.img
matthijs@grubby:~$sudo mkfs.ext2 /dev/loop0p1 (output removed) matthijs@grubby:~$ sudo mount /dev/loop0p1 /mnt/tmp
matthijs@grubby:~$sudo mkdir /mnt/tmp/boot matthijs@grubby:~$ sudo grub-install --target=i386-pc --recheck --boot-directory=/mnt/tmp/boot /dev/loop0
matthijs@grubby:~$sudo sh -c "cat > /mnt/tmp/boot/grub/grub.cfg" <<EOF insmod chain insmod ntfs search --no-floppy --set root --fs-uuid F486E9B586E9790E chainloader +1 boot EOF matthijs@grubby:~$ sudo umount /dev/loop0p1
matthijs@grubby:~sudo losetup -d /dev/loop0 The single partition starts at 2MB, for alignment and to leave some room for grub (this is also common with regular hard disks nowadays). Grub is configured to find my Windows partition based on its UUID, which I figured out by looking at /dev/disk/by-uuid. I added the resulting grub-boot-windows.img as a disk drive in virt-manager (I used SATA, since I was not sure if virtio would boot, and the performance of this disk is irrelevant anyway) and configured it as the first and only boot disk. Booting the VM now boots Windows directly. 0 comments -:- permalink -:- 18:13 Calculating a constant path basename at compiletime in C++ In some Arduino / C++ project, I was using a custom assert() macro, that, if the assertion would fail show an error message, along with the current filename and line number. The filename was automatically retrieved using the __FILE__ macro. However, this macro returns a full path, while we only had little room to show it, so we wanted to show the filename only. Until now, we've been storing the full filename, and when an assert was triggered we would use the strrchr function to chop off all but the last part of the filename (commonly called the "basename") and display only that. This works just fine, but it is a waste of flash memory, storing all these (mostly identical) paths. Additionally, when an assertion fails, you want to get a message out ASAP, since who knows what state your program is in. Neither of these is really a showstopper for this particular project, but I suspected there would be some way to use C++ constexpr functions and templates to force the compiler to handle this at compiletime, and only store the basename instead of the full path. This week, I took up the challenge and made something that works, though it is not completely pretty yet. Working out where the path ends and the basename starts is fairly easy using something like strrchr. Of course, that's a runtime version, but it is easy to do a constexpr version by implementing it recursively, which allows the compiler to evaluate these functions at compiletime. For example, here are constexpr versions of strrchrnul(), basename() and strlen(): /** * Return the last occurence of c in the given string, or a pointer to * the trailing '\0' if the character does not occur. This should behave * just like the regular strrchrnul function. */ constexpr const char *static_strrchrnul(const char *s, char c) { /* C++14 version if (*s == '\0') return s; const char *rest = static_strrchr(s + 1, c); if (*rest == '\0' && *s == c) return s; return rest; */ // Note that we cannot implement this while returning nullptr when the // char is not found, since looking at (possibly offsetted) pointer // values is not allowed in constexpr (not even to check for // null/non-null). return *s == '\0' ? s : (*static_strrchrnul(s + 1, c) == '\0' && *s == c) ? s : static_strrchrnul(s + 1, c); } /** * Return one past the last separator in the given path, or the start of * the path if it contains no separator. * Unlike the regular basename, this does not handle trailing separators * specially (so it returns an empty string if the path ends in a * separator). */ constexpr const char *static_basename(const char *path) { return (*static_strrchrnul(path, '/') != '\0' ? static_strrchrnul(path, '/') + 1 : path ); } /** Return the length of the given string */ constexpr size_t static_strlen(const char *str) { return *str == '\0' ? 0 : static_strlen(str + 1) + 1; } So, to get the basename of the current filename, you can now write: constexpr const char *b = static_basename(__FILE__); However, that just gives us a pointer halfway into the full string literal. In practice, this means the full string literal will be included in the link, even though only a part of it is referenced, which voids the space savings we're hoping for (confirmed on avr-gcc 4.9.2, but I do not expect newer compiler version to be smarter about this, since the linker is involved). To solve that, we need to create a new char array variable that contains just the part of the string that we really need. As happens more often when I look into complex C++ problems, I came across a post by Andrzej Krzemieński, which shows a technique to concatenate two constexpr strings at compiletime (his blog has a lot of great posts on similar advanced C++ topics, a recommended read!). For this, he has a similar problem: He needs to define a new variable that contains the concatenation of two constexpr strings. For this, he uses some smart tricks using parameter packs (variadic template arguments), which allows to declare an array and set its initial value using pointer references (e.g. char foo[] = {ptr[0], ptr[1], ...}). One caveat is that the length of the resulting string is part of its type, so must be specified using a template argument. In the concatenation case, this can be easily derived from the types of the strings to concat, so that gives nice and clean code. In my case, the length of the resulting string depends on the contents of the string itself, which is more tricky. There is no way (that I'm aware of, suggestions are welcome!) to deduce a template variable based on the value of an non-template argument automatically. What you can do, is use constexpr functions to calculate the length of the resulting string, and explicitly pass that length as a template argument. Since you also need to pass the contents of the new string as a normal argument (since template parameters cannot be arbitrary pointer-to-strings, only addresses of variables with external linkage), this introduces a bit of duplication. Applied to this example, this would look like this: constexpr char *basename_ptr = static_basename(__FILE__); constexpr auto basename = array_string<static_strlen(basename_ptr)>(basename_ptr); \ This uses the static_string library published along with the above blogpost. For this example to work, you will need some changes to the static_string class (to make it accept regular char* as well), see this pull request for the version I used. The resulting basename variable is an array_string object, which contains just a char array containing the resulting string. You can use array indexing on it directly to access variables, implicitly convert to const char* or explicitly convert using basename.c_str(). So, this solves my requirement pretty neatly (saving a lot of flash space!). It would be even nicer if I did not need to repeat the basename_ptr above, or could move the duplication into a helper class or function, but that does not seem to be possible. 0 comments -:- permalink -:- 21:33 Automatically remotely attaching tmux and forwarding things I recently upgraded my systems to Debian Stretch, which caused GnuPG to stop working within Mutt. I'm not exactly sure what was wrong, but I discovered that GnuPG version 2 changed quite some things and relies more heavily on the gpg-agent, and I discovered that recent SSH version can forward unix domain socket instead of just TCP sockets, which allows forwarding a gpg-agent connection over SSH. Until now, I had my GPG private keys stored on my server, Tika, where my Mutt mail client also runs. However, storing private keys, even with a passphrase, on permanentely connected multi-user system never felt quite right. So this seemed like a good opportunity to set up proper forwarding for my gpg agent, and keep my private keys confined to my laptop. I already had some small scripts in place to easily connect to my server through SSH, attach to the remote tmux session (or start it), set up some port forwards (in particular a reverse port forward for SSH so my mail client and IRC client could open links in my browser), and quickly reconnect when the connection fails. However, once annoyance was that when the connection fails, the server might not immediately notice, so reconnecting usually left me with failed port forwards (since the remote listening port was still taken by the old session). This seemed like a good occasion to fix that as wel. The end result is a reasonably complex script, that is probably worth sharing here. The script can be found in my scripts git repository. On the server, it calls an attach script, but that's not much more than attaching to tmux, or starting a new session with some windows if no session is running yet. The script is reasonably well-commented, including an introduction on what it can do, so I will not repeat that here. For the GPG forwarding, I based upon this blogpost. There, they suggest configuring an extra-socket in gpg-agent.conf, but I've found that gpg-agent already created an extra socket (whose path I could query with gpgconf --list-dirs), so I didn't use that extra-socket configuration line. They also talk about setting StreamLocalBindUnlink to clean up a lingering socket when creating a new one, but that is already handled by my script instead. Furthermore, to prevent a gpg-agent from being autostarted by gnupg serverside (in case the forwarding fails, or when I would connect without this script, etc.), I added no-autostart to ~/.gnupg/gpg.conf. I'm not running systemd user session on my server, but if you are you might need to disable or mask some ssh-agent sockets and/or services to prevent systemd from creating sockets for ssh-agent and starting it on-demand. My next step is to let gpg-agent also be my ssh-agent (or perhaps just use plain ssh-agent) to enforce confirming each SSH authentication request. I'm currently using gnome-keyring / seahorse as my SSH agent, but that just silently approves everything, which doesn't really feel secure. 0 comments -:- permalink -:- 16:46 Running Ruby on Rails using Systemd socket activation On a small embedded system, I wanted to run a simple Rails application and have it automatically start up at system boot. The system is running systemd, so a systemd service file seemed appropriate to start the rails service. Normally, when you run the ruby-on-rails standalone server, it binds on port 3000. Binding on port 80 normally requires root (or a special capability enabled for all of ruby), but I don't want to run the rails server as root. AFAIU, normal deployments using something like Nginx to open port 80 and let it forward requests to the rails server, but I wanted a minimal setup, with just the rails server. An elegant way to binding port 80 without running as root is to use systemd's socket activation feature. Using socket activation, systemd (running as root) opens up a network port before starting the daemon. It then starts the daemon, which inherits the open network socket file descriptor, with some environment variables to indicate this. Apart from allowing privileged ports without root, this has other advantages such as on-demand starting, easier parallel startup and seamless restarts and upgrades (none of which is really important for my usecase, but it is still nice :-p). ## Making it work To make this work, the daemon (rails server in this case) needs some simple changes to use the open socket instead of creating a new one. I could not find any documentation or other evidence that Rails supported this, so I dug around a bit. I found that Rails uses Rack, which again uses Thin, Puma or WEBrick to actually set up the HTTP server. A quick survey of the code suggests that Thin and WEBrick have no systemd socket support, but Puma does. I did find a note saying that the rack module of Puma does not support socket activation, only the standalone version. A bit more digging in my Puma version supported this, but it seems that some refactoring in the 3.0.0 release (commit) should allow Rack/Rails to also use this feature. Some later commits add more fixes, so it's probably best to just use the latest version. I tested this succesfully using Puma 3.9.1. One additional caveat I found is that you should be calling the bin/rails command inside your rails app directory, not the one installed into /usr/local/bin/ or wherever. It seems that the latter calls the former, but somewhere in that process closes all open file descriptors, losing the network connection (which then gets replaces by some other file descriptor, leading to the "for_fd: not a socket file descriptor" error message). ## Setting this up After setting up your rails environment normally, make sure you have the puma gem installed and add the following systemd config files, based on the puma examples. First, /etc/systemd/system/myrailsapp.socket to let systemd open the socket: [Unit] Description=Rails HTTP Server Accept Sockets [Socket] ListenStream=0.0.0.0:80 # Socket options matching Puma defaults NoDelay=true ReusePort=true Backlog=1024 Restart=always [Install] WantedBy=sockets.target Then, /etc/systemd/system/myrailsapp.service to start the service: [Service] ExecStart=/home/myuser/myrailsapp/bin/rails server puma --port 80 --environment production User=myuser Restart=always [Install] WantedBy=multi-user.target Note that both files should share the same name to let systemd pass the socket to the service automatically. Also note that the port is configured twice, due to a limitation in Puma. This is just a minimal service file to get the socket activation going, there are probably more options that might be useful. This blogpost names a few. After creating these files, enable and start them and everything should be running after that: sudo systemctl enable myrailsapp.socket myrailsapp.service
\$ sudo systemctl start myrailsapp.socket myrailsapp.service
1 comment -:- permalink -:- 10:35
Showing 1 - 10 of 168 posts | 2021-10-19 23:55:04 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 2, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.37546202540397644, "perplexity": 2572.165890080977}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585290.83/warc/CC-MAIN-20211019233130-20211020023130-00476.warc.gz"} |
https://mathoverflow.net/questions/292829/why-is-the-theorem-of-the-base-mostly-cited-only-for-smooth-proper-varieties | Why is the theorem of the base mostly cited only for smooth proper varieties
This is a very soft question, and I'm not sure what I expect as an answer.
In SGA6, Expose XIII, Theoreme 5.1 it is proven that, if $X$ is a proper scheme over a field $k$, then $NS(X)$ is finitely generated. Here $NS(X) := \mathrm{Pic}_{X/k}(k)/\mathrm{Pic}_{X/k}^0(k)$.
However, on wikipedia's page for the "theorem of the base" this theorem is only stated for smooth projective varieties. In an earlier question on MO the same happens; see Modern Proof of the Theorem of the Base. A quick google search gives a lot of papers citing this result from SGA6, but most authors impose smoothness when citing SGA6. Do note that Section 5.3 in these notes math.stanford.edu/~conrad/249CS15Page/handouts/abvarnotes.pdf states that $NS(X)$ is finitely generated for proper geometrically integral, not necessarily smooth, schemes.
What is the reason that the theorem of the base from SGA6 is mostly cited for smooth proper schemes? Does the Neron-Severi group exhibit pathological behaviour if $X$ is singular?
• There's no good reason, and in particular nothing pathological for the non-smooth case. Perhaps some paper working with smooth varieties stated the result in the relevant context and someone getting it from there copied the SGA6 reference without reading it and carried over the smoothness for safety, and then it spread due to people continuing to copy the citation from papers without reading the original reference. Near the end of 8.4 in the book Neron Models the result is stated in the same generality as in SGA6 (in particular, no parasitic smoothness hypotheses). Feb 13, 2018 at 2:05 | 2023-03-28 18:50:40 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7973069548606873, "perplexity": 371.9666129040659}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296948868.90/warc/CC-MAIN-20230328170730-20230328200730-00254.warc.gz"} |
http://sfb649.wiwi.hu-berlin.de/fedc_homepage/xplore/ebooks/html/spm/spmhtmlnode20.html | # 4.1 Univariate Kernel Regression
An important question in many fields of science is the relationship between two variables, say and . Regression analysis is concerned with the question of how (the dependent variable) can be explained by (the independent or explanatory or regressor variable). This means a relation of the form
where is a function in the mathematical sense. In many cases theory does not put any restrictions on the form of , i.e. theory does not say whether is linear, quadratic, increasing in , etc.. Hence, it is up to empirical analysis to use data to find out more about .
## 4.1.1 Introduction
Let us consider an example from Economics. Suppose is expenditure on potatoes and is net-income. If we draw a graph with quantity of potatoes on the vertical axis and income on the horizontal axis then we have drawn an Engel curve. Apparently, Engel curves relate optimal quantities of a commodity to income, holding prices constant. If we derive the Engel curve analytically, then it takes the form , where denotes the quantity of potatoes bought at income level . Depending on individual preferences several possibilities arise:
• The Engel curve slopes upward, i.e. is an increasing function of . As income increases the consumer is buying more of the good. In this case the good is said to be normal. A special case of an upward sloping Engel curve is a straight line through the origin, i.e. is a linear function.
• The Engel curve slopes downward or eventually slopes downward (after sloping upward first) as income grows. If the Engel curve slopes downward the good is said to be inferior.
Are potatoes inferior goods? There is just one way to find out: collect appropriate data and estimate an Engel curve for potatoes. We can interpret the statement potatoes are inferior'' in the sense that, on average, consumers will buy fewer potatoes if their income grows while prices are held constant. The principle that theoretic laws usually do not hold in every individual case but merely on average can be formalized as
(4.1) (4.2)
Equation (4.1) says that the relationship doesn't need to hold exactly for the th observation (household) but is disturbed'' by the random variable . Yet, (4.2) says that the relationship holds on average, i.e. the expectation of on the condition that is given by . The goal of the empirical analysis is to use a finite set of observations , to estimate .
EXAMPLE 4.1
In Figure 4.1, we have observations of net-income and expenditure on food expenditures (not only potatoes), taken from the Family Expenditure Survey of British households in 1973. Graphically, we try to fit an (Engel) curve to the scatterplot of food versus net-income. Clearly, the graph of the estimate of will not run through every point in the scatterplot, i.e. we will not be able to use this graph to perfectly predict food consumption of every household, given that we know the household's income. But this does not constitute a serious problem (or any problem at all) if you recall that our theoretical statement refers to average behavior.
Let us point out that, in a parametric approach, it is often assumed that , and the problem of estimating is reduced to the problem of estimating and . But note that this approach is not useful in our example. After all, the alleged shape of the Engel curve for potatoes, upward sloping for smaller income levels but eventually downward sloping as income is increased, is ruled out by the specification . The nonparametric approach does not put such prior restrictions on . However, as we will see below, there is a price to pay for this flexibility.
### 4.1.1.1 Conditional Expectation
In this section we will recall two concepts that you should already be familiar with, conditional expectation and conditional expectation function. However, these concepts are central to regression analysis and deserve to be treated accordingly. Let and be two random variables with joint probability density function . The conditional expectation of given that is defined as
where is the conditional probability density function (conditional pdf) of given , and is the marginal pdf of . The mean function might be quite nonlinear even for simple-looking densities.
EXAMPLE 4.2
Consider the roof distribution with joint pdf
with elsewhere, and marginal pdf
with elsewhere. Hence we get
which is an obviously nonlinear function.
Note that is a function of alone. Consequently, we may abbreviate this term as . If we vary we get a set of conditional expectations. This mapping from to is called the conditional expectation function and is often denoted as . This tells us how and are related on average''. Therefore, it is of immediate interest to estimate .
### 4.1.1.2 Fixed and Random Design
We started the discussion in the preceeding section by assuming that both and are random variables with joint pdf . The natural sampling scheme in this setup is to draw a random sample from the bivariate distribution that is characterized by . That is, we randomly draw observations of the form . Before the sample is drawn, we can view the pairs as identically and independently distributed pairs of random variables. This sampling scheme will be referred to as the random design.
We will concentrate on random design in the following derivations. However, there are applications (especially in the natural sciences) where the researcher is able to control the values of the predictor variable and is the sole random variable. As an example, imagine an experiment that is supposed to provide evidence for the link between a person's beer consumption () and his or her reaction time () in a traffic incident. Here the researcher will be able to specify the amount of beer the testee is given before the experiment is conducted. Hence will no longer be a random variable, while still will be. This setup is usually referred to as the fixed design. In repeated sampling, in the fixed design case the density is known (it is induced by the researcher). This additional knowledge (relative to the random design case, where is unknown) will simplify the estimation of , as well as deriving statistical properties of the estimator used, as we shall see below. A special case of the fixed design model is the e.g. equispaced sequence , , on .
## 4.1.2 Kernel Regression
As we just mentioned, kernel regression estimators depend on the type of the design.
### 4.1.2.1 Random Design
The derivation of the estimator in the random design case starts with the definition of conditional expectation:
(4.3)
Given that we have observations of the form , the only unknown quantities on the right hand side of (4.3) are and . From our discussion of kernel density estimation we know how to estimate probability density functions. Consequently, we plug in kernel estimates for and in (4.3). Estimating is straightforward. To estimate we employ the multiplicative kernel density estimator (with product kernel) of Section 3.6
(4.4)
Hence, for the numerator of (4.3) we get
(4.5)
where we used the facts that kernel functions integrate to 1 and are symmetric around zero. Plugging in leads to the Nadaraya-Watson estimator introduced by Nadaraya (1964) and Watson (1964)
(4.6)
which is the natural extension of kernel estimation to the problem of estimating an unknown conditional expectation function. Several points are noteworthy:
• Rewriting (4.6) as
(4.7)
reveals that the Nadaraya-Watson estimator can be seen as a weighted (local) average of the response variables (note ). In fact, the Nadaraya-Watson estimator shares this weighted local average property with several other smoothing techniques, e.g. -nearest-neighbor and spline smoothing, see Subsections 4.2.1 and 4.2.3.
• Note that just as in kernel density estimation the bandwidth determines the degree of smoothness of , see Figure 4.2. To motivate this, let go to either extreme. If then if and is not defined elsewhere. Hence, at an observation , converges to , i.e. we get an interpolation of the data. On the other hand if then for all values of , and , i.e. the estimator is a constant function that assigns the sample mean of to each . Choosing so that a good compromise between over- and undersmoothing is achieved, is once again a crucial problem.
• You may wonder what happens if the denominator of is equal to zero. In this case, the numerator is also equal to zero, and the estimate is not defined. This can happen in regions of sparse data.
### 4.1.2.2 Fixed Design
In the fixed design model, is assumed to be known and a possible kernel estimator for this sampling scheme employs weights of the form
(4.8)
Thus, estimators for the fixed design case are of simpler structure and are easier to analyze in their statistical properties.
Since our main interest is the random design case, we will only mention a very particular fixed design kernel regression estimator: For the case of ordered design points , from some interval Gasser & Müller (1984) suggested the following weight sequence
(4.9)
where , , . Note that as for the Nadaraya-Watson estimator, the weights sum to 1.
To show how the weights (4.9) are related to the intuitively appealing formula (4.8) note that by the mean value theorem
(4.10)
for some between and . Moreover,
(4.11)
Plugging in (4.10) and (4.11) into (4.8) gives
We will meet the Gasser-Müller estimator again in the following section where the statistical properties of kernel regression estimators are discussed.
### 4.1.2.3 Statistical Properties
Are kernel regression estimators consistent? In the previous chapters we showed that an estimator is consistent in deriving its mean squared error (), showing that the converges, and appealing to the fact that convergence in mean square implies convergence in probability (the latter being the condition stated in the definition of consistency).
Moreover, the helped in assessing the speed with which convergence is attained. In the random design case it is very difficult to derive the of the Nadaraya-Watson estimator since it is the ratio (and not the sum) of two estimators. It turns out that one can show that the Nadaraya-Watson estimator is consistent in the random design case without explicit recurrence to the of this estimator. The conditions under which this result holds are summarized in the following theorem:
THEOREM 4.1
Assume the univariate random design model and the regularity conditions
[4] , for , . Suppose also , , then
where for holds and is a point of continuity of , , and .
The proof involves showing that -- considered separately -- both the numerator and the denominator of converge. Then, as a consequence of Slutsky's theorem, it can be shown that converges. For more details see Härdle (1990, p. 39ff).
Certainly, we would like to know the speed with which the estimator converges but we have already pointed out that the of the Nadaraya-Watson estimator in the random design case is very hard to derive. For the fixed design case, Gasser & Müller (1984) have derived the of the estimator named after them:
THEOREM 4.2
Assume the univariate fixed design model and the conditions: has support with , is twice continuously differentiable, . Assume . Then, under , it holds
As usual, the (asymptotic) has two components, the variance term and the squared bias term . Hence, if we increase the bandwidth we face the familiar trade-off between decreasing the variance while increasing the squared bias.
To get a similar result for the random design case, we linearize the Nadaraya-Watson estimator as follows
thus
(4.12)
It can be shown that of the two terms on the right hand side, the first term is the leading term in the distribution of , whereas the second term can be neglected. Hence, the of can be approximated by calculating
The following theorem can be derived this way:
THEOREM 4.3
Assume the univariate random design model and the conditions
[3] , for and hold. Suppose , , then
(4.13)
where for holds and is a point of continuity of , , , , and .
Let denote the asymptotic . Most components of this formula are constants w.r.t. and , and we may write denoting constant terms by and , respectively
Minimizing this expression with respect to gives the optimal bandwidth . If you plug a bandwidth into (4.13), you will find that the is of order , a rate of convergence that is slower than the rate obtained by the LS estimator in linear regression but is the same as for estimating a density function (cf. Section 3.2).
As in the density estimation case, depends on unknown quantities like or . Once more, we are faced with the problem of finding a bandwidth-selection rule that has desirable theoretical properties and is applicable in practice. We have displayed Nadaraya-Watson kernel regression estimates with different bandwidths in Figure 4.2. The issue of bandwidth selection will be discussed later on in Section 4.3.
## 4.1.3 Local Polynomial Regression and Derivative Estimation
The Nadaraya-Watson estimator can be seen as a special case of a larger class of kernel regression estimators: Nadaraya-Watson regression corresponds to a local constant least squares fit. To motivate local linear and higher order local polynomial fits, let us first consider a Taylor expansion of the unknown conditional expectation function :
(4.14)
for in a neighborhood of the point . This suggests local polynomial regression, namely to fit a polynomial in a neighborhood of . The neighborhood is realized by including kernel weights into the minimization problem
(4.15)
where denotes the vector of coefficients . The result is therefore a weighted least squares estimator with weights . Using the notations
we can compute which minimizes (4.15) by the usual formula for a weighted least squares estimator
(4.16)
It is important to note that -- in contrast to parametric least squares -- this estimator varies with . Hence, this is really a local regression at the point . Denote the components of by , ..., . The local polynomial estimator of the regression function is
(4.17)
due to the fact that we have by comparing (4.14) and (4.15). The whole curve is obtained by running the above local polynomial regression with varying . We have included the parameter in the notation since the final estimator depends obviously on the bandwidth parameter as it does the Nadaraya-Watson estimator.
Let us gain some more insight into this by computing the estimators for special values of . For reduces to , which means that the local constant estimator is nothing else as our well known Nadaraya-Watson estimator, i.e.
Now turn to . Denote
then we can write
(4.18)
which yields the local linear estimator
(4.19)
Here we used the usual matrix inversion formula for matrices. Of course, (4.18) can be generalized for arbitrary large . The general formula is
(4.20)
Introducing the notation for the first unit vector in , we can write the local linear estimator as
Note that the Nadaraya-Watson estimator could also be written as
EXAMPLE 4.3
The local linear estimator for our running example is displayed in Figure 4.3. What can we conclude from comparing this fit with the Nadaraya-Watson fit in Figure 4.1? The main difference to see is that the local linear fit reacts more sensitively on the boundaries of the fit.
Another graphical difference will appear, when we compare local linear and Nadaraya-Watson estimates with optimized bandwidths (see Section 4.3). Then we will see that the local linear fit will be influenced less by outliers like those which cause the bump'' in the right part of both Engel curves.
Here we can discuss this effect by looking at the asymptotic of the local linear regression estimator:
(4.21)
This formula is dealt with in more detail when we come to multivariate regression, see Section 4.5. The in the local linear case differs from that for the Nadaraya-Watson estimator (4.13) only with regard to the bias. It is easy to see that the bias of the local linear fit is design-independent and disappears when is linear. Thus, a local linear fit can improve the function estimation in regions with sparse observations, for instance in the high net-income region in our Engel curve example. Let us also mention that the bias of the local linear estimator has the same form as that of the Gasser-Müller estimator, i.e. the bias in the fixed design case.
The local linear estimator achieves further improvement in the boundary regions. In the case of Nadaraya-Watson estimates we typically observe problems due to the one-sided neighborhoods at the boundaries. The reason is that in local constant modeling, more or less the same points are used to estimate the curve near the boundary. Local polynomial regression overcomes this by fitting a higher degree polynomial here.
For estimating regression functions, the order is usually taken to be one (local linear) or three (local cubic regression). As we have seen, the local linear fit performs (asymptotically) better than the Nadaraya-Watson estimator (local constant). This holds generally: Odd order fits outperform even order fits. Some additional remarks should be made in summary:
• As the Nadaraya-Watson estimator, the local polynomial estimator is a weighted (local) average of the response variables .
• As for all other kernel methods the bandwidth determines the degree of smoothness of . For we observe the same result as for the Nadaraya-Watson estimator, namely at an observation , converges to . The behavior is different for . An infinitely large makes all weights equal, thus we obtain a parametric th order polynomial fit in that case.
A further advantage of the local polynomial approach is that it provides an easy way of estimating derivatives of the function . The natural approach would be to estimate by and then to compute the derivative . But an alternative and more efficient method is obtained by comparing (4.14) and (4.15) again. From this we get the local polynomial derivative estimator
(4.22)
for the th derivative of . Usually the order of the polynomial is or in analogy to the regression case (recall that the zero derivative of a function is always the function itself). Also in analogy, the odd'' order outperforms the even'' order .
EXAMPLE 4.4
To estimate the first () derivative of our Engel curve we could take (local quadratic derivative estimator). This is done to get Figure 4.4. Note that we have used a rule-of-thumb bandwidth here, see Fan & Müller (1995, p. 92) and Fan & Gijbels (1996, p. 111) | 2013-05-25 23:19:15 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9141640067100525, "perplexity": 452.55595873629454}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368706470784/warc/CC-MAIN-20130516121430-00011-ip-10-60-113-184.ec2.internal.warc.gz"} |
https://gurucalculator.com/health-calculator/Calorie-Calculator | Home > Health > Calorie Calculator
# Calorie Calculator
Unit
Gender
Age:
years
Height
feet
inch
Weight
pound
This is optional. If you used other way such as caliper or scale device to find this value, input it here to make the calculation more acurate.
%
##### Calculator Description
Calorie calculator calculator will calculate your daily calorie needed based on your selection of daily activity. We also calcualte your BMI value and use it to figure out a weight control suggestion for you. A new daily calorie value based on that suggestion is also provided by the calculator. You can use that value as a simple guide for what you should take next.
The daily activity is divided into 6 levels. Refer to the table below for the weight applied to BMR for each level.
Calorie calculator calcualtor also calculate the BMR, BMI, your Fat mass and lean mass.
Fitness ALL BMI Body Fat BMR Ideal Weight
##### How to Calclate Calorie
Daily calorie needed is calculated based on the BMR times a activity rate that is ranged from 1.2 to 1.9. To calculate BMR, If you didn't input the body fat percent value, we used
Mifflin-St Jeor Formula: $For\ men: BMR = 10Weight + 6.25Height - 5Age + 5$ $For\ women: BMR = 10Weight + 6.25Height - 5Age - 161$ If you provided the body fat percent value that you can get it either use our body fat percentage calculator or from a device such as a fat percentage scale or caliper, then we will use
Katch-McArdle Formula: $BMR = 370 + 21.6(1 - BFP)Weight$
The weight factor for each activity is in the following list:
• Little or no exercise: 1.2
• Light exercise: 1.375
• Moderate exercise: 1.4625
• Active exercise: 1.55
• Very active exercise: 1.725
• Extreamly active exercise: 1.9
For example, if the calcualted BMR is 1770 and you activity level is "Active exercise", the calcualted total daily calorie is: $1770 \times 1.55 = 2743.5$
This calculator is a good estimator for adult in normal weight (i.e BMI less than 25). The Energy Calculator is an alternate calculator for the same purpose that will take age group, gender and overweight into consideration and thus will be a better choice as a carolie calculator.
##### How to reduce daily calorie consumption
Just counting daily calories is often the wrong way to lose weight. If you feel hungry constantly due to control of calorie amount, it will be very hard to get a long term success in weight control. There are two strategies that you can take to make you life easy:
• ###### Pay attention to calorie density
Don't eat foods that are fatty and/or dry. Foods that are fatty and dry, like croissants, donuts, chocolate bars, cookies, energy bars, granola cereals, cheesy breads, and potato chips all pack a lot of calories into very small amounts of food. Make sure majority of your foods that are naturally rich in water and fiber. Foods that tend to be naturally rich in water and fiber are whole foods like fruits, vegetables, potatoes , oatmeal, brown rice, and whole-wheat pasta, and legumes like pinto beans, garbanzo beans, peas, and lentils. Other low- to moderately-calorie-dense choices include nonfat dairy foods and lean meat like fish, white poultry without the skin, and game meat like bison. | 2021-10-19 07:53:36 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3551948070526123, "perplexity": 5331.421743632886}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585246.50/warc/CC-MAIN-20211019074128-20211019104128-00407.warc.gz"} |
https://docs.kubos.com/1.6.0/services/telemetry-db.html | # Telemetry Database Service¶
KubOS utilizes a SQLite database to store telemetry data generated by the hardware and payload services until it is requested for transmission by the ground station.
SQLite only allows one process to make changes to a database at a time, so the telemetry database service acts as a single point of contact for interacting with the underlying telemetry database.
## Interface Details¶
Specific details about the available GraphQL queries can be found in the telemetry database service Rust docs.
### Benchmark¶
The Kubos repo contains a database benchmark project which we have used to measure various behaviors of the telemetry database service.
Because each OBC has its own unique system resources, we recommend compiling and running the test project on your OBC to obtain the most accurate results.
When run on a Beaglebone Black, we gathered the following benchmark statistics:
• Sending UDP requests takes ~45 microseconds
• This means that a client can send UDP requests at a rate of 22,000 requests per second, if they don’t wait for a response. Note: This is far faster than rate at which the service processes requests, meaning that packets will be dropped if this maximum speed is used.
• Telemetry database inserts take ~16 milliseconds
• Round-trip service transactions (including UDP receive request, database insert, and UDP send response) take ~17 milliseconds
• This means that the service can process roughly 58 database insert requests per second
## Querying the Service¶
The telemetry query can be used to fetch a certain selection of data from the telemetry database. It will return an array of database entries.
The query has the following schema:
query {
telemetry(timestampGe: Integer, timestampLe: Integer, subsystem: String, parameter: String, limit: Integer): [{
timestamp: Integer!
subsystem: String!
parameter: String!
value: String!
}]
}
Each of the query arguments acts as a filter for the database query:
• timestampGe - Return entries with timestamps occurring on or after the given value
• timestampLe - Return entries with timestamps occurring on or before the given value
• subsystem - Return entries which match the given subsystem name
• parameter - Return entries which match the given parameter name
• limit - Return only the first n entries found
Note: timestampGe and timestampLe can be combined to create a timestamp selection range. For example, entries with timestamps after 1000, but before 5000.
## Saving Results for Later Processing¶
Immediate, large query results might consume more downlink bandwidth than is allowable. Alternatively, downlink and uplink could be asynchronous from each other.
In this case, we can use the routedTelemetry query to write our results to an on-system file. This way, we can choose the specific time at which to downlink the results using the file transfer service. Additionally, by default, the output file will be in a compressed format, reducing the amount of data which needs to be transferred.
The query has the following schema:
query {
telemetry(timestampGe: Integer, timestampLe: Integer, subsystem: String, parameter: String, output: String!, compress: Boolean = true): String!
}
The output argument specifies the output file to write the query results to. It may be a relative or absolute path.
The compress argument specifies whether the service should compress the output file after writing the results to it.
The other arguments are the same as in the telemetry query.
The query will return a single field echoing the file that was written to. If the compress argument is true (which is the default), then the result will be the output file name suffixed with ”.tar.gz” to indicate that the file was compressed using Gzip.
The results file will contain an array of database entries in JSON format. This matches the return fields of the telemetry query.
## Adding Entries to the Database¶
The insert mutation can be used to add an entry to the telemetry database.
It has the following schema:
mutation {
insert(timestamp: Integer, subsystem: String!, parameter: String!, value: String!): {
success: Boolean!,
errors: String!
}
}
The timestamp argument is optional. If it is not specified, one will be generated based on the current system time, in milliseconds.
### Limitations¶
The generated timestamp value will be the current system time in milliseconds. The database uses the combination of timestamp, subsystem, and parameter as the primary key. This primary key must be unique for each entry.
• As a result, any one subsystem parameter may not be logged more than once per millisecond.
## Adding Entries to the Database Asynchronously¶
If you would like to add many entries to the database quickly, and don’t care about verifying that the request was successful, the service’s direct UDP port may be used. This UDP port is configured with the direct_port value in the system’s config.toml file.
Insert requests should be sent as individual UDP messages in JSON format.
The requests have the following schema:
{
"timestamp": Integer,
"subsystem": String!,
"parameter": String!,
"value": String!,
}
The timestamp argument is optional (one will be generated based on the current system time), but the other parameters are all required.
For example:
{
"subsystem": "eps",
"parameter": "voltage",
"value": "3.5"
}
### Limitations¶
The generated timestamp value will be the current system time in milliseconds. The database uses the combination of timestamp, subsystem, and parameter as the primary key. This primary key must be unique for each entry.
• As a result, any one subsystem parameter may not be logged more than once per millisecond.
This asynchronous method sends requests to the telemetry database service much more quickly than time needed for the service to process each request. The service’s direct UDP socket buffer can store up to 256 packets at a time.
• As a result, no more than 256 messages should be sent (from any and all sources) using this direct method in the time period required for the service to process them (this can be calculated by multiplying 256 by the amount of time required to process a single message. See the Benchmark section for more information).
The service processes requests from both the direct UDP method and the traditional GraphQL method one at a time, rather than simultaneously.
• As a result, if the service is receiving requests from both methods at the same time, the time period required to process 256 direct UDP messages should be doubled.
## Removing Entries from the Database¶
The delete mutation can be used to remove a selection of entries from the telemetry database.
It has the following schema:
mutation {
delete(timestampGe: Integer, timestampLe: Integer, subsystem: String, parameter: String): [{
success: Boolean!,
errors: String!,
entriesDeleted: Integer
}]
}
Each of the mutation arguments acts as a filter for the database query:
• timestampGe - Delete entries with timestamps occurring on or after the given value
• timestampLe - Delete entries with timestamps occurring on or before the given value
• subsystem - Delete entries which match the given subsystem name
• parameter - Delete entries which match the given parameter name
The mutation has the following response fields:
• success - Indicates whether the delete operation was successful
• errors - Any errors encountered by the delete operation
• entriesDeleted - The number of entries deleted by the operation | 2019-06-26 06:30:08 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2437674105167389, "perplexity": 3092.4507837665033}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-26/segments/1560628000175.78/warc/CC-MAIN-20190626053719-20190626075719-00493.warc.gz"} |
http://www.ntg.nl/pipermail/ntg-context/2012/067237.html | # [NTG-context] Spacing for {\cal P} in XITS
Janne Junnila janne.junnila at gmail.com
Tue May 29 12:19:00 CEST 2012
Hi,
I just noticed that the spacing after ${\cal P}$ looks a bit too tight
(non-existent?) while using XITS fonts.
\setupbodyfont[xits]
\starttext
The spacing of ${\cal P}$ looks like this.
\stoptext
I'm not sure if the other calligraphic letters are totally fine
either, but this one caught my eye. I suppose it's a font issue. Any
ideas?
Best regards,
Janne Junnila | 2014-09-19 23:55:35 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9906023144721985, "perplexity": 7006.320158136442}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1410657132372.31/warc/CC-MAIN-20140914011212-00348-ip-10-196-40-205.us-west-1.compute.internal.warc.gz"} |
https://motls.blogspot.com/2005/08/let-us-build-ilc.html?showComment=1125156060000 | ## Saturday, August 27, 2005 ... //
### Let us build the ILC
The purpose of this page is not to explain things like which two European countries shared the LEP collider. Incidentally it is either South Africa and Nigeria, or France and the Supersymmetric Republic of Switzerland, or Australia and New Zealand, or Peru and Chile.
JoAnne Hewett has encouraged everyone to promote the ILC, the "Imaginary Linear Collider", as our phenomenological friends call it. It is a pleasure to follow her instructions. My comments are primarily addressed to the true American patriots who, I hope, are well represented among the readers. :-)
In 2007, a new collider called the LHC - the "Large Hadron Collider" - will start at CERN, Switzerland. I mean the old, socialist, and stagnating continent called Europe. It should discover some kind of Higgs - which is incidentally the "God Particle" - and perhaps some kind of supersymmetry - which is a symmetry relating SuperMen and SuperMenino - which would be really cool; for example, I would win a $1000 bet which will otherwise be lost. The LHC is being built in the same 27-kilometer-long tunnel (in circumference) in which the lepton machine called LEP ("Lot of Extra Problems", later also called "Large Electron-Positron" collider) operated in 1999-2000 and nearly discovered the Higgs particle around 115 GeV, the current lower bound for its mass. By the way, CERN has previously found the W and Z bosons in 1983. All good physicists at that time already knew that the bosons would be there - and some of them had already been enjoying their Nobel prizes for the right theory predicting them since 1979. You may notice that these colliders, i.e. particle accelerators (atom smashers) in which the particles collide to create a lot of new stuff (sometimes even interesting stuff), belong to two basic types: • circular colliders in which the particles orbit many times and the centrifugal force - more precisely the synchrotron radiation that also occurs for nonzero acceleration of charged particles - is the main enemy of our attempts to accelerate it too much (LEP, LHC, Tevatron); very strong magnets are needed which is why the ambitious visionaries used to think about the superconducting magnets • linear colliders in which the centrifugal force is absent, but the particles only fly once and therefore the linear tunnel must be very long (SLAC in California, ILC) and the electric fields must be strong There is one more important classification - according to the particles they collide: • hadron machines (protons and perhaps antiprotons): Tevatron in Fermilab, Illinois collides protons off antiprotons; LHC will collide two beams of protons • lepton machines (electrons and positrons): LEP, SLAC, ILC; in principle, one could also collide heavier muons, but no such accelerator has been built and it could also emit too many unhealthy highly-energetic neutrinos from the unstable muons The advantage of the hadron machines, such as the LHC in 2007, is that the heavy hadrons can carry a lot of energy if the velocity is the same, for example. Their disadvantage is that the hadrons contain a lot of glue and other chromodynamic dirt. Whatever you produce is therefore chromodynamically dirty and hard to identify and measure. The lepton machines, on the other hand, have some problems with getting really huge energies, but their collisions are very clean. An electron annihilates with the positron to a "pure energy" (imagine a virtual photon) which is subsequently used by mother Nature to produce virtually anything. Neither technology is universally superior over the other; physicists tend to alternate the approaches as they raise the energy, in order to get complementary information. The power of America Currently the Tevatron in Fermilab, Illinois and SLAC in California are running in the U.S. In 2007, the European LHC may become the only active collider in the world; SLAC is almost sure to be shut down pretty soon. That could be as painful for America as Yuri Gagarin, especially if interesting new discoveries are made by the LHC. This paragraph is really addressed to the true U.S. patriots: the U.S. could have been ahead by a lot because the SSC - the "Superconducting SuperCollider" - a 80-kilometer long circle - was being built by the nice, scientifically oriented Republicans. The collider was invented and proposed by Ronald Reagan in 1987 and continuing huge support was later led by the President Bush Sr., despite the fact that the communism was already gone, who claimed Texas as the new home for "his" SSC. (His son, George W. Bush, is also a pretty big shot in particle physics.) However, the evil anti-scientific, mostly democratic Democratic U.S. Congress later stopped the project after 2 billion dollars (about 20 percent) were already spent. Bill Clinton and Al Gore had different priorities in science, for example, the second guy wanted to pay hundreds of billions of dollars to cool the planet. ;-) The Democrats will never tell you that the SSC was a project of Reagan and Bush Sr. and was killed once Clinton and Gore started. Most of the more recent frustration in particle physics may be attributed to the decisions in 1992 and 1993. Whenever you will hear the bitter criticism against the string theorists or even supersymmetry phenomenologists that they are just too smart and 15 years ahead of the experiments, don't forget that it is not their fault. It is the Democrats' fault that experimental particle physics was slowed down for 15 years. ;-) Even if the LHC is successful, the chromodynamic mud will prevent us from learning many details efficiently, or at least from measuring them accurately. This is why the ILC - which would become the "International Linear Collider" and the word "International" should really mean "Mostly American" - is needed. ILC would be a clean lepton machine where everything is nice and the desired products are produced without any garbage around. For a couple of years, the particle physicists may be secretly afraid of bad luck. But be sure that if the LHC sees something really new, beyond the single Higgs boson, whatever it is, every other intelligent American will ask "How is it possible that Europe is ahead in these crucial discoveries?" Maybe you should already ask the question now... Unless there is some inconsistency in mathematics, the LHC will have to discover something new that has not been yet. Something like the Higgs - the "God Particle" that transforms massless spirits into massive objects and particles. (Genesis: Let there be light in the form of the unbroken "U(1)" part of the "U(1) x SU(2)". And God realized that light was good and the Higgs mechanism was necessary.) While most physicists have already counted the Higgs as a "sure to be discovered" particle, this time we don't know what its mass will be. The God Particle also gives mass to Himself (or the Jesus particle, if you wish) - by self-interactions - but we don't know how much He interacts with Himself although we know that His four-God coupling should be less than one or so. One of the additional magic tricks He uses to give Himself mass is to change Himself into a pair of an object and an antiobject for a while - which would typically lead to a huge mass of God, comparable to the mass of a dust particle (the so-called Planck scale). The puzzle why God is much lighter than the dust - which He apparently has to be if He is omnipotent and able to give mass to others - is called the hierarchy problem. The most popular solution still says that for each object and anti-object that are used for Him to get extra mass, there are new objects, the superpartners, for which the contribution is exactly opposite: that's called the supersymmetry. Also, I was cheating a bit: most of the mass of humans actually does not come directly from God and the humans are not as holy as I suggested; we are sinners and most of our mass comes from the chromodynamic mud. :-) Maybe, the non-physicists won't understand why this story is true, but others may assure them that it is true. So the discovery of the Higgs will be a bit exciting anyway. But yes, if this is the only thing around, the ILC could be a bad investment. However, many of us expect more; much more. An extra comment for all scientifically oriented billionaires who read this sentence: you may pay for the project and I will help you to negotiate that the collider will be named after you. If you pay for the whole thing, I will also help you to create new terminology of the superpartners for the case that they're seen. ;-) I don't expect that a new SLC - "Soros' Linear Collider" - will be built because the person is not sufficiently high-brow for such a project, but someone else could have different standards and more cultivated dreams. And a special message for those string theorists who think that physics of colliders is their competitor and they don't want to support it. Forget it. We are one field with the phenomenologists. We clearly need progress in experimental particle physics because it helps us to choose the right questions and it creates excitement in the whole high-energy physics. Our colleague Quantoken has even figured out that it is really us for whom the new colliders are being built: the "super string theoretists". Roughly speaking, he believes that the purpose of the colliders is to increase the price of oil from$68 to $100 (the price dictated by Osama bin Laden). #### snail feedback (7) : reader Quantoken said... Lubos: As I point out on Cosmic Variance, the exponential growth of accelerators is simply not sustainable. It ends at certain point, which we are pretty near. Whether it ends at LHC, or one more generation after LHC, makes no fundamental difference. Now, depletion of the earth's resources is certainly not caused by LHC, ILC or any big science big money spending. But it a fact nevertheless, a painfully obvious one. A good scientist is very sensitive to anything he/she observes, and thinks about it and draw conclusions. Others will just walk by the evidences and not even seeing it. Oil price is pinching every one, Lubos, when you see the gasoline price near$3 a gallon, do you think only about your wallet?
I hope petroleum price can stop at $100 a barrel, Lubos. But unfortunately it won't. It's on a spiral up and accelelating upward, first slowly, then getting ever quicker its upward trend, until the last drop of oils is depleted. This is happening and the spiral started for two years by now. The day that we see oil price go up and expect it to go down eventually, is GONE! It could only ever go up more, and any downward trend is only temporary fluctuation, until we can't afford to drive any cars. Do you belong to the mid century establishment camp which believed the earth is flat, extend infinitely, and has infinite amount of resource buried underneath. Or do you think it is a crackpot theory that the earth is round, small, limited in size, and its resources are depleting very quickly? I wonder why no one is even interested in discussing this? Oh I forget, Lubos you live in a small apartment, walk to campus and do not own a car. So you think this has nothing to do with you? Quantoken reader Luboš Motl said... Dear Quantoken, I am familiar with the fact that the oil reserves are finite. That does not prevent us from using oil because oil is useful for many segments of the current economy. When oil is nearly gone, its price will increase. Since I came to the U.S. for the first time, the price of gazoline jumped three-fold. Obviously, it did not kill anyone. Once oil starts to disappear visibly, it will not only reduce consumption but also stimulate various kinds of research to find alternatives. At some moments, the alternatives will become cheaper and will start to grow. I am not afraid of the people in the future. And I don't think that looking for replacements of oil is as pure research as high energy theoretical physics; and it requires pretty different skills. And even from a purely economical perspective, I am not sure whether looking for replacement for oil is the hottest thing in business. It's of course one of the programs that will be gaining prominence in the near future, but are they already hot today? Not sure. Even the$100+ price of oil per barrel won't mean a death of civilization. Moreover, many alternatives already exist and they will get better as time goes. For example, one can create oil for $15 per barrel from turkey guts. Then you have various hybrid cars; new sources of electricity, and so forth. I just think that these things enjoy as much attention as they should. Best Luboš reader Quantoken said... Lubos: You never bother to calculate anything, do you? At world consumption of oil at 30 billion barrel per year, how many turkeys would you have to slaughter per year to produce enough turkey guts based fuel? One barrel is 115.6 liter> Let's say one liter is about one kilogram. And you need 10 turkeys to create one kilogram guts based fuel. That would be roughly 3.5x10^13 turkeys per year. i.e., 35 trillion turkeys per year. 6000 times higher than human population. We hardly have enough food to feed every human being on this planet, how do you manage to feed 6000 times more turkeys? The official world wide petroleum reserve underground is 1.2 trillion barrel, and at 30 billion barrel per year consumption rate, it's totally gone in just 40 short years. And you've got to realize that the reserve figure is cooked number due to political and economical reasons. The real figure is no more than 50% or 60% of the official figure. So we are talking about the oil can last another 20 to 25 years. Alternative energy source? There are plenty alternatives but NONE provide anything remotely close to the amount of energy we are consuming in the form of fossil oil. Thermo nuclear fusion? The research had been going on for 50 years with little success. It needs at least 50 more years before it can be successful, and more time before it becomes practical. We don't have the time. Besides we probably end up spend more energy to extract the useful isotope from sea water, than what we can get out of it, due to the low concentration and difficulty in extracting isotopes. And don't assume that we can have 20 or 30 more peace and prosperious lifestyle based on abundance of fossil fuel, before it all runs out. The crisis does NOT wait until the last drop of oil is drawn!!! The point is if you are the leader of any of the couple hundred big or small countries in the world, and knowing full well the oil is coming to an end pretty soon, and there is no replacement in sight. What would you do? Sit and wait 40 years, until it is too late? NO! The key word is national strategic petroleum reserve!!! Uncle Sam has been doing it quietly for decades, and so are a few other countries. The dumber countries are also waking up recently to the reality. And finally, in the year 2005, it has now become an open secret and even the dumbest of the dumbest national leaders all suddenly find the vital survival need to store some petroleum for rainy days. Isn't it, Lubos? All of a sudden virtually every country of any decent size are talking about national strategic petroleum reserve now, and they are paying any price to desperately buy any thing that's available. And I expect that at some point, the Saudis would say: Wait a minute, why would we sell the oil at cheap price to every one else, and not leave some for our own rainy day? We've got to cur export by 90% and keep it for ourselves. Imagine what will happen? So, look out,$68 a barrel or even \$100 a barrel is just a beginning. The much worse is going to going, very quicly, and it could even get much worse.
Do not assume that you are OK since you do not own a car. The kind of comfortable life you took for granted, you walk to any grocery store and pull off a few dollar bills and you can buy whatever you need to eat and consume for the day, such a lifestyle that every one takes for so granted, will be gone! There simply will not be massive transportation any more to sustain lifelines of big cities. Be prepared to plant potatoes in your backyard, and the only fertilize you can get would be your own human waste. The future is groomy.
Quantoken
Quantoken
Quote:
"American needs a national energy policy and a program on a scale of the Manhattan Project that developed the atomic bomb during World War II to prevent or mitigate the consequences of global peak oil. To avoid a really bumpy ride, what we need to do is dramatically reduce our consumption. The cheapest oil is oil we don’t use. Second, we need to invest in greater energy efficiency. Third, we have to invest our limited resources of time and current energy sources to make rapid advances in the development of alternative, renewable sources of energy."
Forget about any other big money big sciences. We can't afford anything but concentrate to work on the alternative energy source.
How is the world reserve number cooked? See this:
"Underpinning all of Campbell's, and Aspo's, work is the lack of transparency in the world's oil data. Campbell drew attention to the way in which members of the Organisation of Petroleum Exporting Countries (Opec) "revised" their reserve figures in the 1980s, and said that it is incredible that this "flawed data" is still being used today. He highlighted the example of Kuwait, which scrubbed its previous figures in 1985. Overnight, its reserves went from 64bn barrels to 92bn barrels. As Opec allows production quotas tied to stated reserves, this allowed Kuwait to pump more oil and immediately make a lot more money.
Campbell showed how, two years later, the other countries in Opec, outflanked by Kuwait's sudden action, followed suit. The United Arab Emirates went from 31bn barrels to 92bn barrels. "Then came Iran," said Campbell. It declared its reserves had increased, but went one better, going from 47bn barrels to 93bn. "And what of Iraq?" added Campbell. "Saddam, as we all know, had some pretty strong views on things, so he decided to come in at a round 100." Its previously stated reserves were 47bn barrels.
Some 18 to 20 years later, these numbers remain unchanged. This despite the United Arab Emirates, for instance, pumping millions of barrels every week since the day it flipped its figures."
We don't have 40 more years of oil, people! We probably have just 20 to 25 more years. And 2005 is the crisis year! The gasoline price is not just a pinch!!!
Quantoken
Somewhat off topic Quantoken but you are correct. It is rare to hear from someone who is acutely aware of this frightening problem.
It looks like it might be a classic case of the boiled frog syndrome. Most people seem totally oblivious to the colossal amounts of energy our global industrial economy consumes, especially the amount of oil we are using. And the demand for energy can only grow especially as China grows economically. But the earth is a closed finite system and entropy consumes everything...it gets you in the end. Entropy is a concept the average person does not seem to understand at all. Even if we can perfect alternative sources it would still only cover a tiny fraction of what we are currently using.
Incidently, you may be interested in the books: "The Party's Over:Oil, War and the Fate of Industrial Societies", by Richard Heinberg, and "Hubbert's Peak:The Impending World Oil Shortage".
Our entire global civilisation is totally hard wired to oil. Modern mass agricultural methods, which are required to feed billions, depend on petroleum-based products, like fertilisers. The harvesting and transportation of this food also requires oil. Next time you are in a supermarket check where everything comes from--
to fly it all its destinations all over the globe takes jet kerosene. All chemistry and chemical engineering depends crucially on petroleum-based materials as the starting point. The plastic bag you carry your shopping home in also came from oil. You can also forget nonsense like "hydrogen cars" since it takes more energy to create the hydrogen in the first place. The books cover these issues in detail. (Incidently, gas station owners all over the US are already reporting verbal and physical abuse from the public just with a slight rise in prices.)
While I support big science projects they sometimes seem like the statue building on Easter Island, with the inhabitants of that tragic place putting all their energy and time into these ultimately pointless, albeit impressive, creations while their enviroment ran out of resources and the ability to sustain life before collapsing into total chaos.
I don't want to be totally pessimistic but we need to wake up now to this problem. We need to tackle it while we still have the energy and resources to do so.
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-1828728-1', 'auto'); ga('send', 'pageview'); | 2021-08-01 13:25:39 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 1, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.25672444701194763, "perplexity": 2719.0774015248176}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154214.36/warc/CC-MAIN-20210801123745-20210801153745-00354.warc.gz"} |
https://hal-lirmm.ccsd.cnrs.fr/lirmm-00153978 | # Arc-chromatic number of digraphs in which every vertex has bounded outdegree or bounded indegree.
1 ALGCO - Algorithmes, Graphes et Combinatoire
LIRMM - Laboratoire d'Informatique de Robotique et de Microélectronique de Montpellier
3 MASCOTTE - Algorithms, simulation, combinatorics and optimization for telecommunications
CRISAM - Inria Sophia Antipolis - Méditerranée , Laboratoire I3S - COMRED - COMmunications, Réseaux, systèmes Embarqués et Distribués
Abstract : A {\it $k$-digraph} is a digraph in which every vertex has outdegree at most $k$. A {\it $(k\vee l)$-digraph} is a digraph in which a vertex has either outdegree at most $k$ or indegree at most $l$. Motivated by function theory, we study the maximum value $\Phi (k)$ (resp. $\Phi^{\vee}(k,l)$) of the arc-chromatic number over the $k$-digraphs (resp. $(k\vee l)$-digraphs). El-Sahili~\cite{ElS03} showed that $\Phi^{\vee}(k,k)\leq 2k+1$. After giving a simple proof of this result, we show some better bounds. We show $\max\{\log(2k+3), \theta(k+1)\}\leq \Phi(k)\leq \theta(2k)$ and $\max\{\log(2k+2l+4), \theta(k+1), \theta(l+1)\}\leq \Phi^{\vee}(k,l)\leq \theta(2k+2l)$ where $\theta$ is the function defined by $\ds \theta(k)=\min\{s : {s\choose \left\lceil \frac{s}{2}\right\rceil}\geq k\}$. We then study in more details properties of $\Phi$ and $\Phi^{\vee}$. Finally, we give the exact values of $\Phi(k)$ and $\Phi^{\vee}(k,l)$ for $l\leq k\leq 3$.
Document type :
Journal articles
https://hal-lirmm.ccsd.cnrs.fr/lirmm-00153978
Contributor : Stephan Thomasse <>
Submitted on : Tuesday, June 12, 2007 - 2:30:53 PM
Last modification on : Wednesday, October 14, 2020 - 4:23:47 AM
### Identifiers
• HAL Id : lirmm-00153978, version 1
• PRODINRA : 251684
### Citation
Stéphane Bessy, Etienne Birmelé, Frédéric Havet. Arc-chromatic number of digraphs in which every vertex has bounded outdegree or bounded indegree.. Journal of Graph Theory, Wiley, 2006, 53 (4), pp.315-332. ⟨lirmm-00153978⟩
Record views | 2020-10-30 08:31:06 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5390226244926453, "perplexity": 3080.7724096899865}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107909746.93/warc/CC-MAIN-20201030063319-20201030093319-00478.warc.gz"} |
https://byjus.com/question-answer/the-average-of-20-numbers-is-zero-of-them-at-the-most-how-many-may/ | Question
# The average of $$20$$ numbers is zero. Of them, at the most, how many may be greater than zero?
A
0
B
1
C
10
D
19
Solution
## The correct option is D $$19$$Let the $$20$$ numbers be $$a_1,a_2,...,a_{20}$$Given that average of 20 numbers is zero.Therefore, $$\dfrac{a_1+a_2+...+a_{20}}{20}=0$$$$\implies {a_1+a_2+...+a_{20}}=0$$$$\implies a_1+a_2+...+a_{19}=-a_{20}$$Therefore, at the most $$19$$ numbers can be greater than zero.Mathematics
Suggest Corrections
0
Similar questions
View More
People also searched for
View More | 2022-01-23 10:05:23 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6362163424491882, "perplexity": 2077.258005960521}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304217.55/warc/CC-MAIN-20220123081226-20220123111226-00221.warc.gz"} |
https://www.redblobgames.com/articles/probability/loot-drops.html | # Probability and Games: Loot Drops
from Red Blob Games
DRAFT
## 1 Outline - new#
{{ Types of problems I want to cover: N->k or k->N ; counting k vs spacing of drops ; infinite vs finite sequence. We start with simple code but then look at behavior, and behavior can be bad. Let’s find some other code that gives us better behavior. We start with code and end with behavior but maybe we should be designing backwards, by starting with behavior and ending with code. }}
### 1.1 Probability 1
Let’s look at a random event: if you open a treasure chest there’s a chance $$p$$ of finding a gem, where $$p$$ is between 0.0 (0% chance) and 1.0 (100% chance). If you open $$N=10$$ chests with probability $$p=0.2$$ (20% chance), how many gems $$k$$ will you find?
{ TODO: add a count of gems, and then animate the count into the histogram }
{ TODO: when you’ve added enough sequences, add a button to add 100 sequences at a time }
Each player will have a different experience. Some will get 0 gems; some will get 5. The histogram shows how many players will have each type of experience. The way to read it is to pick the number on the x-axis that represents the number of gems received, and then read the value from the y-axis that represents how many players experienced that. For example, ??13%?? of players will receive 4 gems out of 10 chests.
### 1.2 Statistics 1
In this scenario each random event is independent of all the others. The probability $$p$$ of a gem being in one chest is the same as the probability of it being in any other chest. It has a simple implementation:
def roll():
if random.uniform(0, 1) < 0.2:
return 'gem'
else:
return 'empty'
gems = 0
chests = 0
while chests < 10:
chests += 1
if roll() == 'gem':
gems += 1
Instead of running our simulation thousands of times, we can calculate the histogram exactly. Let’s call $$p$$ the probability that you’ll find a gem in a chest. Let’s call $$X$$ the number of gems we find in $$N$$ chests. Then the probability that there will be exactly $$k$$ gems is called a binomial distribution (in the special case of 1 chest, it’s also called a bernoulli distribution):
$P(X=k) = {N\choose k} p^k (1-p)^{N-k}$
Let’s see what it looks like with N = chests and p = chance of finding a gem. How many gems k do we find?
Play with this. What’s the range of $$k$$? It can be as little as $$0$$ drops and as much as $$N$$ drops. What’s the most common outcome? It will be $$k = N p$$. How much variation is there? Try doubling the number of chests, but keep the probability the same. Notice that the variation decreases.
{ TODO: figure out better chart scaling, because right now as you drag p around, it rescales and you completely miss that p is affecting the peak – maybe pick a scale range based on p=0.02, and maybe average the calculated max with the desired max so that you get some rescaling }
### 1.3 Probability 2
In some situations you know how many chests you’re going to open, and want to know how many gems you’re going to get. In other situations you know how many gems you need, and want to know how many chests you have to open. In the code, all I’ve done is change chests < 10 to gems < 5:
def roll():
if random.uniform(0, 1) < 0.2:
return 'gem'
else:
return 'empty'
gems = 0
chests = 0
while gems < 5:
chests += 1
if roll() == 'gem':
gems += 1
{ TODO make a diagram where you can click to generate a new random sample k=5, p=0.2; N is added to histogram; after several clicks, add a button to generate more of samples, and change histogram from discrete units to bars, and add a button to generate lots more, and then reveal this text: }
Each player will have a different experience. Lucky players will get all the gems opening only $$N=5$$ chests; unlucky players might have to open $$N=20$$ or more. This histogram shows how many players will have each type of experience. The way to read it is to pick the number on the x-axis that represents the number of chests opened, and then read the value from the y-axis that represents how many players experienced that. For example, ??13%?? of players had to open 10 chests to get their 5 gems.
### 1.4 Statistics 2
Instead of running our simulation thousands of times, we can calculate the histogram exactly. As before, $$p$$ is the probability that you’ll find a gem in a chest. Let’s call $$X$$ the number of chests we need to open to get $$k$$ gems. Then the probability that you have to open $$N$$ chests is called a negative binomial distribution (in the special case of one gem, it’s also called a geometric distribution):
$P(X=N) = {N-1\choose k-1}p^k (1-p)^{N-k}$
Let’s see what it looks like for k = gems and p = chance of finding a gem. How many chests N do we open?
Play with this. What’s the range of $$N$$? It can be as little as $$k$$ chests and as much as $$\infty$$ chests. What’s the most common outcome? It will be $$N = k/p$$. How much variation is there?
### 1.5 Problem
The big danger here is that $$N$$ has no limit. Players have a chance of having an extremely high $$N$$, which will lead to an unpleasant playing experience. If there are lots of players, then it’s likely that some players will have a bad experience. Let’s try to quantify this. How many players will have to open at most $$j$$ chests?
$\sum\limits_{N=k}^{j} P(X=N)$
{ TODO: diagram showing cumulative distribution }
For example, even though the most common scenario is that the player has to open 10 chests, 3% of players have to open more than 50 chests. Ugh.
Can we do better?
Yes. But it means we have to change something about the way we’re picking random numbers.
### 1.6 Probability 3
One option is to cap the number of chests needed. How can we do this? Here’s one way to think about it:
Let’s say we want a cap of $$j=20$$ treasure chests, and you want to find $$k=5$$ gems. Let’s make a set of chests and randomly shuffle them:
{ TODO diagram showing gems and chests, with shuffle button, and show how many chests have to be opened, with histogram }
### 1.7 Statistics 3
How many chests $$N$$ have to be opened? There’s a hard cap of 20, but most of the time you have to open close to 20 before you get 5 gems.
Is this related to hypergeometric? It seems so but I’m not sure how.
{ TODO diagram with controls for p, j, k }
How much variance is there? It’s a lot more when $$k$$ is a lot smaller than $$j$$.
### 1.8 Implementation 3
We could implement this system by randomly shuffling an array:
outcomes = ['gem'] * k + ['empty'] * (j-k)
random.shuffle(outcomes)
def roll():
return outcomes.pop()
Those of you have taken a probability course have seen this as “sampling without replacement” which is slightly different from “sampling with replacement”.
However, this requires us to keep a potentially large array. Can we do better? Yes. Instead of deciding ahead of time what each chest contains, we can keep track of how many gems need to be in the remaining chests, and decide on gem placement one chest at a time.
remaining_chests = j
remaining_gems = k
def roll():
global remaining_chests, remaining_gems
p = remaining_gems / remaining_chests
if random.random() < p:
outcome = 'gem'
remaining_gems -= 1
else:
outcome = 'chest'
remaining_chsts -= 1
return outcome
The probability that this chest contains a gem depends on how many gems and chests remain. This approach generates the same distribution of events as the randomly shuffled array, but we have to keep only two numbers.
### 1.9 Better implementation
Looking at the last implementation, when you open a chest and don’t find a gem, remaining_gems stays the same but remaining_chests decreases, so the probability of a gem increases for the next chest. If you do find a gem, the probability decreases. Eventually, if you have enough bad luck, the probability will reach 100%. The probability of one chest having a gem is no longer independent of another chest having a gem.
This strategy could work in general. We can increase the probability over time, so that if you’re having a streak of bad luck, the increased probability can help you get out. Are there other ways of changing the probability based on the kind of luck you’ve had?
### 1.10 Spacing - a whole ‘nuther topic
So far we’ve only been looking at how many gems drop in $$N$$ chests, and how many chests are needed to get $$k$$ gems. For game design, we also want to consider how they’re distributed. Both of these sequences produce 3 gems in 10 chests but they’re probably not equally fun:
Which of these is more fun? Will the player enjoy the game less knowing that there’s a nonuniform probability? Is there a fair way to have the player experience more fun sequences? Do we need to explain the nonuniformity in the game? If so, is there an in-game mechanism that would produce these sequences? For example, if you want more loot drops towards the end of the sequence, maybe the player’s character is getting better at spotting treasures. If you want more loot drops towards the beginning of the sequence, maybe the monsters are getting better at hiding treasures.
### 1.11 Repeating shuffles
If you have a never-ending selection, such as picking music from your music library, the shuffle approach runs into a problem: you might by chance shuffle the array [A, B, Z] and then next time [Z, B, A], so you play Z twice in a row. Another approach is to use filtered randomness, where you generate a sequence but then you remove things that you don’t want.
TODO Sampling with and without replacement
Hybrid with/out replacement with delay D
D = 0 means with replacement
D = max means without replacement
array { a b c d e f g h }
put a partition at array[D]
pick random number, put it on the right partition
cycle through right partition somehow (it's a circular queue)
why not just two arrays? could be easier, except for the initial state
at D = 0, D = max, does it become what we want?
what are the properties of this?
## 3 Random links I should check#
bernoulli process, does a single line of code end up with such a complex distribution? is this the right generalization from geometric distributions? lots to learn before I can write this section, and amazing that it’s rarely ever explained in the context of games.
average of 20 but the distribution is asymmetric and sometimes it could take a long time. if you have millions of players, playing millions of times, some of them will have bad luck and end up with a poor experience
path of exile completely evenly spaces evasion (instead of doing something random) http://www.pathofexile.com/forum/view-thread/11707/filter-account-type/staff/page/10#p748465[9]
use diagrams to explain how it works, let people change parameters, etc. then ask: what characteristics do you want for the game? in addition to number of drops, do you want those drops to be early or late in the process?
{TO investigate: WoW:LK does something – what?? – to tweak the distribution to cut off the tail ; need to find out if http://www.shacknews.com/article/57886/blizzard-details-secret-world-of[10] progressive drop rates are explained in detail somewhere; even if we don’t have details of what they did I can use a linear interpolation of drop rates from first kill to Nth kill, where N is the design limit on number of kills}
for damage rolls, it might be nice to have a stacked bar chart to show multiple distributions – for example, in the crit diagram, show which of them resulted from a crit
http://stackoverflow.com/questions/910215/need-for-predictable-random-generator[19] or randomize the number of 0s between 1s (poisson?)
May also find discussion on http://gamedev.stackexchange.com/questions/60329/why-do-loot-drops-contain-mostly-useless-items[21] to be interesting
XCOM2 just shows the player a different number than what they actually use (!) http://www.gamasutra.com/view/news/266891/Jake_Solomon_explains_the_careful_use_of_randomness_in_Xcom_2.php[23]
Probabilistic programming language treats random() as a distribution generator instead of returning only one result http://www.pl-enthusiast.net/2014/09/08/probabilistic-programming/[26] | 2021-04-23 02:20:15 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.508541464805603, "perplexity": 1102.8878624664196}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618039626288.96/warc/CC-MAIN-20210423011010-20210423041010-00048.warc.gz"} |
http://mathoverflow.net/questions/56675/is-every-kahler-form-on-a-stein-manifold-exact-outside-a-compact-set | # Is every Kahler form on a Stein manifold exact outside a compact set?
Is it true that on a smooth Stein manifold (or smooth affine variety or smooth complete intersection in $\mathbb{C}^{n}$), every Kahler form is exact outside a compact set?
-
This seems extremely false to me: I can't think of any example of a positive dimensional Stein manifold $W$ and a compact subset $K$ such that $H^2(W) \to H^2(W \setminus K)$ has nontrivial kernel. That means there should be an abundance of counter-examples: Just take any Kahler form representing a nontrivial class in $H^2(W)$.
In any case, here is a specific counter-example. Take $W = (\mathbb{C}^*)^2$ with coordinates $z_1$ and $z_2$. Take a $(1,1)$ form of the form: $$\omega := a \frac{dz_1 \wedge d\overline{z_1}}{z_1 \overline{z_1}} + b \frac{dz_1 \wedge d\overline{z_2}}{z_1 \overline{z_2}} + c \frac{dz_2 \wedge d\overline{z_1}}{z_2 \overline{z_1}} + d \frac{dz_2 \wedge d\overline{z_2}}{z_2 \overline{z_2}}$$
This is obviously closed. If I haven't dropped any signs, it is Kahler if and only if $\left( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \right)$ is positive definite Hermitian. (It is easiest to do this computation after setting $z_i = e^{w_i}$, so $d z_i/z_i = d w_i$.)
Now, let $T$ be the torus $|z_i|=r_i$. Irrespective of what $r_1$ and $r_2$ are, $\int_T \omega = (b-c) (4 \pi^2)$. (Again, if I haven't dropped any signs.) So, if we take $\left( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \right)$ a positive definite Hermitian matrix with $b-c \neq 0$, then we will have a Kahler form $\omega$ for which $\int_T \omega \neq 0$. For example, $\left( \begin{smallmatrix} a & b \\ c & d \end{smallmatrix} \right) = \left( \begin{smallmatrix} 2 & i \\ -i & 2 \end{smallmatrix} \right)$ would do.
Now, let $K$ be any compact set. For $(r_1, r_2)$ large enough, the torus $T$ is disjoint from $K$. So we have exhibited a Kahler form on $W$ such that, for any $K$, there is a $2$-cycle $T$ in $W \setminus K$ with $\int_{T} \omega \neq 0$. So $\omega$ is not exact on any $W \setminus K$. | 2014-10-25 16:52:51 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9734043478965759, "perplexity": 103.46535979326435}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-42/segments/1414119648706.40/warc/CC-MAIN-20141024030048-00294-ip-10-16-133-185.ec2.internal.warc.gz"} |
https://cse.engin.umich.edu/event/deeksha-adil | # Deeksha Adil: Fast Algorithms for l_p-Regression and Other Problems
Regression in $\ell_p$-norms is a canonical problem in optimization, machine learning, and theoretical computer science. In this talk, I will describe our recent advances in developing fast, high-accuracy algorithms both in theory and practice. Our algorithms are based on a few novel techniques which I will go over briefly and are the fastest available both in theory and practice. Our algorithms for $\ell_p$-regression also imply fast algorithms for the p-norm flow problem and an $m^{1+o(1)}\epsilon^{-1}$ time algorithm for the maximum flow problem on unit capacity graphs, matching the best-known bounds for this problem. | 2022-08-11 12:07:19 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7122762799263, "perplexity": 415.36857294455797}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571284.54/warc/CC-MAIN-20220811103305-20220811133305-00104.warc.gz"} |
http://mathoverflow.net/questions/55620/commuting-matrices-in-gln-z/55629 | # Commuting matrices in GL(n,Z)
Suppose $M$ is a "hyperbolic" matrix in $GL(n,\mathbb Z)$, i.e., that its characteristic polynomial $p$ is irreducible over $\mathbb Z$ and has no roots of modulus 1.
Is there a closed description of the set of elements of $GL(n,\mathbb Z)$ which commute with $M$?
I have a vague recollection that it is somewhat similar to the Dirichlet theorem on the units of an algebraic field, but it is really vague so a reference would be appreciated.
The case I'm most interested in is when $p$ has only one root of modulus greater than 1. Can $M$ commute with another matrix $M'$ with the same property (and $M, M'$ not being powers of the same matrix in $GL(n,\mathbb Z)$)?
-
This has very little to do with being hyperbolic; the key point is that the characteristic polynomial is irreducible. It is convenient to "close in" on $\mathbb{Z}$ be thinking about easier rings.
Let $M$ be a matrix in $GL(n, \mathbb{C})$ with distinct eigenvalues. Then I claim that the set of $n \times n$ matrices which commute with $M$ is $\mathrm{Span}_{\mathbb{C}} (\mathrm{Id}, M, M^2, \cdots, M^{n-1})$.
Proof: This statement is clearly invariant under change of basis, so we may assume that $M$ is diagonal, with diagonal entries $\lambda_i$. Then $A M = M A$ if and only if $\lambda_i A_{ij} = \lambda_j A_{ij}$. Since the $\lambda$'s are distinct, this forces $A$ to be diagonal. Since the Vandermonde matrix is invertible, the span of the first $n$ powers of $M$ is precisely the diagonal matrices.
Let $M$ be a matrix in $GL(n, \mathbb{Q})$ whose characteristic polynomial has distinct roots. Then the set of $n \times n$ rational matrices which commute with $M$ is $\mathrm{Span}_{\mathbb{Q}} (\mathrm{Id}, M, M^2, \cdots, M^{n-1})$.
Proof: Let $A$ be "the set of matrices which commute with $M$" and let $B$ be "the linear span of the first $n$ powers of $M$". Both of these are rational subvector spaces of $\mathrm{Mat}_{n \times n}(\mathbb{Q})$. The previous section shows that $A \otimes \mathbb{C}$ and $B \otimes \mathbb{C}$ are the same subspace of $\mathrm{Mat}_{n \times n}(\mathbb{C})$. A standard lemma is that, if $U$ and $V$ are both $K$-subspaces of a $K$ vector space $W$, and $U \otimes L = V \otimes L$ as subspaces of $W \otimes L$, then $U=W$.
Now, let $p$ be the characteristic polynomial, and assume furthermore that $p$ is irreducible. The $\mathbb{Q}$-span of the powers of $M$ is isomrophic, as a ring, to $\mathbb{Q}[t]/p(t)$. Since $p$ is irreducible, this is some number field, call it $K$. So the set of $\mathbb{Q}$-matrices which commute with $M$ is isomorphic to a number field. Since every element in a field, other than 0, is invertible, we get that the matrices in $GL(n, \mathbb{Q})$ which commute with $M$ are isomorphic to $K^*$.
Let $M$ be a matrix in $GL(n, \mathbb{Z})$ whose characteristic polynomial is irreducible. Let $K$ be the field of $\mathbb{Q}$-matrices which commute with $M$, as discussed above. The set of the matrices whose entries are in $\mathbb{Z}$ forms a lattice $\mathcal{O}$, of rank $n$, in $K$, which is also a subring. Such a subring of a number field is called an order; I don't think there is much to say about this order which is not true of general orders.
Finally, you want to understand those matrices of $\mathcal{O}$ which are in $GL(n, \mathbb{Z})$, meaning that their inverses are also in $\mathcal{O}$. This is the unit group of $\mathcal{O}$. And, indeed, Dirichlet's unit theorem applies to orders: if $K$ has $r$ real places and $s$ complex places, then $\mathcal{O}^*$ is a finite group times $\mathbb{Z}^{r+s-1}$.
Finally, you want to know whether or not you can have $M$ hyperbolic, $N$ hyperbolic commuting with $M$, but $N$ not a power of $M$. The answer is YES. I'll first give a theoretical proof, and then sketch an actual computation. Let the eigenvalues of $M$ be $\lambda_1$, ..., $\lambda_n$, with $|\lambda_1|>1$. Let $N=f(\lambda_i)$, with $f$ a polynomial with rational coefficients. Note that the $\lambda$'s are the Galois orbit of $\lambda_1$. For any Galois automorphism $\sigma$, we have $f(\sigma(\lambda_1)) = \sigma(f(\lambda_1))$. So the eigenvalues of $N$ are the Gaois orbit of $f(\lambda_1)$. In short, your question is equivalent to the following:
Let $\mathcal{O}$ be an order in a number field. Suppose that $\lambda$ and $\mu$ are units such that $|\lambda|$ and $|\mu|>1$, but their Galois conjugates are less than $1$. Can this hapen without $\mu$ not a power of $\lambda$?
It certainly can. I'll give the conceptual proof, then sketch a computation. If you recall the standard proof of Diricihlet's unit theorem, it goes as follows: Map $\mathcal{O}^*$ to $\mathbb{R}^{r+s}$ by $u \mapsto (\log |u|, \log |\sigma_2(u)|, \cdots, \log |\sigma_{s+r}(u)| )$, where the inputs to the logs are the Galois orbit of $u$. Clearly, the image lands in the hyperplane where the coordinates sum to $0$. One proves that the image is a discrete lattice, of rank $r+s-1$, in this hyperplane.
In particular, we are interested in units where $\log |u|>0$ but where all the other coordinates are negative. This is the intersection of our discrete lattice with a full dimensional cone; once $r+s-1>1$, this will be larger than the one dimensional sublattice of the powers of any single unit.
If you want an explicit example, lets take $K=\mathbb{Q}[\cos (2 \pi/7)]$. The Galois action permutes $(\cos (2 \pi/7), \cos (4 \pi/7), \cos (6 \pi/7))$ cyclically. (Note that $\cos (4 \pi/7) = 2 \cos^2 (2 \pi/7) -1$, so it is in the same field, and similarly for $\cos (8 \pi /7 ) = \cos (6 \pi /7 )$.
Set $u=(1-\cos(2 pi/7))/(1-\cos (4 \pi/7))$, $v=(1-\cos(4 pi/7))/(1-\cos (6 \pi/7))$ and $w=(1-\cos(4 pi/7))/(1-\cos (8 \pi/7))$. So the Galois group permutes $(u,v,w)$ cyclically and $u*v*w=1$. You can check that $u$, $v$ and $w$ obey the equation $$t^3 - 6 t^2 + 5t -1=0$$ so $u$, $v$ and $w$ are units. I think they generate the unit group; in any case, the have finite index in it. Also note that $|u|$ and $|v| < 1$, while $|w|>1$. So any matrix with eigenvalues $u$, $v$ and $w$ is hyperbolic.
Numerical experimentation reveals that $|u w^4|>1$, while $|v u^4|$ and $|w v^4|<1$.
So, write down explicit matrices for the action of $w$ and $u w^4$ on the ring of integers of $K$. Then these will be two hyperbolic matrices which commute, but where neither is a power of the other.
-
David, thanks! It is clear to me now how these matrices are related to units. As for the second part of my question, I'm afraid I didn't make myself 100% clear... What I meant was whether there exists a hyperbolic $M'$ commuting with $M$ with the <b>same property as $M$</b> - that is, it has only one eigenvalue outside the unit disc. It seems that the basis of the centralizer are matrices from different "clusters" (cluster = $m$ eigenvalues inside the unit disc, $n-m$ outside). Does this mean that the answer to this question is actually no? – Nikita Sidorov Feb 16 '11 at 18:47
Right. Let $M$ have eigenvalues $(u,v,w) \approx (0.307979, 0.643104, 5.04892)$. There will be some other matrix $N$, corresponding to the unit $u w^4$, whose eigenvalues are $(u w^4, v u^4, w v^4) \approx (200.131, 0.0057858, 0.863622)$. So they are both hyperbolic. – David Speyer Feb 16 '11 at 19:03
Thanks again, got it. – Nikita Sidorov Feb 16 '11 at 19:16
Suppose $M$ has a simple eigenvalue $\lambda$ with associated eigenvector $v$. Then $M'$ has also eigenvector $v$ associated to an eigenvalue $\rho$. This means that $\lambda$ and $\rho$ are units in the same ring $\mathbb{Z}[\lambda]$. The converse is clear, so a closed description of the $M' \in GL(n,\mathbb{Z})$ commuting with $M$ would be: The multiplicative group of units in the ring $\mathbb{Z}[\lambda]$. If this group is not cyclic then the answer to the second question is yes.
-
$M$ being hyperbolic means that it sits inside a torus, i.e., an algebraic group isomorphic to ${\mathbb G}_m^n$. Then its centralizer in the algebra of $n\times n$ matrices is semisimple, i.e., a product of smaller matrix algebras over skew fields. The $\mathbb Z$-valued points define an order in that algebra and the matrices in $GL_n({\mathbb Z})$ commuting with $M$ form the unit group of that order. | 2014-07-26 05:09:54 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9689908027648926, "perplexity": 78.39887224207376}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-23/segments/1405997894983.24/warc/CC-MAIN-20140722025814-00011-ip-10-33-131-23.ec2.internal.warc.gz"} |
http://exxamm.com/blog/Blog/14341/zxcfghfgvbnm4?Class%2012 | Biology REGULATION OF GENE EXPRESSION
### KEY TOPICS
star Levels of Gene Regulation
star Conditions that regulate Expression
star Regulation in Prokaryotes
### LEVELS OF GENE REGULATION
● color{Violet}"Regulation" of color{Violet}"gene expression" refers to a very broad term that may occur at color{Violet}"various levels".
● Considering that gene expression results in the color{Violet}"formation of a polypeptide", it can be regulated at several levels.
● In color{Violet}"eukaryotes", the regulation could be exerted at:
(i) color{Violet}"transcriptional level" (formation of primary transcript)
(ii) color{Violet}"processing level" (regulation of splicing)
(iii) color{Violet}"transport of mRNA" from nucleus to the cytoplasm
(iv) color{Violet}"translational level".
### CONDITIONS THAT REGULATE EXPRESSION
● The genes in a cell are expressed to perform a color{Violet}"particular function" or a color{Violet}"set of functions".
● For example, if an enzyme called color{Violet}"-galactosidase" is synthesised by color{Violet}"E. coli", it is used to catalyse the hydrolysis of a color{Violet}"disaccharide", lactose into galactose and glucose; the bacteria use them as a color{Violet}"source of energy".
● Hence, if the bacteria color{Violet}"do not have lactose" around them to be utilised for energy source, they would color{Violet}"no longer require" the synthesis of the enzyme color{Violet}"beta-galactosidase".
● Therefore, in simple terms, it is the color{Violet}"metabolic, physiological or environmental" conditions that regulate the expression of genes.
● The development and differentiation of color{Violet}"embryo into adult organisms" are also a result of the color{Violet}"coordinated regulation of expression" of several sets of genes.
### REGULATION IN PROKARYOTES
● In color{Violet}"prokaryotes", control of the color{Violet}"rate of transcriptional initiation" is the predominant site for color{Violet}"control of gene expression".
● In a color{Violet}"transcription unit", the activity of color{Violet}"RNA polymerase" at a given promoter is in turn regulated by interaction with color{Violet}"accessory proteins", which affect its ability to color{Violet}"recognize start sites".
● These regulatory proteins can act both color{Violet}"positively" (color{Violet}"activators") and color{Violet}"negatively" (color{Violet}"repressors").
● The color{Violet}"accessibility of promoter regions" of prokaryotic DNA is in many cases regulated by the interaction of proteins with sequences termed color{Violet}"operators".
● The operator region is color{Violet}"adjacent" to the promoter elements in color{Violet}"most operons" and in most cases the sequences of the operator bind a color{Violet}"repressor protein".
● Each operon has its specific color{Violet}"operator" and specific color{Violet}"repressor".
● For example, color{Violet}"lac operator" is present only in the color{Violet}"lac operon" and it interacts specifically with color{Violet}"lac repressor" only. | 2019-05-24 07:01:29 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5192237496376038, "perplexity": 12495.804579385182}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232257553.63/warc/CC-MAIN-20190524064354-20190524090354-00262.warc.gz"} |
https://bioeconometrician.github.io/bookreview_thegene/ | # The Gene by Siddhartha Mukherjee (Book Review)
### Introduction
The Gene is Siddhartha Mukherjee’s second book following The Emperor of All Maladies[1], which won the Pulitzer Prize for non-fiction in 2011 for chronicling the history of cancer. Like his first book, The Gene seeks to tackle the whole history of the subject, which in this case means parsing the state of genetic knowledge from homunculus to the human genome project. Both books are written in the same style with the chapters broken up into small vignettes. As an oncologist Dr. Mukherjee had the added benefit of being able to link the theoretical issues and concepts of cancer to his actual patients in the first book. In The Gene, Mukherjee maintains a similar level of intimacy with the reader by describing the various mental health issues that have run throughout his father’s side of his family. From a writer’s perspective, it is interesting that one would write about a specific genetic disease first, and then about genetics second, as one may assume that conceptual specificity follows generality. However, for the Mukherjee oeuvre, the ordering is well suited. Mukherjee’s knowledge of oncology stood on the shoulder of genetics and it is only fitting he play the reductionist in this second work after gazing over the landscape from his perched view.
Three ideas which underpin our understanding of the material world came to full fruition in the twentieth century: the atom, the bit, and the gene. While we had some ur-idea of each of these concepts in preceding centuries, they were only flushed out in the twentieth. These three conceptual units provided the most functionally appropriate level of study for their respective fields (physics, computer science, and biology). While modern biology needs an understanding of evolution to explain why we see the variety and frequency of biological forms that we do, even at a give snapshot in time, the gene is required to explain how biological forms work and reproduce. In this sense, even a creationist would have wondered how it was that all this ‘biological stuff’ actually works. The question of ‘what is life’ would perplex and challenge earlier generations until a modern synthesis of ideas came together in cell and molecular biology.
From the Greeks to the Enlightenment, science was largely driven by intuition and logic to unravel nature’s mysteries. With almost terrifying precision Newton was able to figure out the most important laws of physics and calculus by ruminating in a (probably stuffy) room in Cambridge. And yet, there are some problems to which ‘philosophizing’ proves insufficient. However, 19th century laid to rest that idea that human intuition and logic went hand-in-hand with the natural world. Instead science could now be based on following the implications of models which had already shown themselves to be accurate predictors of physical reality, despite the their seeming incongruity.[2] Christian Doppler, one of Mendel’s physics teachers incidentally, shocked audiences by having brass players demonstrate the Doppler effect: sound coming towards you sounds different that sound moving away from you. Ironically, the very reason that we find many physical phenomenon hard to understand,[3] is because of a concept we find hard to understand: evolutionary psychology (which tells us that our brains are wired to understand things that were important for our species’ evolutionary fitness like the parabolic arcs of thrown objects).
### (i) What the ancients thought
Appearances of “likeness” between parent and sibling did provide one intuitive link between sex and genetics however. Pythagoras of Croton thought that semen carried the self-information of the male into the next generation by coursing through the body and taking note of all the body’s key attributes (on miniature papyrus no doubt). Once inside the womb, the woman would provide nourishment. Gender roles at the zygotic level were nicely segregated and matched social expectations. Pythagorean genetics were on display in Aeschylus’ Eumenides where Apollo defends Orestes for the murder of Clytemnestra.
(Chorus) He who hath shed a mother’s kindred blood,
Shall he in Argos dwell, where dwelt his sire?
How shall he stand before the city’s shrines,
How share the clansmen’s holy lustral bowl?
(Apollo) This too I answer; mark a soothfast word:
Not the true parent is the woman’s womb
That bears the child; she doth but nurse the seed
New-sown: the male is parent; she for him,
As stranger for a stranger, hoards the germ
Of life, unless the god its promise blight.
Plato believed that since children were some function of their parents attributes the possibility of good breeding (eugenics) could improve the calibre of the republic’s citizens. Aristotle rejected the previous Pythagorean idea that only the male’s attributes were germaine to genetics. He accurately noted that both the mother and father’s characteristics were present in offspring and that phenotypes can skip a generation (a phenomenon which helped Mendel to distill his thinking): “In Sicily a woman committed adultery with a man from Ethiopia; the daughter did not become an Ethiopian, but her granddaughter did”. He correctly pointed out that if the sperm collected the current attributes of the male, how did young men pass traits to their children (such a greying hair) which they themselves had not yet experienced? Instead, Aristotelian genetics posited that male’s provides the message whilst female’s furnished the material. As Mukherjee puts it:
Aristotle was wrong in his in partitioning of male and female contributions into “material” and “message,” but abstractly, he had captured one of the essential truths about the nature of heredity. The transmission of heredity …. was essentially the transmission of information. Information was then used to build an organism from scratch: message became material.
However, even attaining a conceptual framework begs the further practical question:
[I]f heredity was transmitted as information, then how was that information encoded? The word code comes from the Latin caudex, the wooden pith of a tree on which scribes carved their writing. What, then, was the caudex of heredity? What was being transcribed, and how? How was the material packaged and transported from one body to the next? Who encrypted the code, and who translated it, to create a child?
Medieval and Renaissance thought in Europe gravitated towards the idea of preformation, that is that miniature humans were to be found inside sperm. In addition to being intuitive, theologians found pleasing the implication that the material which made up our bodies could literally be traced back to the original sin, forever binding our fate to the fall of man.
### (ii) The modern age of genetics
Gregor Mendel, an Augustinian Friar and amateur scientist, single-handedly determined that genetic information in sexual reproduction was inherited in two discrete genes. The idea that genetic information was that, pieces of information, was essential to understand not just genetics (of course) but evolution and biology as well. Darwin had struggled with explaining the “variability of organic beings in a state of nature” with his idea of pangenesis, essentially a riff on Pythagoras’ idea that the sperm collects information from each part of the body, except Darwin had replaced “body” with “cells”. However, pangenesis was also an endorsement of the Lamarckian view of genetics which held that transformations to the adult body could be passed onto their children.[4] In 1883 however, the German embryologist August Weismann performed the grimly methodical experiment of removing the tails of 901 mice and measuring the tail lengths of their offspring. There was no difference: Lamarckian genetics was dead.
This needn’t have been a problem as Mendel had already discovered an alternative set of laws of heredity which accurately described the relationship between inherited characteristics in pea plants. Unfortunately, in a truly heartbreaking episode of scientific history, Mendel was ignored by his colleagues and his groundbreaking paper Experiments on Plant Hybridization was confined to the dustbin of the Proceedings of the Natural History Society of Brünn in 1865. Not only was genetics set back at least thirty-five years (Mendel’s findings would be rediscovered at the turn of the century), but Darwin was deprived of a theory at exactly the time he needed one to explain the variability of natural forms within and between species.
The rebirth of genetics was lead by a handful of figures including the Dutch botanist Huge de Vries. In his 1897 paper Heredity Monstrosities de Vries identified that the inheritance of traits in his data could only be explained by a “single particle of information”. But de Vries went further than Mendel is describing a feature of inheritance that was not found in either of the parents genetic information: mutants (a term coined by de Vries which means ‘change’ in Latin). In other words de Vries showed that:
$\text{Child's traits} = f(\text{Mother's traits}, \text{Father's traits}) + \text{mutation}$
This was the piece of the puzzle that Darwin was missing. Giraffe’s necks did not get longer over time because they continued to stretch their necks, but rather because those animals who had mutations which led to larger necks had enhanced evolutionary fitness.[5] While Darwin was struggling to pin down a theory which could synthesize evolution by natural selection and a genetic mechanism for propagating traits, his cousin Francis Galton was looking for statistical evidence that human characteristics were actually being passed down. Galton was undoubtedly influenced by Adolphe Quetelet, a Belgian Statistician who pioneered ‘social physics’,[6] and showed that many social and physical phenomenon (crime rates or chest size for example) followed statistical distributions in the population as a whole. Galton wanted to show that genius was hereditary,[7] and he found that:
[A]mong the 605 notable men that lived between 1453 and 1853, there were 102 familial relationships … If an accomplished man had a son, Galton estimated, chances were one if twelve that the son would be eminent. In contrast, one one in three thousand “randomly” selected men could achieve distinction… Lords produced lords–not because peerage was hereditary, but because intelligence was.
Of course, Galton understood that this may be because of social advantage and coined the expression “nature versus nurture”. However, he sided with nature in the case of the peerage. While most of what Galton said was wrong he helped us understand the nature of statistics and genetics better by the mistakes he made. Galton also coined the term regression because he found that only a ‘fraction’ of the height of the parents in their offspring. Using a data set which had the height of 934 children and their parents, (he converted the height of the female children to the 1.08 times their height which was the ratio of the of difference in the sex-specific height means he found in the sample),[8] he ran the following regression and found:
$\text{offspring} = \alpha + \beta \cdot \text{parent} + u$
As anyone with knowledge of infinite sequences knows, $\lim_{t \to \infty} { \text{offspring}_t } = \frac{\alpha}{1-\beta}$ which means that Galton’s model suggested in the long-run (sex-adjusted) height will return to 68.4 inches, the same mean height of the parents in the sample. Further evidence for the ‘reversion’ phenomenon was by plotting a confidence ellipse on the bivariate data and to notice that the 45 degree line intersected it a ratio of around two-thirds of children to parents height, as shown in Chart 1 in Galton’s original paper.
##### Chart 1.B: Replication of Galton's data
Galton possessed an impressive amount of intellectual zeal, but his impatience led him to overgeneralize his findings and seek to describe the most complex phenomena whilst even systems remained conceptually obscure. As noted above, Galton found the logic of infinite series appealing and posited that the inheritance of features resembled the following geometric series: $\frac{1}{2} + \frac{1}{4} + \frac{1}{8} + …$. In other words Esau begat half of Reuel who begat half of Zerah and so on. To reinforce his putative achievement he jumped straight from a hypothesis to Galton’s Ancestral Law of Heredity. Whilst data from the Basset Hound Club Rules on the color of dog’s coats initially lent credence to Galton’s views, a more rigorous inquiry into other sources provided by William Bateson, an early geneticist, proved that Galton was wrong and Mendel was right.
[H]ereditary instructions were carried by individual units of information, not by halved and quartered messages from ghostly ancestors. A child was an ancestral composite, but a supremely simple one: one-half from the mother, one-half from the father. Each parent contributed a set of instructions, which were decoded to create a child.
With the conceptual idea of modern genetics firmly understood by the first quarter of the 20th century, the scientific community would begin to ask what was the actual mechanism of inheritance? Was the transmission of life a process able to be understood by science, or did biology possess a special spark invisible to lens of empirical inference?
## Footnotes
1. Referred to as TEoALM from here on out. Note, TEoALM was was one best books I have ever read, one of the few non-fiction books I have read twice, and one additional spur to switch out of the field of Economics to Biostatistics.
2. Although interestingly this idea of looking at only results rather than hypotheses was included in Osiander’s prologue to Copernicus’ De revolutionibus: “… it is the duty of an astronomer to compose the history of the celestial motions through careful and expert study. Then he must conceive and devise the causes of these motions or hypotheses about them. Since he cannot in any way attain to the true causes, he will adopt whatever suppositions enable the motions to be computed correctly … The present author has performed both these duties excellently. For these hypotheses need not be true nor even probable. On the contrary, if they provide a calculus consistent with the observations, that alone is enough … For this art, it is quite clear, is completely and absolutely ignorant of the causes of the apparent [movement of the heavens]. And if any causes are devised by the imagination, as indeed very many are, they are not put forward to convince anyone that they are true, but merely to provide a reliable basis for computation. However, since different hypotheses are sometimes offered for one and the same … the astronomer will take as his first choice that hypothesis which is the easiest to grasp. The philosopher will perhaps rather seek the semblance of the truth. But neither of them will understand or state anything certain, unless it has been divinely revealed to him … Let no one expect anything certain from astronomy, which cannot furnish it, lest he accept as the truth ideas conceived for another purpose, and depart this study a greater fool than when he entered.”
3. Very small things (i.e. bacteria), very large things (i.e. galaxies), very fast things (i.e. light), and very slow things (i.e. evolution).
4. For example, Lamarck thought that the long necks of giraffes had evolved because some giraffes which had stretched their necks were more successful and had passed on this trait. However Lamarckian genetics confused phenotypes with genotypes, assuming that the former drove the latter, rather than the other way around. From a utilitarian perspective though, the belief in Lamarckian genetics may be a positive motivating force for individuals to apply physical and intellectual exertion in the belief that their achievements will be passed onto the next generation.
5. Fitness in the evolutionary sense refers to the propensity of certain genetic traits to increase the change of offspring.
6. A term which now in use again thanks to an MIT Lab of the same name which hopes to use Big Data to explain… everything?
7. Galton was related to Charles and Erasmus Darwin… coincidence? Francis thought not!
8. Note, a very similar relationship is found is one takes average of the individual family ratios of average male to female height. Such a check may be useful in case say shorter families have fewer girls (possibly for epigenetic reasons).
Written on September 16, 2016 | 2021-03-06 18:02:40 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4172182083129883, "perplexity": 3186.2704064690515}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178375274.88/warc/CC-MAIN-20210306162308-20210306192308-00135.warc.gz"} |
https://bristolcrypto.blogspot.com/2017/ | ## Thursday, September 28, 2017
### CHES 2017 Taipei, Taiwan
CHES 2017 was held September 25th - 28th in Taipei, Taiwan. This being my first trip to CHES, I was glad to see a mix of academics and people in industry whom had ties with cryptographic hardware on embedded systems.
Although I have a limited frame of reference, I feel the standard of the conference was quite high - the presenters all knew what they were talking about in great detail, and were able to accurately describe the contribution they had made to their respective fields.
My favourite talks were in the 'Side-Channel Analysis' and the 'Emerging Attacks' sessions, as the talks in these two sessions in particular were engaging and close to the work I have been doing during my PhD.
However, my obligatory post-conference blog post will be on 'Sliding right into disaster: Left-to-right sliding windows leak', a joint work by Daniel J. Bernstein, Joachim Breitner, Daniel Genkin, Leon Groot Bruinderink, Nadia Heninger, Tanja Lange, Christine van Vredendaal, and Yuval Yarom (I wasn't aware so many people could work on one paper at the same time!).
The contribution of the paper was showing that although the Right-to-Left sliding window didn't provide leak a great deal of information, the Left-to-Right sliding window provided just enough to recover the full key (in some cases).
For a brief recap, RSA uses modular exponentiation, and in many implementations the 'sliding window' method is used for efficiency. This can be done either Left-to-Right or Right-to-Left, and although they are very similar, they have very slight differences: the Right-to-Left method tends to be easier to program, uses the same number of multiplications as Left-to-Right, but requires a bit more storage. Both are used in practice: the paper shows that the Libgcrypt crypto library uses the Left-to-Right method (and hence they provide an attack against this implementation).
One way to think about it is that if you want to compute x^25, you would convert the exponent 25 into binary, manipulate this bitstring in some way (depending on whether you are going Left-to-Right or Right-to-Left, and also on the size of your window w), and then parse the bitstring: for every non-zero bit, perform a multiply; for every zero bit, perform a square (or something to that effect)
In this manipulated bitstring in the Right-to-Left method, due to the way the bitstring is created, we are guaranteed to have w - 1 zero bits after a non-zero bit. From a leakage point of view, this doesn't provide much information.
However, in the Left-to-Right method, two non-zero bits can be as close as adjacent. This allows us to infer certain details about the bitstring by applying certain rules to what we know (the leakage), and in some cases, working out the value of the key.
If we are able to recover >50% of the key bits this way, we can implement an efficient Heninger-Shacham attack to recover the remaining bits.
The paper was presented by Leon Groot Bruinderink, and he explained it in such a way that I found it clear to understand how the attack works, and how one would prevent against this kind of attack (not using Left-to-Right would be a start). They also contacted Libgcrypt with details of the attack, and it has been fixed in version 1.7.8.
Aside from the papers, CHES has been pretty amazing: the venue was a 5 star hotel in the centre of Taipei, the food was absolutely incredible (even the banquet, which introduced me to the wonders of sea cucumber), and the excursion to the Taipei Palace Museum was exceptionally educational (which as we all know is the best kind of fun).
I would definitely recommend CHES to anyone interested in the more practical side of cryptography, although if it ever takes place in Taiwan again, I strongly suggest you Youtube how to use chopsticks. Unfortunately I never learnt, and after a humiliating trip to the ShiLin Night Market, am now featured on several locals' phones in a video named 'The Tourist who couldn't eat Beef Noodle Soup'.
## Tuesday, September 5, 2017
### Crypto 2017 - How Microsoft Wants to Fix the Internet (Spoiler: Without Blockchains)
In the second invited talk at Crypto, Cédric Fournet from Microsoft Research presented the recent efforts of Project Everest (Everest VERified End-to-end Secure Transport), which seems an attempt to fix implementing TLS once and for all. Appropriately for such a gigantic task, more than a dozen researchers on three continents (and the UK) work on making it verifiable and efficient at the same time.
As with every self-respecting talk in the area, it started with the disaster porn that is the history of TLS (our lifes depend on it, but it's complicated, there have been 20 years of failures, insert your favourite attack here). However, the Crypto audience hardly needs preaching to (just a reminder that the work isn't done with a proof sketch; performance and error handling also matters), so the talk swiftly moved on to the proposed solutions.
The story starts in 2013 with miTLS, which was the first verified standard-compliant implementation. However, it still involved hand-written proofs and was more of an experimental platform. Enter Everest: They want to tick all the boxes by providing verified drop-in replacements for the HTTPS ecosystem. It covers the whole range from security definitions to code with good performance and side-channel protection.
As an example, Cédric presented Poly1305, a MAC that uses arithmetic modulo $2^{130}-5$ and forms part of the upcoming TLS 1.3 specification. Unsurprisingly, there have already been found bugs in OpenSSL's implementation. Project Everest have implemented Poly1305 with ~3,000 lines of code in Low*, a subset of F* (a functional language) that allows both C-style programming (with pointer arithmetic) as well as verification. Compiling this code with KreMLin (another output of Project Everest) results in machine code that is as fast as hand-written C implementations. The same holds for ChaCha2 and Curve25519.
However, hand-written assembly is still faster. The project aims to catch up on this with Vale, which was published at Usenix this year. Vale promises extensible, automated assembly verification and side-channel protection.
So what is the way forward? TLS 1.3 is on the horizon, bringing various improvements at the cost of a considerable re-design. This requires new implementations, and the project hopes to be first to market with an efficient and verifiable one.
For the rest of talk, Cédric gave more details on how F* naturally lends itself to security games, and how they proved concrete security bounds for the TLS 1.2 and 1.3 record ciphersuites.
All in all, I think it was a great example for an invited talk at Crypto, putting cryptography in a bigger context and bringing work that isn't necessarily on a cryptographer's radar to our attention.
## Tuesday, August 22, 2017
### Crypto 2017 - LPN Decoded
Crypto 2017 kicked off this morning in Santa Barbara. After a quick eclipse-watching break, the lattice track ended with the presentation of LPN Decoded by Andre Esser, Robert Kübler, and Alexander May.
Learning Parity with Noise (LPN) is used as the underlying hardness problem in many cryptographic protocols. It is equivalent to decoding random linear codes, and thus offers strong security guarantees. The authors of this paper propose a memory-efficient algorithm to the LPN problem. They also propose the first quantum algorithm for LPN.
Let's first recall the definition of the LPN problem. Let a secret $s \in \mathbb{F}_2^k$ and samples $(\mathbb{a}_i, b_i)$, where $b_i$ equals $\langle \mathbb{a}_i,s \rangle + e_i$ for some $e \in \{0,1\}$ with $Pr(e_i=1)= \tau < 1/2$. From the samples $(\mathbb{a}_i,b_i)$, recover $s$. We see that the two LPN parameters are $k$ and $\tau$. Notice that this can be seen as a sub-case of the Ring Learning with Errors problems; in fact, LWR originated as an extension of LPN.
If $\tau$ is zero, we can draw $k$ independent samples and solve for $s$ by Gaussian elimination. This can also be extended to an algorithm for $\tau < 1/2$, by computing a guess $s'$ and testing whether $s'=s$. This works well for small $\tau$, for example $\tau = 1/\sqrt{k}$, used in some public key encryption schemes. Call this approach Gauss.
For larger constant $\tau$, the best current algorithm is BKW. However, although BKW has the best running time, it cannot be implemented for even medium size LPN parameters because of its memory consumption. Further, BKW has a bad running time dependency on $\tau$. Both algorithms also require many LPN oracle calls.
The authors take these two as a starting point. They describe a Pooled Gauss algorithm, which only requires a polynomial number of samples. From those, they look for error-free samples, similar to Gauss. The resulting algorithm has the same space and running time complexity, but requires significantly less oracle calls. It has the additional advantage of giving rise to a quantum version, where Grover search can be applied to save a square root faction in the running time.
They then describe a second hybrid algorithm, where a dimension reduction step is added. Thus Well-Pooled Gauss proceeds in two steps. First, reduce the dimension $k$ to $k'$ (for example, using methods such as BKW). Then, decode the smaller instance via Gaussian elimination. The latter step is improved upon by using the MMT algorithm.
For full results, see the original paper. Their conclusion is that Decoding remains the best strategy for small $\tau$. It also has quantum optimisations and is memory-efficient. The Hybrid approach has in fact no advantage over this for small values of $\tau$. For larger values however, they manage to solve for the first time an LPN instance of what they call medium parameters - $k = 243$, $\tau = 1/8$ - in 15 days.
## Tuesday, May 2, 2017
### Eurocrypt 2017 - Parallel Implementations of Masking Schemes and the Bounded Moment Leakage Model
MathJax TeX Test Page
Side-channel analysis made its way into Eurocrypt this year thanks to two talks, the first of which given by François-Xavier Standaert on a new model to prove security of implementations in. When talking about provable security in the context of side-channel analysis, there is one prominent model that comes to mind: the d-probing model, where the adversary is allowed to probe d internal variables (somewhat related to d wires inside an actual implementation) and learn them. Another very famous model, introduced ten years later, is the noisy leakage model in which the adversary is allowed probes on all intermediate variables (or wires) but the learnt values are affected by errors due to noise. To complete the picture, it was proved that security in the probing model implies security in the noisy leakage one.
The work of Barthe, Dupressoir, Faust, Grégoire, Standaert and Strub is motivated precisely by the analysis of these two models in relation to how they specifically deal with parallel implementation of cryptosystems. On one hand, the probing model admits very simple and elegant description and proofs' techniques but it is inherently oriented towards serial implementations; on the other hand, the noisy leakage model naturally includes parallel implementations in its scope but, admitting the existence of noise in leakage functions, it lacks simplicity. The latter is particularly important when circuits are analysed with automated tools and formal methods, because these can rarely deal with errors.
The contribution of the paper can then be summarised in the definition of a new model trying to acquire the pros of both previous models: the Bounded Moment leakage Model (BMM). The authors show how it relates to the probing model and give constructions being secure in their model. In particular, they prove that BMM is strictly weaker than the probing model in that security in the latter implies security in the former but they give a counterexample that the opposite does not hold. The informal definition of the model given during the talk is the following:
An implementation is secure at order o in the BMM if all mixed statistical moments of order up to o of its leakage vectors are independent of any sensitive variable manipulated.
A parallel multiplication algorithm and a parallel refreshing algorithm are the examples brought to show practical cases where the reduction between models stated before holds, the statement of which is the following:
A parallel implementation is secure at order o in the BMM if its serialisation is secure at order o in the probing model.
The falsity of the converse is shown in a slightly different setting, namely the one of continuous leakage: the adversary does not just learn values carried by some wires by probing them, but such an operation can be repeated as many times as desired and the probes can be moved adaptively. Clearly this is a much stronger adversary in that accumulation of knowledge over multiple probing sessions is possible, which is used as a counterexample to show that security in the continuous BMM does not imply security in the continuous probing model. The refreshing scheme mentioned above can easily be broken in the latter after a number of iterations linear in the number of shares, but not in the former as adapting the position of the probes does not help: an adversary in the BMM can already ask for leakage on a bounded function of all the shares.
Both slides and paper are already available.
### Eurocrypt 2017: On dual lattice attacks against small-secret LWE and parameter choices in HElib and SEAL
This morning, Martin gave a great talk on lattice attacks and parameter choices for Learning With Errors (LWE) with small and sparse secret. The work presents new attacks on LWE instances, yielding revised security estimates. This leads to a revised exponent of the dual lattice attack by a factor of 2L/(2L+1), for log q = Θ(L*log n). The paper exploits the fact that most lattice-based FHE schemes use short and sparse secret. We will write q to denote the LWE modulus throughout.
Let's first have a look at the set-up. Remember LWE consists of distinguishing between pairs (A, As+e) and (A,b). In the first instance, A is selected uniformly at random and b is selected from a special (usually Gaussian) distribution. In the second one, both A and b are uniformly random. Selecting s, as this work shows, is perhaps trickier than previously thought. Theory says that, in order to preserve security, selecting a short and sparse secret s means the dimension must be increased to n*log_2(q). Practice says just ignore that and pick a small secret anyway. More formally, HElib typically picks a secret s such that exactly h=64 entries are in {-1,1} and all the rest are 0. SEAL picks uniformly random secrets in {-1,0,1}.
We also recall that the dual lattice attack consists of finding a short vector w such that Aw = 0, then checking if
<Aw, (As+e)w> = <w,e>
is short. If we are in the presence of an LWE sample, e is short, so the inner product is short. Short*short = short, as any good cryptographer can tell you.
The improvements presented in this paper rely on three main observations. Firsly, a revised dual lattice attack is presented. This step is done by adapting BKW-style algorithms in order to increase efficiency and can be done in general, i.e. does not depend on either shortness or sparseness of the secret. It is achieved by applying BKZ to the target basis, then re-randomising the result and applying BKZ again, with different block size.
The second optimisation exploits the fact that we have small secrets. We observe that we can relax the condition on w somewhat. Indeed, if s is short, then finding w such that Aw is short instead of 0 is good enough. Therefore, we look for vectors (v,w) in the lattice
L = {(y,x): yA = x (mod q)}.
Now in small secret LWE instances, ||s||<||e|| and so we may allow ||v||>||w|| such that
||<w,s>|| ≈ ||<v,e>||.
Finally, the sparsity of the small secret is exploited. This essentially relies on the following observation: when s is very sparse, most of the columns of A become irrelevant, so we can just ignore them.
The final algorithm SILKE is the combination of the three above steps. The steps are the following.
• Perform BKZ twice with different block sizes to produce many short vectors
• Scale the normal form of the dual lattice
• If sparse, ignore the presumed zero columns, correct for mistakes by checking shifted distribution
As usual, Martin wins Best Slides Award for including kittens.
## Wednesday, April 12, 2017
### Is Your Banking App Secure?
Last week I was in Malta for Financial Cryptography and Data Security 2017 to present my recent work on securing the PKCS#11 cryptographic API.
One talk that stood out for me was by researchers from the University of Birmingham, who looked for vulnerabilities in the mobile apps provided by major UK banks.
Sadly, they found major weaknesses in apps from 5 of the 15 banks they investigated.
Several apps use certificate pinning, where the app hard-codes a certificate from a trusted CA and only accepts public keys that are signed by the pinned certificate.
This is good practice, as an attacker can add their own certificate to the phone's trust store, but it won't be accepted by the app.
However, two Android apps (for Natwest and Co-op) accepted any public key signed by the pinned certificate, without checking the domain name!
So the attack works as follows:
1. Purchase a certificate for a domain you own from the trusted CA
2. The app will accept your public key with this certificate
3. Man-in-the-middle all the encrypted traffic between the user and their bank.
Curiously, the authors note: "Co-op [...] hired two penetration testing companies to test their apps, both of which had missed this vulnerability". It seems odd that such an obvious mistake wasn't picked up in testing.
The group also found that several banks - Santander, First Trust and Allied Irish - served adverts to their app users over unencrypted HTTP, meaning an attacker could spoof these ads and mount a phishing scam, perhaps by displaying a fake 'security warning' and directing users to re-enter their account details on a malicious page. It was pointed out in the talk that we're much more likely to 'feel safe' within an app (and hence trust all the content we see) than, say, visiting a webpage using a laptop, so this kind of in-app phishing scam could be very effective.
There are even more exploits described in the paper.
It was refreshing to hear that the vulnerable banks responded well to the disclosures made by the Birmingham group and patched their apps as a result. But I'm a little baffled that these basic errors were ever made in such security critical applications.
## Wednesday, March 29, 2017
### PKC 2017: Kenny Paterson accepting bets on breaking TLS 1.3
The member of the TLS 1.3 working group is willing to bet for a beer that the 0-RTT handshake of TLS 1.3 will get broken in the first two years.
In his invited talk, Kenny managed to fill a whole hour on the history of SSL/TLS without even mentioning symmetric cryptography beyond keywords, thus staying within the topic of the conference. Despite all versions of SSL being broken to at least some degree, the standardised TLS became the most import security protocol on the Internet.
The core part of TLS is the handshake protocol, which establishes the choice of ciphers and the session key. Kenny highlighted the high complexity stemming from the many choices (e.g., using a dedicated key exchange protocol or not) and the possible interaction with other protocols in TLS. Together with further weaknesses of the specification, this created the space for the many attacks we have seen. On the upside, these attacks express an increased attention by academics, which comes together with an increased attention by the society as whole. Both have laid the ground for improvements in both the deployment and future versions of TLS. For example, the support of forward secrecy has increased from 12 percent to 86 according to SSL pulse.
Turning to concrete attacks, most important in the area of PKC is the Bleichenbacher attack published already at Crypto 1998 (a human born then would a considered a full adult at the conference venue now). Essentially, it exploits that RSA with the padding used in TLS is not CCA-secure, and it recovers the session key after roughly $2^{20}$ interactions with a server. Nevertheless, the TLS 1.0 specification published shortly after Bleichenbacher's publication incorporates the problematic padding (recommending mitigation measures), and later versions retain it for compatibility. The DROWN shows the danger of this by exploiting the fact that many servers still offer SSLv2 (about 8% of Alexa top 200k) and that it is common to use the same key for several protocol versions. An attacker can recover the session key of a TLS session by replaying a part of it in an SSLv2 session that uses the same key.
On a more positive note, Kenny presented the upcoming TLS 1.3, which is under development since 2014. It addresses a lot of the weaknesses of previous versions by involving academics from an early stage and doing away with a lot of the complexity (including reducing options and removing ciphers). It furthermore aims to decrease latency of the handshake by allowing the parties to send encrypted data as early as possible, reducing the round trip time to one in many cases. The goal of low latency has also led to the inclusion of QUIC, which provides zero round trip time, that is, the client can send data already in the first message when resuming a session. However, QUIC is not fully forward-secure and therefore confined to a separate API. Nevertheless, Kenny predicts that the sole availability will be too tempting for developers, hence the bet offered.
Concluding, he sees three major shifts in TLS this far: from RSA to elliptic-curve Diffie-Hellman, to Curve25519, and away from SHA-1 in certificates. A fourth shift might happen with the introduction of post-quantum algorithms such as Google's deployment of New Hope. Less optimistically, he expects that implementation vulnerabilities will continue to come up.
Update: An earlier version of this post mentioned the non-existing Curve255199 instead of Curve25519, and it attributed New Hope to Google.
## Monday, March 27, 2017
### Tools for proofs
Security proof for even simple cryptographic systems are dangerous and ugly beasts. Luckily, they are only rarely seen: they are usually safely kept in the confines of future full-versions'' of papers, or only appear in cartoon-ish form, generically labelled as ... proof sketch".
The following two quotes frame the problem in less metaphorical terms.
In our opinion, many proofs in cryptography have become essentially unverifiable. Our field may be approaching a crisis of rigor".
Bellare and Rogaway (cca 2004)
Do we have a problem with cryptographic proofs? Yes, we
do [...] We generate more proofs than we carefully verify
(and as a consequence some of our published proofs are
incorrect)".
Halevi (cca 2005)
Solutions developed by cryptographers e.g. compositional reasoning and the game-hopping technique, help to structure proofs and reduce their complexity and therefore alleviate to some extent the pain of having to develop rigorous proofs. Yet, more often than not proofs are still sketchy and shady.
There is help that comes from the programming languages community which has a long experience with developing tools for proving that programs work correctly and...cryptographic systems are just programs. Recent progress, e.g. automated verification of parts of TLS, fully verified security proofs of implementation masking schemes to defeat leakage, is impressive and exciting. More work is under way.
If you want to learn more about how can you get someone else to do the proofs for you or, more realistically, learn about what existent tools can currently do, what they could do in the future, and discuss what is needed and which way to go, then you should attend the
Workshop on Models and Tools for Security Analysis and Proofs
-- Paris, 29th of April; co-located with EuroSnP and Eurocrypt --
which the Bristol Crypto group helps organize. The workshop features as speakers some of the most prominent researchers that are contributing to this direction. You can register for the workshop HERE. Early registration ends March 31st!
But wait...there is more. If you want to explore this area beyond what a one-day workshop allows, then you should consider attending the
--
Nancy, France, July 10th - 13th --
See you all in Paris and/or Nancy!
## Tuesday, February 21, 2017
### Homomorphic Encryption API Software Library
The Homomorphic Encryption Application Programming Interface (HE-API) software library is an open source software library being developed as part of the Homomorphic Encryption Applications and Technology (HEAT) project, and is available here. The main purpose of this software library is to provide a common easy-to-use interface for various existing Somewhat Homomorphic Encryption (SHE) libraries. Limited support for fixed-point arithmetic is also provided by this library. Note that the HE-API library is still a work in progress.
Fully Homomorphic Encryption (FHE) is a cryptographic primitive that allows meaningful manipulation of ciphertexts. In spite of several recent advances, FHE remains out of practical reach. Hence a reasonable restriction to make is to limit the set of evaluated circuits to a specified subclass, usually determined by the multiplicative depth of the circuit. Such encryption schemes are called as SHE schemes. Various libraries such as HElib, SEAL, FV-NFLlib, HElib-MP, etc., are already available that implement these SHE schemes.
The purpose of this HE-API software library is to provide a common, generic, easy-to-use interface for various existing libraries that implement SHE schemes. The SHE libraries that are currently integrated in the HE-API library are HElib and FV-NFLlib. It may be noted that the FV-NFLlib library is itself an outcome of the HEAT project. At a high-level, the HE-API software library abstracts out the technicalities present in the underlying SHE libraries. For instance, the HElib library implements the BGV SHE scheme, while the FV-NFLlib implements the FV SHE scheme. Needless to say, the syntax for various classes and routines in the individual libraries will be different, though the underlying semantics are very similar. The HE-API library integrates the underlying SHE libraries under a single interface, thereby shielding the user from syntactic differences. Another feature of the HE-API library is that it contains minimal, yet complete, set of routines to perform homomorphic computations. The design of this library is motivated by the ease of use for non-experts.
Supported Data Types
The following application data types are supported by the HE-API software library.
• Boolean
• Unsigned long integers
• GMP's arbitrary precision integers class: mpz_class
• Polynomials with coefficients of type: unsigned long integers or mpz_class
• Vectors of : unsigned long integers or mpz_class
• Fixed-point numbers
Note that all the data types and routines described above may not be currently supported by every underlying SHE library.
## Friday, January 13, 2017
### RWC 2017 - Secure MPC at Google
This talk was given by Ben Kreuter and its focus was on the apparent disparity between what we research in academia versus what is required in the real world, specifically in the field of multi-party computation (MPC). MPC is the idea of allowing multiple parties to compute some function on their combined input without any party revealing anything about their input to the other parties (other than what can be learnt from the output alone).
While significant work has been done on making MPC efficient in practice (for example, the work of Yehuda Lindell et al. on high-throughput MPC which was presented by Lindell in the preceding talk), the focus tends to be on generic protocols (e.g. general logic circuits) with strong security guarantees (e.g. malicious security), which invariably leads to large computational overhead. In practice, we usually require only specific protocols, which can therefore be optimised, and comparatively weak security guarantees.
In the real world, network cost is the salient factor, rather than the speed of the protocol, since the parties who are involved in a computation often have to use networks (such as the Internet) which are being used by many other people at the same time and cannot make the best use of the network's full capabilities. The MPC at Google is about computation amongst, for example, mobile phones, laptops and servers; this introduces issues like battery constraints and the possibility of the computation not completing; these considerations, firmly grounded in the real world, are important when developing MPC techniques in research.
A large portion of Google's revenue is generated by advertising: the tech giant, well-known for its aptitude for accurately determining users' desired search results even when queries are expressed ineloquently, specialises in creating personalised adverts to its wide spectrum of users. The efficacy of an advert is generally measured by the proportion of viewers of it who later become customers. Clearly this can be done by businesses comparing their database of customers' transactions with Google's databases of who has been shown which adverts. This, however, would be an invasion of privacy: instead, Google and the business can do MPC: more specifically, a private set intersection protocol.
In a private set intersection protocol, the parties involved compute how large the intersection is amongst the sets input by each party, or even some function on those elements in the intersection. So if the business and Google compute a private set intersection protocol on their data, they can determine how well the advertising went.
Roughly speaking, the MPC Google does in the real world is as follows: Google has a set $\{g_1,g_2,...,g_n\}$ of field elements which encodes a set of people who have been shown an advert for a certain product, and a business has a set $\{b_1,b_2,...,b_m\}$ of field elements which encodes a set of people who have been sold the product in question; Google raises each of its elements to a power $G$ and sends the set $\{g_1^G,g_2^G,...,g_n^G\}$ to the business. The business does the same with its elements for some exponent $B$ to get $\{b_1^B,b_2^B,...,b_m^B\}$, encrypts a set of binary vectors under Paillier encryption (which is additively homomorphic), one corresponding to each element in its set, encoding some other property of the sales (like the amount paid), and also computes the set $\{g_1^{GB},g_2^{GB},...,g_n^{GB}\}$. The business sends Google the set of pairs $\{(b_1^B,P(v_1)),(b_2^B,P(v_2)),...,(b_m^B,P(v_m))\}$ along with $\{g_1^{GB},g_2^{GB},...,g_n^{GB}\}$, and Google computes $\{b_1^{GB},b_2^{GB},...,b_m^{GB}\}$ and adds together all encrypted vectors $P(v_i)$ for which there exists some $j$ such that $g_i^{GB}=b_j^{GB}$. It sends this ciphertext back to the business, which decrypts and interprets the result.
This protocol is very simple, and it is only passively secure (in which players are assumed to execute the protocol faithfully but will possibly try to learn things by inspecting their communication transcripts). An interesting, perhaps somewhat orthogonal concern, to how we approach research from an academic point of view is that it is important that we can convey the security and efficiency of our protocols to lawyers, managers and software engineers who will eventually be sanctioning, authorising or implementing the protocols. "The lawyers are interesting because you can show them a proof, and two plus two equals four is a negotiable statement here... managers usually trust your expertise...and software engineers are the worst because they already assume [the protocol] is impossible."
An alternative solution using garbled circuits was explored in the recent past, but it turned out that their use required some subtle assumptions regarding the computation and communication which would have made the protocol impractical.
Future work would involve getting a (not too much more expensive) maliciously secure protocol and developing the use of the homomorphic encryption to allow different functions to be computed on the data in the intersection.
#### Consumer applications
The Android keyboard app by Google, Gboard, logs what a user types so that it can guess words for auto-completing in the future. This data could be used for training machine learning models, and merging results from many local models would enable the formation of guessing algorithms that work well for everyone. However, to do this, the server would need to receive a set large dataset of words typed by a user from each phone so that this processing could be done. Clearly there is an issue of privacy here; moreover, there is also potentially a differential privacy issue.
This is clearly a good situation in which to use MPC. Each party masks their data using a basic additive secret-sharing scheme: if each party has a vector to input, for every coordinate, every pair of parties agrees on some random field element, one subtracts and one adds this to that coordinate of their vector. When the parties send this to Google, the masks will therefore cancel when added together.
In practice,they use a PRG and perform a key exchange (in which one key is given to each pair of parties, for every possible pair) at the beginning to achieve the same effect but with much smaller communication overhead. They also have a trick for dealing with device failures (which is important given the application).
This talk provided helpful and relevant insight into the the importance of matching what we research with what we require in the real world, which is, after all, one of the main reasons for having conferences such as Real World Crypto. Many of the talks are available to watch online here, and I would highly recommend doing so if interested.
## Thursday, January 12, 2017
### RWC 2017 - Is Password Insecurity Inevitable?
Fresh back from an enlightening trip across the pond, I wanted to write about one of my favourite talks, all about password (in)security, from this year's Real World Cryptography conference.
As we know:
But happily, Hugo Krawczyk from IBM Research spoke about some great new work to resolve these two seemingly incompatible statements. There were a lot of details in the talk that I'll have to miss out here (slides are available online). In particular, I'm going to focus on 'Part I: Take the burden of choosing and memorising passwords off humans'.
The basic idea - this isn't new - is to have the user memorise a single master password that they use to access a password store. Then the password store derives unique pseudorandom passwords for each service the user wants to access (Google, Facebook, etc.) The problem with this solution is that the password store becomes a single point of failure: if it is compromised, then an offline dictionary attack to find the master password will compromise all of the user's accounts at once.
Krawczyk et al. suggest an improvement: SPHINX, which amusingly stands for "a password Store that Perfectly Hides from Itself (No eXaggeration)". The first idea is for the password store to not keep hold of (even a hash of) the master password - instead it has an independent secret key $k$, and any time the user wants to log in to a service $S$, they send the master password $pwd$ to the store, the store computes a PRF $PRF(k, pwd | S)$ and this will be sent to $S$ as the user's password for $S$. This means that if the store is compromised, the master password and the account passwords can't be learned unless the user communicates with the store. So this works well if the store is in local, offline hardware, where the user is unlikely to use the store after it is compromised by an attacker.
However, the authors go further and replace the PRF with an oblivious PRF. This means the store computes an "encrypted" version of $PRF(k, pwd | S)$ from an "encrypted" $pwd|S$, so doesn't learn the plaintext values of the master password or the service password. In practice this can be achieved by the user (i.e. the user's machine) hashing the string $pwd | S$ into an element $g$ of a Diffie-Hellman group, then computing $h = g^r$, where $r$ is a fresh, random exponent, and sending $h$ to the password store. The store's secret key is an exponent $a$, so it computes $h^a$ and sends this back to the user. The user removes the blinding exponent $r$ (i.e. computes $(h^a)^{r^{-1}} = g^a$) and the result is the unique password for $S$. Now even when the password store is compromised and even if the user communicates with the store, the master password and the account passwords can't be learned.
In principle an attacker could recover all the account passwords by compromising both the password store and a service $S$, learning the secret key $a$ and the service password $g^a$, computing $g = H(pwd|S)$ and perfoming an offline dictionary attack to find $pwd|S$. Then for any other service $S'$, the password can be computed via $H(pwd|S')^a$. But as long as $S$ follows good practice and only stores a hash $H'(g^a)$ of the service password, this attack fails: an offline dictionary attack to recover $g^a$ is unfeasible as it's essentially a random group element.
There are no particularly expensive computations involved in using SPHINX, the communication between the user and SPHINX does not need to be secure (so it could be online somewhere) and the store will work regardless of what password protocol is used by the service, so it's extremely flexible. SPHINX therefore strikes me as both useful and practical, which is surely the definition of Real World Cryptography.
## Monday, January 9, 2017
### RWC 2017 - Post-quantum cryptography in the real-world
A new year takes off and, along with it, thousands of resolutions are formulated. Although I am not the right person to talk about them (my diet will begin next Monday), I wish to discuss a resolution that the cryptographic community as a whole has set for itself in this 2017. Because that's what people do at Real World Crypto (RWC): they talk about new threads, topics could be worth exploring during the new year, directions for their researches and interests. This year, for the first time in RWC, post-quantum cryptography (PQC) was given an entire session, clear sign that time is changing and the moment has come to bring the discussion to the real world. The message is clear: even if quantum computers are not popping up in tomorrow's newspapers, we can't postpone any longer.
A very simple reason for this was given by Rene Peralta, of the NIST PQC team, during the overture of the session: standardisation takes time, up to seven years if we start right now, and full transition takes even longer. I found Rene's presentation to be neat and direct: our public-key cryptography fails against quantum computers and our symmetric one needs some (non-drastic) modifications. The resolution is to "start thinking about it this year, possibly by November 30th, 2017". However, a question arises quite naturally: are we ready?
The other three talks of the session tried to answer in the affirmative. Among the several PQC proposals that are around in theoretical papers, two made their ways into RWC: the well-stablished lattice-based cryptography and the new-born isogeny-based cryptography, which nevertheless carries the pride and sympathy of ECC.
Lattices and funny names: NewHope and Frodo and Crystals
Lattice-based cryptography has three representatives in the run for PQC schemes. Valeria Nikolaenko showed two: the first one is called NewHope and is a key agreement protocol based on the hardness of Ring-LWE. The latter is a problem very favourable to applications because it combines sound theoretical security (worst-case to average-case reduction) to fast implementations thanks to specific choices of parameters which allow for speed-ups in the computations: NewHope turns out to be even faster than ECC and RSA, but at the price of a larger communication. However, there are some concerns on the security of LWE when the ring structured is added. Thus, Frodo ("take off the ring") is designed to achieve the same goal using only standard LWE. The drawback is a degradation in performance, since the tricks hinted above cannot be used anymore and keys are generally bigger.
The third lattice-based scheme was presented by Tancrede Lepoint and is a suite called Crystals. This is based on yet another kind of lattices: module lattices, for which it is also known a worst-case to average-case reduction. These are less structured lattices (hence possibly calming down the detractors of ring structure) in which similar implementation speed-ups are possible: the timing is indeed comparable to NewHope's, while the communication is improved.
"Make elliptic curves great again"
Michael Naehrig presented a new proposal for PQC: do you remember curves with plenty of small subgroups where to easily solve the discrete logarithm problem? Now they come in handy again: all the subgroups (of order 2 and 3) are considered to be nodes of a graph, whose edges are the isogenies (a.k.a. bijetive homorphisms between curves). In this new context, given two curves in the graph, it is difficult to come up with the isogeny linking the two. However, such a new approach doesn't really stand against other solutions: keys are small but performance is not a pro (so to speak).
### RWC 2017 - Erasing Secrets from RAM
One of my favourite talks from the Real World Crypto 2017 conference was given by Laurent Simon, on Erasing Secrets from RAM.
In short, it was found that in practice, many non-malicious programs handling keys and other sensitive data do not erase the RAM correctly. This would allow an attacker (that has access to all of a system's volatile memory and CPU state) access to any unerased sensitive data.
It was thought that compiler optimisation played a part in the lack of erasion. Take the code below:
void sensitive_function(...) {
u8 sensitive_buffer[KEY_MAX] = "\0";
...
zeromem(sensitive_buffer, KEY_MAX);
}
The compiler may choose to remove the zeromem line, as the sensitive_buffer is going out of scope anyway. This would leave sensitive data on the RAM, unbeknownst to the programmer.
So, the paper presents a tool that allows developers to mark sensitive variables in their code, and then see (post-compilation) any potential leakage of sensitive data.
They call this tool Secretgrind, based off the popular Valgrind.
Anyway, as it turns out, the compiler optimisation problem mentioned above wasn't actually a problem in practice - they didn't once encounter this problem in all their testing. Instead, the majority of sensitive leaks were down to developers' mistakes; they had forgotten to erase sensitive variables on both the stack and the heap.
There were a few issues with IO API's caching optimisations, though - such as when you read a line from a PEM file using mmap, it often loads the whole file into memory to save you the time. However, this is not immediately obvious, and when you go to delete the line from RAM, the rest of the file is still in memory!
Laurent concluded the talks saying Secretgrind was still in development, and although referring to it as a 'hack' (due to it's fragility), wishes for it to be used to "help you guys check your code".
## Thursday, January 5, 2017
### RWC 2017 - A Formal Security Analysis of the Signal Messaging Protocol
Real World Crypto 2017 kicked off yesterday in New York City. This afternoon, Luke Garratt presented his and his colleagues' work, A Formal Security Analysis of the Signal Messaging Protocol. The signal protocol is used by the Facebook messenger app, WhatsApp and the Signal app (to name but a few). It is therefore surprising that there had been no formal security analysis, and their work addresses this issue. The paper is motivated by the questions
What should Signal achieve?
and
Does it?
Or, put in more modern language (spoiler alert),
Why what does is
Let's first look at what kind of security we can hope for. We speak of Forward Secrecy, which ensures that past messages are not compromised even if the communication is at some point in the future. This is to prevent an adversary storing all the conversations and waiting until an attack is successful to then recover all the communication.
Post-compromise security pushes this even further. If we have post-compromise security, not only past conversations are not compromised, but also future ones. The Signal protocol achieves this using a technique called ratcheting, which involves session keys being updated with each message sent. Why is this useful? Well, it makes the adversary's life much harder. In order to attack a system with post-compromise security, an adversary must obtain long-term keys and immediately attack and continue attacking if they want to compromise future sessions. As opposed to forward security, where an adversary would obtain a long-term key and wait for an interesting target to launch a man-in-the-middle attack (e.g. TLS-DHE) or to no forward security, where they would just store all ciphertext traffic until they obtain a long-term key and decrypt everything (e.g. TLS-RSA). Times are hard.
Their security model captures:
• Full network control by the adversary;
• Perfect forward secrecy;
• Post-compromise security;
• Key compromise impersonation attacks;
• Some (but not all) random numbers compromise.
Their proof is too long to be featured in this blog post, but Luke promises it is tedious rather than complex. Their conclusion? So far, so good.
In terms of limitations, they note that they have not analysed any implementation of the protocol, so this is a theoretical analysis only. They also assume an honest key distribution and have not (yet) considered multiple devices. | 2018-08-19 02:37:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.40564054250717163, "perplexity": 1588.6581249331214}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-34/segments/1534221214538.44/warc/CC-MAIN-20180819012213-20180819032213-00553.warc.gz"} |
https://ericmjl.github.io/blog/2017/12/13/visual-studio-code-a-new-microsoft/ | # Visual Studio Code: A New Microsoft?
written by on 2017-12-13 | tags: software development tooling hacks productivity data science
During my week attending PyData NYC 2017, which was effectively a mini-mini-sabbatical from work, I got a chance to try out Visual Studio Code. Part of it was curiosity, having seen so many PyData participants using it; part of it was because of Steve Dowell, a core CPython contributor who works at Microsoft, who mentioned about the Python-friendly tools they added into VSCode.
I think VSCode is representative of a new Microsoft.
But first, let me describe what using it is like.
## User Interface
First off, the UI is beautiful. It's impossible to repeat enough how important the UI is. With minimal configuration, I made it basically match Atom's UI, which I had grown used to. It has an integrated terminal, and the colours are... wow. That shade of green, blue and red are amazing, ever just so slightly muted compared to the Terminal or iTerm. The background shade of black matches well with the rest of VSCode, and the colour scheme is changeable to match that of Atom's. The design feels... just right. Wow!
## Git Integration
Secondly, the integration with Git rivals Atom; in fact, there's a one-click "sync" button! It also has nice git commit -am analog where I can add and commit all of the files simultaneously.
## Intellisense
Thirdly, IntelliSense is just amazing! I like how I can use it to look up a function signature just by mousing over the function name.
## Open Source
Finally, it’s fully open source and back able, in the same vein as Atom, minus the bloat that comes from building on top of electron. Impressive stuff!
## Other Thoughts
Now, on the new Microsoft.
Only at the recent PyData NYC did I learn that Microsoft has hired almost half of the core CPython developers! Not only that, they are encouraged to continue their contributions into the CPython code base. In my view, that’s a pretty awesome development! It means the Python programming language will continue to have a strong corporate backing while also enjoying community support. Its a sign of a healthy ecosystem, IMO, and also a sign of Microsoft’s support for Open Source Software!
I’m more and more impressed by what Microsoft is doing for the Open Source community. I’m hoping they’ll continue up with this!! | 2021-09-21 04:24:37 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.22197513282299042, "perplexity": 4205.93834756368}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057158.19/warc/CC-MAIN-20210921041059-20210921071059-00655.warc.gz"} |
http://mfem.github.io/doxygen/html/classmfem_1_1ConstrainedSolver.html | MFEM v4.3.0 Finite element discretization library
mfem::ConstrainedSolver Class Reference
An abstract class to solve the constrained system $$Ax = f$$ subject to the constraint $$B x = r$$. More...
#include <constraints.hpp>
Inheritance diagram for mfem::ConstrainedSolver:
[legend]
Collaboration diagram for mfem::ConstrainedSolver:
[legend]
## Public Member Functions
ConstrainedSolver (MPI_Comm comm, Operator &A_, Operator &B_)
ConstrainedSolver (Operator &A_, Operator &B_)
virtual ~ConstrainedSolver ()
virtual void SetOperator (const Operator &op) override
Also calls SetOperator for the preconditioner if there is one. More...
virtual void SetConstraintRHS (const Vector &r)
Set the right-hand side r for the constraint B x = r. More...
void GetMultiplierSolution (Vector &lambda) const
Return the Lagrange multiplier solution in lambda. More...
virtual void Mult (const Vector &f, Vector &x) const override
Solve for $$x$$ given $$f$$. More...
virtual void LagrangeSystemMult (const Vector &f_and_r, Vector &x_and_lambda) const
Solve for (x, lambda) given (f, r) More...
Public Member Functions inherited from mfem::IterativeSolver
IterativeSolver ()
IterativeSolver (MPI_Comm comm_)
void SetRelTol (double rtol)
void SetAbsTol (double atol)
void SetMaxIter (int max_it)
void SetPrintLevel (int print_lvl)
int GetNumIterations () const
int GetConverged () const
double GetFinalNorm () const
virtual void SetPreconditioner (Solver &pr)
This should be called before SetOperator. More...
void SetMonitor (IterativeSolverMonitor &m)
Set the iterative solver monitor. More...
MPI_Comm GetComm () const
Return the associated MPI communicator, or MPI_COMM_NULL if no communicator is set. More...
Public Member Functions inherited from mfem::Solver
Solver (int s=0, bool iter_mode=false)
Initialize a square Solver with size s. More...
Solver (int h, int w, bool iter_mode=false)
Initialize a Solver with height h and width w. More...
Public Member Functions inherited from mfem::Operator
void InitTVectors (const Operator *Po, const Operator *Ri, const Operator *Pi, Vector &x, Vector &b, Vector &X, Vector &B) const
Initializes memory for true vectors of linear system. More...
Operator (int s=0)
Construct a square Operator with given size s (default 0). More...
Operator (int h, int w)
Construct an Operator with the given height (output size) and width (input size). More...
int Height () const
Get the height (size of output) of the Operator. Synonym with NumRows(). More...
int NumRows () const
Get the number of rows (size of output) of the Operator. Synonym with Height(). More...
int Width () const
Get the width (size of input) of the Operator. Synonym with NumCols(). More...
int NumCols () const
Get the number of columns (size of input) of the Operator. Synonym with Width(). More...
virtual MemoryClass GetMemoryClass () const
Return the MemoryClass preferred by the Operator. More...
virtual void MultTranspose (const Vector &x, Vector &y) const
Action of the transpose operator: y=A^t(x). The default behavior in class Operator is to generate an error. More...
virtual OperatorGetGradient (const Vector &x) const
Evaluate the gradient operator at the point x. The default behavior in class Operator is to generate an error. More...
virtual void AssembleDiagonal (Vector &diag) const
Computes the diagonal entries into diag. Typically, this operation only makes sense for linear Operators. In some cases, only an approximation of the diagonal is computed. More...
virtual const OperatorGetProlongation () const
Prolongation operator from linear algebra (linear system) vectors, to input vectors for the operator. NULL means identity. More...
virtual const OperatorGetRestriction () const
Restriction operator from input vectors for the operator to linear algebra (linear system) vectors. NULL means identity. More...
virtual const OperatorGetOutputProlongation () const
Prolongation operator from linear algebra (linear system) vectors, to output vectors for the operator. NULL means identity. More...
virtual const OperatorGetOutputRestrictionTranspose () const
Transpose of GetOutputRestriction, directly available in this form to facilitate matrix-free RAP-type operators. More...
virtual const OperatorGetOutputRestriction () const
Restriction operator from output vectors for the operator to linear algebra (linear system) vectors. NULL means identity. More...
void FormLinearSystem (const Array< int > &ess_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B, int copy_interior=0)
Form a constrained linear system using a matrix-free approach. More...
void FormRectangularLinearSystem (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Vector &x, Vector &b, Operator *&A, Vector &X, Vector &B)
Form a column-constrained linear system using a matrix-free approach. More...
virtual void RecoverFEMSolution (const Vector &X, const Vector &b, Vector &x)
Reconstruct a solution vector x (e.g. a GridFunction) from the solution X of a constrained linear system obtained from Operator::FormLinearSystem() or Operator::FormRectangularLinearSystem(). More...
void FormSystemOperator (const Array< int > &ess_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this square operator. More...
void FormRectangularSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, Operator *&A)
Return in A a parallel (on truedofs) version of this rectangular operator (including constraints). More...
void FormDiscreteOperator (Operator *&A)
Return in A a parallel (on truedofs) version of this rectangular operator. More...
void PrintMatlab (std::ostream &out, int n=0, int m=0) const
Prints operator with input size n and output size m in Matlab format. More...
virtual ~Operator ()
Virtual destructor. More...
Type GetType () const
Return the type ID of the Operator class. More...
## Protected Attributes
OperatorA
OperatorB
Vector constraint_rhs
Vector multiplier_sol
Vector workb
Vector workx
Protected Attributes inherited from mfem::IterativeSolver
const Operatoroper
Solverprec
IterativeSolverMonitormonitor = nullptr
int max_iter
int print_level
double rel_tol
double abs_tol
int final_iter
int converged
double final_norm
Protected Attributes inherited from mfem::Operator
int height
Dimension of the output / number of rows in the matrix. More...
int width
Dimension of the input / number of columns in the matrix. More...
Public Types inherited from mfem::Operator
enum DiagonalPolicy { DIAG_ZERO, DIAG_ONE, DIAG_KEEP }
Defines operator diagonal policy upon elimination of rows and/or columns. More...
enum Type {
ANY_TYPE, MFEM_SPARSEMAT, Hypre_ParCSR, PETSC_MATAIJ,
PETSC_MATIS, PETSC_MATSHELL, PETSC_MATNEST, PETSC_MATHYPRE,
PETSC_MATGENERIC, Complex_Operator, MFEM_ComplexSparseMat, Complex_Hypre_ParCSR
}
Enumeration defining IDs for some classes derived from Operator. More...
Public Attributes inherited from mfem::Solver
bool iterative_mode
If true, use the second argument of Mult() as an initial guess. More...
Protected Member Functions inherited from mfem::IterativeSolver
double Dot (const Vector &x, const Vector &y) const
double Norm (const Vector &x) const
void Monitor (int it, double norm, const Vector &r, const Vector &x, bool final=false) const
Protected Member Functions inherited from mfem::Operator
void FormConstrainedSystemOperator (const Array< int > &ess_tdof_list, ConstrainedOperator *&Aout)
see FormSystemOperator() More...
void FormRectangularConstrainedSystemOperator (const Array< int > &trial_tdof_list, const Array< int > &test_tdof_list, RectangularConstrainedOperator *&Aout)
see FormRectangularSystemOperator() More...
OperatorSetupRAP (const Operator *Pi, const Operator *Po)
Returns RAP Operator of this, using input/output Prolongation matrices Pi corresponds to "P", Po corresponds to "Rt". More...
## Detailed Description
An abstract class to solve the constrained system $$Ax = f$$ subject to the constraint $$B x = r$$.
Although implementations may not use the below formulation, for understanding some of its methods and notation you can think of it as solving the saddle-point system
( A B^T ) ( x ) ( f ) ( B ) ( lambda ) = ( r )
Do not confuse with ConstrainedOperator, which handles only simple pointwise constraints and is not a Solver.
The height and width of this object as an IterativeSolver are the same as just the unconstrained operator $$A$$, and the Mult() interface just takes $$f$$ as an argument. You can set $$r$$ with SetConstraintRHS() (it defaults to zero) and get the Lagrange multiplier solution with GetMultiplierSolution().
Alternatively, you can use LagrangeSystemMult() to solve the block system shown above.
This abstract object unifies this interface so that derived classes can solve whatever linear system makes sense and the interface will provide uniform access to solutions, Lagrange multipliers, etc.
Definition at line 53 of file constraints.hpp.
## Constructor & Destructor Documentation
mfem::ConstrainedSolver::ConstrainedSolver ( MPI_Comm comm, Operator & A_, Operator & B_ )
Definition at line 643 of file constraints.cpp.
mfem::ConstrainedSolver::ConstrainedSolver ( Operator & A_, Operator & B_ )
Definition at line 651 of file constraints.cpp.
virtual mfem::ConstrainedSolver::~ConstrainedSolver ( )
inlinevirtual
Definition at line 61 of file constraints.hpp.
## Member Function Documentation
void mfem::ConstrainedSolver::GetMultiplierSolution ( Vector & lambda ) const
inline
Return the Lagrange multiplier solution in lambda.
Does not make sense unless you've already solved the constrained system with Mult() or LagrangeSystemMult()
Definition at line 76 of file constraints.hpp.
void mfem::ConstrainedSolver::LagrangeSystemMult ( const Vector & f_and_r, Vector & x_and_lambda ) const
virtual
Solve for (x, lambda) given (f, r)
The base class implementation calls Mult(), so derived classes must implement either this or Mult()
Reimplemented in mfem::SchurConstrainedSolver.
Definition at line 692 of file constraints.cpp.
void mfem::ConstrainedSolver::Mult ( const Vector & f, Vector & x ) const
overridevirtual
Solve for $$x$$ given $$f$$.
If you want to set $$r$$, call SetConstraintRHS() before this.
If you want to get $$\lambda$$, call GetMultiplierSolution() after this.
The base class implementation calls LagrangeSystemMult(), so derived classes must implement either this or LagrangeSystemMult()
Implements mfem::Operator.
Reimplemented in mfem::PenaltyConstrainedSolver, and mfem::EliminationSolver.
Definition at line 664 of file constraints.cpp.
void mfem::ConstrainedSolver::SetConstraintRHS ( const Vector & r )
virtual
Set the right-hand side r for the constraint B x = r.
(r defaults to zero if you don't call this)
Definition at line 658 of file constraints.cpp.
virtual void mfem::ConstrainedSolver::SetOperator ( const Operator & op )
inlineoverridevirtual
Also calls SetOperator for the preconditioner if there is one.
Reimplemented from mfem::IterativeSolver.
Reimplemented in mfem::PenaltyConstrainedSolver, and mfem::EliminationSolver.
Definition at line 63 of file constraints.hpp.
## Member Data Documentation
Operator& mfem::ConstrainedSolver::A
protected
Definition at line 97 of file constraints.hpp.
Operator& mfem::ConstrainedSolver::B
protected
Definition at line 98 of file constraints.hpp.
Vector mfem::ConstrainedSolver::constraint_rhs
mutableprotected
Definition at line 100 of file constraints.hpp.
Vector mfem::ConstrainedSolver::multiplier_sol
mutableprotected
Definition at line 101 of file constraints.hpp.
Vector mfem::ConstrainedSolver::workb
mutableprotected
Definition at line 102 of file constraints.hpp.
Vector mfem::ConstrainedSolver::workx
mutableprotected
Definition at line 103 of file constraints.hpp.
The documentation for this class was generated from the following files: | 2021-12-09 07:15:06 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.32096853852272034, "perplexity": 14576.660052643572}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363689.56/warc/CC-MAIN-20211209061259-20211209091259-00302.warc.gz"} |
https://homepages.math.uic.edu/~hurder/publications.html | Home Teaching Research Publications Vita Service
Preprints and Publications
1. Dual homotopy invariants of G-foliations Thesis, University of Illinois at Urbana-Champaign, May 1980.
2. Dual homotopy invariants of G-foliations Topology, 20(4):365--387, 1981.
3. Homotopy invariants of foliations (with Franz W. Kamber) In Topology Symposium, Siegen 1979 (Proc. Sympos., Univ. Siegen, Siegen, 1979). Lecture Notes in Math. Vol. 788, pages 49--61. Springer, Berlin, 1980.
4. On the homotopy and cohomology of the classifying space of Riemannian foliations Proc. Amer. Math. Soc. 81 (1981), no. 3, 485--489.
5. On the secondary classes of foliations with trivial normal bundles Comment. Math. Helv. 56 (1981), no. 2, 307--326.
6. Growth of leaves and secondary invariants of foliations preprint, Princeton University, 1982
7. Independent rigid secondary classes for holomorphic foliations Invent. Math. 66 (1982), no. 2, 313--323.
8. Exotic classes for measured foliations Bull. Amer. Math. Soc. (N.S.) 7 (1982), no. 2, 389--391.
9. The Godbillon-Vey class for analytic foliations of codimension one preprint, Princeton University, 1983
10. Vanishing of secondary classes for compact foliations J. London Math. Soc. (2) 28 (1983), no. 1, 175--183.
11. Global invariants for measured foliations Trans. Amer. Math. Soc. 280 (1983), no. 1, 367--391.
12. The Weil measures of foliations - a survey and some applications preprint, Princeton University, 1983
13. Secondary classes, Weil measures and the geometry of foliations. (with James L. Heitsch) J. Differential Geom. 20 (1984), no. 2, 291--309.
14. Secondary classes and transverse measure theory of a foliation (with Anatole Katok) Bull. Amer. Math. Soc. (N.S.) 11 (1984), no. 2, 347--350.
15. The classifying space of smooth foliations Illinois J. Math. 29 (1985), no. 1, 108--133.
16. Foliation dynamics and leaf invariants Comment. Math. Helv. 60 (1985), no. 2, 319--335.
17. Problems on rigidity of group actions and cocycles Ergodic Theory Dynam. Systems 5 (1985), no. 3, 473--484.
18. The Jacobian cocycle of a distal group action. preprint, Math. Sci. Res. Inst., 1985.
19. The Godbillon measure of amenable foliations J. Differential Geom. 23 (1986), no. 3, 347--365.
20. The Connes spectrum for actions of abelian groups on continuous-trace algebras (with Dorte Olesen, Iain Raeburn, and Jonathan Rosenberg) Ergodic Theory Dynam. Systems 6 (1986), no. 4, 541--560.
21. Ergodic theory and Weil measures for foliations (with Anatole Katok) Ann. of Math. (2) 126 (1987), no. 2, 221--275.
22. The ∂-operator Appendix A in Global analysis on foliated spaces by C. C. Moore and C. Schochet, Springer, New York, 1988.
23. Toeplitz operators and the eta invariant: the case of $S^1$ (with Ronald G. Douglas and Jerome Kaminker) in Index theory of elliptic operators, foliations, and operator algebras (New Orleans, LA/Indianapolis, IN, 1986), 11--41, Contemp. Math., 70, Amer. Math. Soc., Providence, RI, 1988.
24. Ergodic theory of foliations and a theorem of Sacksteder in Dynamical systems (College Park, MD, 1986--87), 291--328, Lecture Notes in Math., 1342, Springer, Berlin, 1988.
25. Spectral theory of foliation geometric operators preprint, U.I.C., 1989
26. Eta invariants and von Neumann algebras (with Ronald G. Douglas and Jerome Kaminker) Bull. Amer. Math. Soc. (N.S.) 21 (1989), no. 1, 83--87.
27. Eta invariants and the odd index theorem for coverings in Geometric and topological invariants of elliptic operators (Brunswick, ME, 1988), 47--82, Contemp. Math., 105, Amer. Math. Soc., Providence, RI, 1990.
28. Homotopy characteristic classes of foliations (with Daniel Lehmann) Illinois J. Math. 34 (1990), no. 3, 628--655.
29. Differentiability, rigidity and Godbillon-Vey classes for Anosov flows (with Anatole Katok) Inst. Hautes Études Sci. Publ. Math. No. 72 (1990), 5--61 (1991).
30. Deformation rigidity for subgroups of SL(n, Z) acting on the n-torus Bull. Amer. Math. Soc. (N.S.) 23 (1990), no. 1, 107--113.
31. Cyclic cocycles, renormalization and eta-invariants. (with Ronald G. Douglas and Jerome Kaminker) Invent. Math. 103 (1991), no. 1, 101--179.
32. The longitudinal cocycle and the index of Toeplitz operators (with Ronald G. Douglas and Jerome Kaminker) J. Funct. Anal. 101 (1991), no. 1, 120--144.
33. Exceptional minimal sets of $C^{1+a}$-group actions on the circle Ergodic Theory Dynam. Systems 11 (1991), no. 3, 455--467.
34. The intersection product of transverse invariant measures (with Yoshihiko Mitsumatsu) Indiana Univ. Math. J. 40 (1991), no. 4, 1169--1183.
35. Almost Compact Foliations. preprint, U.I.C., 1991
36. Rigidity for Anosov actions of higher rank lattices Ann. of Math. (2) 135 (1992), no.2, 361--410.
37. Rigidity for Cartan actions of higher rank lattices (with Anatole Katok, Jim Lewis, and Robert J. Zimmer) preprint, U.I.C., 1991
38. Affine Anosov actions Michigan Math. J. 40 (1993), no. 3, 561--575.
39. A product theorem for $\Omega B\Gamma_G$ Topology and Its Applications, 50 (1993), no. 1, 81--86.
40. Topology of covers and the spectral theory of geometric operators in Index theory and operator algebras (Boulder, CO, 1991), 87--119, Contemp. Math., 148, Amer. Math. Soc., Providence, RI, 1993.
41. The transverse Euler class for amenable foliations (with Yoshihiko Mitsumatsu) preprint, U.I.C., 1993
42. Exotic theory for foliated spaces preprint, U.I.C., 1993
43. Topological rigidity of strong stable foliations for Cartan actions Ergodic Theory Dynam. Systems {\bf 14} (1994), no.~1, 151--167.
44. Pure-point spectrum for foliation geometric operators (with Jésus Alvarez Lopez) preprint, U.I.C., 1994
45. Differential topology, foliations, and group actions (with Paul A. Schweitzer, Nathan Moreira dos Santos, and José Luis Arraut, editors) Contemp. Math., 161, Amer. Math. Soc., Providence, RI, 1994.
46. Transverse Euler classes of foliations on nonatomic foliation cycles (with Yoshihiko Mitsumatsu) in Differential topology, foliations, and group actions (Rio de Janeiro, 1992), 29--39, Contemp. Math., 161, Amer. Math. Soc., Providence, RI, 1994.
47. A survey of rigidity theory for Anosov actions in Differential topology, foliations, and group actions (Rio de Janeiro, 1992), 143--173, Contemp. Math., 161, Amer. Math. Soc., Providence, RI, 1994.
48. Coarse geometry of foliations in Geometric study of foliations (Tokyo, 1993), 35--96, World Sci. Publishing, River Edge, NJ, 1994.
49. Infinitesimal rigidity for hyperbolic actions J. Differential Geom. 41 (1995), no. 3, 515--527.
50. Exotic index theory and the Novikov conjecture in Novikov conjectures, index theorems and rigidity, Vol. 2 (Oberwolfach, 1993), 255--276, Cambridge Univ. Press, Cambridge, 1995.
51. Manifolds which cannot be leaves of foliations (with Oliver Attie) Topology 35 (1996), no. 2, 335--353.
52. Coarse cohomology for families (with James L. Heitsch) Illinois Jour. Math. 45 (2001), no. 2, 323--360.
53. Expansive maps of the circle (with Chris Connell and Alex Furman) UIC preprint 2000
54. Dynamics and the Godbillon-Vey class: a history and survey. in Foliations: geometry and dynamics (Warsaw, 2000), 29--60, World Sci. Publishing, River Edge, NJ, 2002.
55. Tangential LS category and cohomology for foliations (with Hellen Colman) in Foliations: geometry and dynamics (Warsaw, 2000), 29--60, World Sci. Publishing, River Edge, NJ, 2002.
56. LS-category of compact Hausdorff foliations (with Hellen Colman) Trans. Amer. Math. Soc. 356 (2004), no.~1, 1463--1487.
57. Category and compact leaves Topology and Its Applications 153 (2006), 2135--2154.
58. Foliation Geometry/Topology Problem Set preprint, U.I.C., 2003
59. Dynamics and the Godbillon-Vey Class of C^1 Foliations (with Remi Langevin) Journal Math. Society Japan, Vol. 70:423 - 462, 2018. revision of 2004 preprint
60. Compact foliations with finite transverse LS category (with Pawel Walczak) Journal Math. Society Japan, Vol. 70:1015-1046, 2018; revision of 2005 preprint
63. Hirsch foliations in codimension greater than one (with Andrzej Bís and Joseph Shive) In FOLIATIONS 2005, pages 71--108, World Scientific, 2006.
64. Foliations Lodz 2005 Problem Set In FOLIATIONS 2005, pages 441--475, World Scientific, 2006.
65. FOLIATIONS 2005 Proceedings Conference held June 14-23, Lodz, Poland Editors: Steven Hurder, Remi Langevin , Takashi Tsuboi , Pawel Walczak World Scientific, 2006.
66. Transverse LS-category for Riemannian foliations (with Dirk Toben) Transactions AMS 361 (2009), 5647-5680.
67. The equivariant LS-category of polar actions (with Dirk Toben) Topology and Its Applications 156 (2009), 500-514.
68. Classifying foliations In Foliations, Geometry, and Topology, Contemp. Math., Vol. 498, pages 1-65, Amer. Math. Soc., Providence, RI, 2009.
69. Characteristic classes for Riemannian foliations In Differential Geometry, pages 11-35, World Sci. Publ., Hackensack, NJ, 2009.
70. Lectures on Foliation Dynamics: Barcelona 2010 In Foliations: Dynamics, Geometry and Topology, Advanced Courses in Mathematics CRM Barcelona, 2014.
71. Embedding solenoids in foliations (with Alex Clark) Topology and Its Applications, Vol. 158 (2011), 1249-1270.
72. Homogeneous matchbox manifolds (with Alex Clark) Transactions A.M.S., Vol. 365 (2013), 3151-3191.
73. Voronoi tessellations for matchbox manifolds (with Alex Clark and Olga Lukina) Topology Proceedings, Vol. 41 (2013), 167-259.
74. The dynamics of generic Kuperberg flows (with Ana Rechtman) Astérisque, Vol. 377, 2016.
75. Shape of matchbox manifolds (with Alex Clark and Olga Lukina) Indagationes Mathematicae, Vol. 25:669-712, 2014
76. Classifying matchbox manifolds (with Alex Clark and Olga Lukina) Geometry and Topology, to appear {arXiv:1311.0226}
77. Lipshitz matchbox manifolds Geometry, Dynamics, and Foliations 2013, Advanced Studies in Pure Math. Vol. 72, 2017, pages 71-115.
78. Problem Session - FOLIATIONS 2012 In FOLIATIONS 2012, pages 235-255, World Scientific, 2013.
79. The discriminant invariant of Cantor group actions (with Jessica Dyer and Olga Lukina) Topology and Its Applications, Vol. 208 (2016), 64-92.
80. Growth and homogeneity of matchbox manifolds (with Jessica Dyer and Olga Lukina) Indagationes Mathematicae, Vol. 28 (2017), 145-169.
81. Aperiodicity at the boundary of chaos (with Ana Rechtman) Ergodic Theory Dynamical Systems, Vol. 38:2683-2728, 2018.
82. Perspectives on Kuperberg flows (with Ana Rechtman) Topology Proceedings, Vol. 51:197-244, 2017.
83. Molino theory for matchbox manifolds (with Jessica Dyer and Olga Lukina) Pacific Journal Math., Vol. 289:91-151, 2017.
84. Wild solenoids (with Olga Lukina) Transactions A.M.S., Vol. 371:4493-4533, 2019 {arXiv:1702.03032}
85. Manifold-like matchbox manifolds (with Alex Clark and Olga Lukina) Proceedings A.M.S., Vol. 147:3579-3594, 2019, {arXiv:1704.04402}
86. Orbit equivalence and classification of weak solenoids (with Olga Lukina) Indiana Univ. Math. J., Vol. 69:2339-2363, 2020; {arXiv:1803.02098}.
87. Pro-groups and a generalization of a theorem of Bing (with Alex Clark and Olga Lukina) Topology and Its Applications, Vol. 270, ; {arXiv:1811.00288}.
88. Limit group invariants for non-free Cantor actions (with Olga Lukina) Ergodic Theory Dynamical Systems, vol. 41, 1751-1794; {arXiv:1904.11072}.
89. Nilpotent Cantor actions (with Olga Lukina) Proceedings A.M.S., to appear; {arXiv:1905.07740}.
90. Cantor dynamics of renormalizable groups (with Olga Lukina and Wouter van Limbeek) Groups, Geometry, and Dynamics, to appear; {arXiv:2002.01565}.
91. The prime spectra of solenoidal manifolds (with Olga Lukina) submitted, {arXiv:2103.06825}.
**. Entropy and Dynamics of C^1 Foliations preprint, U.I.C., August 2000
updated July 5, 2021 | 2021-08-03 10:47:56 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7925383448600769, "perplexity": 2172.423216659576}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154457.66/warc/CC-MAIN-20210803092648-20210803122648-00584.warc.gz"} |
https://math.stackexchange.com/questions/2844045/showing-that-fw-frac12-pi-i-oint-gamma-fracf-zeta-zeta-w | # Showing that $F(w) = \frac{1}{2 \pi i} \oint_{\gamma} \frac{F(\zeta)}{\zeta - w}d \zeta$ is holomorphic?
Is the proof given of $\text{Proposition (1)}$ vaild, and also is there an alternate way to approach this problem without relying on Leibniz Rule ?
$\text{Proposition (1)}$
Suppose that $U \subset \mathbb{C}$ is an open set. Let $F \in C^{0}(U).$ Suppose that for every $\overline D(z,r) \subset U$ and $\gamma$ the curve surrounding this disc (with counter-clockwise orientation) and all $w \in D(z,r)$ it holds that in $(1.1)$
$(1.1)$
$$F(w) = \frac{1}{2 \pi i} \oint_{\gamma} \frac{F(\zeta)}{\zeta - w}d \zeta$$
Prove that $F$ is holomorphic
In order to prove $(1.1)$, one needs the sufficient criterion for a function to be considered holomorphic this is carefully constructed in $(2.2)$
$\text{Lemma (2)}$
$\text{Definition}\, \, (2.2)$
A continuously differentiable $(C^{k})$ function $f: U \rightarrow \mathbb{C}$ defined on an open subset $U$ of $\mathbb{C}$ is said to be holomorphic if
$$\partial_{\overline z}f = 0$$
at every point of $U.$
In view of $(2.2)$ it becomes necessary to formulate the following claim in $(3.3)$
$(3.3)$
$$\partial_{\overline z} F(w) = 0$$
Utilizing, Differentiation Under the Integral Sign it's trivial to see that
$$\frac{1}{2 \pi i} \bigg( \partial_{\overline z} F\oint_{\gamma} \frac{F(\zeta)}{\zeta - w}d \zeta \bigg) = \frac{1}{2 \pi i} \oint_{\gamma} \partial_{\overline z} F \big(\frac{F(\zeta)}{\zeta - w} \big )d \zeta = 0$$
• Isn't in definition 2.2 the condition $\partial_{\bar{z}}f=0$.? – Nosrati Jul 7 '18 at 20:56
• Sorry about the typo I'll fix that – Zophikel Jul 7 '18 at 21:03
• The last line needs $\partial_{\bar z}$ a few places, too. – Ted Shifrin Jul 7 '18 at 22:10
• I Will address the typo thanks for noticing @TedShifrin – Zophikel Jul 8 '18 at 13:39 | 2019-04-23 22:39:09 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9155778288841248, "perplexity": 432.6889043116337}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-18/segments/1555578613888.70/warc/CC-MAIN-20190423214818-20190424000818-00420.warc.gz"} |
https://ijnaa.semnan.ac.ir/issue_10_12.html | International Journal of Nonlinear Analysis and Applications
1. Fixed point theorems for weakly contractive mappings on g-Metric spaces and a homotopy result
Pages 1-8
A Erduran; I. Altun
2. Weak and strong convergence theorems for a finite family of generalized asymptotically quasinonexpansive nonself-mappings
Pages 9-16
P. Yatakoat; S. Suantai
3. A unique common fixed point theorem for six maps in g-metric spaces
Pages 17-23
K. P. R. Rao; K. B. Lakshmi; Z. Mustafa
Pages 24-30
5. On the fine spectra of the Zweier matrix as an operator over the weighted sequence space $l_{p}(w)$
Pages 31-39
R. Lashkaripour; J. Fathi
6. On the approximate solution of Hosszus functional equation
Pages 40-44
B. Bouikhalene; J. M. Rassias; A. Charifi; S. Kabbaj
7. Some inequalities involving lower bounds of operators on weighted sequence spaces by a matrix norm
Pages 45-54
A. R. Moazzen; R. Lashkaripour
8. An analog of Titchmarsh's theorem for the Dunkl transform in the space $\mathrm{L}_{\alpha}^{2}(\mathbb{R})$
Pages 55-60
R. Daher; M. El Hamma
9. Application of He's homotopy perturbation method for solving Sivashinsky equation
Pages 61-67
M. Ghasemi; A. Davari; M. Fardi
Pages 68-73
M. Gil | 2022-05-27 15:16:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7101907730102539, "perplexity": 12215.028516395381}, "config": {"markdown_headings": false, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662658761.95/warc/CC-MAIN-20220527142854-20220527172854-00725.warc.gz"} |
http://math.stackexchange.com/questions/793274/is-sum-limits-n-1-infty-frac1a-n-irrational | # Is $\sum\limits_{n=1}^\infty\frac1{a_n}$ irrational?
$\{a_n\}$ is a strictly increasing sequence of positive integers such that $$\lim_{n\to\infty}\frac{a_{n+1}}{ a_n}=+\infty$$ Can one conclude that $\sum\limits_{n=1}^\infty\frac1{a_n}$ is an irrational number? a transcendental number?
A special case is $a_n=n!$, $e$ is a transcendental number.
Another special example is Liouville number $\sum\limits_{n=1}^\infty\dfrac1{10^{n!}}$ is a transcendental number, too.
so the question, if true, may be difficult.
The question is a generalization of $\sum\limits_{n=1}^\infty\frac1{a_n}$ is irrational
-
I have heard about specific classes of sequences that converge faster than a geometric series and always have irrational limits, but I cannot remember the exact hypothesis. Also, if we allow the $a_n$ to be non-integers, it's clearly not true. – Arthur May 13 '14 at 15:39
@ᛥᛥᛥ Whoops, I missed that! – Fly by Night May 13 '14 at 15:46
In the case or $e$, you have $a_n\mid a_{n+1}$ for every $n$. ${}\qquad{}$ – Michael Hardy May 13 '14 at 16:05
Consider the Sylvester's sequence (OEIS A000058):
$$(s_0, s_1, \ldots ) = ( 2, 3, 7, 43, 1807, 3263443, 10650056950807, \ldots)$$ defined recursively by the relation
$$s_n = \begin{cases} 2,& n = 0,\\ s_{n-1}(s_{n-1}-1)+1,& n > 0 \end{cases}$$
It is known that its reciprocals give an infinite Egyptian fraction representation of number one:
$$1 = \frac12 + \frac13 + \frac17 + \frac{1}{43} + \frac{1}{1807} + \cdots$$
It is also easy to check $\displaystyle\;\lim_{k\to\infty} \frac{s_{k+1}}{s_k} = \infty\;$. If you set $a_n = s_{n-1}$ for $n \in \mathbb{Z}_{+}$, you get a counterexample of what you want to show. i.e $\displaystyle\;\sum_{n=1}^\infty \frac{1}{a_n}\;$ need not be irrational.
-
To me it seems clearer to state the definition by saying $s_{n+1} = 1 + \prod_{k=1}^n s_n$. ${}\qquad{}$ – Michael Hardy May 13 '14 at 16:19
@MichaelHardy that might be true. However, I start from constructing the infinite Egyptian fraction myself, come up the recursion relation I wrote down before I locate the name and other properties of this sequence. – achille hui May 13 '14 at 16:26
The conjecture is false.
Take $S_0 = 0$, and for $n=1,2,\cdots$ define $a_n$ to be the least integer such that $S_{n-1}+1/a_n < 1$. Then $\sum_{n=1}^\infty 1/a_n = 1$ but $a_{n+1}/a_n$ grows very fast... $$a_1 = 2\\ a_2 = 3\\ a_3 = 7\\ a_4 = 43\\ a_5 = 1807\\ a_6 = 3263443\\ a_7 = 10650056950807\\ a_8 = 113423713055421844361000443\\ a_9 = 12864938683278671740537145998360961546653259485195807$$
-
edAssume the sum is rational $p/q$.
Then $$p = \sum_{n=1}^{m}\frac{q}{a_n} + \sum_{n=m+1}^{\infty}\frac{q}{a_n}$$
and
$$qa_1\ldots a_m\sum_{n=m+1}^{\infty}\frac{1}{a_n} < qa_1\ldots a_m\sum_{n=m+1}^{\infty}r^{-n}$$
$$pa_1\ldots a_m - \sum_{n=1}^{m}qa_1\ldots a_{n-1}a_{n+1}\ldots a_m = qa_1\ldots a_m\sum_{n=m+1}^{\infty}\frac{1}{a_n} \tag{*}$$
From the limit we know for $n$ sufficiently large, ${1/a_n}$ is dominated by the terms of a convergent goemetric series so
$$qa_1\ldots a_m\sum_{n=m+1}^{\infty}\frac{1}{a_n} < qa_1\ldots a_m\sum_{n=m+1}^{\infty}r^{-n}$$
and $$qa_1\ldots a_m\sum_{n=m+1}^{\infty}\frac{1}{a_n} < qa_1\ldots a_m\frac{r^m}{1-r}$$
We can choose $r$ sufficiently small and and $m$ sufficiently large so the RHS of (*) is less than $1$ and the LHS is an integer, a contradiction
-
The proof is wrong, because first, you fix $r>0$, and $r$ depends on $m$. Intuitively, the smaller is $r$, the greater must be $m$. You cannot guarantee that $qa_1\ldots a_m\frac{r^m}{1-r}$ is less than $1$, because it is involved a product of $m$ integers, and by the way, no smaller integers at all... – ajotatxe May 13 '14 at 16:55
"I threw this together in a hurry as everyone jumped on this problem" This must be one of the most absurd motives to "throw something together in a hurry" on a maths site. – Did May 15 '14 at 17:48 | 2016-06-26 03:16:06 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9398862719535828, "perplexity": 290.2669878564912}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-26/segments/1466783394605.61/warc/CC-MAIN-20160624154954-00010-ip-10-164-35-72.ec2.internal.warc.gz"} |
https://gmatclub.com/forum/robots-x-y-and-z-each-assemble-components-at-their-107311.html?fl=similar | It is currently 22 Nov 2017, 22:48
### GMAT Club Daily Prep
#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.
Customized
for You
we will pick new questions that match your level based on your Timer History
Track
every week, we’ll send you an estimated GMAT score based on your performance
Practice
Pays
we will pick new questions that match your level based on your Timer History
# Events & Promotions
###### Events & Promotions in June
Open Detailed Calendar
# Robots X, Y, and Z each assemble components at their
Author Message
TAGS:
### Hide Tags
Senior Manager
Joined: 28 Aug 2010
Posts: 260
Kudos [?]: 792 [2], given: 11
Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
03 Jan 2011, 18:30
2
KUDOS
9
This post was
BOOKMARKED
00:00
Difficulty:
25% (medium)
Question Stats:
73% (01:14) correct 27% (01:32) wrong based on 811 sessions
### HideShow timer Statistics
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
(1) $$r_x<r_y$$
(2) $$r_y<1$$
Can some explain the reasoning behind this ques.
[Reveal] Spoiler: OA
_________________
Gmat: everything-you-need-to-prepare-for-the-gmat-revised-77983.html
-------------------------------------------------------------------------------------------------
Ajit
Last edited by Bunuel on 08 Feb 2012, 05:09, edited 1 time in total.
Edited the question
Kudos [?]: 792 [2], given: 11
Math Expert
Joined: 02 Sep 2009
Posts: 42305
Kudos [?]: 133079 [7], given: 12403
Re: Robots X, Y, and Z each assemble [#permalink]
### Show Tags
08 Feb 2012, 05:06
7
KUDOS
Expert's post
6
This post was
BOOKMARKED
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
Let the rates of robots X, Y, and Z be x, y, and z respectively. Given: $$r_x=\frac{x}{z}$$ and $$r_y=\frac{y}{z}$$. Question is $$z>x$$ and $$z>y$$?
(1) $$r_x<r_y$$ --> $$\frac{x}{z}<\frac{y}{z}$$ --> $$x<y$$. Not sufficient.
(2) $$r_y<1$$ --> $$\frac{y}{z}<1$$ --> $$y<z$$. Not sufficient.
(1)+(2) As $$x<y$$ and $$y<z$$ then $$x<y<z$$. Sufficient.
_________________
Kudos [?]: 133079 [7], given: 12403
Manager
Joined: 17 Jul 2010
Posts: 123
Kudos [?]: 56 [0], given: 43
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
07 May 2013, 07:09
Does this equation work when plugging in numbers, opposed to looking at pure variables?
Kudos [?]: 56 [0], given: 43
Intern
Joined: 12 Apr 2013
Posts: 7
Kudos [?]: 11 [0], given: 20
Location: Germany
Concentration: Finance, Accounting
GMAT Date: 05-28-2013
GPA: 3.6
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
07 May 2013, 14:10
laythesmack23 wrote:
Does this equation work when plugging in numbers, opposed to looking at pure variables?
Sure. Lets say the rates are X = 5, Y = 6 and Z = 7.
Y/Z = 6/7 -> as stated in II
X/Y = 5/6 and Y/Z = 6/7 -> 5/6< 6/7 as stated in I
Cheers
_________________
........................................................................................
See it big and keep it simple.
Kudos [?]: 11 [0], given: 20
Intern
Joined: 02 Jul 2013
Posts: 19
Kudos [?]: 208 [0], given: 16
Schools: LBS MIF '15
Re: Robots X, Y, and Z each assemble [#permalink]
### Show Tags
22 Oct 2013, 08:00
Bunuel wrote:
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
Let the rates of robots X, Y, and Z be x, y, and z respectively. Given: $$r_x=\frac{x}{z}$$ and $$r_y=\frac{y}{z}$$. Question is $$z>x$$ and $$z>y$$?
(1) $$r_x<r_y$$ --> $$\frac{x}{z}<\frac{y}{z}$$ --> $$x<y$$. Not sufficient.
(2) $$r_y<1$$ --> $$\frac{y}{z}<1$$ --> $$y<z$$. Not sufficient.
(1)+(2) As $$x<y$$ and $$y<z$$ then $$x<y<z$$. Sufficient.
Bunuel,
Please help me clarify. The question says "Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate", so if it is rates, why is X's constant rate not 1/X (which is the rate of completing one unit of work, and Z's rate would therefore be 1/Z. Thus r(x) would be 1/X : 1/Z? What am I misunderstanding here?
Kudos [?]: 208 [0], given: 16
Math Expert
Joined: 02 Sep 2009
Posts: 42305
Kudos [?]: 133079 [0], given: 12403
Re: Robots X, Y, and Z each assemble [#permalink]
### Show Tags
22 Oct 2013, 09:22
bulletpoint wrote:
Bunuel wrote:
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
Let the rates of robots X, Y, and Z be x, y, and z respectively. Given: $$r_x=\frac{x}{z}$$ and $$r_y=\frac{y}{z}$$. Question is $$z>x$$ and $$z>y$$?
(1) $$r_x<r_y$$ --> $$\frac{x}{z}<\frac{y}{z}$$ --> $$x<y$$. Not sufficient.
(2) $$r_y<1$$ --> $$\frac{y}{z}<1$$ --> $$y<z$$. Not sufficient.
(1)+(2) As $$x<y$$ and $$y<z$$ then $$x<y<z$$. Sufficient.
Bunuel,
Please help me clarify. The question says "Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate", so if it is rates, why is X's constant rate not 1/X (which is the rate of completing one unit of work, and Z's rate would therefore be 1/Z. Thus r(x) would be 1/X : 1/Z? What am I misunderstanding here?
Because we denoted rates by x , y, and z: let the rates of robots X, Y, and Z be x, y, and z respectively.
_________________
Kudos [?]: 133079 [0], given: 12403
Intern
Joined: 10 Nov 2012
Posts: 31
Kudos [?]: 20 [0], given: 29
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
03 Nov 2013, 08:25
Hello Everyone,
In OG 13, the question uses "rx" and "ry" in the question stem but "r_x (x in suffix)" and "r_y(y in suffix)".
Are these typos?
Or am I supposed to guess that rx and ry of question stem has been converted to r_x and r_y in the two given options?
TIA,
Kudos [?]: 20 [0], given: 29
Math Expert
Joined: 02 Sep 2009
Posts: 42305
Kudos [?]: 133079 [1], given: 12403
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
03 Nov 2013, 11:21
1
KUDOS
Expert's post
drebellion wrote:
Hello Everyone,
In OG 13, the question uses "rx" and "ry" in the question stem but "r_x (x in suffix)" and "r_y(y in suffix)".
Are these typos?
Or am I supposed to guess that rx and ry of question stem has been converted to r_x and r_y in the two given options?
TIA,
It's a typo. x and y must be indexes in both stem and the statements.
_________________
Kudos [?]: 133079 [1], given: 12403
Intern
Joined: 10 Nov 2012
Posts: 31
Kudos [?]: 20 [1], given: 29
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
03 Nov 2013, 12:06
1
KUDOS
Also thank you for pointing out the error/typo in Diagnostic Test Q 5 (Cylindrical tank contains 36PI f3 of water...)
At lest for the second question (Cylindrical Tank...) we will never know if its a typo or the guys who had this question in their real GMAT were unfortunate!
Thanks Anyway!
Kudos [?]: 20 [1], given: 29
Non-Human User
Joined: 09 Sep 2013
Posts: 15546
Kudos [?]: 283 [0], given: 0
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
19 Sep 2015, 22:35
Hello from the GMAT Club BumpBot!
Thanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos).
Want to see all other topics I dig out? Follow me (click follow button on profile). You will receive a summary of all topics I bump in your profile area as well as via email.
_________________
Kudos [?]: 283 [0], given: 0
SVP
Joined: 06 Nov 2014
Posts: 1905
Kudos [?]: 542 [0], given: 23
Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
19 Jun 2016, 04:40
Assume the individual rates be X, Y and Z respectively for the robots.
Given: X/Z = $$r_x$$ and Y/Z = $$r_y$$
Required: Is Z the greatest?
Statement 1: $$r_x < r_y$$
Hence X/Z < Y/Z
Or, X < Y - (i)
We do not have any information about Z.
INSUFFICIENT
Statement 2: $$r_y < 1$$
Or Y/Z < 1
Hence Y < Z - (ii)
We do not know anything about X.
INSUFFICIENT
Combining both statements:
From (i) and (ii), we know that
X < Y and Y < Z
Hence X < Y < Z
SUFFICIENT
Correct Option: C
Kudos [?]: 542 [0], given: 23
Director
Joined: 04 Jun 2016
Posts: 647
Kudos [?]: 379 [1], given: 36
GMAT 1: 750 Q49 V43
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
01 Aug 2016, 02:23
1
KUDOS
ajit257 wrote:
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
(1) $$r_x<r_y$$
(2) $$r_y<1$$
Can some explain the reasoning behind this ques.
Fist of all we need to remember that rate can never be negative.
this makes the question super easy to deal
(1) $$r_x<r_y$$
meaning
$$\frac{x}{z}<\frac{y}{z}$$ {since neither x,y,z are rates and rate cannot be negative; therefore we can remove z from both side it easily without worrying about the sign}
so
$$x<y$$
INSUFFICINET
(2) $$r_y<1$$
meaning$$\frac{y}{z}$$ is less than 1
No info about rate of x or rate of z
INSUFFICIENT
merge both statements
$$\frac{x}{z}<\frac{y}{z}<1$$
multiply each term with z
$$z*\frac{x}{z}<z*\frac{y}{z}<z*1$$
x<y<z
Therefore Z is greatest
SUFFICIENT
_________________
Posting an answer without an explanation is "GOD COMPLEX". The world doesn't need any more gods. Please explain you answers properly.
FINAL GOODBYE :- 17th SEPTEMBER 2016. .. 16 March 2017 - I am back but for all purposes please consider me semi-retired.
Kudos [?]: 379 [1], given: 36
Intern
Joined: 17 Aug 2016
Posts: 49
Kudos [?]: 2 [0], given: 82
Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
24 Oct 2016, 09:47
Bunuel wrote:
Robots X, Y, and Z each assemble components at their respective constant rates. If r(x) is the ratio of robot X's constant rate to robot Z's constant rate and r(y) is the ratio of robot Y's constant rate to robot Z's constant rate, is robot Z's constant rate the greatest of the three?
Let the rates of robots X, Y, and Z be x, y, and z respectively. Given: $$r_x=\frac{x}{z}$$ and $$r_y=\frac{y}{z}$$. Question is $$z>x$$ and $$z>y$$?
(1) $$r_x<r_y$$ --> $$\frac{x}{z}<\frac{y}{z}$$ --> $$x<y$$. Not sufficient.
(2) $$r_y<1$$ --> $$\frac{y}{z}<1$$ --> $$y<z$$. Not sufficient.
(1)+(2) As $$x<y$$ and $$y<z$$ then $$x<y<z$$. Sufficient.
Hi Bunuel, I prefectly understad your solution, but why I can't reach the same conclusion if I use the notation 1/x, 1/y, 1/z to denote the 3 rates? After all the rate is output/time, therfore it should work also in this way...
Thanks
EDIT: sorry I wrote something stuopid, it works fine also using the notation 1/x etc
Kudos [?]: 2 [0], given: 82
Manager
Joined: 23 Jan 2016
Posts: 212
Kudos [?]: 23 [0], given: 510
Location: India
GPA: 3.2
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
10 Nov 2016, 23:28
Bunuel, why are we not taking the 1/x, 1/y format? shouldnt r(x) be (1/x)/1/z = z/x? and r(y) in the same manner? Thank you.
Kudos [?]: 23 [0], given: 510
Math Expert
Joined: 02 Sep 2009
Posts: 42305
Kudos [?]: 133079 [1], given: 12403
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
10 Nov 2016, 23:42
1
KUDOS
Expert's post
TheLordCommander wrote:
Bunuel, why are we not taking the 1/x, 1/y format? shouldnt r(x) be (1/x)/1/z = z/x? and r(y) in the same manner? Thank you.
In the solution I denoted rates by x , y, and z because we need to find the ratio of rates and it makes more sense to do this way. We could denoted the times of robots X, Y, and Z by x , y, and z and in this case, since the rate is reciprocal of time, the rates would be 1/x. 1/y, and 1/z but the way I did is better for this problem.
_________________
Kudos [?]: 133079 [1], given: 12403
Manager
Joined: 23 Jan 2016
Posts: 212
Kudos [?]: 23 [0], given: 510
Location: India
GPA: 3.2
Re: Robots X, Y, and Z each assemble components at their [#permalink]
### Show Tags
12 Nov 2016, 01:59
Bunuel wrote:
TheLordCommander wrote:
Bunuel, why are we not taking the 1/x, 1/y format? shouldnt r(x) be (1/x)/1/z = z/x? and r(y) in the same manner? Thank you.
In the solution I denoted rates by x , y, and z because we need to find the ratio of rates and it makes more sense to do this way. We could denoted the times of robots X, Y, and Z by x , y, and z and in this case, since the rate is reciprocal of time, the rates would be 1/x. 1/y, and 1/z but the way I did is better for this problem.
I understand Bunuel, thank you. Please review if the following solution is correct too -
If we use 1/x, 1/y and 1/z, we get rx = z/x and ry as z/y. To have the greatest rate, the denominator should be lowest; so z will have to be lower than x and y.
Statement 1 - rx<ry that means z/x<z/y => y<x. Not sufficieent.
Statement 2 - ry<1=> z/y<1 =>z<y => z<y. Not sufficient.
Statement 1+2 - z<y<x - sufficient. C.
Kudos [?]: 23 [0], given: 510
Re: Robots X, Y, and Z each assemble components at their [#permalink] 12 Nov 2016, 01:59
Display posts from previous: Sort by | 2017-11-23 05:48:11 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7363067269325256, "perplexity": 5542.0530245561395}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-47/segments/1510934806736.55/warc/CC-MAIN-20171123050243-20171123070243-00613.warc.gz"} |
https://or.stackexchange.com/posts/3561/revisions | • 1.4k
• 4
• 12
I don't know much about Python-mip but looking at the code, maximize expects a LinExpr, so I tried:
model.objective = maximize(1*x)
which gives the expected output.
Edit: I also opened a PR to allow maximize(var) and minimize(var).
Edit: The PR has been merged, this won'tshouldn't be a problem in >1.7.2.
• 1.4k
• 4
• 12
I don't know much about Python-mip but looking at the code, maximize expects a LinExpr, so I tried:
model.objective = maximize(1*x)
which gives the expected output.
Edit: I also opened a PR to allow maximize(var) and minimize(var).
Edit: The PR has been merged, this won't be a problem in >1.7.2.
• 1.4k
• 4
• 12
I don't know much about Python-mip but looking at the code, maximize expects a LinExpr, so I tried:
model.objective = maximize(1*x)
which gives the expected output.
Edit: I also opened a PR to allow maximize(var) and minimize(var).
Fix github url to a tag
• 1.4k
• 4
• 12
deleted 55 characters in body
• 1.4k
• 4
• 12 | 2022-01-20 21:04:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.43713492155075073, "perplexity": 13509.868231432503}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320302622.39/warc/CC-MAIN-20220120190514-20220120220514-00510.warc.gz"} |
https://motls.blogspot.com/2010/01/message-from-abraham-lincoln-to-barack.html?m=1 | ## Thursday, January 14, 2010
### Message from Abraham Lincoln to Barack Obama
You cannot help the poor by destroying the rich.
You cannot strengthen the weak by weakening the strong.
You cannot bring about prosperity by discouraging thrift.
You cannot lift the wage earner up by pulling the wage payer down.
You cannot further the brotherhood of man by inciting class hatred.
You cannot build character and courage by taking away people's initiative
and independence.
You cannot help people permanently by doing for them, what they could and
should do for themselves.
...... Abraham Lincoln
[while this text agrees with Lincoln's general opinions about these matters, see the comments for a discussion of proper attribution of the quote]
See also: Founding fathers on redistribution of wealth (where the attributions have been rechecked a few times)
#### 1 comment:
1. This is a great quote, but apparently it was not Lincoln who said it. See http://www.cincinnatiskeptics.org/blurbs/lincoln-cannots.html for further details. Thanks for sharing this, though! It brightened up my day. :) | 2022-01-18 05:22:10 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 1, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3776751756668091, "perplexity": 8520.873291426338}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320300722.91/warc/CC-MAIN-20220118032342-20220118062342-00136.warc.gz"} |
https://listserv.uni-heidelberg.de/cgi-bin/wa?A2=9710&L=LATEX-L&D=0&H=A&S=a&P=2189987 | ## LATEX-L@LISTSERV.UNI-HEIDELBERG.DE
Options: Use Forum View Use Monospaced Font Show Text Part by Default Condense Mail Headers Message: [<< First] [< Prev] [Next >] [Last >>] Topic: [<< First] [< Prev] [Next >] [Last >>] Author: [<< First] [< Prev] [Next >] [Last >>]
Some months ago I pointed out in another message that I wanted to make
some remarks about templates. Well, we all know the pace of this list,
where months play the rôle of days, so here it is:
There is something about how collections work that puzzles me.
Currently, if one wishes to use the instance "iname" of the type "type",
one has to write
\UseInstance{type}{iname},
no matter whether the instance was declared via \DeclareInstance or via
\DeclareCollectionInstance. So, ¿what are the collections for? I know,
to restrict the use of an instance to a particular collection.
Form my point of view the existence of instances should be independent
from the association of particular instances with certain collections.
Thus, a file may store the declaration of a bunch of instances for a
particular template, say, for a heading formating template. Supose they
are called ''simple", "beautiful", "front1", "front2", where the names
of the last ones suggest that they are specifically designed to be used
in front matters. And suppose that for a particular work or in a
particular series of books the designer decides to make use of the
instance "front1" to format the headings at the frontmatter. Then he may
write
and at some point in the document near the beginning the author or, more
likely, a macro defined by the designer, writes
so that from now on (normal scoping rules) the instance to be used to
format headings is the corresponding to the collection frontmatter. An
so when the time comes to create a heading (posibly inside another
macro) one simply writes
where the empty second argument means: "Use the instance that is in
force for the type heading", and an error is issued if such an instance
doesn't exist, i.e., if there has not been a previous call to
\UseCollection where the first argument is "heading" and also a suitable
call to \AssociateInstanceCollection. This allows the creation of very
simple high level commands. Think for example about formating a caption.
One may simply use always \UseInstance{caption}{}, and the setting of
the collection in force will be made by the commands that format the
particular float: figures, tables, pieces of code,... Thus, once the
skeleton is written, a separate format-defining file will consist of
severall calls to \AssociateInstanceCollection{type}{collection}{iname}
(among other tings), setting the appearance of the documment.
Furthermore, one could write
\SetCollection{frontamtter}
in order to set in force all the instances of all types that have been
associated to the collection.
I think it wouldn't be very difficult to implement this. At the present
time the command that gets executed when \UseInstance is called is
\<coll>type/iname,
wher "coll" may be empty. We can have simply \type/iname. The definition
of \AssociateInstanceCollection would then be:
\def\AssociateInstanceCollection#1#2#3{ % type, collection, iname
\let:cc{#1/??_#2}{#1/#3}
}
Where it can be seen that ??_coll is a faked iname that gets assigned to
a real iname via \AssociateInstanceCollection.
The code for \UseCollection is then
\def\UseCollection#1#2{ % type, collection
\let:cc{#1/???}{#1/??_#2}
}
And so type/??? means "current iname according to the collection in
force for this type". This definition needs a check to test if
\type/??_coll has been associated to a real iname, and if not issue an
error or define \type/??_coll to issue an error. This last option allows
the association to take place latter, since \UseCollection may appear in
the definition of a macro that expects the association to be performed
before the macro is called. It will also complicate the initial check
for \type/??_coll, but see below.
We need also, at the moment of declaring a type, to define \type/??? to
issue an error. If we do not the user will get the error "the instance
??? for type heading is not defined", or something like that.
The command \SetCollection executes, if it is defined,
\TP_tlp_set_collection_coll (coll is #1):
\def:Npn\SetCollection#1{
\cs:w TP_tlp_set_collection_#1\cs_end:
}
\TP_tlp_set_collection_coll will get dinamically defined by adding code
to it every time we call \AssociateInstanceCollection. We have then to
modify the previous definition of this macro. It may also be useful to
know which instance is associated to a particular collection, if any. In
particular, it is necesary for the check needed at \SetCollection:
\def:Npn\AssociateInstanceCollection#1#2#3{ % type, collection, iname
\let:cc{#1/??_#2}{#1/#3}
%Here we localy (important) add the command \UseCollection{#1}{#2} to
de definition of \TP_tlp_set_collection_coll
\tlp_put_right:cn{TP_tlp_set_collection_#2}{\UseCollection{#1}{#2}}
%Record that type+collection is from now on iname:
\def:cpn{TPC>/#1/#2}{#3} %Note the order #1/#2. We always
regard a collection as an indirect iname for types.
}
And the definition of \UseCollection will then be:
\def:Npn\UseCollection#1#2{ % type, collection
\expandafter\ifx\csname TPC>/#1/#2\endcsname\relax %define #1/??_#2
to be an error message
\def:cpn{#1/??_2}{PackageError{template}{There is not defined any
instance of type #1 to be used with the collection #2}}
\else
\let:cc{#1/???}{#1/??_#2}
\fi
}
We need also to modify slightly the definition of UseInstance to check
if the second argument is empty, and if so execute \type/??? (i.e.
It is important that the list TP_tlp_set_collection_coll (for every
particular coll) be updated locally, as the collection in force is also
associated locally. It works properly because \UseCollection{type}{coll}
is appended to the right, so that local settings override those from an
outer scope. We cannot provide a global \gAssociateInstanceCollection,
since a global setting of TP_tlp_set_collection_coll will play havoc on
the other types. (We can make a really ugly hack, by executing
\globalhack_TP_type_coll, defined as
{\tlp_put_right:cn{TP_tlp_set_collection_coll}{\UseCollection{type}{coll}}\aftergroup\globalhack_TP_type_coll},
where type and coll are parameters #1 and #2, but this does not seem the
right solution).
The right solution is to make TP_tlp_set_collection_coll consist of
several tlp! So that TP_tlp_set_collection_front could be for example
Each of the individual tlp's is really a stak, where inner associations
get added to the left and thus override outer ones. The final definition
of \AssociateInstanceCollection is then:
\def:Npn\AssociateInstanceCollection#1#2#3{ % type, collection, iname
\let:cc{#1/??_#2}{#1/#3}
%The following line is pseudocode. It doesn't seem to be difficult to
translate into code,
%but this is the first time I use a tlp or any of its relatives (I
can't even remember which kinds of structures exsit),
%so I didn't bother to look in the manual for the functions that I need.
look if \cs:w TP_tlp_set_collection_#2_#1\end_cs: appears in \cs:w
TP_tlp_set_collection_#2\end_cs: %Assume the real function is of type TF
{
\tlp_gput_right:cc{TP_tlp_set_collection_#2}{TP_tlp_set_collection_#2_#1}
%Make it global so that we insert it once and for ever
\gdef:cn{TP_tlp_set_collection_#2_#1}{}
}
{}
\tlp_put_right:cn{TP_tlp_set_collection_#2_#1}{\UseCollection{#1}{#2}}
%Record that type+collection is from now on iname:
\def:cpn{TPC>/#1/#2}{#3} %Note the order #1/#2. We always
regard a collection as an indirect iname for types.
}
This new definition of \AssociateInstanceCollection needs
TP_tlp_set_collection_coll to exist, so we may either add a check and
create it if necessary, or define
\DeclareCollection#1{ \tlp_new:cn{TP_tlp_set_collection_#1}{}.
A global version of \AssociateInstanceCollection is now trivial:
\def:Npn\AssociateInstanceCollection#1#2#3{ % type, collection, iname
\glet:cc{#1/??_#2}{#1/#3}
look if \cs:w TP_tlp_set_collection_#2_#1\end_cs: appears in \cs:w
TP_tlp_set_collection_#2\end_cs: %Assume the real function is of type TF
{
\tlp_gput_right:cc{TP_tlp_set_collection_#2}{TP_tlp_set_collection_#2_#1}
}
{}
\gdef:cn{TP_tlp_set_collection_#2_#1}{\UseCollection{#1}{#2}}
\gdef:cpn{TPC>/#1/#2}{#3}
}
Successive calls to \AssociateInstanceCollection within the same group
will keep unnecessary \UseCollection{type}{coll}, but I think it is not
a problem in practice, and in order to eliminate them we should know
whether the last \UseCollection{type}{coll} of
TP_tlp_set_collection_coll_type comes from the current gruop or from an
outer one, which seem awckward.
And that's all!
If all of the above is useless, do not feel sympathy whith me! I really
needed to unrust myself, its a long time since I last worked with TeX.
Javier A. | 2023-02-04 22:19:17 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6551194190979004, "perplexity": 5544.520671111636}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500154.33/warc/CC-MAIN-20230204205328-20230204235328-00137.warc.gz"} |
https://talkstats.com/threads/difference-between-sigma-and-standard-deviation.21031/ | # difference between sigma and standard deviation
#### sihem
##### New Member
please, what is the difference between sigma and standard deviation in quality control
#### noetsi
##### No cake for spunky
Sigma is the greek letter used to represent standard deviation. For example Six sigma, used often in the quality literature, means six standard deviations from the mean. In other words there is no generic difference, although specific individuals in the quality movement (many of whoom use terms pretty losely or differently from their initial meaning) might use the terms differently.
http://sixsigmatutorial.com/six-sigma-tutorial/7/
The above notes this. One "difference" is that sigma in quality is usually used to denote reduction of errors (by so many standard deviations from the process mean). | 2021-12-07 21:04:30 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8317915797233582, "perplexity": 1849.023313997577}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363418.83/warc/CC-MAIN-20211207201422-20211207231422-00489.warc.gz"} |
http://www.azfamily.com/story/28314791/border-agents-discover-smuggling-tunnel-near-nogales | ### Border agents discover smuggling tunnel near Nogales
Posted: Updated:
U.S. Border Patrol agents assigned to the Nogales Station discovered an intricate smuggling tunnel passing under the international border yesterday, the first such tunnel found in recent months. By Catherine Holland
U.S. Border Patrol agents assigned to the Nogales Station discovered an intricate smuggling tunnel passing under the international border yesterday, the first such tunnel found in recent months. By Catherine Holland
U.S. Border Patrol agents assigned to the Nogales Station discovered an intricate smuggling tunnel passing under the international border yesterday, the first such tunnel found in recent months. By Catherine Holland
U.S. Border Patrol agents assigned to the Nogales Station discovered an intricate smuggling tunnel passing under the international border yesterday, the first such tunnel found in recent months. By Catherine Holland
TUCSON -- U.S. Border Patrol agents assigned to the Nogales Station discovered an intricate smuggling tunnel passing under the international border yesterday, the first such tunnel found in recent months.
The tunnel was discovered approximately 150 yards east of the DeConcini Port of Entry. On the Mexican side of the border it is supported with shoring and is three feet wide by three feet tall. As the tunnel passes under the border fence, into the United States, shoring stops and the opening reduces to a hole 18 inches wide by 18 inches tall. The total length of the tunnel is approximately 30 feet. The tunnel exit on the U.S. side was concealed with plywood and weeds.
“It has been nearly four months since the discovery of an intricate tunnel,” said John M. Fitzpatrick, Division Chief of Operations for the Tucson Sector. A more elaborate tunnel was discovered in June (Fiscal Year 2009). It was approximately 48 feet in length on the U.S. side and stretched another 35 feet under Nogales, Sonora, Mexico.
This is the first tunnel discovered in the Tucson Sector for Fiscal Year 2010. The effectiveness of the Border Patrol’s Operational Goal to deploy the proper mix of manpower, technology and infrastructure is making it difficult for smuggling organizations to make a profit. Tunnels such as this are clear indicators of the frustration and desperation of smuggling organizations attempting to profit from the smuggling of illegal aliens and narcotics. | 2018-03-22 14:05:51 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.828856348991394, "perplexity": 6225.29260699014}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-13/segments/1521257647885.78/warc/CC-MAIN-20180322131741-20180322151741-00252.warc.gz"} |
https://www.statsmodels.org/v0.10.2/generated/statsmodels.tsa.kalmanf.kalmanfilter.KalmanFilter.loglike.html | # statsmodels.tsa.kalmanf.kalmanfilter.KalmanFilter.loglike¶
method
classmethod KalmanFilter.loglike(params, arma_model, set_sigma2=True)[source]
The loglikelihood for an ARMA model using the Kalman Filter recursions.
Parameters
paramsarray
The coefficients of the ARMA model, assumed to be in the order of trend variables and k exogenous coefficients, the p AR coefficients, then the q MA coefficients.
arma_modelstatsmodels.tsa.arima.ARMA instance
A reference to the ARMA model instance.
set_sigma2bool, optional
True if arma_model.sigma2 should be set. Note that sigma2 will be computed in any case, but it will be discarded if set_sigma2 is False.
Notes
This works for both real valued and complex valued parameters. The complex values being used to compute the numerical derivative. If available will use a Cython version of the Kalman Filter. | 2022-05-27 01:01:28 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8918672204017639, "perplexity": 2453.5426865854365}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662627464.60/warc/CC-MAIN-20220526224902-20220527014902-00682.warc.gz"} |
http://tex.stackexchange.com/questions/73776/biblatex-footnote-citations-and-numbers-in-bibliography | # Biblatex, Footnote Citations and Numbers in Bibliography
I'm writing a document where I'm using biblatex (with BibTeX as back-end). In my document I would like to have citations as footnotes, "normal" footnotes containing text and at the end a consolidated bibliography of the references my document contains.
There is only one, quite small, issue. I would like the final bibliography to also display the footnote number associated with the citation. How do I accomplish that?
The references at the end should then appear as:
(footnote number) (author) (title) (year)
Here's a simple example of my problem:
Generated document: http://fuskbugg.se/dl/ySqEUE/test.pdf
\documentclass[a4paper,12pt]{article}
\usepackage[style=verbose]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{test.bib}
@book{Foo,
title={Book title1},
author={Author1},
year= {Year1},
}
@book{Bar,
title={Book title2},
author={Author2},
year= {Year2},
}
\end{filecontents}
\begin{document}
This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.} footnotes.\footcite{Bar}
\newpage
How can I make the footnote number associated with the reference be printed along with the reference? (First entry should be numbered 1 and second numbered 3.)
\printbibliography
\end{document}
-
Welcome to TeX.sx! Is there a special reason why you are using BibTeX instead of Biber? It appears you are using an outdated version of biblatex. The newer version of biblatex (2.x) has the default option backend=biber. To help you more effective I recommend that you have a updated LaTeX distribution. – Marco Daniel Sep 23 '12 at 17:23
What will happen if you use \footcite{foo} more often? How do you expect the output in the references? – Marco Daniel Sep 23 '12 at 17:28
@MarcoDaniel I guess the OP wants the number of the first footnote. – lockstep Sep 23 '12 at 17:29
@lockstep: And the option \nocite isn't explained here ;-). I think the question might become really complex. – Marco Daniel Sep 23 '12 at 17:31
@MarcoDaniel 1. I'm using bibtex for no special reason. I just started writing a document and bibtex seemed to work just fine. 2. Multiple citations of the same source is an interesting issue. I'm pretty much neutral on this issue but I'm kinda leaning towards that multiple occurrences in the bibliography would be the best solution. (the solution presented by lockstep is good though) 3. As for \nocite that's nothing I have utilized. – user19051 Sep 24 '12 at 18:26
The following must be done:
• Amend the cite:full bibmacro so that it will also store the current footnote number in a new macro whose name uses the entrykey of the current entry;
• Use the numeric bibstyle and the option sorting=none;
• Change the labelnumber format so that it displays the meaning of the "footnote number" macro of the current entry.
Note that the bibliography "labels" will be ambiguous if you cite several entries for the first time in the same footnote.
(EDIT: The OP stated that he/she uses BibTeX as backend, but the current biblatex version [2.2] willl by default [as in the OP's MWE] use Biber. That said, the following solution will also work with BibTeX if one adds the appropriate backend=bibtex package option.)
\documentclass[a4paper,12pt]{article}
\usepackage[citestyle=verbose,bibstyle=numeric,sorting=none]{biblatex}
\makeatletter
\renewbibmacro*{cite:full}{%
\usebibmacro{cite:full:citepages}%
\printtext[bibhypertarget]{%
\usedriver
{\DeclareNameAlias{sortname}{default}}
{\thefield{entrytype}}}%
% \usebibmacro{shorthandintro}}% DELETED
\usebibmacro{shorthandintro}% NEW
\csxdef{cbx@\thefield{entrykey}@footnotenumber}{\the\value{footnote}}% NEW
}% NEW
\DeclareFieldFormat{prefixnumber}{}
\DeclareFieldFormat{labelnumber}{\csuse{cbx@\thefield{entrykey}@footnotenumber}}
\makeatother
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Foo,
title={Book title1},
author={Author1},
year= {Year1},
}
@book{Bar,
title={Book title2},
author={Author2},
year= {Year2},
}
\end{filecontents}
\begin{document}
\null\vfill% just for the example
This is some text\footcite{Foo}, with\footnote{"Normal" footnotes also appear.}
footnotes.\footcite{Bar}
How can I make the footnote number associated with the reference be printed along
with the reference? (First entry should be numbered 1 and second numbered 3.)
\printbibliography
\end{document}
-
I try your solutions, but with error: File 'filecontents.sty' not found. How can they fix it? – jafan Sep 23 '12 at 17:50
@jafan a) Remove all auxiliary files and compile again. b) Be sure to compile my example as-is. – lockstep Sep 23 '12 at 17:52
Without effect. a) copy your solution b) cmd> xelatex exam.tex -> error File 'filecontents.sty' not found. Should I create yet another file? – jafan Sep 23 '12 at 17:58
@lockstep Thank you! This solution works great. You really did me a favour there. – user19051 Sep 24 '12 at 18:29
@jafan " 'filecontents.sty' not found." Almost certainly means that the package filecontents is not installed on your computer. – user19051 Sep 24 '12 at 18:32 | 2014-10-02 01:00:41 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8580781817436218, "perplexity": 4134.760370987406}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1412037663612.31/warc/CC-MAIN-20140930004103-00243-ip-10-234-18-248.ec2.internal.warc.gz"} |
https://brilliant.org/problems/a-problem-by-karthik-kannan/ | # Weighted Binomial Coefficient Sum
If the value of $\dbinom{36}{1}+4\dbinom{36}{4}+7\dbinom{36}{7}+\cdots+34\dbinom{36}{34}$ can be expressed as $$a\times b^{c}+12,$$ where $$a$$ and $$b$$ are prime numbers, then find the value of $$a+b+c+12.$$
× | 2018-09-26 09:48:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9566283226013184, "perplexity": 123.3906678151426}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-39/segments/1537267164469.99/warc/CC-MAIN-20180926081614-20180926102014-00542.warc.gz"} |
https://stat.ethz.ch/R-manual/R-patched/library/Matrix/html/sparseVector.html | sparseVector {Matrix} R Documentation
## Sparse Vector Construction from Nonzero Entries
### Description
User friendly construction of sparse vectors, i.e., objects inheriting from class sparseVector, from indices and values of its non-zero entries.
### Usage
sparseVector(x, i, length)
### Arguments
x vector of the non zero entries; may be missing in which case a "nsparseVector" will be returned. i integer vector (of the same length as x) specifying the indices of the non-zero (or non-TRUE) entries of the sparse vector. length length of the sparse vector.
### Details
zero entries in x are dropped automatically, analogously as drop0() acts on sparse matrices.
### Value
a sparse vector, i.e., inheriting from class sparseVector.
### Author(s)
Martin Maechler
sparseMatrix() constructor for sparse matrices; the class sparseVector.
### Examples
str(sv <- sparseVector(x = 1:10, i = sample(999, 10), length=1000))
sx <- c(0,0,3, 3.2, 0,0,0,-3:1,0,0,2,0,0,5,0,0)
ss <- as(sx, "sparseVector")
stopifnot(identical(ss,
sparseVector(x = c(2, -1, -2, 3, 1, -3, 5, 3.2),
i = c(15L, 10:9, 3L,12L,8L,18L, 4L), length = 20L)))
(ns <- sparseVector(i= c(7, 3, 2), length = 10))
stopifnot(identical(ns,
new("nsparseVector", length = 10, i = c(2, 3, 7))))
[Package Matrix version 1.5-3 Index] | 2023-01-30 07:52:25 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8643950819969177, "perplexity": 13694.167780671252}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764499804.60/warc/CC-MAIN-20230130070411-20230130100411-00082.warc.gz"} |
http://lib.farmlandmedia.com/8ubcu0/in-radius-of-right-angle-triangle-f2f281 | Pythagorean Theorem: Perimeter: Semiperimeter: Area: Altitude of a: Altitude of b: Altitude of c: Angle Bisector of a : Angle Bisector of b: Angle Bisector of c: Median of a: Median of b: Median of c: Inscribed Circle Radius: Circumscribed Circle Radius: Isosceles Triangle: Two sides have equal length Two angles … Find the sides of the triangle. Namely: The secant, cosecant and cotangent are used very rarely used, because with the same inputs we could also just use the sine, cosine and tangent. As we know, the condition of a triangle,Sum of two sides is always greater than third side.i.e. The best way to solve is to find the hypotenuse of one of the triangles. The default option is the right one. 45°-45°-90° triangle: The 45°-45°-90° triangle, also referred to as an isosceles right triangle, since it has two sides of equal lengths, is a right triangle in which the sides corresponding to the angles, 45°-45°-90°, follow a ratio of 1:1:√ 2. And we know that the area of a circle is PI * r 2 where PI = 22 / 7 and r is the radius of the circle. Right Triangle Formula is used to calculate the area, perimeter, unknown sides and unknown angles of the right triangle. We know that the radius of the circle touching all the sides is (AB + BC – AC)/ 2 ⇒ The required radius of circle = … Let x = 3, y = 4. But we've learned several videos ago that look, this angle, this inscribed angle, it subtends this arc up here. However, in a right triangle all angles are non-acute, and we will not need this definition. Such an angle is called a right angle. The side opposite the right angle is called the hypotenuse (side c in the figure). The value of the hypotenuse is View solution. 2014: 360 × 183 (11 KB) MartinThoma {{Information |Description ={{en|1=Half-circle with triangles and right angles to visualize the property of a thales triangle.}} If G is the centroid of Δ ABC and Δ ABC = 48 cm2, then the area of Δ BGC is, Taking any three of the line segments out of segments of length 2 cm, 3 cm, 5 cm and 6 cm, the number of triangles that can be formed is. What is the measure of the radius of the circle inscribed in a triangle whose sides measure $8$, $15$ and $17$ units? p = 18, b = 24) 33 Views. So, Hypotenuse = 2(r) = 2(3) = 6cm. Time it out for real assessment and get your results instantly. {{de|1=Halbkreis mit Dreiecken und rechten Winkeln zur Visualisierung der Eigenschaft eines Thaleskreises.}} Here’s what a right triangle looks like: Types of right triangles. We know 1 side and 1 angle of the right triangle, in which case, use sohcahtoa. In a right-angle ΔABC, ∠ABC = 90°, AB = 5 cm and BC = 12 cm. Or another way of thinking about it, it's going to be a right angle. ΔABC is an isosceles right angled triangle. Solution First, let us calculate the hypotenuse of the right-angled triangle with the legs of a = 5 cm and b = 12 cm. The sine, cosine and tangent are also defined for non-acute angles. The longest side of a right triangle is called the hypotenuse, and it is the side that is opposite the 90 degree angle. In a ΔABC, . Problem 1. ∴ ΔABC is a right angled triangle and ∠B is a right angle. I can easily understand that it is a right angle triangle because of the given edges. View solution. Like the 30°-60°-90° triangle, knowing one side length allows you to determine the lengths of the other sides of a 45°-45°-90° triangle. Enter the side lengths. Recommended: Please try your approach on first, before moving on to the solution. Video Tutorial . Input: r = 5, R = 12 Output: 4.9. Now we know that: a = 6.222 in; c = 10.941 in; α = 34.66° β = 55.34° Now, let's check how does finding angles of a right triangle work: Refresh the calculator. "Now,AD2 = AP. Then, there is one side left which is called the opposite side. Since these functions come up a lot they have special names. We know 1 side and 1 angle of the right triangle, in which case, use sohcahtoa. So if we know sin(x) = y then x = sin-1 (y), cos(x) = y then x = cos-1 (y) and tan(x) = y … And if someone were to say what is the inradius of this triangle right over here? The longest side of a right triangle is called the hypotenuse, and it is the side that is opposite the 90 degree angle. This is a right triangle, and the diameter is its hypotenuse. css rounded corner of right angled triangle. To give the full definition, you will need the unit circle. Figure 1. We know that in a right angled triangle, the circumcentre is the mid-point of hypotenuse. The radius of the circumcircle of a right angled triangle is 15 cm and the radius of its inscribed circle is 6 cm. 6. Since ΔPQR is a right-angled angle, PR = sqrt(7^2 + 24^2) = sqrt(49 + 576) = sqrt625 = 25 cm Let the given inscribed circle touches the sides of the given triangle at points A, B and C respectively. Find the angles of the triangle View solution. Calculate the radius of a inscribed circle of a right triangle if given legs and hypotenuse ( r ) : radius of a circle inscribed in a right triangle : = Digit 2 1 2 4 6 10 F. =. And if someone were to say what is the inradius of this triangle right over here? © Last Updated: 18 July 2019. , - legs of a right triangle. Let the angles be 2x, 3x and 4x. The radius of the incircle of a right triangle can be expressed in terms of legs and the hypotenuse of the right triangle. 3 Diagnosis; 4 Treatment of joint disease ... radius of incircle of right angle triangle Palindromic rheumatism is characterized by sudden and recurrent attacks of painful swelling of one or more joints. Hence the area of the incircle will be PI * ((P + B – H) / … Switch; Flag; Bookmark; 114. For right triangles In the case of a ... where the diameter subtends a right angle to any point on a circle's circumference. We can also do it the other way around. https://www.zigya.com/share/UUFFTlNMMTIxNjc4Mjk=. Then using right-angled triangles and trigonometry, he was able to measure the angle between the two cities and also the radius of the Earth, since he knew the distance between the cities. We know that the radius of the circle touching all the sides is (AB + BC – AC )/ 2 So if f(x) = y then f-1(y) = x. Find the sides of the triangle. 24, 36, 30. For right triangles In the case of a ... where the diameter subtends a right angle to any point on a circle's circumference. Find the sides of the triangle. Show Answer . Right triangle is a triangle whose one of the angle is right angle. So use the triangle with vertex P. Call the point at the top of the tree T Call the height of the tree H The angle formed between sides PT and QT was worked out as 108 degrees. Therefore, a lot of people would not even know they exist. The relation between the sides and angles of a right triangle is the basis for trigonometry.. The best way to solve is to find the hypotenuse of one of the triangles. Calculate the length of the sides below. In a right triangle, one of the angles has a value of 90 degrees. Calculating an Angle in a Right Triangle. Now we can calculate how much vertical and horizontal space this slide will take. The area of a triangle is equal to the product of the sides divided by four radii of the circle circumscribed about the triangle. 18, 24, 30 . - circumcenter. If you only know the length of two sides, or one angle and one side, this is enough to determine everything of the triangle. Now, check with option say option (d) (h = 30, and p + b = 42 (18 + 24) i.e. In Δ BDC, y + 180° - 2x + x + 50° = 180° y - x + 50° = 0 y - x = -50° ...(i)In Δ ABC, In a triangle, if three altitudes are equal, then the triangle is. We find tan(36) = 0.73, and also 2.35/3.24 = 0.73. Share 0. Examples: Input: r = 2, R = 5 Output: 2.24. Calculate the radius of the circumcircle of a triangle if given all three sides ( R ) : radius of the circumcircle of a triangle : = Digit 2 1 2 4 6 10 F An inverse function f-1 of a function f has as input and output the opposite of the function f itself. In each case, round your answer to the nearest hundredth. + radius of incircle of right angle triangle 12 Jan 2021 2.1 Infectious arthritis; 2.2 Rheumatic inflammation (inflammatory rheumatic disease); 2.3 Osteoarthritis (osteoarthritis). All triangles have interior angles adding to 180 °.When one of those interior angles measures 90 °, it is a right angle and the triangle is a right triangle.In drawing right triangles, the interior 90 ° angle is indicated with a little square in the vertex.. Therefore two of its sides are perpendicular. Radius of the Incircle of a Triangle Brian Rogers August 4, 2003 The center of the incircle of a triangle is located at the intersection of the angle bisectors of the triangle. Then by the Pythagorean theorem we know that r = 5, since sqrt(32 + 42) = 5. This is the same radius -- actually this distance is the same. The other two sides are identified using one of the other two angles. One of them is the hypothenuse, which is the side opposite to the right angle. Right Triangle Equations. If we draw a circumcircle which passes through all three vertices, then the radius of this circle is equal to half of the length of the hypotenuse. And what that does for us is it tells us that triangle ACB is a right triangle. In the triangle above we are going to calculate the angle theta. In the given figure, P Q > P R and Q S, R S are the bisectors of ∠ Q and ∠ R respectively, then _____. 30, 40, 41. An inverse function f-1 of a function f has as input and output the opposite of the function f itself. Then, area of triangle. Here is the output along with a blown up image of the shape: … Calculate the radius of a inscribed circle of a right triangle if given legs and hypotenuse ( r ) : radius of a circle inscribed in a right triangle : = Digit 2 1 2 4 6 10 F ⇒ 5 2 = 3 2 + 4 2 ⇒ 25 = 25 ∴ ΔABC is a right angled triangle and ∠ B is a right angle. In the given figure, P Q > P R and Q S, R S are the bisectors of ∠ Q and ∠ R respectively, then _____. In a right angle Δ ABC, BC = 12 cm and AB = 5 cm, Find the radius of the circle inscribed in this triangle. It is very well known as a2 + b2 = c2. The radius of the circumcircle of a right angled triangle is 15 cm and the radius of its inscribed circle is 6 cm. We can define the trigonometric functions in terms an angle t and the lengths of the sides of the triangle. Our right triangle side and angle calculator displays missing sides and angles! Examples: Input: r = 2, R = 5 Output: 2.24. The definition is very simple and might even seem obvious for those who already know it: a right-angled triangle is a triangle where one and only one of the angles is exactly 90°. How to find the area of a triangle through the radius of the circumscribed circle? 232, Block C-3, Janakpuri, New Delhi, . View solution. Calculating an Angle in a Right Triangle. So for example, if this was a triangle right over here, this is maybe the most famous of the right triangles. These angles add up to 180° for every triangle, independent of the type of triangle. Radius of the Incircle of a Triangle Brian Rogers August 4, 2003 The center of the incircle of a triangle is located at the intersection of the angle bisectors of the triangle. To calculate the height of the slide we can use the sine: And therefore y = 4*sin(36) = 2.35 meters. There are however three more ratios we could calculate. 30, 40, 41. Given the side lengths of the triangle, it is possible to determine the radius of the circle. It was quite an astonishing feat, that now you can do much more easily, by just using the Omni calculators that we have created for you . D. 18, 24, 30. It is = = = = = 13 cm in accordance with the Pythagorean Theorem. 24, 36, 30. This means that these quantities can be directly calculated from the sine, cosine and tangent. (3, 5, 6) ⟹ (3 + 5 > 6) (2, 5, 6) ⟹ (2 + 5 > 6)∴ only two triangles can be formed. It is = = = = = 13 cm in accordance with the Pythagorean Theorem. p = 18, b = 24) 33 Views. The radius of the circumcircle of the triangle ABC is a) 7.5 cm b) 6 cm c) 6.5 cm d) 7 cm Assume that we have two sides and we want to find all angles. Now, check with option say option (d) (h = 30, and p + b = 42 (18 + 24) i.e. In a right angle Δ ABC, BC = 12 cm and AB = 5 cm, Find the radius of the circle inscribed in this triangle. 30, 24, 25. Hence the area of the incircle will be PI * ((P + B – H) / 2) 2.. Below is the implementation of the above approach: In a right triangle, one of the angles has a value of 90 degrees. This Gergonne triangle, , is also known as the contact triangle or intouch triangle of .Its area is = where , , and are the area, radius of the incircle, and semiperimeter of the original triangle, and , , and are the side lengths of the original triangle. A triangle in which one of the interior angles is 90° is called a right triangle. on Finding the Side Length of a Right Triangle. Find the sides of the triangle. Such a circle, with a center at the origin and a radius of 1, is known as a unit circle. asked Oct 1, 2018 in Mathematics by Tannu ( 53.0k points) circles For equilateral triangles In the case of an equilateral triangle, where all three sides (a,b,c) are have the same length, the radius of the circumcircle is given by the formula: where s … Find the angles of the triangle View solution. The bisectors of the internal angle and external angle intersect at D. If , then is. Now we can calculate the angle theta in three different ways. Delhi - 110058. The side opposite the right angle is called the hypotenuse (side c in the figure). … Ask Question Asked 1 year, 4 months ago. If I have a triangle that has lengths 3, 4, and 5, we know this is a right triangle. According to tangent-secant theorem:"When a tangent and a secant are drawn from one single external point to a circle, square of the length of the tangent segment must be equal to the product of lengths of whole secant segment and the exterior portion of secant segment. You can verify this from the Pythagorean theorem. This allows us to calculate the other non-right angle as well, because this must be 180-90-36.87 = 53.13°. Recommended: Please try your approach on first, before moving on to the solution. I wrote an article about the Pythagorean Theorem in which I went deep into this theorem and its proof. The radius of the circumcircle of a right angled triangle is 15 cm and the radius of its inscribed circle is 6 cm. In a triangle ABC , right angled at B , BC=12cmand AB=5cm. Viewed 639 times 0. So if f(x) = y then f-1 (y) = x. By Pythagoras Theorem, ⇒ AC 2 = AB 2 + BC 2 Given in ΔABC, AB = 3, BC = 4, AC = 5. Just like every other triangle, a right triangle has three sides. Also the sum of other two angles is equal to 90 degrees. Enter the … We are basically in the same triangle again, but now we know theta is 36° and r = 4. A circle is inscribed in a right angled triangle with the given dimensions. 1.2.36 Use Example 1.10 to find all six trigonometric functions of $$15^\circ$$. Now we know that: a = 6.222 in; c = 10.941 in; α = 34.66° β = 55.34° Now, let's check how does finding angles of a right triangle work: Refresh the calculator. A right angled triangle is formed between point P, the top of the tree and its base and also point Q, the top of the tree and its base. If r is its in radius and R its circum radius, then what is $$\frac{R}{r}$$ equal to ? If you drag the triangle in the figure above you can create this same situation. We can calculate the angle between two sides of a right triangle using the length of the sides and the sine, cosine or tangent. Assume that we have two sides and we want to find all angles. from Quantitative Aptitude Geometry - Triangles Broadly, right triangles can be categorized as: 1. - hypotenuse. Switch; Flag; Bookmark; 114. The acute angles of a right triangle are in the ratio 2: 3. In a ΔABC, . on Finding the Side Length of a Right Triangle. Input: r = 5, R = 12 Output: 4.9. A right triangle (American English) or right-angled triangle (British English) is a triangle in which one angle is a right angle (that is, a 90-degree angle). Problem 1. In each case, round your answer to the nearest hundredth. In fact, the sine, cosine and tangent of an acute angle can be defined by the ratio between sides in a right triangle. If we draw a circumcircle which passes through all three vertices, then the radius of this circle is equal to half of the length of the hypotenuse. Calculate the length of the sides below. The inverse of the sine, cosine and tangent are the arcsine, arccosine and arctangent. The rules above allow us to do calculations with the angles, but to calculate them directly we need the inverse function. So use the triangle with vertex P. Call the point at the top of the tree T Call the height of the tree H The angle formed between sides PT and QT was worked out as 108 … Okt. A line CD drawn || to AB, then is. Dividing the hypothenuse by the adjacent side gives the secant and the adjacent side divided by the opposite side results in the cotangent. Right triangle or right-angled triangle is a triangle in which one angle is a right angle (that is, a 90-degree angle). Let ABC be the right angled triangle such that ∠B = 90° , BC = 6 cm, AB = 8 cm. Well we can figure out the area pretty easily. Therefore, Area of the given triangle = 6cm 2 We get: And therefore x = 4*cos(36) = 3.24 meters. The radius of the circumcircle of a right angled triangle is 15 cm and the radius of its inscribed circle is 6 cm. Given the side lengths of the triangle, it is possible to determine the radius of the circle. This is a central angle right here. If we put the same angle in standard position in a circle of a different radius, r, we generate a similar triangle; see the right side of Figure 1. The Gergonne triangle (of ) is defined by the three touchpoints of the incircle on the three sides.The touchpoint opposite is denoted , etc. Pick the option you need. ABGiven AB = AC and D is mid-point of AC. Right Triangle Equations. Right Triangle Equations. In equilateral triangle, all three altitudes are equal in length. The rules above allow us to do calculations with the angles, but to calculate them directly we need the inverse function. 1.2.37 In Figure 1.2.4, $$\overline{CB}$$ is a diameter of a circle with a radius of $$2$$ cm and center $$O$$, $$\triangle\,ABC$$ is a right triangle, and $$\overline{CD}$$ has length $$\sqrt{3}$$ cm. For more information on inverse functions and how to calculate them, I recommend my article about the inverse function. Then to find the horizontal length x we can use the cosine. Also, the right triangle features all the … Problem. The center of the incircle is called the triangle’s incenter. If we would look from the other non-right angle, then b is the opposite side and a would be the adjacent side. Approach: Formula for calculating the inradius of a right angled triangle can be given as r = ( P + B – H ) / 2. You can verify this from the Pythagorean theorem. the radius of the circle isnscibbed in the triangle is-- Share with your friends. This is because the sum of all angles of a triangle always is 180°. A circle through B touching AC at the middle point intersects AB at P. Then, AP : BP is. p = 18, b = 24) 33 Views. Math: How to Find the Inverse of a Function. As largest side is the base, therefore corresponding altitude (h) is given by,Now, ABC is an isosceles triangle with AB = AC. Practice Problems. To calculate the other angles we need the sine, cosine and tangent. Every triangle has three sides, and three angles in the inside. The top right is fine but the other two has this clipping issue. Check you scores at the end of the test. A line CD drawn || to AB, then is. AB, BC and CA are tangents to the circle at P, N and M. ∴ OP = ON = OM = r (radius of the circle) By Pythagoras theorem, CA 2 = AB 2 + … Video Tutorial . Right triangle is the triangle with one interior angle equal to 90°. I studied applied mathematics, in which I did both a bachelor's and a master's degree. Take Zigya Full and Sectional Test Series. Our right triangle side and angle calculator displays missing sides and angles! Practice and master your preparation for a specific topic or chapter. The median of a rightangled triangle whose lengths are drawn from the vertices of the acute angles are 5 and 4 0 . (Hint: Draw a right triangle and label the angles and sides.) Now, check with option say option (d) (h = 30, and p + b = 42 (18 + 24) i.e. Right angle triangle: When the angle between a pair of sides is equal to 90 degrees it is called a right-angle triangle. I am creating a small stylised triangular motif 'before' my h1 element, but I am not able to get the corners rounded correctly. The other two angles will clearly be smaller than the right angle because the sum of all angles in a … The sine, cosine and tangent define three ratios between sides. Let the sides be 4x, 5x, 6x respectively. The term "right" triangle may mislead you to think "left" or "wrong" triangles exist; they do not. Approach: Formula for calculating the inradius of a right angled triangle can be given as r = ( P + B – H ) / 2. Now, check with option say option (d) (h = 30, and p + b = 42 (18 + 24) i.e. This other side is called the adjacent side. The acute angles of a right triangle are in the ratio 2: 3. A right triangle (American English) or right-angled triangle (British English) is a triangle in which one angle is a right angle (that is, a 90-degree angle). When we know the angle and the length of one side, we can calculate the other sides. A website dedicated to the puzzling world of mathematics. p = 18, b = 24), In a ΔABC, the side BC is extended upto D. Such that CD = AC, if and then the value of is, ABC is a triangle. If I have a triangle that has lengths 3, 4, and 5, we know this is a right triangle. When you would look from the perspective of the other angle the adjacent and opposite side are flipped. The other angles are formed by the hypothenuse and one other side. So theta = arcsin(3/5) = arccos(4/5) = arctan(3/4) = 36.87°. The product of the incircle radius and the circumcircle radius of a triangle with sides , , and is: 189,#298(d) r R = a b c 2 ( a + b + c ) . The radius of the circumcircle of a right angled triangle is 15 cm and the radius of its inscribed circle is 6 cm. Now, Altitude drawn to hypotenuse = 2cm. The value of the hypotenuse is View solution. Solution First, let us calculate the hypotenuse of the right-angled triangle with the legs of a = 5 cm and b = 12 cm. We call the angle alpha then: Then alpha = arcsin(4/5) = arccos(3/5) = arctan(4/3) = 53.13. We can check this using the sine, cosine and tangent again. So if we know sin(x) = y then x = sin-1(y), cos(x) = y then x = cos-1(y) and tan(x) = y then tan-1(y) = x. The Pythagorean Theorem is closely related to the sides of right triangles. So for example, if this was a triangle right over here, this is maybe the most famous of the right triangles. Adjusted colors and thickness of right angle: 19:41, 20. If we divide the length of the hypothenuse by the length of the opposite is the cosecant. Let's say we have a slide which is 4 meters long and goes down in an angle of 36°. Instead of the sine, cosine and tangent, we could also use the secant, cosecant and cotangent, but in practice these are hardly ever used. Practice Problems. The relation between the sides and angles of a right triangle is the basis for trigonometry.. Let O be the centre and r be the radius of the in circle. 30, 24, 25. Approach: The problem can be solved using Euler’s Theorem in geometry, which … All trigonometric functions (sine, cosine, etc) can be established as ratios between the sides of a right triangle (for angles up to 90°). Circumradius: The circumradius( R ) of a triangle is the radius of the circumscribed circle (having center as O) of that triangle. Then this angle right here would be a central angle. Right Triangle Definition. Find the length of side X in the triangle below. 18, 24, 30 . D. 18, 24, 30. r = Radius of circumcircle = 3cm. The sine of an acute angle is defined as the length of the opposite side divided by the length of the hypothenuse. An inverse function f-1 of a function f has as input and output the opposite of the function f itself. So if f(x) = y then f-1 (y) = x. 30, 24, 25. The radius of the circumcircle of the triangle ABC is a) 7.5 cm b) 6 cm c) 6.5 cm d) 7 cm So if you look at the picture above, then the hypothenuse is denoted with h. When we look from the perspective of the angle alpha the adjacent side is called b, and the opposite side is called a. asked 2 hours ago in Perimeter and Area of Plane Figures by Gaangi (13.2k points) ΔABC is an isosceles right angled triangle. The sine, cosine and tangent can be defined using these notions of hypothenuse, adjacent side and opposite side. 30, 40, 41. 6 views. It's going to be 90 degrees. These are the legs. Find the radius of the inscribed circle into the right-angled triangle with the legs of 5 cm and 12 cm long. The cosine of an acute angle is defined as the length of the adjacent side divided by the length of the hypothenuse. Show Answer . If r is its in radius and R its circum radius, then what is ← Prev Question Next Question → 0 votes . This only defines the sine, cosine and tangent of an acute angle. Then, 2x + 3x + 4x = 180° 9x = 180° x = 20° Now, AB || CD and AC be the transversalThen, If the length of the sides of a triangle are in the ratio 4 : 5 : 6 and the inradius of the triangle is 3 cm, then the altitude of the triangle corresponding to the largest side as base is. The rules above allow us to do calculations with the angles, but to calculate them directly we need the inverse function. The third side, which is the larger one, is called hypotenuse. In a right triangle, one of the angles is exactly 90°. Well we can figure out the area pretty easily. Let me draw another triangle right here, another line right there. The median of a rightangled triangle whose lengths are drawn from the vertices of the acute angles are 5 and 4 0 . shows a right triangle with a vertical side of length and a horizontal side has length Notice that the triangle is inscribed in a circle of radius 1. The longest side of the right triangle, which is also the side opposite the right angle, is the hypotenuse and the two arms of the right angle are the height and the base. Find the sides of the triangle. Pick the option you need. 2021 Zigya Technology Labs Pvt. Right Triangle: One angle is equal to 90 degrees. Circumradius: The circumradius( R ) of a triangle is the radius of the circumscribed circle (having center as O) of that triangle. Right angle triangle: When the angle between a pair of sides is equal to 90 degrees it is called a right-angle triangle. Find the length of side X in the triangle below. This content is accurate and true to the best of the author’s knowledge and is not meant to substitute for formal and individualized advice from a qualified professional. And we know that the area of a circle is PI * r 2 where PI = 22 / 7 and r is the radius of the circle. Figure 1: The angle T in both a unit circle and in a circle of radius r create a pair of similar right triangles. but I don't find any easy formula to find the radius of the circle. In a right-angle ΔABC, ∠ABC = 90°, AB = 5 cm and BC = 12 cm. This is a radius. The default option is the right one. So this is indeed equal to the angle we calculated with the help of the other two angles. Now we can check whether tan(36) is indeed equal to 2.35/3.24. Some relations among the sides, incircle radius, and circumcircle radius are: [13] D. 18, 24, 30. The tangent of an acute angle is defined as the length of the opposite side divided by the length of the adjacent side. Right Triangle: One angle is equal to 90 degrees. If you drag the triangle in the figure above you can create this same situation. 18, 24, 30 . Switch; Flag; Bookmark; 113. {\displaystyle rR={\frac {abc}{2(a+b+c)}}.} A right angled triangle is formed between point P, the top of the tree and its base and also point Q, the top of the tree and its base. So indeed we did everything correctly. asked Oct 1, 2018 in Mathematics by Tannu ( 53.0k points) circles 24, 36, 30. Find the radius of the inscribed circle into the right-angled triangle with the legs of 5 cm and 12 cm long. Ltd. Download Solved Question Papers Free for Offline Practice and view Solutions Online. Active 1 year, 4 months ago. To do this, we need the inverse functions arcsine, arccosine and arctangent. Right Triangle: One angle is equal to 90 degrees. So the central angle right over here is 180 degrees, and the inscribed angle is going to be half of that. The incircle or inscribed circle of a triangle is the largest circle contained in the triangle; it touches (is tangent to) the three sides. | 2021-12-06 23:37:07 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7423182129859924, "perplexity": 281.52122217192766}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363327.64/warc/CC-MAIN-20211206224536-20211207014536-00043.warc.gz"} |
https://math.stackexchange.com/questions/4620191/evaluating-multiple-integrals-after-it%C3%B4-taylor-expansion | # Evaluating multiple integrals after Itô-Taylor expansion
Consider an autonomous, scalar stochastic differential equation (SDE):
$$d[X(t)] = f[X(t)]\textrm{d}t + g[X(t)]\textrm{d}W(t)$$
Consider also a scalar function $$U[X(t)]$$ of the solution of the SDE.
The integral form of the Itô formula is:
$$U[X(t)] = U[X(t_0)] + \int_{t_0}^{t} L^0 U[X(s)] \textrm{d}s + \int_{t_0}^{t} L^1 U[X(s)] \textrm{d} W(s)$$
With the differential operators:
$$L^0 = f \frac{\partial}{\partial X} + \frac{1}{2} g^2 \frac{\partial^2}{\partial X^2}$$ $$L^1 = g \frac{\partial}{\partial X}$$
We consider a third-order expansion for the case of a SDE with a constant function $$g[X(t)]$$. After several applications of the Itô formula to the integrands $$U[X(t)] = f[X(t)]$$ and $$U[X(t)] = g[X(t)]$$ in the SDE, we obtain:
\begin{align} X\left(t\right) = X\left(t_0\right) & + fI_0 + gI_1 + \left(ff^\prime+\frac{1}{2}g^2f^{\prime\prime}\right)I_{00} + \left(gf^\prime\right)I_{10} \\ & +\left[f\left(ff^{\prime\prime}+f^\prime f^\prime+\frac{1}{2}g^2f^{\prime\prime\prime}\right)+\frac{1}{2}g^2\left(ff^{\prime\prime\prime}+3f^\prime f^{\prime\prime}+\frac{1}{2}g^2f^{\prime\prime\prime\prime}\right)\right]I_{000} \\ & +\left[g\left(ff^{\prime\prime}+f^\prime f^\prime+\frac{1}{2}g^2f^{\prime\prime\prime}\right)\right]I_{100} \\ & +\left[f\left(gf^{\prime\prime}\right)+\frac{1}{2}g^2\left({gf}^{\prime\prime\prime}\right)\right]I_{010} \\ & +\left[g\left(gf^{\prime\prime}\right)\right]I_{110} \\ & + R \end{align}
Where $$f$$, $$g$$, and the derivatives of $$f$$ are evaluated at $$X(t_0)$$.
This equation includes several stochastic and deterministic integrals. Some are straightforward to evaluate:
\begin{align} I_0 & = \int_{t_0}^{t}{\mathrm{d}s} = \Delta t \\ I_1 & = \int_{t_0}^{t}{\mathrm{d}W(s)} = \Delta W\left(t\right) \\ I_{00} & = \int_{t_0}^{t}\int_{t_0}^{s}{\mathrm{d}u\mathrm{d}s} = \frac{1}{2}{(t-t_0)}^2 = \frac{{\Delta t}^2}{2} \\ I_{000} & = \int_{t_0}^{t}\int_{t_0}^{s}\int_{t_0}^{u}{\mathrm{d}v\mathrm{d}u\mathrm{d}s}=\frac{{\Delta t}^3}{6} \end{align}
But others, not so much. They are the double or triple integrals of an integrand equal to 1 with respect to either the time $$\mathrm{d} s$$ or a Brownian motion $$\mathrm{d} W(s)$$:
\begin{align} I_{10} & = \int_{t_0}^{t}{\int_{t_0}^{s}{\mathrm{d}W(u)}\mathrm{d} s} \\ I_{100} & =\int_{t_0}^{t}\int_{t_0}^{s}\int_{t_0}^{u}{\mathrm{d}W(v)\mathrm{d}u\mathrm{d}s} \\ I_{010} & =\int_{t_0}^{t}\int_{t_0}^{s}\int_{t_0}^{u}{\mathrm{d}v\mathrm{d}W(u)\mathrm{d}s} \\ I_{110} & =\int_{t_0}^{t}\int_{t_0}^{s}\int_{t_0}^{u}{\mathrm{d}W(v)\mathrm{d}W(u)\mathrm{d}s} \end{align}
Could somenone please explain how to evaluate these last four integrals?
My hope is to obtain a scalar, for instance $$\sqrt{\Delta t}N(0,1)$$ as in $$I_1$$, in order to use Itô-Taylor expansion as a numerical integration scheme.
Many thanks
• You have a typo at the very top (the equation defining $X$ is not actually stochastic as written).
– Ian
Jan 17 at 19:37
• I have corrected it, thanks! Jan 18 at 17:35
You can proceed in the same manner as for the classical nested integrals. For instance, the first one is given by $$I_{10} = \int_{t_0}^t\int_{t_0}^s\mathrm{d}W_u\mathrm{d}s = \int_{t_0}^t(W_s-W_{t_0})\mathrm{d}s = \int_{t_0}^tW_s\mathrm{d}s - (t-t_0)W_{t_0}$$ Thanks to Itô's lemma applied to the quantity $$tW_t$$, it is possible to rewrite the remaining integral as follows : $$\int_{t_0}^tW_s\mathrm{d}s = \int_{t_0}^t\mathrm{d}(sW_s) - \int_{t_0}^ts\mathrm{d}W_s = tW_t-t_0W_{t_0} - \int_{t_0}^ts\mathrm{d}W_s$$ hence $$I_{10} = t(W_t-W_{t_0}) - \int_{t_0}^ts\mathrm{d}W_s$$ Recalling that $$\int_{t_0}^ts\mathrm{d}W_s$$ is gaussian with $$\mathrm{Var}\left[\int_{t_0}^ts\mathrm{d}W_s\right] = \int_{t_0}^ts^2\mathrm{d}s = \frac{1}{3}(t^3-t_0^3)$$ by Itô's isometry, we can conclude that $$I_{10} \sim \mathcal{N}\left(0,\frac{2}{3}t^3+t^2t_0+\frac{1}{3}t_0^3\right)$$ since $$\lambda_1\mathcal{N}(\mu_1,\sigma_1^2) + \lambda_2\mathcal{N}(\mu_2,\sigma_2^2) = \mathcal{N}(\lambda_1\mu_1+\lambda_2\mu_2,\lambda_1^2\sigma_1^2+\lambda_2^2\sigma_2^2)$$ for independent gaussians. The other integrals can be handled in the same way.
Finally, note that, apart from the expansion you are trying to implement, numerical methods based on finite elements are also possible for stochastic differential equations (see e.g. here or here).
Addendum. Here are further hints for the main obstacles with the other integrals. Note that we have : $$I_{100} = \int_{t_0}^tI_{10}(s)\mathrm{d}s = \int_{t_0}^t(sW_s-W_{t_0})\mathrm{d}s - \int_{t_0}^t\int_{t_0}^s\sigma\mathrm{d}W_\sigma\mathrm{d}s$$ The integral containing the term $$sW_s$$ can be tackled by the same procedure as for $$I_{10}$$, that is with the help of Itô's lemma for the quantity $$s^2W_s$$. But what to do with $$X_t := \int_{t_0}^t\int_{t_0}^s\sigma\mathrm{d}W_\sigma\mathrm{d}s$$ (this kind of integral will also appear in $$I_{010}$$) ? Recall that $$\int_{t_0}^s\sigma\mathrm{d}W_\sigma = W_{\phi(s)}$$, with $$\phi(s) := \frac{1}{3}(s^3-t_0^3)$$, hence thanks to the change of time $$\tau = \phi(s)$$ : $$X_t = \int_{t_0}^tW_{\phi(s)}\mathrm{d}s = \int_{\phi(t_0)}^{\phi(t)}W_\tau\frac{\mathrm{d}\tau}{\dot{\phi}(\phi^{-1}(\tau))} = \int_0^{\phi(t)}\frac{W_\tau}{(3\tau+t_0^3)^{3/2}}\mathrm{d}\tau$$ Applying Itô's lemma to $$\psi(\tau)W_\tau$$, where $$\psi(\tau) := \frac{-2/3}{\sqrt{3\tau+t_0^3}}$$, leads to $$X_t = \int_0^{\phi(t)}\mathrm{d}(\psi(\tau)W_\tau) - \int_0^{\phi(t)}\psi(\tau)\mathrm{d}W_\tau \sim \mathcal{N}\left(0,\phi(t)\psi(\phi(t))^2 + \int_0^{\phi(t)}\psi(\tau)^2\mathrm{d}\tau\right),$$ which I let you compute explicitly.
As for the last integral, namely $$I_{110}$$, it contains the following quantity : $$\int_{t_0}^t\mathrm{d}W_s\int_{t_0}^s\mathrm{d}W_\sigma = \int_{t_0}^t(W_s-W_{t_0})\mathrm{d}W_s = \frac{1}{2}(W_t^2-W_{t_0}^2)-\frac{1}{2}(t-t_0) + W_{t_0}(W_t-W_{t_0}),$$ where $$\int_{t_0}^tW_s\mathrm{d}W_s = \frac{1}{2}(W_t^2-W_{t_0}^2)-\frac{1}{2}(t-t_0)$$ is a well-known result obtained by Itô's lemma on $$W_s^2$$; unfortunately, it is not gaussian. The last term is not gaussian either (unless $$t_0 = 0$$, because $$W_0 = 0$$); it is to be noticed that $$\mathbb{E}[W_{t_0}(W_t-W_{t_0})] = \mathbb{E}\left[\int_{t_0}^tW_{t_0}\mathrm{d}W_s\right] = \int_{t_0}^t\mathbb{E}[W_{t_0}]\mathbb{E}[\mathrm{d}W_s] = 0$$ and $$\mathrm{Var}[W_{t_0}(W_t-W_{t_0})] = \mathrm{Var}\left[\int_{t_0}^tW_{t_0}\mathrm{d}W_s\right] = \mathbb{E}\left[\left(\int_{t_0}^tW_{t_0}\mathrm{d}W_s\right)^2\right] = \int_{t_0}^tt_0\mathrm{d}s = t_0(t-t_0)$$
• I'm a little bit confused why the last integral isn't trivial even though the integrand doesn't depend on time. It seems like in a Riemann sum for it you can just factor out $W_{t_0}$ so you get $W_{t_0}(W_t-W_{t_0})$.
– Ian
Jan 17 at 19:38
• @Ian You're right, I don't why I beat around the bush like that; I guess it's time for my brain to go to sleep... I'll edit. Jan 17 at 20:17
• Thank you very much for the detailed answer! It makes things clear. Jan 18 at 17:41 | 2023-03-30 07:24:18 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 48, "wp-katex-eq": 0, "align": 3, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.999626636505127, "perplexity": 386.0739777572711}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296949107.48/warc/CC-MAIN-20230330070451-20230330100451-00137.warc.gz"} |
https://spmaddmaths.blog.onlinetuition.com.my/2019/10/spm-additional-mathematics-2019-paper-2-question-3.html | # SPM Additional Mathematics 2019, Paper 2 (Question 3)
Question 3:
Diagram 1 shows a sector POA with centre O.
It is given that the length of arc PB is 2.56 cm. [Use π = 3.142]
Calculate
(a) ∠ POB in radians, [2 marks]
(b) the area, in cm2, of the shaded region. [4 marks]
Solution:
(a)
(b) | 2021-07-26 03:50:07 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.913270890712738, "perplexity": 11150.686947469883}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046152000.25/warc/CC-MAIN-20210726031942-20210726061942-00298.warc.gz"} |
https://physics.stackexchange.com/questions/381597/how-does-normal-reaction-work-to-provide-centrifugal-force-in-a-banked-road-when?noredirect=1 | # How does Normal reaction work to provide Centrifugal force in a banked road when some of force die to gravity is already there?
I came across the problem-
A turn of radius 20m is banked for the vehicles going at a speed 36km/hr. If the coefficient of static friction between road and the is 0.4, what are the possible speeds of a vehicle so that it neither slips down or skids up?
While solving it, I come across resolving forces along the road as frictional force, sine of force due to gravity and also Sine of Normal Reaction force which just complicates the solution
What is the way to solve this question as the solution I have just says ignore normal reaction and then solve the question, and it works. How? I mean if Normal reaction is giving the force, why is it not in the Free Body Diagram?
• – sammy gerbil Jan 22 '18 at 19:05
• Whoa that was so really different that what I asked – Ashish Shukla Jan 22 '18 at 19:07
• -1 The problem is almost identical to yours. It does not answer your particular question about normal reaction. It does show how to solve the problem. Car on a frictionless banked curve asks about the normal force. Normal reaction is needed to provide centripetal force, so it should be included in the Free Body Diagram. You have not provided the solution which you are asking about so we cannot explain why normal reaction is not in the FBD. – sammy gerbil Jan 22 '18 at 19:12
• Gonna do that quickly – Ashish Shukla Jan 22 '18 at 19:18
• The normal reaction is labelled $R$ in the diagrams. – sammy gerbil Jan 22 '18 at 19:29 | 2019-12-09 11:20:34 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.42409318685531616, "perplexity": 460.15856569779055}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575540518627.72/warc/CC-MAIN-20191209093227-20191209121227-00283.warc.gz"} |
https://matholympiad.org.bd/forum/viewtopic.php?p=20244 | ## EGMO 2013/1
For discussing Olympiad level Geometry Problems
Absur Khan Siam
Posts: 65
Joined: Tue Dec 08, 2015 4:25 pm
Location: Bashaboo , Dhaka
### EGMO 2013/1
The side $BC$ of $\triangle ABC$ is extended beyond $C$ to $D$ so that $CD = BC$.The side $CA$ is extended beyond $A$ to $E$ so that $AE = 2CA$.
Prove that if $AD = BE$, then $\triangle ABC$ is right-angled.
"(To Ptolemy I) There is no 'royal road' to geometry." - Euclid
Absur Khan Siam
Posts: 65
Joined: Tue Dec 08, 2015 4:25 pm
Location: Bashaboo , Dhaka
### Re: EGMO 2013/1
"(To Ptolemy I) There is no 'royal road' to geometry." - Euclid
thczarif
Posts: 17
Joined: Mon Sep 25, 2017 11:27 pm | 2021-03-08 13:30:03 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9237714409828186, "perplexity": 13128.573712222882}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178375439.77/warc/CC-MAIN-20210308112849-20210308142849-00084.warc.gz"} |
https://www2.math.binghamton.edu/p/calculus/resources/calculus_videos/chapter4 | Sidebar
calculus:resources:calculus_videos:chapter4
Definite Integrals
Section 4.2 in Stewart's Calculus.
Preclass Learning Objectives:
• Definite integrals calculate the area under a function over an interval.
• Riemann Sums.
• Properties of definite integrals.
Fundamental Theorem of Calculus
Section 4.3 in Stewart's Calculus.
Indefinite Integrals
Section 4.4 in Stewart's Calculus.
Preclass Learning Objectives:
• An indefinite integral of a function is its general antiderivative.
• The definite integral of a rate of change is the net change.
Integration with Substitution
Section 4.5 in Stewart's Calculus.
Preclass Learning Objectives:
• Substitution is the rule for integration which corresponds to the chain rule for differentiation.
• Introduction to integrating with substitution. | 2019-01-16 06:00:36 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9420138001441956, "perplexity": 3217.7122592626242}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547583656897.10/warc/CC-MAIN-20190116052151-20190116074151-00084.warc.gz"} |
http://math.stackexchange.com/questions/12263/b-spline-derivatives | # B-Spline Derivatives
I'm attempting to understand how B-Spline derivatives work.
To do this, i've generated some data in MATLAB to plot sin(x) over 0 - 2*pi. I then use the splinetool to fit an order 2 spline to the data which it fits perfectly. However, when I look at the 1st derivative of this sine wave data it's max is 0.017 and it's min is -0.017.
I don't understand why the derivative of this data doesn't give exactly cos(x) with a max and min of 1, -1. Any insights please?
-
Unless you specified that the derivatives of your B-spline take specific values and derivatives at specific points, in general you cannot expect your B-spline to take the exact same values as the function you're approximating at points other than the points you derived your B-spline from. – J. M. Nov 29 '10 at 0:23 The data points should be disclosed. Suppose a spline interpolates at the three points x = 0, pi, 2pi? – hardmath Nov 29 '10 at 0:41
If the slopes of such a function vary between +0.017 and -0.017 on the interval $[0,2\pi]$, then by the Mean Value Theorem there cannot be more than $0.034\pi$ or about 0.1 between the minimum and maximum function values.
So either there are no data points near the minimum and maximum of $sin(x)$ on this interval or else some error has been made in computation (perhaps a mistake in scaling the x-axis that stretches everything out). | 2013-05-20 06:45:22 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6541150808334351, "perplexity": 503.48361227134507}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2013-20/segments/1368698493317/warc/CC-MAIN-20130516100133-00056-ip-10-60-113-184.ec2.internal.warc.gz"} |
https://www.w3spoint.com/sum-of-digits-in-c-sharp | # Sum of digits in C Sharp
## Sum of digits
We are using a loop and mathematical operations to print the sum of digits in C#.
## Algorithm:
• Step 1: Take input from the user.
• Step 2: The modulus/remainder of the number is then calculated.
• Step 3: The remainder of the number is then summed.
• Step 4: The number is then divided by 10.
• Step 5: Step 2 is repeated while the number is greater than 0.
Example:
using System; public class Example { public static void Main(string[] args) { int num, sum=0, x; Console.Write("Enter a number: "); num = int.Parse(Console.ReadLine()); while(num>0) { x = num%10; sum = sum + x; num = num/10; } Console.Write("Sum of digits= " + sum); } }
Output:
Explanation:
In the above example, we are printing the sum of the digits in C#. | 2021-04-14 02:21:12 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2511943280696869, "perplexity": 2014.9292041175518}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038076454.41/warc/CC-MAIN-20210414004149-20210414034149-00263.warc.gz"} |
https://bora.uib.no/bora-xmlui/browse?rpp=20&offset=40&etal=-1&sort_by=-1&type=author&value=Abreu%2C+Henso&order=ASC | Now showing items 41-60 of 370
• #### Jet energy measurement and its systematic uncertainty in proton–proton collisions at √s=7TeV with the ATLAS detector
(Peer reviewed; Journal article, 2015-01-15)
The jet energy scale (JES) and its systematic uncertainty are determined for jets measured with the ATLAS detector using proton–proton collision data with a centre-of-mass energy of s√=7 TeV corresponding to an integrated ...
• #### Light-quark and gluon jet discrimination in pp collisions at √s = 7 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2014-08-21)
A likelihood-based discriminant for the identification of quark- and gluon-initiated jets is built and validated using 4.7 fb−1 of proton–proton collision data at √s = 7 TeV collected with the ATLAS detector at the LHC. ...
• #### Measurement of $W$ boson angular distributions in events with high transverse momentum jets at $\sqrt{s}=$ 8 TeV using the ATLAS detector
(Peer reviewed; Journal article, 2017-02)
The $W$ boson angular distribution in events with high transverse momentum jets is measured using data collected by the ATLAS experiment from proton--proton collisions at a centre-of-mass energy $\sqrt{s}=$ 8 TeV at ...
• #### Measurement of angular and momentum distributions of charged particles within and around jets in Pb+Pb and pp collisions at √sNN=5.02 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2019)
Studies of the fragmentation of jets into charged particles in heavy-ion collisions can provide information about the mechanism of jet quenching by the hot and dense QCD matter created in such collisions, the quark-gluon ...
• #### Measurement of azimuthal anisotropy of muons from charm and bottom hadrons in Pb+Pb collisions at √sNN=5.02 TeV with the ATLAS detector
(Journal article; Peer reviewed, 2020-08-10)
Azimuthal anisotropies of muons from charm and bottom hadron decays are measured in Pb+Pb collisions at √sNN = 5.02 TeV. The data were collected with the ATLAS detector at the Large Hadron Collider in 2015 and 2018 with ...
• #### Measurement of azimuthal anisotropy of muons from charm and bottom hadrons in pp collisions at √s=13 TeV with the ATLAS detector
(Journal article; Peer reviewed, 2020)
The elliptic flow of muons from the decay of charm and bottom hadrons is measured in pp collisions at √s=13 TeV using a data sample with an integrated luminosity of 150 pb−1 recorded by the ATLAS detector at the LHC. The ...
• #### Measurement of charged-particle spectra in Pb+Pb collisions at (Formula presented.) = 2.76 TeV with the ATLAS detector at the LHC
(Peer reviewed; Journal article, 2015-09-09)
Charged-particle spectra obtained in Pb+Pb interactions at sNN−−−√=2.76 TeV and pp interactions at sNN−−−√=2.76 TeV with the ATLAS detector at the LHC are presented, using data with integrated luminosities of 0.15 nb−1 and ...
• #### Measurement of colour flow using jet-pull observables in tt¯events with the ATLAS experiment at √s=13 TeV
(Peer reviewed; Journal article, 2018-10)
Previous studies have shown that weighted angular moments derived from jet constituents encode the colour connections between partons that seed the jets. This paper presents measurements of two such distributions, the ...
• #### Measurement of differential cross sections and W+/W− cross-section ratios for W boson production in association with jets at s√=8 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2018-05-11)
This paper presents a measurement of the W boson production cross section and the W +/W − cross-section ratio, both in association with jets, in proton-proton collisions at 𝑠√=8 TeV with the ATLAS experiment at the Large ...
• #### Measurement of differential cross sections for single diffractive dissociation in √s = 8 TeV pp collisions using the ATLAS ALFA spectrometer
(Journal article; Peer reviewed, 2020-02-06)
A dedicated sample of Large Hadron Collider proton-proton collision data at centre-of-mass energy s√ = 8 TeV is used to study inclusive single diffractive dissociation, pp → X p. The intact final-state proton is reconstructed ...
• #### Measurement of differential cross sections of isolated-photon plus heavy-flavour jet production in pp collisions at √s = 8 TeV using the ATLAS detector
(Peer reviewed; Journal article, 2018-01-10)
This Letter presents the measurement of differential cross sections of isolated prompt photons produced in association with a b-jet or a c-jet. These final states provide sensitivity to the heavy-flavour content of the ...
• #### Measurement of differential cross-sections of a single top quark produced in association with a W boson at s√=13TeV with ATLAS
(Peer reviewed; Journal article, 2018-03-06)
The differential cross-section for the production of a W boson in association with a top quark is measured for several particle-level observables. The measurements are performed using 36.1fb^−1 of pp collision data collected ...
• #### Measurement of dijet azimuthal decorrelations in pp collisions at √s=8 TeV with the ATLAS detector and determination of the strong coupling
(Peer reviewed; Journal article, 2018-11-07)
A measurement of the rapidity and transverse momentum dependence of dijet azimuthal decorrelations is presented, using the quantity RΔϕ. The quantity RΔϕ specifies the fraction of the inclusive dijet events in which the ...
• #### Measurement of distributions sensitive to the underlying event in inclusive Z boson production in pp collisions at √s = 13 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2019-08-08)
This paper presents measurements of charged-particle distributions sensitive to the properties of the underlying event in events containing a Z boson decaying into a muon pair. The data were obtained using the ATLAS detector ...
• #### Measurement of distributions sensitive to the underlying event in inclusive Z-boson production in pp collisions at √s = 7 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2014-12-10)
A measurement of charged-particle distributions sensitive to the properties of the underlying event is presented for an inclusive sample of events containing a TeX -boson, decaying to an electron or muon pair. The measurement ...
• #### Measurement of fiducial and differential W+W−production cross-sections at √s=13 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2019-10-29)
A measurement of fiducial and differential cross-sections for W+W− production in proton–proton collisions at s√=13 TeV with the ATLAS experiment at the Large Hadron Collider using data corresponding to an integrated ...
• #### Measurement of flow harmonics correlations with mean transverse momentum in lead–lead and proton–lead collisions at √sNN−−−=5.02 TeVwith the ATLAS detector
(Peer reviewed; Journal article, 2019-12-03)
To assess the properties of the quark–gluon plasma formed in ultrarelativistic ion collisions, the ATLAS experiment at the LHC measures a correlation between the mean transverse momentum and the flow harmonics. The analysis ...
• #### Measurement of flow harmonics with multi-particle cumulants in Pb+Pb collisions at (Formula presented.) TeV with the ATLAS detector
(Peer reviewed; Journal article, 2014-11-26)
ATLAS measurements of the azimuthal anisotropy in lead–lead collisions at TeX TeV are shown using a dataset of approximately 7 TeX b TeX collected at the LHC in 2010. The measurements are performed for charged particles ...
• #### Measurement of forward-backward multiplicity correlations in lead-lead, proton-lead, and proton-proton collisions with the ATLAS detector
(Peer reviewed; Journal article, 2017-06)
Two-particle pseudorapidity correlations are measured in $\sqrt{s_{\rm{NN}}}$ = 2.76 TeV Pb+Pb, $\sqrt{s_{\rm{NN}}}$ = 5.02 TeV $p$+Pb, and $\sqrt{s}$ = 13 TeV $pp$ collisions at the LHC, with total integrated ...
• #### Measurement of Higgs boson production in the diphoton decay channel in $pp$ collisions at center-of-mass energies of 7 and 8 TeV with the ATLAS detector
(Peer reviewed; Journal article, 2014-12-24)
A measurement of the production processes of the recently discovered Higgs boson is performed in the two-photon final state using 5.4 fb$^{-1}$ of proton-proton collisions data at $\sqrt{s}=7$ TeV and 20.3 fb$^{-1}$ ... | 2021-10-18 15:58:01 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9095742702484131, "perplexity": 4479.712693632469}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585204.68/warc/CC-MAIN-20211018155442-20211018185442-00388.warc.gz"} |
https://www.albert.io/ie/gre/donut-day | Free Version
Easy
# Donut Day
GRE-U1VKAX
It's National Donut Day at the Statistics, Inc. office in Chicago! An employee polled the thirty people in the office and asked how many donuts they had for breakfast that morning. The data is shown in the frequency distribution below:
Number of Donuts Frequency
0 5
1 13
2 8
3 4
Total 30
What is the mean number of donuts consumed? Round to two decimal places as needed.
A
$0.87$ donuts
B
$1.37$ donuts
C
$1.75$ donuts
D
$1.98$ donuts
E
$2.74$ donuts | 2017-02-27 18:33:06 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6322021484375, "perplexity": 9639.07552149603}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-09/segments/1487501173405.40/warc/CC-MAIN-20170219104613-00575-ip-10-171-10-108.ec2.internal.warc.gz"} |
http://clay6.com/qa/21944/find-the-sum-of-the-series-1-4-2-5-3-6-upto-20-terms- | Browse Questions
# Find the sum of the series 1.4 + 2.5 + 3.6----- upto 20 terms.
$\begin{array}{1 1} 2500 \\ 1560 \\ 8270 \\ 3500 \end{array}$
$Explanation : \;T_{n}=n(n+3)$
$=n^2+3n$
$S_{n}=\sum\;T_{n}=\sum\;n^2+3\;.\sum\;n$
$=\large\frac{n(n+1)(2n+1)}{6}+3\;.\large\frac{n(n+1)}{2}$
$S_{20}=\large\frac{20*21*41}{6}+3\;.\large\frac{20*21}{2}$
$=2870+630$
$=3500.$
edited Jan 24, 2014 | 2017-01-23 16:58:48 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9051951766014099, "perplexity": 3509.103127194086}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-04/segments/1484560282935.68/warc/CC-MAIN-20170116095122-00011-ip-10-171-10-70.ec2.internal.warc.gz"} |
https://apple.stackexchange.com/questions/357487/keynote-equation-is-it-possible-to-predefine-latex-macros | # Keynote equation: is it possible to predefine LaTeX macros?
Is it possible to add to the LaTeX preamble for the Keynote equation tool? For example, the default setting is that \vec{x} generates an arrow over the letter x, but I would like this to produce a bold x. | 2020-02-27 17:31:15 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.987311840057373, "perplexity": 1384.9305447640256}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875146744.74/warc/CC-MAIN-20200227160355-20200227190355-00017.warc.gz"} |
https://proofwiki.org/wiki/Category_of_Vector_Spaces_is_Category | # Category of Vector Spaces is Category
## Theorem
Let $\mathbf{Vect}$ be the category of vector spaces.
Then $\mathbf{Vect}$ is a metacategory. | 2022-10-05 09:02:59 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8468972444534302, "perplexity": 737.1538327684298}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030337595.1/warc/CC-MAIN-20221005073953-20221005103953-00652.warc.gz"} |
https://docs.deistercloud.com/content/Axional%20development%20tools.15/Axional%20Studio.4/Development%20Guide.10/Languages%20reference.16/XSQL%20Script.10/Packages.40/http/http.request.JRepAdapter.postURL.xml?embedded=true | Allows to add an URL to the adapter to access in the following form load. The URL can be both an internal URL of the system Axional Studio or external addresses. Also, it is possible to indicate where and in what way you want to visualize the URL, for this the mode attribute is used and it allows the following options:
• modal: The URL is opens in a modal window, on the current form.
• new: The URL is opens in a new window.
• self: The URL is opens in the current window, replacing the form.
This function needs both a request and an adapter; so it can be only used from a script called from the form. In this way, it is either called from the main process of the object, or from a button, or from the transaction manager. Note that the URL is linked to the adapter and can be lost when the adapter is recharged. Such recharging may occur because the adapter expires, because its recharging has been forced or for example, if it is called from a button of the type Run and refresh, in which case, the URL will never open.
#### Deprecated
Deprecated since September 2017. Instead of it, use cursor.postUrl.
<http.request.JRepAdapter.postURL mode='modal|new|self'> <url /> !</http.request.JRepAdapter.postURL>
Example
Example of a process to open an extern URL towards http://www.deister.net. If this process is performed from a form button of type Rum; after doing click on the button, the page is reloaded and a new one is opened with the address http://www.deister.net
Copy
<xsql-script name='http_connection_getAttr'>
<body>
<if>
<then>
<string>http://www.deister.net</string>
</then>
</if>
</body>
</xsql-script>
Example
Example of a button which opens a Axional Studio form.
Copy
<xsql-script name='http_connection_getAttr'>
<body>
<if>
</xsql-script> | 2021-04-18 02:48:19 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.34023743867874146, "perplexity": 1475.8536582951383}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038464146.56/warc/CC-MAIN-20210418013444-20210418043444-00538.warc.gz"} |
https://it.mathworks.com/help/vision/ref/insertobjectannotation.html | # insertObjectAnnotation
Annotate truecolor or grayscale image or video stream
## Description
example
RGB = insertObjectAnnotation(I,shape,position,label) returns a truecolor image annotated with shape and label at the location specified by position.
example
insertObjectAnnotation(I,"rectangle",position,label) inserts rectangles and labels at the location indicated by the position matrix.
insertObjectAnnotation(I,"circle",position,label) inserts circles and corresponding labels at the location indicated by the position matrix.
example
___ = insertObjectAnnotation(___,Name=Value) specifies options using one or more name-value arguments in addition to the previous syntax. For example,insertObjectAnnotation(I,"rectangle",position,label_str,FontSize=18) sets the annotation font size to 18.
## Examples
collapse all
Create labels of floating point numbers. The floating point numbers relate to confidence value labels.
label_str = cell(3,1);
conf_val = [85.212 98.76 78.342];
for ii=1:3
label_str{ii} = ['Confidence: ' num2str(conf_val(ii),'%0.2f') '%'];
end
Set the position for the rectangles in the form of [x y width height].
position = [23 373 60 66;35 185 77 81;77 107 59 26];
Insert the labels.
RGB = insertObjectAnnotation(I,"rectangle",position,label_str,TextBoxOpacity=0.9,FontSize=18);
Display the annotated image.
figure
imshow(RGB)
title("Annotated chips");
Read an image into the workspace.
Set the positions on the image for the circle shapes. The first two values represents the center at (x,y) and the third value is the radius.
position = [96 146 31;236 173 26];
Set the label to display the integers 5 and 10 (U.S. cents).
label = [5 10];
Insert the annotations.
RGB = insertObjectAnnotation(I,"circle",position,label,LineWidth=3,Color=["cyan","yellow"],TextColor="black");
Display.
figure
imshow(RGB)
title("Annotated coins");
## Input Arguments
collapse all
Truecolor or grayscale image, specified as an image or video stream. The input image can be either an M-by-N-by-3 truecolor or a M-by-N 2-D grayscale image.
Data Types: double | single | uint8 | uint16 | int16
Shape of annotation, specified as "rectangle" or "circle"
Data Types: char
Position of shape, specified according to the type of shape, described in the table.
ShapePositionExample
"rectangle"For one or more rectangles, specify M-by-4 matrix where each row specifies a rectangle as $\left[\begin{array}{cccc}x& y& width& height\end{array}\right]$.
$\left[\begin{array}{cccc}{x}_{1}& {y}_{1}& widt{h}_{1}& heigh{t}_{1}\\ {x}_{2}& {y}_{2}& widt{h}_{2}& heigh{t}_{2}\\ ⋮& ⋮& ⋮& ⋮\\ {x}_{M}& {y}_{M}& widt{h}_{M}& heigh{t}_{M}\end{array}\right]$
Two rectangles, M=2
"circle"An M-by-3 matrix, where each row is a vector specifying a circle as $\left[\begin{array}{ccc}x& y& radius\end{array}\right]$. The $\left[\begin{array}{cc}x& y\end{array}\right]$ coordinates represent the center of the circle.
$\left[\begin{array}{ccc}{x}_{1}& {y}_{1}& radiu{s}_{1}\\ {x}_{2}& {y}_{2}& radiu{s}_{2}\\ ⋮& ⋮& ⋮\\ {x}_{M}& {y}_{M}& radiu{s}_{M}\end{array}\right]$
"projected-cuboid"
An 8-by-2-by-M array or an M-by-8 matrix, where M specifies a projected cuboid.
When specified as an 8-by-2-M array, each row must contain the $\left[\begin{array}{cc}x& y\end{array}\right]$ location of a projected cuboid vertex. The vertices are connected to form a cuboid with six faces. The order of the input vertices must match the order shown in the diagram.
When specified as an M-by-8 matrix, each row specifies the front-facing and rear-facing sides of a projected cuboid in the form,
$\left[\begin{array}{cccccccc}x1& y1& w1& h1& x2& y2& w2& h2\end{array}\right]$
where, [x1 y1] and [x2 y2] specify the upper-left coordinates of the front-facing and back-facing sides, respectively. [w1 h1] and [w2 h2] specify the corresponding width and height.
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Label to associate with a shape, specified as an M numeric vector, string, categorical labels, or a cell array of ASCII character vectors. The character, string, or categorical labels must be encoded as ASCII characters. The cell array must be the of length equal to the number of shape positions. You can specify a scalar label for all shapes as a numeric scalar, string, or categorical.
Example: label = [5 10], where the function marks the first shape with the label, 5, and the second shape with the label, 10.
### Name-Value Arguments
Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose Name in quotes.
Example: Color="white" sets the color for the label text box to white.
Font face of text, specified as a character vector. The font face must be one of the available truetype fonts installed on your system. To get a list of available fonts on your system, type listTrueTypeFonts at the MATLAB® command prompt.
Data Types: char
Label text font size, specified as an integer that corresponds to points in the range of [8 72].
Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
Shape border line width, specified as a positive scalar integer in pixels.
Shape color, specified as a character vector, cell array of character vectors, vector, or an M-by-3 matrix. You can specify a different color for each shape or one color for all shapes. Color values must be specified in the range [0,255]. Values that have a range of [0,1] must be scaled by a value of 255 before using it with this function. For example, [255 255 255].*colorvalue.
Supported colors are: "blue", "green", "red", "cyan", "magenta", "yellow","black", and "white".
ColorFormatExample
Specify one color for all shapes
String or character color name
"r"
"red"
1-by-3 vector (RGB triplet)
[255 0 0]
Specify a color for each shapeM-element vector
["red","yellow","blue"]
M-by-3 matrix, as a list of RGB values
255 0 0
255 0 0
0 255 255
Data Types: cell | char | uint8 | uint16 | int16 | double | single
Color of text in text label, specified as a character vector, an [R G B] vector, a cell array, or an M-by-3 matrix. To specify one color for all text, set this parameter to either a character vector or an [R G B] vector. To specify a color for each of the M text labels, set this parameter to a cell array of M character vectors. Alternatively, you can specify an M-by-3 matrix of RGB values for each annotation. RGB values must be in the range of the input image data type.
Supported colors: "blue", "yellow","green", "cyan", "red", "magenta", "black", and "white".
Data Types: char | uint8 | uint16 | int16 | double | single | cell
Opacity of text label box background, specified as a scalar defining the opacity of the background of the label text box. Specify this value in the range of 0 to 1.
Data Types: double | single | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64
## Output Arguments
collapse all
Truecolor image with annotation, returned as an image or video stream.
Data Types: double | single | uint8 | uint16 | int16
## Version History
Introduced in R2012b
expand all | 2023-01-28 14:02:08 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 7, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7152361273765564, "perplexity": 5349.708501808785}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764499634.11/warc/CC-MAIN-20230128121809-20230128151809-00792.warc.gz"} |
https://datascience.stackexchange.com/questions/109416/assess-overfitting-all-model-metrics-or-only-specific-metric/109418#109418 | # Assess overfitting - All model metrics or only specific metric?
I am working on a binary classification using random forest with 977 records with 77:23 class proportion
I got the below performance in train and test data (AUC = 81)
Train data
Test data
My metric of interest is F1-score because my dataset is imbalanced.
So, based on the above classification report, we can infer that drop in F1-score is not huge between train and test. Am I right to understand that?
How much is considered a huge drop?
Should I be worried about Precision and Recall values being dropped heavily? I don't assess my model based on precision and recall indvidually. Should I just focus on F1 and conclude whether my model is overfit or not? Or all the metrics should have some decent/gradual drop?
If we see 1.00 for any of the metric, is it sure shot way to say that model is overfitting?
update - new run screnshot - 7 point drop in f1-score | 2022-08-18 19:14:30 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.18780635297298431, "perplexity": 1900.9810713076006}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882573399.40/warc/CC-MAIN-20220818185216-20220818215216-00348.warc.gz"} |
https://mazebert.com/forum/news/luck-custom-tower-stats--id822/ | ×
# Luck & custom tower stats
[latexpage] Today I added luck as a new property for towers (in YouTD this is called trigger chance). For those of you who are unfamiliar with the concept, I will try to give a short explanation: Beaver has a 20% chance to stun a creep. Now, if you give an item to him that grants 10% more luck, his chance to stun is increased. Old chance to stun (0% luck): $$\label{eq:luck} p(20\%, 0\%) = 20\% + 0\% * 20\% = 20\%$$ New chance to stun (10% luck): $$\label{eq:luck} p(20\%, 10\%) = 20\% + 10\% * 20\% = 22\%$$ So luck will be a very nice option to buff some towers, for example Beaver, Pocket Thief or the new Shadow tower! [caption id="attachment_895" align="aligncenter" width="200"] Lucky pants increase the luck of your tower.[/caption] I also created a new item with this ability, the Lucky Pants you see in the image above. Plus, there is a new skill to master regarding luck, the Trickster. The skill is available if your player is at least level 18. [caption id="attachment_910" align="aligncenter" width="300"] Master the new trickster skill![/caption] Because luck didn't fit anymore on the tower stats, I did a little re-layout. I also implemented Mr. Gonzalez's feature request to show custom boni for certain towers. Have a look at Knusperhexe and Shadow below. [caption id="attachment_920" align="alignleft" width="200"] You see the amounts of creeps the witch already ate.[/caption][caption id="attachment_921" align="alignleft" width="200"] For Shadow, you see the amount of adaption done so far.[/caption]
Hey andy I was wondering about the whole luck thing if there is a cap you can't go above and if it changes per effect. Here is the thing see scarface with 3 pants of luck has about +120 % level 99 right, and 60% ish to refire. However mine managed to hit x1 so it is apparently not possible to have 100% chance of having a special effect going on. Like scarface. let's say it's 80% or something, is it the same with like a beaver? or does every tower have their proc chance limit on effects ?
Yes, your observation is right! All luck-improved chances have a cap of max. 80%. Otherwise Scarface would be able to shoot indefinitely, same for Beavers' stun and so on.
So shadow skill chance at lv99 = 5%+5%=10% If i equiped him with 4x pants = 40%x4 = 120% New adaptations chance (120% luck) 10%+120%*10%= 22% Is that rite? Dang, still low chance. I need luck potion to boost the chance :( | 2022-12-06 00:35:34 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 2, "x-ck12": 0, "texerror": 0, "math_score": 0.5612139105796814, "perplexity": 5462.878693118937}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446711064.71/warc/CC-MAIN-20221205232822-20221206022822-00823.warc.gz"} |
http://seanbowman.me/blog/clue-sat-logic/ | Software! Math! Data! The blog of R. Sean Bowman
The blog of R. Sean Bowman
The game of Clue (Clue, Logic, and SAT Solvers)
July 13 2016
I like the game Clue (called Cluedo in some parts of the world). I played it with my family when I was young, and we always had a great time. In college I wrote several programs to try to deduce what cards players were holding, but there was always some deduction my program missed. I started thinking about Clue again recently, and found much to think about. Frankly, this was a bit surprising to me! Isn’t Clue pretty straightforward?
Short answer: no, I guess not. Although I originally wanted a "clue assistant" program, I ended up with a platform for agents to play Clue against themselves; you can see the code here. In the course of writing and thinking about the game, I discovered a fascinating new way to deduce cards and answered a small question in dynamic epistemic logic.
The basics
Clue is a board game, but I’m really only interested in the deduction part. So I’ll leave all the extraneous stuff out and describe a core version of Clue.
• There are 3-5 players.
• There are three types of cards, “suspects”, “weapons”, and “rooms”. In the version of Clue I have, there are six suspect cards, six weapon cards, and six room cards.
• One card of each type is chosen at random and put in a “secret box” that no player can see.
• After this, the cards are shuffled and distributed as evenly as possible among the players.
The narrative behind Clue is that players are solving a murder mystery. The goal is to discover the identity of the murderer, the weapon they used, and the location the murder occurred by deducing the three cards in the “secret box”. The game proceeds like this:
• The first player makes a “suggestion”, announcing that they believe the murder was committed by particular person with a particular weapon in a particular room (these correspond to cards; note that they player need not hold the cards themselves).
• The player to the left must either refute the suggestion by showing (secretly) one of the suggested cards, or, if they have none of the cards suggested, pass to the next player.
• This process continues until the suggestion is refuted or all the players have passed.
At the end of their turn, a player may either make an “accusation”, stating that they know the secret cards, or end their turn, letting the next player have their turn.
A Knowledge Game
Note the information we get from a suggestion: if we’re doing the suggesting, we might see one of the cards we suggested. We might find out that a player has none of the cards suggested. And if we’re not doing the suggesting, we might find out that some player has one of the suggested cards, but we don’t know which one.
From this information, it is possible to deduce the locations of cards. With some practice and a note taking system, people get pretty good at playing Clue. But the point is that Clue is a knowledge game. The state of the game does not change; only the knowledge of the actors over time does. We’ll come back to this later, but first, how do we encode our knowledge of what cards are where?
For simplification, well denote players as P1, P2, and so on, and use a predicate $has(p, c)$ to mean that player $p$ has card $c$. So for example we might know that P1 has the Miss Scarlett card, written $has(P1, MissScarlett)$. If we know that a player doesn’t have a card, we’ll write $\neg has(p, c)$. If we know two facts, we join them with $\wedge$, so that $has(P1, c)\wedge has(P2, c')$ means that P1 has card $c$ and P2 has a different card $c'$. Sometimes we only know that one of several things is true; we write this with $\vee$. So $has(P1, c)\vee has(P2, c)$ means that either P1 or P2 has card $c$, but we don’t know which.
Propositional logic
Now we’re in a position to write down what we know about what cards are where. For example, if we make a suggestion and are shown card $c$ by player $p$, we now know $has(p, c)$. If player $p$ cannot refute our suggestion of “Mr. Green with the knife in the parlor,” we know $\neg has(p, MrGreen)\wedge \neg has(p, knife) \wedge \neg has(p, parlor)$. Finally, if P2 makes the suggestion of three cards $c_1, c_2, c_3$ and we see P3 show P2 a card, we know that $has(P2, c_1)\vee has(P2, c_2)\vee has(P2, c_3)$. This knowledge, combined with our knowledge of the cards we hold at the beginning of the game, allows us to make deductions about what cards other players hold. This type of logic is known as propositional logic and simple versions are studied by most college students in some form or another.
Some semi-technical details
Here are some vague ideas about how this can be done automatically, with a computer. First, we need to tell the computer some facts about the game:
1. Every card is either held by exactly one player or is in the secret box,
2. Each player has some number of cards (we can see how many; this is not a secret), and
3. There are exactly three cards in the secret box, one of each type.
It is somewhat tedious but not difficult to formalize these statements and have the computer understand them.[1] Then we add our knowledge of our own cards and what we’ve seen so far from our observation of the game. We take all these facts and feed them in to a so called SAT solver, short for satisfiability solver. This allows us to deduce locations of certain cards in the following way: we hypothesize that a certain player has a certain card. If the SAT solver tells us there are no satisfying truth assignments to the resulting sentence in propositional logic, our hypothesis must have been incorrect, and so that player cannot possess that card. On the other hand, if we hypothesize that a player does not have a card and the SAT solver does not find a solution, then we know that that player must have the card. If the SAT solver finds a solution in either case, we learn nothing except that they player may hold the card.
Probability, etc.
In fact, SAT solvers can be used to tell us the probabilities that certain players hold certain cards, from our point of view. I believe that these probabilities correspond exactly to what you’d get by using Bayes’ theorem repeatedly assuming uniform priors.
To get probabilities, you need your SAT solver to enumerate all models (truth assignments) that satisfy your current state of knowledge. Take note of how many times $has(p, c)$ is true in the truth assignment returned by the SAT solver for the players and cards you’re interested in. The probability that $p$ holds $c$ is just that number divided by the total number of models.
This isn’t hard, but it is time consuming, and I’m not sure how much it gets us, so I have left it out of most of my experiments.
Epistemic explorations
So far, we have a computerized assistant that allows us to use all the information from the game to deduce locations of cards. Clearly this is a great help in playing Clue. This is the program I was trying to write in college! At the time I realized that this is a good way to formalize deduction in Clue, I believed that this method used all the information available to the player.
And so, being a mathematically minded fellow and always wondering if we can know a bit more, I began to think about what a player can know about another player’s knowledge. Above, we considered only our knowledge about what cards are where. What can we say about what other players know about the locations of cards? For example, if we know that P2 has card $c$, we can ask the question “does P3 know that P2 has $c$?”
Once we start thinking about these types of questions, there’s really no end to the madness we can create. For example, we can ask things like “does P1 know that I know that P2 doesn’t know that P1 has the kinfe card?” Of course, this is crazy and probably unhelpful, but if we’re able to reason about the knowledge of players, we should ideally be able to reason about arbitrary questions like this.
Common knowledge
As a special case of the knowledge of other players, let’s talk about common knowledge, which you can take to mean in the informal sense of “everybody knows this” if you like. But the real kind of common knowledge I’m thinking of is (as the wikipedia link describes) facts that all players know, that all players know all players know, that all players know that all players know all players know, and so on.
Common knowledge in Clue takes the form of “announcements” that can be seen by everybody: either a player shows a card to another player (but we don’t see which card) or a player passes. This is knowledge that is available to everybody at the table, even an observer who never sees a single card during the entire game. Therefore we represent common knowledge as a silent player, the observer, who does not participate except to observe all actions of the other players.
Using common knowledge, we can divide the deduction constraints in to three groups: constraints on the game itself (each card can be held by at most one player, together with the rest listed previously), constraints given by common knowledge, and constraints given by an individual player’s knowledge of the cards they hold together with the cards other players have shown them.
Note that the vast majority of the constraints come from the first two groups! Clue is a game decided by the very little, but very important, knowledge of the players themselves.
Epistemic logic (and more!)
I’m interested in questions about what we can know about other players’ knowledge in Clue because… well, these questions are interesting to me per se. But there’s another motivation for thinking about this stuff. I began to have my doubts that all the available information was being used in the deduction engine I described above. First of all, it’s clear that other players’ knowledge is not being used in the scheme I describe. But does adding in this extra information actually help us play Clue? I could not give examples where it would, nor prove that it couldn’t.
So, I did a bit of reading. It turns out that people have thought some about Clue, including modeling the game in a theorem prover (Modeling Epistemic Actions in Coq), describing how the knowledge of actors changes over time (Specifying and Verifying the Game Cluedo Using Temporal Logics of Knowledge), and describing player actions using Epistemic modal logic in Description of actions in Cluedo by Hans van Ditmarsch. This last paper especially got my attention.
Epistemic logic is a type of modal logic that allows reasoning about the knowledge of agents. There are several of these logics, but we’ll focus on one called S5. Whereas above we could only make statements or hypotheses like $has(p, c)$ or $\neg has(P1, knife)$, in S5 we can say things like "P1 knows that P2 has the kitchen card." This would be written like $K_1 has(P2, kitchen)$. We can say much more complicated things, too, like $K_2 (\neg K_1 has(P2, pipe) \vee has(P1, revolver))$. This says "player 2 knows that either player 1 doesn’t know that player 2 has the pipe, or player 1 has the revolver. Clearly these types of statements and questions can get quite complicated.[2]
New (actionable?) information
Epistemic logic is pretty cool. Being able to reason about the knowledge of others is a powerful concept. In the above paper, the author considers an idealized card game not unlike Clue. The game is modeled much as we did above, with “knowledge actions” (actions that transmit information) of showing a card to another player or announcing that you have none of the suggested cards. But a third possibility is included, that of ending your turn without making an accusation. This caught my attention.
Ending your turn seems like a completely innocent act, doesn’t it? When I played Clue for years, I always ended my turn, thinking “yay I learned something” or “I need to record some or another bit of info.” I never thought of ending my turn as a potential source of information for other players. And upon reflection, it’s not entirely clear to me that it does give any useful information. So… does it?
Van Ditmarsch himself asks a strong version of this question at the end of the paper: Can it be that no player knows the secret cards just before a player announces the end of their turn, but once this act has occurred, some other player is able to deduce the secret cards?[3] Note there that we’re talking about deducing the secret cards from the fact that a player ended their turn without making an accusation, not just that some player was slow in figuring out what the secret cards are.
In general, can a player learn anything at all from the fact that a player ended their turn without making an accusation? What a great question! I wanted to know the answer.
Epistemic logic without the modal part
Well we could write our own model checker for S5, or use one of a few interesting academic ones I found. For a while I got excited about writing one, just to be able to answer (maybe?) the crazy questions above (does P2 know that P1 doens’t know that…). I looked in to it and came to the conclusion that it would be a big undertaking. I don’t shy away from difficult things, and frankly I’d still like to write a model checker for a suitably restricted “card game oriented” S5, but I don’t have the time or energy right now. So: is there a way to answer epistemic questions, maybe just simple ones, using the propositional logic framework described above?
Yes, it turns out to be pretty easy, in fact.[4] Suppose that a player (P2, say) passes, and we want to try to make interesting deductions from that. What information can we use? As before, we can use the constraints on the game itself as well as the common knowledge obtained by all players so far. We can also use our knowledge of what P2 knows. We must be careful here, because although we may know, say, that P3 has card $c$, P2 might not know that. What we can say is that although P2 might not know that P3 has card $c$, P2 certainly knows that they don’t have card $c$. So we come up with a list of cards P2 knows they have (because we know they have them) and a list of cards they know they don’t have (because we know they don’t have them) and throw them in to our SAT solver.
For every card $c$ we know P2 might have, we assume they have that card. If the SAT solver tells us that they can deduce the secret cards from holding $c$, then they must not hold $c$! Otherwise they would not have passed! Similarly, if we assume that they don’t hold card $c$ and find that they could deduce the secret cards, then they must in fact hold $c$. Easy as pie, and if we manage to figure out that P2 holds or doesn’t hold some card using this technique, we can go back an re-examine all the other cards we’re unsure about. In that way, we may be able to obtain information about a bunch of cards at once.
Why is it important for us to work outside the propositional framework we outlined above? That framework allowed us only to reason about our own knowledge. Here, we have used “higher order knowledge” at least twice: once because we are considering what happens when a player announces that they don’t know the secret cards (we know that they don’t know the cards), and again when we assemble our knowledge about what the player knows (we know that they know that they have/don’t have a certain card).
Butt-kicking Cluebots
Now I needed data from a bunch of games, but they’re slow to play and my friends and family got bored of me constantly talking about Clue. So I had the computer play itself – you can have a look at the code if you like. The computer agents play fairly aggressively with the single aim of trying to deduce the secret cards. They’re pretty good at logic, too, using the SAT solver and being computers as they are. When one is able to deduce the secret cards at the end of their turn, they win.
Remember, the question we asked above is whether it is possible for a player to deduce the location of cards from the fact that an opponent passed at the end of their turn. And the short answer is: yes! It is possible! In fact, I observed a game in which an agent wins using this strategy. This answers van Ditmarsch’s question above in the affirmative.
A note on real live, idealized assumptions, and disappointment
Note that the strategy described above doesn’t work very well in the real world. I know from my own experience that not all Clue players use all the information available to them and might not even realize that they have enough information to win the game. (For one, I am usually playing for fun, do not keep track of all the information I could, and probably couldn’t process it all even if I did keep track of it – so there is at least one crappy Clue player among us!) If a player passes at the end of their turn because they don’t realize that they can win, we may make erroneous conclusions about the cards they hold.
So, before you get too excited about trouncing your family, classmates, or colleagues at Clue, consider that the above strategy will probably backfire badly. (Unless, you know, your family, classmates, or colleagues are really, really good at logic or very quick with the boolean satisfiability problem.)
Other stuff I learned
Although the main motivation for writing this software was to answer the epistemic questions above, I ended up collecting more data. One interesting and slightly surprising thing I found was that the common knowledge “observer” who watches the game but never sees any specific cards held by players knows quite a lot at the end of the average game. With four players, on average about one secret card was known to the observer just before then end of the game. The observer knew a lot about cards held by individual players, too.
Conclusion
I wrote a program to help me win at Clue. I ended up with a program that played itself at Clue. I learned some things about Clue, logic, and software development that might be interesting to other people. I would love to write more about this at some point.
1. While encoding these constraints I found a neat identity that allows us to convert formulas for the game constraints, written most naturally in DNF, to CNF, which the SAT solver expects. Nifty! ↩︎
2. As a small aside, (temporal) epistemic logic and common knowledge can get incredibly weird and complicated. Our intuition of what common knowledge is (or at least my intuition) is not very good. See the link above on common knowledge, which explains the “blue islander puzzle”, as well as Terry Tao’s post on epistemic logic and this puzzle. (The latter is not for the faint of heart as the math/logic gets quite complicated.) ↩︎
3. Here is the exact question as as van Ditmarsch phrases it. In his notation, $K\delta$ means that some player knows the secret cards, and $L_{123}\neg K\delta$ means that players 1, 2, and 3 learn that none of them know the secret cards. (The paper considers a game between only three players, so $L_{123}$ means that all players learn.) The double turnstile and variable $s$ are used as in modal logic, and blackboard bold brackets indicate state after an announcement. Van Ditmarsch writes, “Is there a game state $s$ such that $s \models \neg K\delta$ but $s\denote{L_{123}\neg K\delta}\models K\delta$?” ↩︎
4. This is a small, special case of translating a model checking problem in epistemic logic to the problem of satisfiability of a propositional formula. This has been done, even in the case of the dynamic epistemic logic considered by van Ditmarsch. Let me just say that this stuff is super cool and applicable to all sorts of real word problems. As usual, there is only a vague distinction between fun, toy problems and big, tough, important problems we find in the garden of mathematics/computer science ↩︎
Approx. 3500 words, plus code | 2020-02-22 12:02:22 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5189245343208313, "perplexity": 543.3197121314986}, "config": {"markdown_headings": false, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875145676.44/warc/CC-MAIN-20200222115524-20200222145524-00408.warc.gz"} |
http://www.itl.nist.gov/div898/handbook/pmd/section1/pmd142.htm | 4. Process Modeling
4.1. Introduction to Process Modeling
4.1.4. What are some of the different statistical methods for model building?
## Nonlinear Least Squares Regression
Extension of Linear Least Squares Regression Nonlinear least squares regression extends linear least squares regression for use with a much larger and more general class of functions. Almost any function that can be written in closed form can be incorporated in a nonlinear regression model. Unlike linear regression, there are very few limitations on the way parameters can be used in the functional part of a nonlinear regression model. The way in which the unknown parameters in the function are estimated, however, is conceptually the same as it is in linear least squares regression.
Definition of a Nonlinear Regression Model As the name suggests, a nonlinear model is any model of the basic form, $$y = f(\vec{x};\vec{\beta}) + \varepsilon \, ,$$ in which
1. the functional part of the model is not linear with respect to the unknown parameters, $$\beta_0, \, \beta_1, \, \ldots \,$$, and
2. the method of least squares is used to estimate the values of the unknown parameters.
Due to the way in which the unknown parameters of the function are usually estimated, however, it is often much easier to work with models that meet two additional criteria:
1. the function is smooth with respect to the unknown parameters, and
2. the least squares criterion that is used to obtain the parameter estimates has a unique solution.
These last two criteria are not essential parts of the definition of a nonlinear least squares model, but are of practical importance.
Examples of Nonlinear Models Some examples of nonlinear models include: $$f(x;\vec{\beta}) = \frac{\beta_0 + \beta_1x}{1+\beta_2x}$$ $$f(x;\vec{\beta}) = \beta_1x^{\beta_2}$$ $$f(x;\vec{\beta}) = \beta_0 + \beta_1\exp(-\beta_2x)$$ $$f(\vec{x};\vec{\beta}) = \beta_1\sin(\beta_2 + \beta_3x_1) + \beta_4\cos(\beta_5 + \beta_6x_2)$$
Advantages of Nonlinear Least Squares The biggest advantage of nonlinear least squares regression over many other techniques is the broad range of functions that can be fit. Although many scientific and engineering processes can be described well using linear models, or other relatively simple types of models, there are many other processes that are inherently nonlinear. For example, the strengthening of concrete as it cures is a nonlinear process. Research on concrete strength shows that the strength increases quickly at first and then levels off, or approaches an asymptote in mathematical terms, over time. Linear models do not describe processes that asymptote very well because for all linear functions the function value can't increase or decrease at a declining rate as the explanatory variables go to the extremes. There are many types of nonlinear models, on the other hand, that describe the asymptotic behavior of a process well. Like the asymptotic behavior of some processes, other features of physical processes can often be expressed more easily using nonlinear models than with simpler model types.
Being a "least squares" procedure, nonlinear least squares has some of the same advantages (and disadvantages) that linear least squares regression has over other methods. One common advantage is efficient use of data. Nonlinear regression can produce good estimates of the unknown parameters in the model with relatively small data sets. Another advantage that nonlinear least squares shares with linear least squares is a fairly well-developed theory for computing confidence, prediction and calibration intervals to answer scientific and engineering questions. In most cases the probabilistic interpretation of the intervals produced by nonlinear regression are only approximately correct, but these intervals still work very well in practice.
Disadvantages of Nonlinear Least Squares The major cost of moving to nonlinear least squares regression from simpler modeling techniques like linear least squares is the need to use iterative optimization procedures to compute the parameter estimates. With functions that are linear in the parameters, the least squares estimates of the parameters can always be obtained analytically, while that is generally not the case with nonlinear models. The use of iterative procedures requires the user to provide starting values for the unknown parameters before the software can begin the optimization. The starting values must be reasonably close to the as yet unknown parameter estimates or the optimization procedure may not converge. Bad starting values can also cause the software to converge to a local minimum rather than the global minimum that defines the least squares estimates.
Disadvantages shared with the linear least squares procedure includes a strong sensitivity to outliers. Just as in a linear least squares analysis, the presence of one or two outliers in the data can seriously affect the results of a nonlinear analysis. In addition there are unfortunately fewer model validation tools for the detection of outliers in nonlinear regression than there are for linear regression. | 2015-03-06 16:00:39 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5645867586135864, "perplexity": 235.36246123679885}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-11/segments/1424936469077.97/warc/CC-MAIN-20150226074109-00018-ip-10-28-5-156.ec2.internal.warc.gz"} |
http://mathhelpforum.com/trigonometry/116331-trig-max-min-values.html | 1. ## trig max/min values
hi im struggling with my homework and was wondering if anyone can help
here the question...
find the max and min values of 3sinx + 2cosx ,and find in radians ,the smallest values of x at which they occur
any help is fully appreciated thank you
2. $\frac{d}{dx}[3sin(x)+2cos(x)]=3cos(x)-2sin(x)$
Set to 0 and solve for x:
$3cos(x)-2sin(x)=0$
Now, assuming $cos(x)\neq 0$:
$\frac{sin(x)}{cos(x)}=\frac{3}{2}$
$tan(x)=\frac{3}{2}$
$x=C{\pi}-tan^{-1}(\frac{2}{3})+\frac{\pi}{2}$
Let C=0 for the smallest value for the max and C=-1 for the smallest value that is a min.
Graph it as well and take a peek. | 2017-06-22 12:47:32 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 6, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.47901684045791626, "perplexity": 2261.20520443253}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-26/segments/1498128319265.41/warc/CC-MAIN-20170622114718-20170622134718-00105.warc.gz"} |
https://studydaddy.com/question/what-is-the-electron-configuration-of-li | Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
QUESTION
# What is the electron configuration of Li+?
"Li""^(+): 1s^2
Your starting point here will be the of a neutral lithium atom, "Li".
A quick look in the will reveal that lithium is located in period 2, group 1, and that it has an equal to 3.
This means that a neutral lithium atom will have a total of 3 electrons surrounding its nucleus.
Its will be
"Li: " 1s^2 color(red)(2)s^1
Now, the lithium cation, "Li"^(+), is formed when lithium loses the electron located on its outermost shell -> its . This electron is located on the second energy level, in the 2s-orbital.
This means that the electron configuration of the "Li"^(+) cation will be
"Li"^(+): 1s^2
To write this using , use the electron configuration of the noble gas that comes before lithium in .
Helium, "He", has the electron configuration
"He: " 1s^2
This means that you have
"Li"^(+): ["He"]
Here the notation ["He"] is meant to represent the electron configuration of helium.
LEARN MORE EFFECTIVELY AND GET BETTER GRADES! | 2019-04-21 07:08:02 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3421509265899658, "perplexity": 1690.6043892680634}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-18/segments/1555578530253.25/warc/CC-MAIN-20190421060341-20190421082341-00087.warc.gz"} |
http://rosalind.info/problems/suggested/342/ | # Suggested problems
## Install pypy
Jan. 26, 2021, 3:14 a.m. by Simon Crase
## A faster python
Many of the problems in alignment cannot, IMHO, be solved within the 5 minute time limit using regular python. I think it would be helpful to have a new task in Python Village to get up and running with pypy. ...
## Problem
1. Install pypy and modify environment variables so it is useable. Maybe give students a hint about constructing a benchmark.
2. Install numpy so pypy can access it. (I'm currently failing to do this using pip, so I'm going to have to do this manually.)
I'd like to know whether others think this is a good idea before I commit to fleshing out this outline.
Given: TBP if people thing this problem is a good idea.
Return: TBP if people thing this problem is a good idea.
## Sample Dataset
TBP if people thing this problem is a good idea.
## Sample Output
TBP if people thing this problem is a good idea. | 2021-10-17 07:06:45 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.38274112343788147, "perplexity": 2450.887773453423}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585121.30/warc/CC-MAIN-20211017052025-20211017082025-00019.warc.gz"} |
https://docs.nvidia.com/drive/archive/driveworks-3.0/imageprocessing_filtering_mainsection.html | DriveWorks SDK Reference 3.0.4260 Release For Test and Development only
Filtering
Note
SW Release Applicability: This module is available in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.
The Filtering module provides three functionalities: Pyramid computing, Thresholding, and Image filtering.
### Pyramid
The input to the Tracking module are Gaussian Pyramids of single channel frames, e.g. the Y channel of an YUV image. Memory for it is allocated during dwPyramid_create(), which also specifies the number of levels. Each level has the quarter resolution of the previous level, e.g. 1280x800, 640x400, 320x200 for a 3-level pyramid and camera resolution of 1280x800. Each created pyramid is meant to be reused and is updated via the dwImageFilter_computePyramid(). This module can be accelerated using the Programmable Vision Accelerator(PVA). When using PVA dwPyramidPVA_create() and dwPyramidPVA_computePyramid() have to be used respectively to allocate memory and update pyramids.
### Thresholding
The thresholding operation allows to set individual groups of pixels to a specific pixel value, based on a simple comparison criterion. The simples thresholding consists of setting all pixels greater than a value X to a maximum value MAXVAL and keeping the rest as is.
The dwThresholdParameters describe how the thresholding will take place.
There are 3 modes described in dwThresholdMode:
• DW_THRESHOLD_MODE_SIMPLE compares all pixels to a single value selected manually
• DW_THRESHOLD_MODE_OTSU similar to the above, but the value is automatically computed and set, based on the global contrast values of the image. If the histogram of the image is bimodal, then the result is the segmentation in 2 distinct classes
• DW_THRESHOLD_MODE_PER_PIXEL each pixel is individually compared to each pixel of the image dwThresholdParameters.thresholdingImage of the same size as the image. If thresholdingImage is the obtained by gaussian filtering the original image, then the operation is called Adaptive Gaussian Thresholding (see OpenCV's cv2.adaptiveThreshold)
The comparison of the pixels can be done with > or < sign, depending on the value of dwThresholdParameters.inverse, if it's false then the copmarison between PIX and TRSH is PIX > TRSH -> X otherwise it is PIX < TRSH -> X where X depends on the chosen behavior described in dwThresholdBehavior:
• DW_THRESHOLD_BEHAVIOR_BINARY if the result of the comparison is true, then X is dwThresholdParameters.maxVal other wise it is 0
• DW_THRESHOLD_BEHAVIOR_TRUNCATE if the result of the comparison is true, then X is TRSH otherwise PIX
• DW_THRESHOLD_BEHAVIOR_TO_ZERO if the result of the comparison is true, then X is PIX otherwise 0
### ImageFilter
Image filtering allows you to apply various effects on images. This module implements three types of filtering: Recursive Gaussian filter, Box filter, and Convolution filter.
The dwImageFilterType indicates the types of filtering.
• DW_IMAGEFILTER_TYPE_RECURSIVE_GAUSSIAN_FILTER The recursive implementation of Gaussian filter, the filter coefficients have a closed-form solution as a function of scale (/spl sigma/) and recursion order N (N=0, 1, 2).
• DW_IMAGEFILTER_TYPE_BOX_FILTER The Box Filter algorithm blurs an image using windowWidth×windowHeight normalized averaging kernel. Filter anchor point is center of the kernel.
• DW_IMAGEFILTER_TYPE_CONVOLUTION_FILTER The Convolution algorithm performs a 2D convolution operation on the input image with the provided kernel. The functionality supports both 2D kernels and separable 1D kernels. While executing PVA Convolution filter, pxlType need to be set to corresponding data type of input&output image. Its value is described in dwTrivialDataType, and current PVA engine supports data type INT8, UINT8, INT16 and UINT16 only.
The dwImageFilterConfig describes how the filtering will take place.
• dwImageFilterConfig.processorType indicates what processor handles image filter. For user defined kernel:
• dwImageFilterConfig.kernelWidth and dwImageFilterConfig.kernelHeight indicate the width and height of kernel.
• dwImageFilterConfig.kernelLength indicates size of dwImageFilterConfig.kernel which points to a float32_t data. For 2D Conv, the kernelLength equals kernelWidth x kernelHeight. For Separable Conv, the kernelLength equals to kernelWidth + kernelHeight. | 2021-09-25 20:43:32 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.34715715050697327, "perplexity": 3940.788532426041}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057775.50/warc/CC-MAIN-20210925202717-20210925232717-00610.warc.gz"} |
http://mathhelpforum.com/differential-geometry/210176-differentiable-but-not-continuosly-differentiable.html | # Math Help - Differentiable but not continuosly differentiable.
1. ## Differentiable but not continuosly differentiable.
Is it true that there are no function which are differentiable (in a complex sense) but not continuously differentiable (in a complex sense)? i.e. If a function f' exist then it is continuous.
This seems to be the only correct conclusion from the theorems in my course but I've never heard it stated explicitly so I just wanted to check I'm not misunderstanding!
Thanks,
Yes.
3. ## Re: Differentiable but not continuosly differentiable.
Being "differentiable" for functions of complex variables is much more severe than for real functions because of the increased "dimensionality". To be "differentiable" for functions of a real variable, we only have to have the limits "from the left" and "from the right" the same. To be "differentiable" for a function of a complex variable we must have all limits from the infinitely many ways to approach a point in two dimension the same. In fact, one can show that if a function of a complex variable is differentiable in some neighborhood of a point, then it is infinitely differentiable at that point. | 2015-01-29 18:45:20 | {"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8719945549964905, "perplexity": 213.1658036835183}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-06/segments/1422122328486.60/warc/CC-MAIN-20150124175848-00204-ip-10-180-212-252.ec2.internal.warc.gz"} |
https://arbital.greaterwrong.com/p/iff?l=46m | # Iff
Iff is a shorthand for “if and only if”. Its logical symbol is $$\leftrightarrow$$.
“A iff B” ($A \leftrightarrow B$) is quite distinct from “if A then B” ($A \rightarrow B$). Consider the stipulation “If the dog barks, then it will soon bite”. This would not obligate the dog to bark a warning before biting. The “if” relation isn’t symmetrical. As such, the dog might sometimes bite spontaneously, with no barking at all.
If we wanted to ensure that biting is always forewarned by barking, we would instead stipulate “Iff dog barks, then it will soon bite”. This is equivalent to
• “the dog barks if and only if it will soon bite”
• “If the dog barks then it will soon bite, and if the dog bites it will have barked beforehand”.
• “The dog barks only when it will soon bite”
With “iff”, the implication runs in both directions.
Parents:
• Mathematics
Mathematics is the study of numbers and other ideal objects that can be described by axioms. | 2021-08-05 09:16:33 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3175683319568634, "perplexity": 3022.3472578939936}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046155458.35/warc/CC-MAIN-20210805063730-20210805093730-00515.warc.gz"} |
https://www.zbmath.org/?q=an%3A0872.51007 | # zbMATH — the first resource for mathematics
Planar functions and planes of Lenz-Barlotti class II. (English) Zbl 0872.51007
Planar functions were introduced by Dembowski and the reviewer [P. Dembowski and T. G. Ostrom, Math. Z. 103, 239-258 (1968; Zbl 0163.42402)]. To take the simplest case, let $$F= {\mathcal G} F(p^r)$$. A function from $$F$$ onto $$F$$ is planar if the mapping $$x\to f(x+ m)- f(x)$$ is $$1-1$$ onto for each $$m\neq 0$$.
If $$f$$ is such a planar function there exists an affine plane whose points are ordered pairs $$(x, y)$$ of elements of $$F$$ and whose lines are sets of points $$(x,y)$$ such that $$y= f(x+m) +b$$ one line for each $$m,b$$. For each $$c\in F$$ there is also a line consisting of all points such that $$x=c$$. (A nicer representation is to take $$y= f(x+m)- f(x)- f(m) +b)$$. If $$f(X)= \sum a_{ij} X^{p^i+ p^j}$$, the plane turns out to be a semi-field plane. The authors show that if $$p=3$$, that $$x^k$$ is planar function if $$k$$ has the form $${1\over 2} (3^\alpha+2)$$.
Furthermore, the projective version of the plane is $$(p,L)$$ transitive for just one choice of $$p$$ and $$L$$. (In the natural coordinatization, $$p= (\infty)$$ and $$L= L_\infty)$$.
##### MSC:
51E15 Finite affine and projective planes (geometric aspects) 51A35 Non-Desarguesian affine and projective planes
##### Keywords:
permutation polynomials; planar function; affine plane
Full Text: | 2021-04-20 13:19:50 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8798577189445496, "perplexity": 427.5363843215716}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618039398307.76/warc/CC-MAIN-20210420122023-20210420152023-00301.warc.gz"} |
https://pennylane.ai/qml/demos/function_fitting_qsp.html | # Function Fitting using Quantum Signal Processing¶
Author: Jay Soni. Posted: 24 May 2022
## Introduction¶
This demo is inspired by the paper ‘A Grand Unification of Quantum Algorithms’. This paper is centered around the Quantum Singular Value Transform (QSVT) protocol and how it provides a single framework to generalize some of the most famous quantum algorithms like Shor’s factoring algorithm, Grover search, and more.
The QSVT is a method to apply polynomial transformations to the singular values of any matrix. This is powerful because from polynomial transformations we can generate arbitrary function transformations using Taylor approximations. The QSVT protocol is an extension of the more constrained Quantum Signal Processing (QSP) protocol which presents a method for polynomial transformation of matrix entries in a single-qubit unitary operator. The QSVT protocol is sophisticated, but the idea at its core is quite simple. By studying QSP, we get a relatively simpler path to explore this idea at the foundation of QSVT.
In this demo, we explore the QSP protocol and how it can be used for curve fitting. We show how you can fit polynomials, as illustrated in the animation below.
This is a powerful tool that will ultimately allow us to approximate any function on the interval $$[-1, 1]$$ that satisfies certain constraints. Before we can dive into function fitting, let’s develop some intuition. Consider the following single-qubit operator parameterized by $$a \in [-1, 1]$$:
$\begin{split}\hat{W}(a) = \begin{bmatrix} a & i\sqrt{1 - a^{2}} \\ i\sqrt{1 - a^{2}} & a \end{bmatrix}.\end{split}$
$$\hat{W}(a)$$ is called the signal rotation operator (SRO). Using this operator, we can construct another operator which we call signal processing operator (SPO),
$\hat{U}_{sp} = \hat{R}_{z}(\phi_{0}) \prod_{k=1}^{d} \hat{W}(a) \hat{R}_{z}(\phi_{k}).$
The SPO is parameterized by a vector $$\vec{\phi} \in \mathbb{R}^{d+1}$$, where $$d$$ is a free parameter which represents the number of repeated applications of $$\hat{W}(a)$$.
The SPO $$\hat{U}_{sp}$$ alternates between applying the SRO $$\hat{W}(a)$$ and parameterized rotations around the z-axis. Let’s see what happens when we try to compute the expectation value $$\bra{0}\hat{U}_{sp}\ket{0}$$ for the particular case where $$d = 2$$ and $$\vec{\phi} = (0, 0, 0)$$ :
\begin{split}\begin{align*} \bra{0}\hat{U}_{sp}\ket{0} &= \bra{0} \ \hat{R}_{z}(0) \prod_{k=1}^{2} \hat{W}(a) \hat{R}_{z}(0) \ \ket{0} \\ \bra{0}\hat{U}_{sp}\ket{0} &= \bra{0} \hat{W}(a)^{2} \ket{0} \\ \end{align*}\end{split}
$\begin{split}\bra{0}\hat{U}_{sp}\ket{0} = \bra{0} \begin{bmatrix} a & i\sqrt{1 - a^{2}} \\ i\sqrt{1 - a^{2}} & a \end{bmatrix} \ \circ \ \begin{bmatrix} a & i\sqrt{1 - a^{2}} \\ i\sqrt{1 - a^{2}} & a \end{bmatrix} \ket{0}\end{split}$
$\begin{split}\bra{0}\hat{U}_{sp}\ket{0} = \bra{0} \begin{bmatrix} 2a^{2} - 1 & 2ai\sqrt{1 - a^{2}} \\ 2ai\sqrt{1 - a^{2}} & 2a^{2} - 1 \end{bmatrix} \ket{0}\end{split}$
$\bra{0}\hat{U}_{sp}\ket{0} = 2a^{2} - 1$
Notice that this quantity is a polynomial in $$a$$. Equivalently, suppose we wanted to create a map $$S: a \to 2a^2 - 1$$. This expectation value would give us the means to perform such a mapping. This may seem oddly specific at first, but it turns out that this process can be generalized for generating a mapping $$S: a \to \text{poly}(a)$$. The following theorem shows us how:
### Theorem: Quantum Signal Processing¶
Given a vector $$\vec{\phi} \in \mathbb{R}^{d+1}$$, there exist complex polynomials $$P(a)$$ and $$Q(a)$$ such that the SPO, $$\hat{U}_{sp}$$, can be expressed in matrix form as:
$\hat{U}_{sp} = \hat{R}_{z}(\phi_{0}) \prod_{k=1}^{d} \hat{W}(a) \hat{R}_{z}(\phi_{k}),$
$\begin{split}\hat{U}_{sp} = \begin{bmatrix} P(a) & iQ(a)\sqrt{1 - a^{2}} \\ iQ^{*}(a)\sqrt{1 - a^{2}} & P^{*}(a) \end{bmatrix},\end{split}$
where $$a \in [-1, 1]$$ and the polynomials $$P(a)$$, $$Q(a)$$ satisfy the following constraints:
• $$deg(P) \leq d \$$ and $$deg(Q) \leq d - 1$$,
• $$P$$ has parity $$d$$ mod 2 and $$Q$$ has parity, $$d - 1$$ mod 2
• $$|P|^{2} + (1 - a^{2})|Q|^{2} = 1$$.
The third condition is actually quite restrictive because if we substitute $$a = \pm 1$$, we get the result $$|P^{2}(\pm 1)| = 1$$. Thus it restricts the polynomial to be pinned to $$\pm 1$$ at the end points of the domain, $$a = \pm 1$$. This condition can be relaxed to $$|P^{2}(a)| \leq 1$$ by expressing the signal processing operator in the Hadamard basis, i.e., $$\bra{+}\hat{U}_{sp}(\vec{\phi};a)\ket{+}$$). This is equivalent to redefining $$P(a)$$ such that:
$P^{'}(a) = \text{Re}(P(a)) + i\text{Re}(Q(a))\sqrt{1 - a^{2}}$
This is the convention we follow in this demo.
## Let’s Plot some Polynomials¶
Now we put this theorem to the test! In this section we construct the SRO $$\hat{W}(a)$$, and then use PennyLane to define the SPO. To test the theorem we will randomly generate parameters $$\vec{\phi}$$ and plot the expectation value $$\bra{+}\hat{U}_{sp}(\vec{\phi};a)\ket{+}$$ for $$a \in [-1, 1]$$.
Next, we introduce a function called rotation_mat(a), which will construct the SRO matrix. We can also make a helper function (generate_many_sro(a_vals)) which, given an array of possible values for ‘$$a$$’, will generate an array of $$\hat{W}(a)$$ associated with each element. We use Pytorch to construct this array as it will later be used as input when training our function fitting model.
import torch
def rotation_mat(a):
"""Given a fixed value 'a', compute the signal rotation matrix W(a).
(requires -1 <= 'a' <= 1)
"""
diag = a
off_diag = (1 - a**2) ** (1 / 2) * 1j
W = [[diag, off_diag], [off_diag, diag]]
return W
def generate_many_sro(a_vals):
"""Given a tensor of possible 'a' vals, return a tensor of W(a)"""
w_array = []
for a in a_vals:
w = rotation_mat(a)
w_array.append(w)
Now having access to the matrix elements of the SRO, we can leverage PennyLane to define a quantum function that will compute the SPO. Recall we are measuring in the Hadamard basis to relax the third condition of the theorem. We accomplish this by sandwiching the SPO between two Hadamard gates to account for this change of basis.
import pennylane as qml
def QSP_circ(phi, W):
"""This circuit applies the SPO. The components in the matrix
representation of the final unitary are polynomials!
"""
qml.Hadamard(wires=0) # set initial state |+>
for i in range(len(phi) - 1): # iterate through rotations in reverse order
qml.RZ(phi[i], wires=0)
qml.QubitUnitary(W, wires=0)
qml.RZ(phi[-1], wires=0) # final rotation
qml.Hadamard(wires=0) # change of basis |+> , |->
return
Finally, we randomly generate the vector $$\vec{\phi}$$ and plot the expectation value $$\bra{+}\hat{U}_{sp}\ket{+}$$ as a function of $$a$$. In this case we choose $$d = 5$$. We expect to observe the following:
• Since $$d$$ is odd, we expect all of the polynomials we plot to have odd symmetry
• Since $$d = 5$$, we expect none of the polynomials will have terms ~ $$O(a^6)$$ or higher
• All of the polynomials are bounded by $$\pm1$$
import math
import matplotlib.pyplot as plt
d = 5
a_vals = torch.linspace(-1, 1, 50)
w_mats = generate_many_sro(a_vals)
gen = torch.Generator()
gen.manual_seed(444422) # set random seed for reproducibility
for i in range(5):
phi = torch.rand(d + 1, generator=gen) * 2 * torch.tensor([math.pi], requires_grad=False)
matrix_func = qml.matrix(QSP_circ)
y_vals = [matrix_func(phi, w)[0, 0].real for w in w_mats]
plt.plot(a_vals, y_vals, label=f"poly #{i}")
plt.vlines(0.0, -1.0, 1.0, color="black")
plt.hlines(0.0, -1.0, 1.0, color="black")
plt.legend(loc=1)
plt.show()
Exactly as predicted, all of these conditions are met!
• All curves have odd symmetry
• Qualitatively, the plots look similar to polynomials of low degree
• Each plot does not exceed $$\pm1$$ !
## Function Fitting with Quantum Signal Processing¶
Another observation we can make about this theorem is the fact that it holds true in both directions: If we have two polynomials $$P(a)$$ and $$Q(a)$$ that satisfy the conditions of the theorem, then there exists a $$\vec{\phi}$$ for which we can construct a signal processing operator which maps $$a \to P(a)$$.
In this section we try to answer the question:
Can we learn the parameter values of $$\vec{\phi}$$ to transform our signal processing operator polynomial to fit a given function?
In order to answer this question, we leverage the power of machine learning. In this demo we assume you are familiar with some concepts from quantum machine learning, for a refresher checkout this blog post on QML. We begin by building a machine learning model using Pytorch. The __init__() method handles the random initialization of our parameter vector $$\vec{\phi}$$. The forward() method takes an array of signal rotation matrices $$\hat{W}(a)$$ for varying $$a$$, and produces the predicted $$y$$ values.
Next we leverage the PennyLane function qml.matrix(), which accepts our quantum function (it can also accept quantum tapes and QNodes) and returns its unitary matrix representation. We are interested in the real value of the top left entry, this corresponds to $$P(a)$$.
torch_pi = torch.Tensor([math.pi])
class QSP_Func_Fit(torch.nn.Module):
def __init__(self, degree, num_vals, random_seed=None):
"""Given the degree and number of samples, this method randomly
initializes the parameter vector (randomness can be set by random_seed)
"""
super().__init__()
if random_seed is None:
self.phi = torch_pi * torch.rand(degree + 1, requires_grad=True)
else:
gen = torch.Generator()
gen.manual_seed(random_seed)
self.phi = torch_pi * torch.rand(degree + 1, requires_grad=True, generator=gen)
self.phi = torch.nn.Parameter(self.phi)
self.num_phi = degree + 1
self.num_vals = num_vals
def forward(self, omega_mats):
"""PennyLane forward implementation"""
y_pred = []
generate_qsp_mat = qml.matrix(QSP_circ)
for w in omega_mats:
u_qsp = generate_qsp_mat(self.phi, w)
P_a = u_qsp[0, 0] # Taking the (0,0) entry of the matrix corresponds to <0|U|0>
y_pred.append(P_a.real)
Next we create a Model_Runner class to handle running the optimization, storing the results, and providing plotting functionality:
class Model_Runner:
def __init__(self, model, degree, num_samples, x_vals, process_x_vals, y_true):
"""Given a model and a series of model specific arguments, store everything in
internal attributes.
"""
self.model = model
self.degree = degree
self.num_samples = num_samples
self.x_vals = x_vals
self.inp = process_x_vals(x_vals)
self.y_true = y_true
def execute(
self, random_seed=13_02_1967, max_shots=25000, verbose=True
): # easter egg: oddly specific seed?
"""Run the optimization protocol on the model using Mean Square Error as a loss
function and using stochastic gradient descent as the optimizer.
"""
model = self.model(degree=self.degree, num_vals=self.num_samples, random_seed=random_seed)
criterion = torch.nn.MSELoss(reduction="sum")
optimizer = torch.optim.SGD(model.parameters(), lr=1e-5)
t = 0
loss_val = 1.0
while (t <= max_shots) and (loss_val > 0.5):
self.y_pred = model(self.inp)
if t == 1:
self.init_y_pred = self.y_pred
# Compute and print loss
loss = criterion(self.y_pred, self.y_true)
loss_val = loss.item()
if (t % 1000 == 0) and verbose:
print(f"---- iter: {t}, loss: {round(loss_val, 4)} -----")
# Perform a backward pass and update weights.
loss.backward()
optimizer.step()
t += 1
self.model_params = model.phi
def plot_result(self, show=True):
"""Plot the results"""
plt.plot(self.x_vals, self.y_true.tolist(), "--b", label="target func")
plt.plot(self.x_vals, self.y_pred.tolist(), ".g", label="optim params")
plt.plot(self.x_vals, self.init_y_pred.tolist(), ".r", label="init params")
plt.legend(loc=1)
if show:
plt.show()
Now that we have a model, lets first attempt to fit a polynomial. We expect this to perform well when the target polynomial also obeys the symmetry and degree constraints that our quantum signal processing polynomial does. To do this, we defined a function custom_poly(x) which implements the target polynomial. In this case, we (arbitrarily) choose the target polynomial:
$y = 4x^{5} - 5x^{3} + x$
Lets see how well we can fit this polynomial!
Note
Depending on the initial parameters, training can take anywhere from 10 - 30 mins
import numpy as np
d = 9 # dim(phi) = d + 1,
num_samples = 50
def custom_poly(x):
"""A custom polynomial of degree <= d and parity d % 2"""
a_vals = np.linspace(-1, 1, num_samples)
y_true = custom_poly(a_vals)
qsp_model_runner = Model_Runner(QSP_Func_Fit, d, num_samples, a_vals, generate_many_sro, y_true)
qsp_model_runner.execute()
qsp_model_runner.plot_result()
Out:
---- iter: 0, loss: 13.5938 -----
---- iter: 1000, loss: 11.8809 -----
---- iter: 2000, loss: 10.229 -----
---- iter: 3000, loss: 8.6693 -----
---- iter: 4000, loss: 7.2557 -----
---- iter: 5000, loss: 6.0084 -----
---- iter: 6000, loss: 4.9197 -----
---- iter: 7000, loss: 3.9801 -----
---- iter: 8000, loss: 3.1857 -----
---- iter: 9000, loss: 2.5312 -----
---- iter: 10000, loss: 2.0045 -----
---- iter: 11000, loss: 1.5873 -----
---- iter: 12000, loss: 1.2594 -----
---- iter: 13000, loss: 1.0021 -----
---- iter: 14000, loss: 0.7997 -----
---- iter: 15000, loss: 0.6397 -----
---- iter: 16000, loss: 0.5127 -----
We were able to fit that polynomial quite well! Lets try something more challenging: fitting a non-polynomial function. One thing to keep in mind is the symmetry and bounds constraints on our polynomials. If our target function does not satisfy them as well, then we cannot hope to generate a good polynomial fit, regardless of how long we train for.
A good non-polynomial candidate to fit to, that obeys our constraints, is the step function. Let’s try it!
d = 9 # dim(phi) = d + 1,
num_samples = 50
def step_func(x):
"""A step function (odd parity) which maps all values <= 0 to -1
and all values > 0 to +1.
"""
res = [-1.0 if x_i <= 0 else 1.0 for x_i in x]
a_vals = np.linspace(-1, 1, num_samples)
y_true = step_func(a_vals)
qsp_model_runner = Model_Runner(QSP_Func_Fit, d, num_samples, a_vals, generate_many_sro, y_true)
qsp_model_runner.execute()
qsp_model_runner.plot_result()
Out:
---- iter: 0, loss: 33.8345 -----
---- iter: 1000, loss: 19.0937 -----
---- iter: 2000, loss: 11.6557 -----
---- iter: 3000, loss: 8.2853 -----
---- iter: 4000, loss: 6.6824 -----
---- iter: 5000, loss: 5.8523 -----
---- iter: 6000, loss: 5.3855 -----
---- iter: 7000, loss: 5.1036 -----
---- iter: 8000, loss: 4.9227 -----
---- iter: 9000, loss: 4.8004 -----
---- iter: 10000, loss: 4.7138 -----
---- iter: 11000, loss: 4.6502 -----
---- iter: 12000, loss: 4.6018 -----
---- iter: 13000, loss: 4.5638 -----
---- iter: 14000, loss: 4.5333 -----
---- iter: 15000, loss: 4.5082 -----
---- iter: 16000, loss: 4.4872 -----
---- iter: 17000, loss: 4.4693 -----
---- iter: 18000, loss: 4.4537 -----
---- iter: 19000, loss: 4.4401 -----
---- iter: 20000, loss: 4.4281 -----
---- iter: 21000, loss: 4.4174 -----
---- iter: 22000, loss: 4.4078 -----
---- iter: 23000, loss: 4.3991 -----
---- iter: 24000, loss: 4.3912 -----
---- iter: 25000, loss: 4.3839 -----
## Conclusion¶
In this demo, we explored the Quantum Signal Processing theorem, which is a method to perform polynomial transformations on the entries of the SRO $$\hat{W}(a)$$. This polynomial transformation arises from the repeated application of $$\hat{W}(a)$$ and the parameterized Z-axis rotations $$e^{i \phi \hat{Z}}$$. Note, the SRO is itself a transformation, in this case a rotation around the X-axis by $$\theta = -2 \cos^{-1}(a)$$, which rotates our basis. Thus the underlying principal of quantum signal processing is that we can generate polynomial transformations through parameterized rotations along a principal axis followed by change of basis transformations which re-orients this axis.
This is the same principal at the heart of QSVT. In this case the subspace in which we apply our parameterized rotations is defined by the singular vectors, the change of basis transformation takes us between these subspaces and this allows us to apply polynomial transformations on the singular values of our matrix of interest.
We also showed that one could use a simple gradient descent model to train a parameter vector $$\vec{\phi}$$ to generate reasonably good polynomial approximations of arbitrary functions (provided the function satisfied the same constraints). This isn’t the only way to compute the optimal values. It turns out there exist efficient algorithms for explicitly computing the optimal values for $$\vec{\phi}$$ known as “Remez-type exchange algorithms” for analytic function fitting. If you want to explore other approaches to function fitting, checkout this demo where we use a photonic neural network for function fitting.
## References¶
[1]: John M. Martyn, Zane M. Rossi, Andrew K. Tan, Isaac L. Chuang. “A Grand Unification of Quantum Algorithms” PRX Quantum 2, 040203, 2021.
#### Jay Soni
Jay completed his BSc. in Mathematical Physics from the University of Waterloo and currently works as a Quantum Software Developer at Xanadu. Fun fact, you will often find him sipping on a Tim Horton's IceCapp while he is coding.
Total running time of the script: ( 0 minutes 0.000 seconds)
Gallery generated by Sphinx-Gallery | 2022-06-29 00:07:53 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8623396158218384, "perplexity": 2857.343942239166}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103619185.32/warc/CC-MAIN-20220628233925-20220629023925-00507.warc.gz"} |
https://socratic.org/questions/how-do-you-solve-2x-2-x-1-0-using-the-quadratic-formula | # How do you solve 2x^2 + x - 1 = 0 using the quadratic formula?
Oct 15, 2015
$x = \frac{1}{2} , x = - 1$
#### Explanation:
$a {x}^{2} + b x + c = 0$
Where,
a is the constant with x to the power 2.
b is the constant with x to the power 1.
c is the constant.
$x = \frac{- b \pm \sqrt{{b}^{2} - 4 \left(a\right) \left(c\right)}}{2 \left(a\right)}$
Given Equation:
$2 {x}^{2} + x - 1 = 0$
In this Case:
a = 2
b = 1
c = -1
put these values in the quadratic formula.
$x = \frac{- 1 \pm \sqrt{{\left(1\right)}^{2} - 4 \left(2\right) \left(- 1\right)}}{2 \left(2\right)}$
$x = \frac{- 1 \pm \sqrt{1 + 8}}{4}$
$x = \frac{- 1 \pm \sqrt{9}}{4}$
$x = \frac{- 1 \pm 3}{4}$
$x = \frac{- 1 + 3}{4} , \frac{- 1 - 3}{4}$
$x = \frac{2}{4} , x = - \frac{4}{4}$
$x = \frac{1}{2} , x = - 1$ | 2019-01-23 03:09:54 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 11, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8632617592811584, "perplexity": 1134.037914307442}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547583884996.76/warc/CC-MAIN-20190123023710-20190123045710-00618.warc.gz"} |
https://nips.cc/Conferences/2013/ScheduleMultitrack?event=4100 | `
Timezone: »
Spotlight
More data speeds up training time in learning halfspaces over sparse vectors
Amit Daniely · Nati Linial · Shai Shalev-Shwartz
Sat Dec 07 03:38 PM -- 03:42 PM (PST) @ Harvey's Convention Center Floor, CC
The increased availability of data in recent years led several authors to ask whether it is possible to use data as a {\em computational} resource. That is, if more data is available, beyond the sample complexity limit, is it possible to use the extra examples to speed up the computation time required to perform the learning task? We give the first positive answer to this question for a {\em natural supervised learning problem} --- we consider agnostic PAC learning of halfspaces over $3$-sparse vectors in $\{-1,1,0\}^n$. This class is inefficiently learnable using $O\left(n/\epsilon^2\right)$ examples. Our main contribution is a novel, non-cryptographic, methodology for establishing computational-statistical gaps, which allows us to show that, under a widely believed assumption that refuting random $\mathrm{3CNF}$ formulas is hard, efficiently learning this class using O\left(n/\epsilon^2\right)$examples is impossible. We further show that under stronger hardness assumptions, even$O\left(n^{1.499}/\epsilon^2\right)$examples do not suffice. On the other hand, we show a new algorithm that learns this class efficiently using$\tilde{\Omega}\left(n^2/\epsilon^2\right)\$ examples. This formally establishes the tradeoff between sample and computational complexity for a natural supervised learning problem. | 2021-11-27 23:55:47 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.898168683052063, "perplexity": 1150.4739883408126}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964358323.91/warc/CC-MAIN-20211127223710-20211128013710-00142.warc.gz"} |
https://www.risk.net/risk-management/liquidity-risk/2475441/a-referendum-on-clearing | # A referendum on clearing
## Brexit margin calls show swaps CCPs are relying on funding strength of a handful of banks
If you owe the bank $100, that's your problem; if you owe the bank$100 million, that's the bank's problem.
Or so the saying goes. Now substitute the word ‘bank' for ‘clearing house' and read it again.
On the morning of June 24, clearing houses in Europe and the US found themselves with exactly this problem, repeated across a handful of big member firms. Violent moves in currencies, rates and stocks meant each of those members was asked – at various points during the day – to pay margin calls that are estimated to run into multiple billions of dollars in some cases. At the point of each call, they had an hour or so to make the payment.
This caused some tension at the banks. A senior executive at one large clearer says, in deadpan fashion, that "suddenly being asked to make 10-digit payments makes people uncomfortable".
But the discomfort was felt more widely. During the day, each bank was contacted by the clearing houses – and by regulators – looking for assurances that the margin would be forthcoming. If a bank failed to pay, its positions would be closed out, pouring fuel onto the fire of the Brexit vote. Even the perception of payment difficulties could have triggered panic.
On the day, it all went well. But that's not the point.
The point, which has been made numerous times over the past few years, is that imposing mandatory clearing for over-the-counter derivatives was essentially a decision to trade counterparty risk for liquidity risk: having a third party calculate and enforce margining requirements should reduce the risk of a domino effect when a big market participant collapses, but the need to stump up that margin introduces a new source of fragility.
The aftermath of the 1987 stock market collapse is instructive. Writing a couple of years after the fact, Ben Bernanke, then a Princeton University professor, was one of those to document multiple flaws in the clearing and settlement system. Chicago's clearing houses issued more than $4 billion in variation margin calls during a two-day period – calls with which "the banks were initially reluctant to comply", Bernanke wrote. Fears grew that payments would not be made, and that clearing houses would be unable to act in their role as insurers in the event of a default. This may in turn have made the markets more chaotic. Brexit margin calls owed less to stock market volatility and more to yield curve moves acting on the interest rate swap market – now in its third year of mandatory clearing in the US – and this is why it is worth a closer look. Unlike the futures market, the bulk of cleared over-the-counter derivatives risk is handled by a small, and shrinking, number of banks. The last time Risk.net did the sums, in March 2015, 73% of cleared OTC risk in the US was passing through just five futures commission merchants. This is a concentration risk that banks themselves would not tolerate. As one clearing house executive says: "No bank would ever offer a standby letter of credit for$10 billion to one counterparty. You don't ever let yourself be exposed that way."
The old saying would lead to the conclusion that this is the clearing house's problem – not the bank's. But this is where the saying breaks down: it could be everyone's problem.
Only users who have a paid subscription or are part of a corporate subscription are able to print or copy content.
To access these options, along with all other subscription benefits, please contact [email protected] or view our subscription options here: http://subscriptions.risk.net/subscribe
#### 7 days in 60 seconds
###### Libor switch, US capital problems and operating in lockdown
The week on Risk.net, June 20-26, 2020 | 2020-07-03 23:56:52 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.17826633155345917, "perplexity": 3317.147758060527}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655883439.15/warc/CC-MAIN-20200703215640-20200704005640-00320.warc.gz"} |
https://echomasaz.pl/25603-silicon_carbide_absorption_spectrum_in_chile.html | # silicon carbide absorption spectrum in chile
#### Wettability of Silicon, Silicon Dioxide, and Organosilie Glass
Martinez, Nelson. Wettability of Silicon, Silicon Dioxide, and Organosilie Glass. Master of Science (Materials Science and Engineering), Deceer 2009, 106 pp., 26 tables, 48 illustrations, references 88 titles. Wetting of a substance has been widely
#### Furfural - DrugFuture
Absorption spectrum: Purvis, J. Chem. Soc. 97, 1655 (1910). Sol in 11 parts water; very sol in alcohol, ether. Silicon Carbide Butylparaben Podophyllic Acids Stannic Chromate(VI) Ethirimol Benzo[e]pyrene p-Bromophenylhydrazine Magnoflorine Lepidine DL
#### Reflection Measurements in IR Spectroscopy
reflection spectrum by a mathematical operation called the Kramers-Kronig transformation. This is provided in most data manipulation packages used with FTIR spectrometers. Below is a comparison between the absorption spectrum of polymethylmethacrylate
#### Tandem Solar Cells on Crystalline Silicon - Fraunhofer ISE
To make better use of the whole solar spectrum (reduction of thermalisation losses), we are also developing silicon-based tandem solar cells. In addition to process adaptation for the Si base cell and the development of tunnel contacts, our research is concentrating primarily on new silicon nanocrystalline materials with adjustable band gaps and III-V-based absorber materials.
#### Graphene Photodetector Could Make Sharper Images …
Photo: iStockphoto Silicon carbide is the key to a graphene photodetector While inventors of digital electronic appliions are still wrestling with graphene’s lack of a band gap, in
#### Laser Crystals
Laser output can be generated over the entire spectrum from 650 to 1100 nm. Frequency doubling the output provides tunability across the blue-green region of the visible spectrum. For femtosecond and research lasers, titanium doped sapphire is a versatile crystal.
#### FABRIION AND CHARACTERIZATION OF SILICON CARBIDE …
FABRIION AND CHARACTERIZATION OF SILICON CARBIDE INERT MATRIX FUELS THROUGH A POLYMER PRECURSOR ROUTE By CHUNGHAO SHIH …
#### Study Notes: Interpreting Infrared Spectra
The radiation source is a silicon carbide rod that is heated to between 1000 and 2000 C to emit in the infrared. The beam is split into two equal intensity beams by a mirror system. The sample beam passes through a cell containing the sample substance.
#### The Use of UV-visible Spectroscopy to Measure the Band Gap of a …
• Calculate the absorption coefficient and convert wavelength in nm to eV • Fit the spectrum to estimate the band gap and assess whether it is direct or indirect and whether it is forbidden or allowed There is little preparation time involved in a UV-vis spectroscopic
#### Silicon Nitride Si3N4 Material Properties - Accuratus
Silicon nitride (Si3N4) engineering properties and typical uses commercially available *All properties are room temperature values except as noted. The data presented is typical of commercially available material and is offered for comparative purposes only.
#### /a>
Silicon Carbide Thin Films Synthesized by Using Pulsed YAG -— Y. SUDA et al. 300 400 500 Wavelength (nm) 600 Quartz windo Mirro d Heate Chaer Nd:YA laser X.=532 nm otating target Fig. 2. Optical emission spectrum of the plasma plume generated by
#### Layer Structure Enhances Light Absorption | Features | …
A double absorbing layer based on amorphous silicon thin film is promising for solar cells because it considerably enhances the utilization of sunlight.Other potential appliions can be found in the field of IR detection. Over the past few decades, hydrogenated amorphous silicon (a-Si:H) thin film has been widely studied because of its potential use in a wide variety of devices, such as
#### ET3034TUx - 5.2.1 - Thin film silicon PV technology 1
ET3034TUx - 5.2.1 - Thin film silicon PV technology 1 Last week we have discussed the dominant PV technology in the current market, the PV technology based on c-Si wafers. Now we will discuss a different silicon technology, the thin-film silicon PV technology
#### Refractive index of MgF2 (Magnesium fluoride) - Dodge-o
Dispersion formula $$n^2-1=\frac{0.48755108λ^2}{λ^2-0.04338408^2}+\frac{0.39875031λ^2}{λ^2-0.09461442^2}+\frac{2.3120353λ^2}{λ^2-23.793604^2}$$ Comments 19 C
#### Refractive Index Database – Table of Refractive Index …
The table below contains links to refractive index data for common materials. Each material in the database has refractive index listed as a function of wavelength over a range typically required for thin-film thickness measurement.
#### Research Institute “Orion” - leader of microwave …
A characteristic feature of the absorption spectrum in the atmosphere is the presence of low absorption bands in the wavelength ranges of 8 mm, 3 mm and 2 mm. These bands are of great interest to create electronic systems of various appliions.
#### Identifiion of the binding site between bovine serum …
G. Dravecz, L. Bencs, D. Beke and A. Gali, Determination of silicon and aluminum in silicon carbide nanocrystals by high-resolution continuum source graphite furnace atomic absorption spectrometry, Talanta, 2016, 147, 271 —275 CAS .
#### Interference fringe-free transmission spectroscopy of amorphous …
Photoluminescence properties and crystallization of silicon quantum dots in hydrogenated amorphous Si-rich silicon carbide films J. Appl. Phys. 115, 164303 (2014); 10.1063/1.4871980 Amorphous silicon thin-film transistors with field-effect mobilities of 2 cm
#### 2. Interpretation of XRF Spectra - Chemistry LibreTexts
Summary of Factors That Complie Interpretation of XRF Spectra Elements in the sample may produce 2 or more lines K α, K β, L α, L β, (we use simplified nomenclature and discussed only α and β lines) L γ, L α1, L β1, L β2 (can also have α1 and α2 lines, β1 and β2 lines, γ lines, etc.)
#### mp-568656: SiC (trigonal, P3m1, 156)
SiC is Moissanite-6H-like structured and crystallizes in the trigonal P3m1 space group. The structure is three-dimensional. there are five inequivalent Si4+ sites. In the first Si4+ site, Si4+ is bonded to four C4- atoms to form corner-sharing SiC4 tetrahedra. There is
#### transmission spectrum,transmission spectrum …
transmission spectrum,transmission spectrum,transmission spectrum,transmission spectrum,transmission spectrum,transmission spectrum in Chinese,transmission spectrum,,,, …
#### Appliion Note # EDS-10 - Bruker
and carbon by spectrum imaging will be demonstrated using a sintered hard ceramic material composed of the three major phases titanium boride (TiB 2), titanium carbide (TiC), silicon carbide (SiC) and minor phases, sub-µm in size. The coination of these
#### THIN SILICON CARBIDE COATING OF THE PRIMARY MIRROR OF …
the silicon carbide coated mirrors have been used to calculate the thermo-optical properties under solar irradiation. The solar spectrum of the “Solar 2000 Model” [3] was used to calculate the transmission, reflectance, and absorption of the samples. Figure 3
#### IR Light Sources for MIR8035™ FT-IR Scanners
Silicon Carbide (SiC) Infrared Light Source The 80007 is a complete silicon carbide (SiC) infrared light source that provides a smooth continuum from 6,000 to 400 cm-1 (1.7 to 25 µm). Its 1.5-Inch Series output flange allows the source to be coupled to a …
#### Silicon Carbide — 1968 - 1st Edition
Silicon Carbide — 1968 presents the proceedings of the International Conference on Silicon Carbide held in University Park, Pennsylvania on October 20-23, 1968. The book covers papers about the perspectives on silicon carbide; several problems in the development of silicon carbide semiconductors, such as the control of crystal structure and analysis.
#### Blue light-emitting diode with high external quantum …
1995/5/16· FIG. 9 is a plot of the absorption coefficient of silicon carbide as a function of p-type dopant concentration. DETAILED DESCRIPTION The present invention is a light-emitting diode that emits light in the blue portion of the visible spectrum (i.e., approximately 400-480 nanometers (nm)) with high external quantum efficiency.
#### Standard Abrasives™ Silicon Carbide Unitized Wheel - …
Hard Density Wheel Imparts a Fine Polish The hardness of this wheel places it on the upper end of the spectrum of aggressiveness among Standard Abrasives Unitized Wheels. The Standard Abrasives Silicon Carbide 800 Series Unitized Wheel is able to
#### Infrared dielectric properties of low-stress silicon nitride
Infrared dielectric properties of low-stress silicon nitride Giuseppe aldo,1,2,* James A. Beall,3 Hsiao-Mei Cho,3 Brendan McAndrew,1 Michael D. Niemack,3 and Edward J. Wollack1 1NASA Goddard Space Flight Center, 8800 Greenbelt Road, Greenbelt, Maryland 20771, USA | 2021-07-25 19:44:13 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4261415898799896, "perplexity": 7070.436483791206}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046151760.94/warc/CC-MAIN-20210725174608-20210725204608-00102.warc.gz"} |
http://lesswrong.com/lw/3gj/efficient_charity_do_unto_others/3823 | # fischer comments on Efficient Charity: Do Unto Others... - Less Wrong
130 24 December 2010 09:26PM
You are viewing a comment permalink. View the original post to see all comments and the full post content.
Sort By: Best
You are viewing a single comment's thread.
Comment author: 25 December 2010 06:55:57AM 2 points [-]
I'm bothered by the intertemporal implications of this, i.e. if I have $100 that I will spend to help the most humans possible, then I could either spend it today or invest it and spend$105 next year (assumed 5% ROR). Will I then ever spend the money on charity? Or will I always invest it, and just let this amassed wealth be distributed when I die?
Comment author: 25 December 2010 07:24:00AM * 12 points [-]
Assuming that charities can invest and borrow at prevailing interest rates (and large charitable trusts can in fact borrow from their endowment), you should be indifferent to this choice. Robin Hanson has addressed this issue here.
Comment author: 25 December 2010 07:07:26AM * 7 points [-]
The good you do can compound too. If you save a childs life at $500, that child might go on to save other childrens lives. I think you might well get a higher rate of interest on the good you do than 5%. There will be a savings rate at which you should save instead of give, but I don't think we're near it at the moment. Comment author: 27 December 2010 05:16:15AM 3 points [-] This, incidentally, is also an argument for supporting less immediately-efficient charities. If you spend$500 on mosquito nets, you are saving the life of a child whose expected lifetime earning potential is low. This is wonderful, but the rate of "interest" may well be small. If you spend $500 on saving the painting Blue Rigi, you have not saved a single life in the short run. But it contributes to the education of thousands of British children, many of whom will grow up to create and donate large amounts of wealth/knowledge. Your incremental impact on their education may plausibly prevent more malarial deaths than your donation of mosquito nets, though I've no idea how to calculate this. At the very least, I'd suggest that analogy of "setting out on an Arctic journey" sets us up to mentally discount future benefits in favor of immediate results. Instead we might imagine that we've set up an Arctic village, or are planning a journey a decade from now. Our spending habits would change accordingly. Comment author: 27 December 2010 06:22:14AM 10 points [-] If you spend$500 on saving the painting Blue Rigi, [...] it contributes to the education of thousands of British children, many of whom will grow up to create and donate large amounts of wealth/knowledge
Contributes how much? For each child, how much more knowledge do you expect they will create because they saw the original, rather than a facsimile, Blue Rigi? My estimate for this is so close to 0 that I can't conscience paying even \$1 for Blue Rigi, except for aesthetic reasons.
Comment author: 28 December 2010 01:46:02AM 1 point [-]
Is this another way of saying that schools should focus on math and science, ignoring art? Or is this an argument that we need to restructure the way public museums work, slashing the cost by replacing the paintings with copies?
Comment author: 28 December 2010 02:36:10AM 5 points [-]
It's just an argument that art is not in the same bucket as saving lives. I'm not going to tell you how to spend your money, but if your stated objective is to help people, saving Blue Rigi is not a cost effective way of doing that.
The way we run schools, math and science aren't very useful to begin with. Slashing art budgets is probably not a useful place to start.
Comment author: 28 December 2010 03:28:41AM * 2 points [-]
Well, I want to make sure I understand it. Which of the following do you mean: a. If British people become more productive that productivity won't translate into more charity/inventions that will save lives? b. Education does not improve productivity? c. Art museums are not an important part of education (at least not in terms of scientific/economic productivity)? d. Blue Rigi does not improve the overall quality of the Tate? e. Actually none of the above, but Blue Rigi was simply priced too high?
I am not attempting to make an argument in this post. I am trying to identify the point at which datadataeverywhere first has a problem. For instance, I don't need to discuss whether the cultural given (fetish?) that our museums will seek out originals is easily mutable if his objection really starts earlier in my list. For instance, is it possible that the education of British children is a better way to save African lives than the immediate purchase of mosquito nets? If that's implausible, then the question of how one educates a child is irrelevant to this discussion.
Comment author: 28 December 2010 09:16:43PM 3 points [-]
Aris' expanded explanation is excellent, and what I would have tried to say at first.
I find it pretty implausible that the education of British children in the artwork of an 18th century British landscape painter is a better method of saving African lives than a proven method that currently saves lives and is reckoned to be one of the cheapest methods per life saved.
Over the long term, how we educate children probably determines a great deal about what our world looks like in the future. However, unless you have an oracle, or are educating them in something specifically related, such as the concept of Efficient Charity, I would place the upper and lower guesses of the median increase in QALY/DALY well below and above zero, respectively, indicating that you shouldn't do it on that basis.
Comment author: 28 December 2010 03:46:29AM * 3 points [-]
Downvoted for extreme amounts of muddled thinking, and a line of argumentation that's so hole-ridden it gives me a headache.
Also he has answered you already: He argued that displaying the original Blue Rigi as opposed to a facsimile doesn't contribute one iota to the education of any child. You either didn't pay attention, or are trying to wear him out by keep on asking something he already answered.
Comment author: 28 December 2010 03:58:51AM * 1 point [-]
Maybe. But I still don't know if that's because art doesn't contribute or because originals are the same as facsimiles.
Anyway, can you help me understand what you consider the holes/muddle?
Comment author: 28 December 2010 04:46:15AM * 10 points [-]
Muddled thinking is when your line of argumentation "painting contributes to museum, museum contributes to education, education contributes to productivity, productivity contributes to charity" implies there's some single metric each of these increase, which can be traced from one to the other simply, step by step.
An original painting may contribute to museum's "quality", but it needn't contribute to the educational quality of the museum, so you can't transfer that sort of contribution down that next step.
An art museum contributes to education, but it needn't contribute to education in such a manner that it becomes the sort of "productivity" that saves lives. Art is about aesthetics, which contribute to quality of life, but not the preservation of such. Art contributes, but it contributes differently - and you were told that already.
Education may contribute to productivity, but depending what you're educated to value, it may increase or decrease the amounts of charity provided. For example, if you're taught to value the presence of original paintings, you'll probably give money to keep original paintings in your nation, not to save lives.
Wanting an original painting, as opposed to a copy, isn't about educating, it's about satisfying a fetish. A national fetish in this case, much the way that Greece was obsessing with Olympic Games and museums to house the unreturned Parthenon marbles, while in the meantime its economy was going down the crapper.
In that way I could easily argue that the original is of less utility than a facsimile, exactly because it encourages such unproductive fetishes, while being aesthetically identical.
Comment author: 27 December 2010 07:42:07AM 2 points [-]
that child might go on to save other childrens lives.
Or, of course, go on to harm them. Or be neutral. It seems almost certain that on average there is some benefit from the standard trade and comparative advantage reasons, but I have no idea how to even approach that calculation.
Comment author: 25 December 2010 10:56:14AM * 2 points [-]
Will I then ever spend the money on charity?
What's likely to happen is that the RoR and benefit of charity will fluctuate over time and over the size of your pot- so your pot will grow until there's a need, then you'll spend, and then it'll go back to growing. The problem is that requires active management (which is hard to continue after your death) and typically the view is that if you value warm fuzzies, you can find some charity that returns more than the RoR of profitable ventures.
There is quite a bit of warm fuzzies in generating a giant pot of cash and then endowing it to stand perpetually- but beyond stability effects I'm not sure there is much to recommend that model of charity.
Comment author: 26 December 2010 01:32:56AM 1 point [-]
In order this to be true forever, the world would have to never end, which would mean that there's infinite utility no matter what you do.
If this is false eventually, there is no paradox. Whether or not It's worth while to invest for a few centuries is an open question, but if it turns out it is, that's no reason to abandon the idea of comparing charities.
Comment author: 26 December 2010 02:40:22AM 1 point [-]
In order this to be true forever, the world would have to never end, which would mean that there's infinite utility no matter what you do.
That doesn't sound right... even if I'm expecting an infinite future I think I'd still want to live a good existence rather than a mediocre one (but with >0 utility). So it does matter what I do.
Say I have two options:
• A, which offers on average 1.. utilon per second? (Are utilons measures of utility of a time period, or instantaneous utility?)
• B, which offers on average 2 utilons / s
The limits as t approaches infinity are U(A) = t, U(B) = 2t. Both are "infinite" but B is yet larger than A, and therefore "better".
Comment author: 26 December 2010 03:25:08AM 0 points [-]
So we need to formalize this, obviously.
Method 1: Exponential discounting.
Problem: You don't care very much about future people.
Method 2: Taking the average over all time (specifically the limit as t goes to infinity of the integral of utility from 0 to t, divided by t)
Conclusion which may be problematic: If humanity does not live forever, nothing we do matters.
Caveat: Depending on our anthropics, we can argue that the universe is infinite in time or space with probability 1, in which case there are an infinite number of copies of humanity, and so we can always calculate the average. This seems like the right approach to me. (In general, using the same math for your ethics and your anthropics has nice consequences, like avoiding most versions of Pascal's Mugging.)
Comment author: 27 December 2010 07:43:52AM 2 points [-]
Problem: You don't care very much about future people.
Why is this a problem? This seems to match reality for most people.
Comment author: 01 January 2011 12:34:36AM 1 point [-]
So does selfishness and irrationality. We would like to avoid those. It also is intuitive that we would like to care more about future people.
Comment author: 06 January 2011 09:33:16AM * 1 point [-]
Excessive selfishness, sure. Some degree of selfishness is required as self-defense, currently, otherwise all your own needs are subsumed by supplying others' wants.. Even in a completely symmetric society with everybody acting more for others' good than their own is worse than one where everybody takes care of their own needs first -- because each individual generally knows their own needs and wants better than anyone else does.
I don't know the needs and wants of the future. I can't know them particularly well. I have worse and worse uncertainty the farther away in time that is. Unless we're talking about species-extinction level of events, I damn well should punt to those better informed, those closer to the problems.
It also is intuitive that we would like to care more about future people.
Not to me. Heck. I'm not entirely sure what it means to care about a person who doesn't exist yet, and where my choices will influence which of many possible versions will exist.
Comment author: 06 January 2011 03:31:30PM * 0 points [-]
each individual generally knows their own needs and wants better than anyone else does.
I don't know the needs and wants of the future.
Expected-utility calculation already takes that into effect. Uncertainty about whether an action will be beneficial translates into a lower expected utility. Discounting, on top of that, is double counting.
Knowledge is a fact about probabilities, not utilities.
Not to me.
Let's hope our different intuitions are resolvable.
I'm not entirely sure what it means to care about a person who doesn't exist yet, and where my choices will influence which of many possible versions will exist.
Surely it's not much more difficult than caring about a person who your choices will dramatically change?
Comment author: 26 December 2010 05:44:21AM 2 points [-]
If you have a set E = {X, Y, Z...} of possible actions, A (in E) is the utility-maximising action iff for all other B in E, the limit
$\lim_{t\rightarrow\infty}\left(\int_0^t Eu(A, t')dt' - \int_0^t {Eu(B, t')dt' \right)$
is greater than zero, or approaches zero from the positive side. Caveat: I have no evidence this doesn't implode in some way, perhaps by the limit being undefined. This is just a stupid idea to consider. A possibly equivalent formulation is
$\exists e\forall t.~(t>e) \implies \left(\int_0^t Eu(A, t')dt' \geq \int_0^t Eu(B, t')dt'\right)$
The inequality being greater or equal allows for two or more actions being equivalent, which is unlikely but possible.
Comment author: 27 December 2010 06:59:42PM 4 points [-]
Side comment: that math equation image generator you used is freakin' excellent. The image itself is generated based from the URL, so you don't have to worry about hosting. Editor is here.
Comment author: 28 December 2010 03:06:43AM * 4 points [-]
I prefer this one, which automatically generates the link syntax to paste into a LW comment. There's a short discussion of all this on the wiki.
Comment author: 26 December 2010 12:28:12PM 1 point [-]
Functions whose limit is +infinity and -infinity can be distinguished, so your good there.
I think it's the same as my second: As long as the probability given both actions of a humanity lasting forever is nonzero, and the differences of expected utilities far in the future is nonzero, nothing that happens in the first million billion years matters.
Comment author: 27 December 2010 09:30:13AM * 0 points [-]
The difference in expected utility would have to decrease slow enough (slower than exponential?) to not converge, not just be nonzero. [Which would be why exponential discounting "works"...]
However I would be surprised to see many decisions with that kind of lasting impact. The probability of an action having some effect at time t in the future "decays exponentially" with t (assuming p(Effect_t | Effect_{t-1}, Action) is approximately constant), so the difference in expected utility will in general fall off exponentially and therefore converge anyway. Exceptions would be choices where the utilities of the likely effects increase in magnitude (exponentially?) as t increases.
Anyway I don't see infinities as an inherent problem under this scheme. In particular if we don't live forever, everything we do does indeed matter. If we do live forever, what we do does matter, excepts how it affects us might not if we anticipate causing "permanant" gain by doing something.
Comment author: 26 December 2010 06:04:15AM 0 points [-]
Can't think about the underlying idea right now due to headache, but instead of talking about any sort of limit, just say that it's eventually positive, if that's what you mean.
Comment author: 26 December 2010 03:58:38AM 2 points [-]
Bostrom would disagree with your conclusion that infinities are unproblematic for utilitarian ethics: http://www.nickbostrom.com/ethics/infinite.pdf
Comment author: 26 December 2010 07:48:22AM 0 points [-]
You can switch between A and B just by rearranging when events happen. For example, imagine that there are two planets moving in opposite directions. One is a Utopia, the other is a Distopia. From the point of reference of the Utopia, time is slowed down in the Distopia, so the world is worth living in. From the point of reference of the Distopia, it's reversed.
This gets even worse when you start dealing with expected utility. As messed up as the idea is that the order of events matter, there at least is an order. With expected utility, there is no inherent order.
The best I can do is assign the priors for infinite utility to zero, and make my priors fall off fast enough to make sure expected utility always converges. I've managed to prove that my posteriors will also always have a converging expected utility. | 2017-05-25 18:20:00 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 2, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3752179443836212, "perplexity": 1613.02914325087}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-22/segments/1495463608120.92/warc/CC-MAIN-20170525180025-20170525200025-00196.warc.gz"} |
https://spinnaker8manchester.readthedocs.io/en/latest/_modules/spinnman/model/enums/diagnostic_filter_default_routing_status/ | # Source code for spinnman.model.enums.diagnostic_filter_default_routing_status
# Copyright (c) 2017-2019 The University of Manchester
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from enum import Enum
[docs]class DiagnosticFilterDefaultRoutingStatus(Enum):
""" Default routing flags for the diagnostic filters.
Note that only one has to match for the counter to be incremented
"""
#: Packet is to be default routed
DEFAULT_ROUTED = (0, "Packet is to be default routed")
#: Packet is not to be default routed
NON_DEFAULT_ROUTED = (1, "Packet is not to be default routed")
def __new__(cls, value, doc=""):
# pylint: disable=protected-access, unused-argument
obj = object.__new__(cls)
obj._value_ = value
return obj
def __init__(self, value, doc=""):
self._value_ = value
self.__doc__ = doc | 2022-01-27 10:34:31 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.28451648354530334, "perplexity": 3634.0474880755546}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320305260.61/warc/CC-MAIN-20220127103059-20220127133059-00716.warc.gz"} |
https://datascience.stackexchange.com/questions/10555/svm-prediction-time-increase-with-number-of-test-cases | # SVM prediction time increase with number of test cases
I am using scikit-learn's SVM for the MNIST digit classification dataset. In order to improve the performance I extended the dataset by adding rotated samples. I was aware that SVM takes O(N^3) time to train the data, where N is the number of training vectors.
However even prediction seems to take increase polynomially, the number of test vectors is the same. Is there any explanation for this or some equation that relates prediction time to the number of training samples?
I am using a 3rd degree polynomial as the kernel with C=100.0.
Note: I am doing a group project to compare the performance of various methods so I can't use any other method as my teammates would have used those. I referred to a paper by Decoste and Scholkoph which uses Virtual SVM. However I don't think I can run this on my current system if I can't run a simple extended training set.
The number of support vectors must be increasing. The prediction time is proportional to that; after all, the kernel classifier is $f(x) = \sum_i \alpha_i k(x, x_i)$, where the summation is over the support vectors. With sklearn you can find out how many you have by inspecting n_support_ | 2020-01-29 09:37:27 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7412794232368469, "perplexity": 483.20047705671055}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579251789055.93/warc/CC-MAIN-20200129071944-20200129101944-00171.warc.gz"} |
http://scicomp.aalto.fi/training/linux-shell-tutorial.html | # Linux shell tutorial¶
## Course basics¶
Linux Shell tutorial by Science IT at Aalto University.
Abstract: This course consists of two parts: Linux Shell Basics and Linux Shell Scripting. The first covers introductory level shell usage (which also is a backdoor introduction to Linux basics). The second covers actual BASH scripting, using learning by doing.
Linux Shell Basics: 2 sessions x 3h
Linux Shell Scripting: 4 sessions x 3h, session rough schedule 2x1h25m with 10m break in between.
Setting up instructions for the lecturer: Main terminal white&black with the enlarged font size. One small terminal at the top that shows commands to the learners.
• export PROMPT_COMMAND='history -a' # .bashrc or all the terminals one launches commands
• tail -n 0 -F .bash_history
Alternatively, script allows to follow the session even after sshing to a remote host plus command appear as soon as they are run. The regular expression can be adapted to the lecturer’s PS1, this one assumes ]$command. • script -f demos.out # action window • tail -n 1 -f demos.out | while read line; do [[ "$line" =~ \]\$\ ([^ ].+)$ ]] && echo ${BASH_REMATCH[1]}; done Starred exercises (*) are for advanced users who would like further stimulation. Based on • man bash v4.2 (Triton default version in Feb 2018) • Advanced BASH scripting guide [1] • UNIX Power Tools, Shelley Powers etc, 3rd ed, O’Reilly • common sense and 20+ years Linux experience • see also other references in the text ## PART #1. Linux Shell Basics¶ ## 1.1 session: processes and files¶ ### First touch: getting a BASH shell¶ Set yourself up with a BASH shell. Connect to a server or open on your own computer. Examples and demos given during the lecture are done on Triton, though should work on all other Linux installations. • Linux and Mac users: just open a terminal window. If you wish you can login to Triton or any other Aalto Linux server. • Windows users: install PuTTY [2] then SSH to any interactive server at Aalto or your department. ### About the Linux Shell¶ • A shell is what you get when your terminal window is open. It is a command-line (CLI), an interface that interpreters and executes the commands. • The name comes from being a “shell” (layer) around the operating system. It connects and binds all programs together. • This is the basic, raw method of using UNIX-like systems. It may not be used everyday, but it’s really good (necessary) for any type of automation and scripting - as is often needed in science, when connecting pieces together, or when using Triton. • There are multiple shells. This talk is about bash, which is the most common one. zsh is another common shell which is somewhat similar but has some more powerful features. tcsh is another shell from a completely different family (the csh family), which has quite different syntax. • bash is a “Bourne shell”: the “bourne-again shell”. An open source version of original Bourne shell. • It may not be obvious, but the concepts here also apply to Windows programs and will help you understand them. They also apply more directly to Mac programs, because Mac is unix under the hood. ### Basic shell operation¶ • You type things on the screen (standard input or stdin). The shell uses this to make a command. • The shell takes the command, splits it into words, does a lot more preprocessing, and then runs it. • When the command runs, the keyboard (still standard input) goes to the process, output (standard output) goes to the screen. ### What’s a UNIX process?¶ • To understand a shell, let’s first understand what processes are. • All programs are a process: process is a program in action. • Processes have: • Process ID (integer) • Name (command being run) • Command line arguments • input and output: stdin (input, like from keyboard), stdout (output, like to screen), stderr (like stdout) • Return code (integer) when complete • Working directory • environment variables: key-values which get inherited across processes. • These concepts bind together all UNIX programs, even graphical ones. Process listing commands (feel free to try, but we play more with them later): top # (q to quit) htop # (q to quit) pstree pstree$USER
pstree -pau $USER ps auxw You can find info about your user (try them right away): id echo$SHELL
Is your default shell is a /bin/bash? Login to kosh/taltta and run chsh -s /bin/bash
Another way to find out what SHELL you are running:
### Files and directories¶
Files contain data. They have a name, permissions, owner (user+group), contents, and some other metadata.
Filenames may contain any character except ‘/’, which is reseved as a separator between directory and filenames. The special characters would require quotaion while dealing, with such filenames, though it makes sence to avoid them anyway.
Path can be absolute, starts with ‘/’ or relative, that is related to the current directory.
ls is the standard way of getting information about files. By default it lists your current directory (i.e. pwd), but there are many options:
# list directory content
ls /scratch/work
# list directory files including dot files (i.e. hidden ones)
ls -A ~/directory1
# list all files and directories using long format (permissions, timestamps, etc)
ls -lA ../../directory2
Special notations and expanssions in BASH, can be used with any command:
./, ../, ~, *, ?, [], [!], {abc,xyz}, {1..10}
For the quotation:
'', "", \
Quotation matters “$USER” vs echo '$USER'
BASH first expand the expanssions and substitute the wildcards, and then execute the command. Could be as complex as:
ls -l ~/[!abc]???/dir{123,456}/filename*.{1..9}.txt
There are a variety of commands to manipulate files/directories:
cd, mkdir, cp, cp -r, rm, rm -r, mv, ln, touch
For file/directory meta information or content type:
ls, stat, file
Note that cd is a shell builtin which change’s the shell’s own working directory. This is the base from which all other commands work: ls by default tells you the current directory. . is the current directory, .. is the parent directory, ~ is your HOME. This is inherited to other commands you run. cd with no options drops your to your $HOME. # copy a directory preserving all the metadata to two levels up cp -a dir1/ ../../ # move all files with the names like filename1.txt, filename_abc.txt etc to dir2/ mv filename*.txt dir2/ # remove a directories/files in the current dir without asking for the confirmation rm -rf dir2/ dir1/ filename* # create an empty file if doesn't exist or update its access/modification time touch filename # create several directories at once mkdir dir3 dir4 dir5 # -or- mkdir dir{3,4,5} # make a link to a target file (hard link by default, -s for symlinks) ln target_file ../link_name Discover other ls features ls -lX, ls -ltr, ls -Q You may also find useful rename utility implemented by Larry Wall. ### File/directory permissions¶ • Permissions are one of the types of file metadata. • They tell you if you can read a file, write a file, and execute a file/list directory • Each of these for both user, group, and others • Here is a typical permission bits for a file: -rw-r--r-- • In general, it is rwxrwxrwx – read, write, execute/search for user, group, others respectively • ls -l gives you details on files. ### Modifying permissions: the easy part¶ chmod/chown is what will work on all filesystems: chmod u+rwx,g-rwx,o-rwx <files> # u=user, g=group, o=others, a=all # -or- chmod 700 <files> # r=4, w=2, x=1 # recursive, changing all the subdirectories and files at once chmod -R <perm> <directory> # changing group ownership (you must be a group member) chgrp group_name <file or directory> Extra permission bits: • s-bit: setuid/setgid bit, preserves user and/or group IDs. • t-bit: sticky bit, for directories it prevents from removing file by another user (example /tmp) Setting default access permissions: add to .bashrc umask 027 [8]. The umask is what permissions are removed from any newly created file by default. So umask 027 means “by default, g-w,o-rwx any newly created files”. It’s not really changing the permissions, just the default the operating system will create with. Hint: even though file has a read access the top directory must be searchable before external user or group will be able to access it. Sometimes on Triton, people do chmod -R o-rwx$WRKDIR; chmod o+x $WRKDIR. Execute (x) without read (r) means that you can access files inside if you know the exact name, but not list the directory. The permissions of the files themselves still matter. ### Modifying permissions: advanced (*)¶ Access Control Lists (ACLs) are advanced access permissions. They don’t work everywhere, for example mostly do no work on NFS mounted directories. They are otherwise supported on ext4, lustre, etc (thus works on Triton$WRKDIR).
• In “normal” unix, files have only “owner” and “group”, and permissions for owner/group/others. This can be rather limiting.
• Access control lists (ACLS) are an extension that allows an arbitrary number of users and groups to have access rights to files. The basic concept is that you have:
• ACLs don’t show up in normal ls -l output, but there is an extra plus sign: -rw-rwxr--+. ACLs generally work well, but there are some programs that won’t preserve them when you copy/move files, etc.
• POSIX (unx) ACLs are controlled with getfacl and setfacl
• Allow read access for a user setfacl -m u:<user>:r <file_or_dir>
• Allow read/write access for a group setfacl -m g:<group>:rw <file_or_dir>
• Revoke granted access setfacl -x u:<user> <file_or_dir>
• See current stage getfacl <file_or_dir>
File managers on Triton we have installed Midnight Commander – mc
Advanced file status to get file meta info stat <file_or_dir>
[Lecture notes: hands-on ~30 mins till the end of this session]
Exercise 1.1.2: mkdir in your $HOME (or $WRKDIR if on Triton), cd there and touch a file. Rename it. Make a copy and then remove the original. What does touch do? list all files in /usr/bin and /usr/sbin that start with non-letter characters with one ls command (*) list with ls dot files/directories only (by default it lists all files/directories but not those that begin with .). “dotfiles” are a convention where filenames that begin with . such as .bashrc are considered “hidden”. Explore stat file output. What metadata do you find? Try to stat files of different types (regular file, directory, link, special device in /dev, named pipe) create a directory, use chmod to allow user and any group members full access and no access for others (*) change that directory group ownership with chown or chgrp (any group that you belong to is fine), set s-bit for the group and apply t-bit to a directory, check that the upper directory has o+x bit set: now you should have a private working space for your group. Tip: see groups that you are a member of id -Gn ls -ld tells you that directory has permissions rwxr-Sr--. Do group members have access there? create a directory (in WRKDIR if on Triton and in /tmp if on any other server), use setfacl to set its permissions so that only you and some user/group of your choice would have access to it. (*) create a directory and a subdirectory in it and set their permissions to 700 with one command.
## 1.2 session: interactive usage¶
### find¶
• find is a very unixy program: it finds files, but in the most flexible way possible.
• It is a amazingly complicated program
• It is a number one in searching files in shell
With no options, just recursively lists all files starting in current directory:
find
The first option gives a starting directory:
find /etc/
Other search options: by modification/accessing time, by ownership, by access type, joint conditions, case-insensitive, that do not match, etc [5] [6]:
# -or- 'find ~ $WRKDIR -name file.txt' one can search more than one dir at once find ~ -name file.txt # look for jpeg files in the current dir only find . -maxdepth 1 -name '*.jpg' -type f # find all files of size more than 10M and less than 100M find . -type -f -size +10M -size -100M # find everything that does not belong to you find ~ ! -user$USER | xargs ls -ld
# open all directories to group members
# tip: chmod applies x-bit to directories automatically
find . -type d -exec chmod g+rw {} \;
# find all s-bitted executable binaries
find /usr/{bin,sbin} -type f -perm -u+x,u+s
# find and remove all files older than 7 days
find path/dir -type f -mtime +7 -exec rm -f {} \;
Find syntax is actually an entire boolean logic language given on the command line: it is a single expression evaluated left to right with certain precedence. There are match expressions and action expressions. Thus, you can get amazingly complex if you want to. Take a look at the ‘EXAMPLES’ section in man find for the comprehensive list of examples and explanations.
find on Triton On Triton’s WRKDIR you should use lfs find. This uses a raw lustre connection to make it more efficient than accessing every file. It has somewhat limited abilities as comparing to GNU find. For details man lfs on Triton.
Fast find – locate Another utility that you may find useful locate <pattern>, but on workstations only. This uses a cached database of all files, and just searches that database so it is much faster.
Too many arguments error solved with the find ... | xargs
### File archiving¶
tar is the de-facto standard tool for saving many files or directories into a single archive file. Archive files may have extenssions .tar, .tar.gz etc depending on compression.
# create tar archive gzipped on the way
tar -caf arhive_name.tar.gz directory_to_be_archived/
# extract files
tar -xaf archive_name.tar.gz -C path/to/directory
Other command line options: r - append files to the end of an archive, t - list archive content. f is for the filename, and a selects the compression method based on the archive file suffix (in this example gzip, due to the .gz suffix. Without compression files/directories are simply packed as is.
# xz has better compression ratio than gzip, but is very slow
tar -caf archive_file.tar.xz dir1/ dir2/
Individual files can be compressed directly, e.g. with gzip:
# file.gz is created, file is removed in the process.
gzip file
# Uncompress
gunzip file.gz
### Transferring files (+archiving on the fly)¶
For Triton users the ability to transfer files to/from Triton is essential. Same applicable to file transfer between your home workstation and kosh etc.
Several use cases:
# transferring a file from your HOME on kosh to your home worstaion
# transferring files from Triton to your Aalto workstation
(*) Another use case, copying to Triton, or making a directory backup with rsync:
rsync -urlptDxv --chmod=Dg+s somefile triton.aalto.fi:/scratch/work/LOGIN_NAME # copy a file to $WRKDIR rsync -urlptDxv --chmod=Dg+s dir1/ triton.aalto.fi:/scratch/work/LOGINNAME/dir1/ # sync two directories (*) Transferring and archiving your Triton data on the fly to some other place: # login to Triton cd$WRKDIR
tar czf - path/to/dir | ssh kosh.aalto.fi 'cat > path/to/archive/dir/archive_file.tar.gz'
[Lecture notes: this session has three theory+excersise hands-ons, roughly 40+20 minutes each]
export CDPATH=$HOME:$WRKDIR:$WRKDIR/project ### Initialization files and configuration¶ • When the shell first starts (when you login), it reads some files. These are normal shell files, and it evaluates normal shell commands to set configuration. • You can always test things in your own shell and see if it works before putting it in the config files. Highly recommended! • You customize your environment means setting or expanding aliases, variables, functions. • The config files are: • .bashrc (when SSH) and • .bash_profile (interactive login to a workstation) • they are often a symlink from one to another • To get an idea how complicated .bashrc can be take a look at <https://www.tldp.org/LDP/abs/html/sample-bashrc.html> One of the things to play with: command line prompt defined in PS1 [4] PS1="[\d \t $email protected]\h:\w ] " For special characters see PROMPTING at man bash. To make it permanent, should be added to .bashrc like export PS1. ### Creating/editing/viewing file¶ • A text editor edits files as ASCII. These are your best friend. In fact, text files are your best friend: rawest, most efficient, longest-lasting way of storing data. • “pager” is a generic term for things that view files or data. Linux command line text editors like: • nano - simplest • vim - minimal. To save&quit, ESC :wq • emacs - or the simplest one nano. To save&quit: Ctrl-x Ctrl-c To view contents of a file in a scrollable fashion: less Quick look at the text file cat filename.txt (dumps everything to screen- beware of non-text binary files or large files!) Other quick ways to add something to a file (no need for an editor) echo 'Some sentence, or whatever else 1234567!-+>#' > filename.txt cat > filename2.txt to finish typing and write written to the file, press enter, then Ctrl-d. The best text viewer ever less -S (to open a file in your EDITOR, hit v, to search through type /search_word) Watching files while they grow tail -n 0 -f <file> Try: add above mentioned export PS1 to .bashrc. Remember source .bashrc to enable changes Exercise 1.2.2: link .bash_profile to .bashrc. Tip: see ln command from the previous session. open ~/.bashrc for eiditng and add there CDPATH example from above, customize it for your needs and test. Tip: remember source ~/.bashrc. add umask 027 to .bashrc, try creating files. Tip: umask -S prints your current setting. customize a prompt PS1 and add it to your .bashrc, make sure is has a current directory name and the hostname in it in the format hostname:/path/to/current/dir. Hint: save the original PS1 like oldPS1=PS1 to be able to recover it any time. (*) Set some default options for the less program in your bashrc. Examples: case-insensitive searching, long prompt, wrapping lines. ### Utilities: the building blocks of shell¶ • wide range of all kind of utilities available in Linux • shell is a glue to bind them all together • commandline is often a long list of those utilities joint into pipe that pass output of each other further cat; sort; tr; cut; head; date; tail; wc; grep; uniq; paste; find # and many others We catch many of them on the way. ### Input and output: redirect and pipes¶ • Programs can display something: echo this is some output or cat • Programs can take some input: e.g. less by default displays input if no filename given. • cat /etc/bashrc dumps that file to stardard output (stdout) • cat /etc/bashrc | less gives it to less on standard input (stdin) Pipe: output of the first command as an input for the second one command_a | command_b: # send man page to a default printer man -t ls | lpr # see what files/directories use the most space, including hidden ones du -hs * .[!.]* | sort -h # count a number of logged in users w -h | wc -l # to remove all carriage returns and Ctrl-z characters from a Windows file cat win.txt | tr -d '\15\32' > unix.txt # to list all matching commands history | grep -w 'command name' # print all non-printable characters as well ls -lA | cat -A # print the name of the newest file in the directory (non-dot) ls -1tF | grep -v -E '*/|@' | head -1 Redirects: • Like pipes, but send data to/from files instead of other processes. • Replace a file: command > file.txt • Append to a file: command >> file.txt (be careful you do not mix them up!) • Redirect file as STDIN: command < file (in case program accepts STDIN only) echo Hello World > hello.txt ls -lH >> current_dir_ls.txt # join two files into one cat file1 file2 > file3 # extract user names and store them to a file getent passwd | cut -d: -f1,5 > users # join file1 and 2 lines one by one using : as a delimiter paste -s -d : file1 file2 > file3 # go through file1 and replace spaces with a new line mark, then output to file2 tr -s ' ' '\n' < file1 > file2 # -or- in more readable format cat file1 | tr -s ' ' '\n' > file2 This is the unix philosophy and the true power of the shell. The unix philosophy is a lot of small, specialized, good programs which can be easily connected together. The beauty of the cli are elegant one-liners i.e. list of commands executed in one line. To dump output of all commands at once: group them. { command1; command2; } > filename # commands run in the current shell as a group ( command1; command2; ) > filename # commands run in external shell as a group Coreutils by GNU You may find many other useful commands at https://www.gnu.org/software/coreutils/manual/coreutils.html ### Pipelines: ;, &&, and ||¶ • You can put several commands on the same line using different separators. • The shell term for this is pipelines. Chaining: command_a ; command_b: always runs both commands. Remember exit codes? In shell, 0=success and anything 1-255=failure. Note that this is opposite of normal Boolean logic! The && and || are short-circuit (lazy) boolean operators. They can be used for quick conditionsals. • command_a && command_b • If command_a is successful, also run command_b • final exit code is last evaluated one, which has the role of Boolean and. • command_a || command_b • If command_a is not successful, also run command_b • final exit code is that of the last evaluated command, which has the role of Boolean or. Hint command_a && command_b || command_c Try: cd /nonexistent_dir && ls /nonexistent_dir compare with cd /nonexistent_dir; ls /nonexistent_dir Try: ping -c 1 8.8.8.8 > /dev/null && echo online || echo offline ### grep¶ Later on you’ll find out that grep is one of the most useful commands you ever discover on Linux (except for all the other most useful commands ever) grep <pattern> <filename> # grep lines that match <pattern> -or- command | grep <pattern> # grep lines from stdin # search all the files in the dir/ and its subdirs, to match the word 'is', case insensitive grep -R -iw 'is' dir/ # grep all lines from *command* output, except those that have 'comment' in it *command* | grep -v comment # displaying 2 extra lines before and after the match (-A just after, -B just before) grep -C 2 'search word' file # counts the number of matches grep -c <pattern> file(s) # shows only the matched part of the string (by default grep shows whole line) grep -o <pattern> file(s) # accepts way more advanced regular expressions as a search pattern grep -E <extended_regexpr> file(s) For details on what <pattern> could be, look for REGULAR EXPRESSIONS at man grep. Some examples: # grep emails to a list grep -Eio "\b[a-z0-9._%+-][email protected][a-z0-9.-]+\.[a-z]{2,6}\b" file.txt # grep currently running firefox processes ps auxw | grep firefox # grep H1 and H2 header lines out of HTML file grep "<[Hh][12]>" file.html Exercise 1.2.3: make a pipe that counts number of files/directories (including dot files) in your directory grep directories out of ls -l grep all but blank lines in triton:/etc/bashrc expand the previous one to filter out commented lines also (line starts with #). Note that lines may have spaces before # mark. count unique logged in users on triton. Tip: w or users gives you a list of all currently login users, many of them have several sessions open. (*) Play with the commands grep, cut: find at least two ways to extract IP addresses only out of /etc/hosts. Tip: grep has -o option, thus one can build a regular expression that will grab exactly what you need. (*) Using pipes and commands echo/tr/uniq, find doubled words out of My Do Do list: Find a a Doubled Word. Any easier way to do it? ## PART #2. Linux Shell Scripting¶ ## Quoting, substitutions, aliases¶ Last time, we focused on interactive things from the command line. Now, we build on that some and end up with making our own scripts. ### Command line processing and quoting¶ So, shell is responsible for interpreting the commands you type. Executing commands might seem simple enough, but a lot happens between the time you press RETURN and time your computer actually does something. • When you enter a command line, it is one string. • When a program runs, it always takes an array of strings (the argv in C, sys.argv in Python, for example). How do you get from one string to an array of strings? Bash does a lot of processing. • The simplest way of looking at it is everything separated by spaces, but actually there is more: variable substitution, command substitution, arithmetic evaluation, history evaluation, etc. The partial order of operations is (don’t worry about exact order: just realize that the shell does a lot of different things in same particular order): • history expansion • brace expansion ({1..9}) • parameter and variable expansion (VAR, {VAR}) • command substitution (()) • arithmetic expansion (((1+1))) • word splitting • pathname expansion (*, ?, [a,b]) • redirects and pipes One thing we will start to see is shell quoting. There are several types of quoting (we will learn details of variables later): # Double quotes: disable all other characters except , ', \ echo "SHELL" # Single quotes: disable all special characters echo 'SHELL' # backslash disables the special meaning of the next character ls name\ with\ space By special characters we mean: # & * ? [ ] ( ) { } = | ^ ; < > " ' \ There are different rules for embedding quoting in other quoting. Sometimes a command passes through multiple layers and you need to really be careful with multiple layers of quoting! This is advanced, but just remember it. echo 'What's up? how much did you get ?' # wrong, ' can not be in between '' echo "What's up? how much did you get ?" # wrong, is a variable in this case echo "What's up? how much did you get \\?" # correct echo "What's up? how much did you get "''"?" # correct At the end of the line \ removes the new line character, thus the command can continue to a next line: ping -c 1 8.8.8.8 > /dev/null && \ echo online || \ echo offline ### Substitute a command output¶ • Command substitutions execute a command, take its stdout, and place it on the command line in that place. (command) or alternatively command. Could be a command or a list of commands with pipes, redirections, grouping, variables inside. The () is a modern way, supports nesting, works inside double quotes. To understand what is going on in these, run the inner command first. # get the latest modified file to a variable newest=(ls -F1t | grep -v */ | head -1) # save current date to a variable today=(date +%Y-%m-%d) # create a new file with current timestamp in the name (almost unique filename) touch file.(date +%Y-%m-%d-%H-%M-%S) # archive current directory content, where new archive name is based on current path and date tar czf (basename (pwd)).(date +%Y-%m-%d).tar.gz . # counting directories and files on the fly echo Number of directories (ls -lA | grep ^d | wc -l) files (ls -lA | grep ^- | wc -l) This is what makes BASH powerful! Note: (command || exit 1) will not have an effect you expect, command is executed in a subshell, exiting from inside a subshell, closes the subshell only not the parent script. Subshell can not modify its parent shell environment, though can give back exit code or signal it: # this will not work, echo still will be executed dir=nonexistent echo (ls -l dir || exit 1) # this will not work either, since || evaluates echo's exit code, not ls echo (ls -l dir) || exit 1 # this will work, since assignment a comman substitution to a var returns exit # code of the executed command var=(ls -l dir) || exit 1 echo var ### More about redirection, piping and process substitution¶ STDIN, STDOUT and STDERR: reserved file descriptors 0, 1 and 2. They always there whatever process you run. /dev/null file (actually special operating system device) that discards all data written to it. # discards STDOUT only command > /dev/null # discards both STDOUT and STDERR command &> /dev/null command > /dev/null 2>&1 # same as above, old style notation # redirects outputs to different files command 1>file.out 2>file.err # takes STDIN as an input and outputs STDOUT/STDERR to a file command < input_file &> output_file Note, that &> and >& will do the same, redirect both STDOUT and STDERR to the same place, but the former syntax is preferable. # what happens if 8.8.8.8 is down? How to make the command more robust? ping -c 1 8.8.8.8 > /dev/null && echo online || echo down # takes a snapshot of the directory list and send it to email, then renames the file ls -l > listing && { mail -s "ls -l (pwd)" [email protected] < listing; mv listing listing.(date +"%Y-%m-%d-%H-%M") } # a few ways to empty a file > filename cat /dev/null > filename # read file to a variable var=(< path/to/file) # extreme case, if you can't get the program to stop writing to the file... ln -s /dev/null filename Pipes are following the same rules with respect to standard output/error. In order to pipe both STDERR and STDOUT |&. If ! preceeds the command, the exit status is the logical negation. tee in case you still want output to a terminal and to a file command | tee filename But what if you need to pass to another program results of two commands at once? Or if command accepts file as an argument but not STDIN? One can always do this in two steps, run commands and save results to file(s) and then use them with the another command. Though BASH helps to make even this part easier (or harder), the feature called Process Substitution, looks like <(command) or >(command), no spaces in between parentheses and < signs. It emulates a file creation out of command output and place it on a command line. The command can be a pipe, pipeline etc. The actual file paths substituted are /dev/fd/<n>. The file paths can be passed as an argument to the another command or just redirected as usual. # BASH creates a file that has an output of *command2* and pass it to *command1* # file descriptor is passed as an argument, assuming command1 can handle it command1 <(command2) # same but redirected (like: cat < filename) command1 < <(command2) # in the same way one can substitute results of several commands or command groups command1 <(command2) <(command3 | command4; command5) # example: comparing listings of two directories diff <(ls dir1) <(ls dir2) # and vice versa, *command1* output is redirected as a file to *command2* command1 > >(command2) # essentially, in some cases pipe and process substituion do the same ls -s | cat cat <(ls -s) ### Aliases¶ • Alias is nothing more than a shortcut to a long command sequence • With alias one can redefine an existing command or name a new one • Alias will be evaluated only when executed, thus it may have all the expansions and substitutions one normally has on the cli • They are less flexible than functions which we will discuss next # your own listing command alias l='ls -lAF' # shortcut for checking space usage alias space='du -hs .[!.]* * | sort -h' # prints in the compact way login/group alias me="echo \"'(id -un)' '(id -gn)'\"" # redefine rm alias rm='rm -i' alias rm='rm -rf' Aliases go to .bashrc and available later by default (really, anywhere they can be read by the shell). [Lecturer’s notes: about 40 mins joint hands-on session + break] Exercise 2.1: Define above mentioned ping ... command as an alias (you name it) in ~/.bashrc once you verify it works. Then source ~/.bashrc and try the new alias. Tip: any path that starts with ~ means the file or directory is in your HOME. Create a directory structure, that has five directories and five subdirs in each directory like dir1/subdir1, dir1/subdir2, … dir5/subdir5 with one command. Tip: use Brace expansions and see mkdir -p ... Use command substitution to create an empty file with the date the in the name, like file.YYYY-MM-DD.out. Tip: investigate date +"..." output format. Create a one-liner with ls, echo, redirections etc that takes a file path and says whether this file/directory exists or not. Redirect STDOUT/STDERR to /dev/null. See our ping -c 8.8.8.8 ... as an example. Use any of the earlier created files to compare there modification times with stat -c '%y' filename, diff and the process substitution. (*) Make a one-liner that copies a small dir (small (!), to save time/traffic) from your Triton’s WRKDIR (or any other remote server) and sends confirmation to your email with the directory listing attached but use process substitution instead of saving directory listing to a file. Tip: use examples in the text. (*) Using pipes and commands echo, tr, uniq, find doubled words out of My Do Do list: Find a a Doubled Word. (*) Pick up /scratch/scip/BASH/windows.txt file and convert it to UNIX format using tr and redirects only. Tip: remind first session examples. (*) Using find, duplicate current directory tree (to some other dir, only tree, no content) (*) Join find and grep power and find all the files in /{usr/,}{bin,sbin} that have ‘#!/bin/bash’ in it ## Variables, functions, environment¶ ### Your ~/bin and PATH¶ The PATH is an environment variable. It is a colon delimited list of directories that your shell searches through when you enter a command. Binaries are at /bin, /usr/bin, /usr/local/bin etc. The best place for your own is ~/bin.: # add to .bashrc export PATH="PATH:HOME/bin" # after you have your script written, set +x bit and run it chmod +x ~/bin/script_name.sh script_name.sh You can find where a program is using which or type -a, we recommend the later one: type -a ls # a binary type -a cd # builtin Other options: # +x bit and ./ chmod +x script.sh ./script.sh # that works if script.sh has #!/bin/bash as a first line # with no x bit bash script.sh # this will work even without #!/bin/bash Extension is optional note that .sh extension is optional, script may have any name ### Functions as part of your environment¶ Alias is a shortcut to a long command, while function is a piece of programming that has logic and can accept input parameters. Functions can be defined on-the-fly from the cli, or can go to a file. Let us set ~/bin/functions and collect everything useful there.: # cd to the directory and lists it at once # can be run as: lcd <path/to/directory> lcd() { cd 1 ls -FlA } # in one line, note spaces and ; delimiters lcd() { cd 1; ls -FlA; } # -or- in a full format function lcd { cd 1; ls -FlA; } By now function has been defined, to run it, one has to invoke it.: source ~/bin/functions lcd dir1 The function refers to passed arguments by their position (not by name), that is 1, 2, and so forth: func_name arg1 arg2 arg3 # will become 1 2 3 Functions in BASH have return but it only returns the exit code. Useful in cases where you want to ‘exit’ the function and continue to the rest of the script. By default functions’ variables are in the global space, once chaged in the function is seen everywhere else. local can be used to localize the vars. Compare: var=2; f() { var=3; }; f; echo var var=2; f() { local var=3; }; f; echo var If you happened to build a function in an alias way, redefining a command name while using that original command inside the function, you need to type command before the name of the command, like: rm() { command rm -i "[email protected]"; } here you avoid internal loops (forkbombs). Exporting a function with export -f function_name lets you pass a function to a sub-shell, by storing that function in a environment variable. Helpful when you want to use it within a command substitution, or any other case that launches a subshell, like find ... -exec bash -c 'function_name {}' \;. ### Variables¶ In shell, variables define your environment. Common practice is that environmental vars are written IN CAPITAL: HOME, SHELL, PATH, PS1, RANDOM. To list all defined variables printenv. All variables can be used or even redefined. No error if you call an undefined var, it is just considered to be empty: # assign a variable, note, no need for ; delimiter var1=100 var2='some string' # calling a variable is just putting a dollar sign in a front echo "var1 is var1" # re-assign to another var var3=var1 # when appending a variable, it is considered to be a string var+=<string>/<integer> var1+=50 # var1 is now 10050 var2+=' more' # var2 is 'some string more' # we come later to how to deal with the integers (Arithmetic Expanssions (()) below) There is no need to declare things in advance: there is flexible typing. In fact, you can access any variable, defined or not. However, you can still declare things to be of a certain type if you need to: declare -r var=xyz # read-only declare -i var # must be treated as an integer, 'man bash' for other declare options BASH is smart enough to distinguish a variable inline without special quoting: dir=HOME/dir1 fname=file fext=xyz echo "dir/fname.fext" though if variable followed by a number or a letter, you have to explicitly separate it with the braces syntax: echo {dir}2/{file}abc.fext Built-in vars: • ? exit status of the last command • current shell pid • # number of input parameters • 0 running script name, full path • FUNCNAME function name being executed, [ note: actually an array {FUNCNAME[*]} ] • 1, 2 … input parameter one by one (function/script) • “@” all input parameters as is in one line example() { echo -e " number of input params: #\n input params: [email protected]\n shell process id: \n script name: 0\n function name: FUNCNAME"; return 1; }; f arg1 arg2; echo "exit code: ?" What if you assing a variable to a variable like: var2='something' var1=\var2 echo var1 # will return 'var2' literally # BASH provides built-in 'eval' command that reads the string then re-evaluate it # if variables etc found, they are given another chance to show themselves eval echo var1 # returns 'something' In more realistic examples it is often used to compose a command string based on input parameters or some conditionals and then evaluate it at very end. ### Magic of BASH variables¶ BASH provides wide abilities to work with the vars “on-the-fly” with {var...} like constructions. This lets you do simple text processing easily. These are nice, but are easy to forget so you will need to look them up when you need them. • Assign a var with default value if not defined: {var:=value} • Returns var value or a default value if not defined: {var:-value} • Print an error_message if var empty: {var:?error_message} • Extract a substring: {var:offset:length}, example var=abcde; echo {var:1:3} returns ‘bcd’ • Variable’s length: {#var} • Replace beginning part: {var#prefix} • Replace trailing part: {var%suffix} • Replace pattern with the string: {var/pattern/string} • Modify the case of alphabetic characters: {var,,} for lower case or {var^^} for upper case # will print default_value, which can be a variable var=''; echo {var:-default_value} var1=another_value; var=''; echo {var:-var1} # assign the var if it is not defined # note that we use ':' no operation command, to avoid BASH's 'command not found' errors : {var:=default_value} # will print 'not defined' in both cases var=''; echo {var:?not defined} var=''; err='not defined'; echo {var:?err} # will return 'love you' var='I love you'; echo {var:2:8} # will return 15, that is a number of characters var='I love you too!'; echo {#var} # returns file.ext var=26_file.ext; echo {var#[0-9][0-9]_} # in both cases returns 26_file var=26_file.ext; echo {var%.ext} var=26_file.ext; echo {var%.[a-z][a-z][a-z]} # returns 'I hate you' var='I love you'; echo {var/love/hate} # other options for substitutions var=' some text '; echo {var/# /} # returns without the first space echo {var/% /} # without the last space echo {var// /} # without spaces at all Except for the := the variable remains unchanged. If you want to redefine a variable: var='I love you'; var={var/love/hate}; echo var # returns 'I hate you' BASH allows indirect referencing, consider: var1='Hello' var2=var1 echo var2 # returns text 'var1' echo {!var2} # returns 'Hello' instead of 'var1' To address special characters: # replacing all tabs with the spaces in the var var={var//'\t'/ } [Lecturer’s note: ~20 minutes for the hands-on exercises. Solution examples can be given at very end.] Exercise 2.2: Expand lcd() function to have WRKDIR as a default directory in case function is invoked without any input parameter. Expand the Exersice 2.1’s ls ... && echo .. || echo example, make a function that check any file/directory existense given as an argument, like checkexist path/to/file. If no argument given, function must return an error message “File or directory not found”. Implement a spaceusage() function with du ... | sort ... (see Aliases part examples) that takes directory path as an argument, and if missing uses current directory. Using find utility, implement a ‘fast find’ function ff word. The function should return a long listing (ls -ldA) of any file or directory names that contain the . Make search case insensitive. Note: your newly ceated functions should go to ~/bin/functions file. Write two functions get_filename() and get_extension(). Both should accept a full filename like path/to/filename.ext of any length and return filename or ext correspondingly. Extenssion can be of any length. Function should handle missing argument case correctly. Expand get_filename() so that it would accept extenssion pattern as a second argument (if given) and return filename out of path/to/filename.tar.gz or alike. I.e. get_filename path/to/filename.tar.gz tar.gz (*) By now one should be able to explain: :() { :|:&; };:. & in this case sends process to background. [WARNING: it is a forkbomb] (*) On Triton write a function that lfs find all the dirs/files at WRKDIR that do not belong to your group and fix the group ownership. Use find ... | xargs. Tip: on Triton at WRKDIR your username USER and group name are the same. On any other filesystem, (id -gn) returns your group name. One can (*) Expand the function above to set group’s s-bit on all the WRKDIR directories. ## Conditionals¶ ### Tests: [[ ]]¶ • [[ expression ]] returns 0=true/success or 1=false/failure depending on the evaluation of the conditional expression. • [[ expression ]] is a new upgraded variation on test (also known as [ ... ]), all the earlier examples with single brackets that one can find online will also work with double • Inside the double brackets it performs tilde expansion, parameter and variable expansion, arithmetic expansion, command substitution, process substitution, and quote removal • Conditional expressions can be used to test file attributes and perform string and arithmetic comparisons Selected examples file attributes and variables testing: • -f file true if is a file • -r file true if file exists and readable • -d dir true if is a directory • -e file true if file/dir/etc exists in any form • -z string true if the length of string is zero (always used to check that var is not empty) • -n string true if the length of string is non-zero • file1 -nt file2 true if file1 is newer (modification time) • many more others # checks that file exists [[ -f file ]] && echo file exists || { echo error; exit 1; } # check that directory does not exist before creating one [[ -d dir ]] || mkdir dir Note that integers have their own construction (( expression )) (we come back to this), though [[ ]] will work for them too. The following are more tests: • == strings or integers are equal (= also works) • != strings or integers are not equal • string1 < string2 true if string1 sorts before string2 lexicographically • > vice versa, for integers greater/less than • string =~ pattern matches the pattern against the string • && logical AND, conditions can be combined • || logical OR • ! negate the result of the evaluation • () group conditional expressions In addition, double brackets inherit several operands to work with integers mainly: • -eq, -ne, -lt, -le, -gt, -ge equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal # the way to check input arguments, if no input, exit (in functions # 'return 1'). Remember, # is special variable for number of arguments. [[ # -eq 0 ]] && { echo Usage: 0 arguments; exit 1; } aalto=Aalto hy=HY utu=UTU # the result will be true (0), since Aalto sorts before HY [[ aalto < hy ]]; echo ? # though with a small modification, the way around is going to be true also [[ ! aalto > hy ]]; echo ? # this will return also true, here we compare lengths, Aaaaalto has a longer... name [[ {#aalto} -gt {#hy} ]]; echo ? # true, since Aalto in both cases sorted before HY and UTU [[ aalto < hy && aalto < utu ]]; echo ? # false, since both fail [[ ( aalto < hy && aalto > utu ) || hy > utu ]]; echo ? # note that [[ ]] always require spaces before and after brackets The matching operator =~ brings more opportunities, because regular expressions come in play. Even more: matched strings in parentheses assigned to {BASH_REMATCH[]} array elements! • Regular expressions (regexs) are basically a mini-language for searching within, matching, and replacing text in strings. • They are extremely powerful and basically required knowledge in any type of text processing. • Yet there is a famous quote by Jamie Zawinski: “Some people, when confronted with a problem, think ‘I know, I’ll use regular expressions.’ Now they have two problems.” This doesn’t mean regular expressions shouldn’t be used, but used carefully. When writing regexs, start with a small pattern and slowly build it up, testing the matching at each phase, or else you will end up with a giant thing that doesn’t work and you don’t know why and can’t debug it. There are also online regex testers which help build them. • While the basics (below) are the same, there are different forms of regexs! For example, the grep program has regular regexs, but grep -E has extended. The difference is mainly in the special characters and quoting. Basically, check the docs for each language (Perl, Python, etc) you want to use regexs in. Selected operators: • . matches any single character • ? the preceding item is optional and will be matched, at most, once • * the preceding item will be matched zero or more times • + the preceding item will be matched one or more times • {N} the preceding item is matched exactly N times • {N,} the preceding item is matched N or more times • {N,M} the preceding item is matched at least N times, but not more than M times • [abd], [a-z] a character or a range of characters/integers • ^ beginning of a line • the end of a line • () grouping items, this what comes to {BASH_REMATCH[@]} # match an email email='[email protected]'; regex='(.*)@(.*)'; [[ "email" =~ regex ]]; echo {BASH_REMATCH[*]} # a number out of the text txt='Some text with #1278 in it'; regex='#([0-9]+ )'; [[ "txt" =~ regex ]] && echo {BASH_REMATCH[1]} || echo do not match # case insensitive matching var1=ABCD, var2=abcd; [[ {var1,,} =~ {var2,,} ]] && ... For case insesitive matching, alternatively, in general, set shopt -s nocasematch (to disable it back shopt -u nocasematch) ### Conditionals: if/elif/else¶ Yes, we have [[ ]] && ... || ... but scripting style is more logical with if/else construction: if condition; then command1 elif condition; then command2 else command3 fi At the condition place can be anything what returns an exit code, i.e. [[ ]], command/function, an arithmetic expression (( )), or a command substitution. # to compare two input strings/integers if [[ "1" == "2" ]] then echo The strings are the same else echo The strings are different fi # checking command output if ping -c 1 8.8.8.8 &> /dev/null; then echo Online elif ping -c 1 127.0.0.1 &> /dev/null; then echo Local interface is down else echo No external connection fi # check input parameters if [[ # == 0 ]]; then echo Usage: 0 input_arg exit 1 fi ... the rest of the code ### case¶ Another option to handle flow, instead of nested ifs, is case. read -p "Do you want to create a directory (y/n)? " yesno # expects user input case yesno in y|yes) dir='dirname' echo Creating a new directory dir mkdir dir cd dir ;; n|no) echo Proceeding in the current dir (pwd) ;; *) echo Invalid response exit 1 ;; esac # yesno can be replaced with {yesno,,} to convert to a lower case on the fly In the example above, we introduce read, a built-in command that reads one line from the standard input or file descriptor. case tries to match the variable against each pattern in turn. Understands patterns rules like *, ?, [], |. Here is the case that could be used as an idea for your ~/.bashrc host=(hostname) case host in myworkstation*) export PRINTER=mynearbyprinter # making your promt smiling when exit code is 0 :) PS1='(if [[ ? == 0 ]]; then echo "\[\e[32m$:)"; else echo "$\e[31m$:("; fi)$\e[0m$ \[email protected]\h \w$ '
;;
triton*)
[[ -n $WRKDIR ]] && alias cwd="cd$WRKDIR" && cwd
;;
kosh*|brute*|force*)
PS1='\[email protected]\h:\w\$' export IGNOREEOF=0 ;& *.aalto.fi) kinit ;; *) echo 'Where are you?' ;; esac ;; is important, if replaced with ;&, execution will continue with the command associated with the next pattern, without testing it. ;;& causes the shell to test next pattern. The default behaviour with ;; is to stop matches after first pattern has been found. # create a file 'cx' case "$0" in
*cx) chmod +x "[email protected]" ;&
*cw) chmod +w "[email protected]" ;;
*c-w) chmod -w "[email protected]" ;;
*) echo "$0: seems that file name is somewhat different"; exit 1 ;; esac # chmod +x cx # ln cx cw # ln cx c-w # to make a file executable 'cx filename' The following example is useful for Triton users: array jobs, where one handles array subtasks based on its index. Exercise 2.3: Using BASH builtin functionality implement my_grep pattern string script that picks up a pattern ($1) and a string ($2) as an input and reports whether pattern matches any part of the string or not. Tip: have your scripts in ~/bin The script must check that number of input parameters is correct (i.e. equal 2). (*) Expand my_grep script to make search case insensitive Write a function pathvalid (add to ~/bin/functions file) that validates a file path like path/to/file. Let’s say the path should have only alphanumeric symbols, dots, underscore and slashes as a directory delimiter. Implement a my_mkdir script that either accepts a directory name as an input parameter or requests it with read if no input parameter is given. Script should create a directory if it does not exist with the access permissions 700. (*) Use the pathvalid function to add a sanity check before creating a directory. (*) Make a bs utlity and place it to ~/bin directory. The utility should help to start writing a new BASH script. It must create a file in the current directory with a given name bs script_name with the ‘#!/bin/bash’ header, set +x bit and open that newly created file in editor of your choice. (*) Write a function (add to ~/bin/functions) that validates an IPv4 using =~ matching operator only. The function should fail incorrect IPs like 0.1.2.3d or 233.204.3.257. The problem should be solved with the regular expression only. Use return command to exit with the right exit code. ## Loops¶ ### Arithmetic¶ BASH works with integers only (no floating point) but supports wide range of arithmetic operators using arithmetic expansion $(( expression )).
• All tokens in the expression undergo parameter and variable expansion, command substitution, and quote removal. The result is treated as the arithmetic expression to be evaluated.
• Arithmetic expansion may be nested.
• Variables inside double parentheses can be without a $sign. • BASH has other options to work with the integers, like let, expr, $[], and in older scripts/examples you may see them.
Available operators:
• n++, n--, ++n, --n increments/decrements
• +, - plus minus
• ** exponent
• *, /, % multiplication, (truncating) division, remainder
• &&, || logical AND, OR
• expr?expr:expr conditional operator (ternary)
• ==, !=, <, >, >=, <= comparison
• =, +=, -=, *=, /=, %= assignment
• () sub-expressions in parentheses are evaluated first
• The full list includes bitwise operators, see man bash section ARITHMETIC EVALUATION.
# without dollar sing value is not returned, though 'n' has been incremented
n=10; ((n++))
# but if we need a value
n=10; m=3; q=$((n**m)) # here we need exit code only if ((q%2)); then echo odd; fi if ((n>=m)); then ...; fi # condition ? integer_value_if_true : integer_value_if_false n=2; m=3; echo$((n<m?10:100))
# checking number of input parameters, if $# is zero, then exit # (though the alternative [[$# == 0 ]] is more often used, and intuitively more clear)
if ! (($#)); then echo Usage:$0 argument; exit1; fi
# sum all numbers from 1..n, where n is a positive integer
# Gauss method, summing pairs
if (($#==1)); then n=$1
else
read -p 'Give me a positive integer ' n
fi
echo Sum from 1..$n is$((n*(n+1)/2))
Left for the exercise: make a summation directly 1+2+3+…+n and compare performance with the above one.
For anything more mathematical than summing integers, one should use something else, one of the option is bc, often installed by default.
# bc -- an arbitrary precision calculator language
# compute Pi number
echo "scale=10; 4*a(1)" | bc -l
### For loops¶
BASH offers several options for iterating over the lists of elements. The options include
• Basic construction for arg in item1 item2 item3 ...
• C-style for loop for ((i=1; i <= LIMIT ; i++))
• while and until constructs
Simple loop over a list of items:
# note that if you put 'list' in quotes it will be considered as one item
for dir in dir1 dir2 dir3/subdir1; do
echo "Archiving $dir ..." tar -caf${dir//\/.}.tar.gz $dir && rm -rf$dir
done
If path expansions used (*, ?, [], etc), loop automatically lists current directory:
# example below uses ImageMagick's utlity to convert all *.jpg files
# in the current directory to *.png.
# i.e. '*.jpg' similar to 'ls *.jpg'
for f in *.jpg; do
convert "$f" "${f/.jpg/.png}" # quotes to avoid issues with the spaces in the name
done
# another command line example renames *.JPG and *.JPEG files to *.jpg
# note: in reality one must check that a newly created *.jpg file does not exist
for f in *.JPG *JPEG; do mv -i "$f" "${f/.*/.jpg}"; done
# do ... done in certain contexts, can be omitted by framing the command block within curly brackets
# and certain for loop can be written in one line as well
for i in {1..10}; { echo i is $i; } If in list omitted, for loop goes through script/function input parameters $@
# here is a loop to rename files which names are given as input parameters
# touch file{1..3}; ./newname file1 file2 file3
for old; do
read -p "old name $old, new name: " new mv -i "$old" "$new" done Note: as side note, while working with the files/directories, you will find lots of examples where loops can be emulated by find ... -print0 | xargs -0 ... pipe. Loop output can be piped or redirected: # loop other all Triton users to find out who has logged in within last month for u in$(getent group triton-users | cut -d: -f4 | tr ',' ' '); do
echo $u:$(last -Rw -n 1 $u | head -1) done | sort > filename The list can be anything what produces a list, like Brace expansion {1..10}, command substitution etc.: # on Triton, do something to all pending jobs based on squeue output for jobid in$(squeue -h -u $USER -t PD -o %A); do scontrol update JobId=$jobid StartTime=now+5days
done
# using find to make a list of files to deal with; the benefit here is that you work
# with the filename as a variable, which gives you flexibility as comparing to
# 'find ... -exec {}' or 'find ... print0 | xargs -0 ...'
for f in $(find . -type f -name '*.sh'); do if ! bash -n$f &>/dev/null; then
mv $f${f/.sh/.fixme.sh}
fi
done
C-style, expressions evaluated according to the arithmetic evaluation rules:
N=10
for ((i=1; i <= N ; i++)) # LIMIT with no $do echo -n "$i "
done
Loops can be nested.
### While/until loops¶
Other useful loop statement are while and until. Both execute continuously as long as the condition returns exit status zero/non-zero correspondingly.
while condition; do
...
done
# sum of all numbers 1..n
read -p 'Give a positive integer: ' n
i=1
until ((i > n)); do
((s+=i))
((i++))
done
echo Sum of 1..$n is$s
# endless loop, note : is a 'no operation' command in BASH, does nothing
# can be run as sort of "deamon", process should be stopped with Ctrl-c or killed
while true; do : ; done
# drop an email every 10 minutes about running jobs on Triton
# can be used in combination with 'screen', and run in background
while true; do
squeue -t R -u $USER | mail -s 'running jobs' [email protected] sleep 600 done # reads a file passed line by line, # IFS= variable before read command to prevent leading/trailing whitespace from being trimmed input=/path/to/txt/file while IFS= read -r line; do echo$line
done < "$input" # reading file fieldwise file="/etc/passwd" while IFS=: read -r f1 f2 f3 f4 f5 f6 f7; do printf 'Username: %s, Shell: %s, Home Dir: %s\n' "$f1" "$f7" "$f6"
done <"$file" # reading command output, this will be run in a subshell, and thus all variables used # inside the loop will die when loop is over file -b * | while read line; do do something with the lines done # to avoid above situation, one can use process substitution while read line; do do something with the lines done < <(file -b *) All the things mentioned above for for loop applicable to while / until loops. printf should be familiar to programmers, allows formatted output similar to C printf. [9] ### Loop control¶ Normally for loop iterates until it has processed all its input arguments. while and until loops iterate until the loop control returns a certain status. But if needed, one can terminate loop or jump to a next iteration. • break terminates the loop • continue jump to a new iteration • break n will terminate n levels of loops if they are nested, otherwise terminated only loop in which it is embedded. Same kind of behaviour for continue n. Even though in most of the cases you can design the code to use conditionals or alike, break and continue certainly add the flexibility. # here we expand an earlier example to avoid errors in case$f is missing/not accesible
for f in *.JPG *.JPEG; do
[[ -r "$f" ]] || { echo "$f is missing on inaccessible"; continue; }
mv -i "$f" "${f/.*/.jpg}"
done
Exercise 2.4: Write separate scripts that count a sum of any 1+2+3+4+..+n sequence, both the Gauss version and direct summation. Accept the n on the command line. Benchmark them with time for n=10000 or more. (*) For the direct summation one can avoid loops, how? Tip: discover eval $(echo {1..$n}) Write a scirpt or function days_till that counts a number of days till a deadline (or vacation/holyday). Script should accept dates suitable to date -d like days_till 2019-6-1. Tip: investigate date +%s. Using for loop rename all the files with the .txt extension to .fixed.txt. Tip: combine ‘for’ loop with ‘find’. Make script that accepts a list of files and checks if there are files in there with the spaces in the name, and if there are, rename them by replacing spaces with the underscores. Use BASH’s builtin functionality only. As a study case, compare it against find . -depth -name '* *' -execdir rename 's/ /_/g' {} \; (*) Get familiar with the getent and cut utilities. Join them with a loop construction to write a mygetentgroup script or just a oneliner that generates a list of users and their real names that belong to a given group. Like: $mygetentgroup group_name meikalaj1: Jussi Meikäläinen meikalam1: Maija Meikäläinen ... (*) To Aalto users: on kosh/lyta run net ads search samaccountname=$USER accountExpires 2>/dev/null to get your account expiration date. It is a 18-digit timestamp, the number of 100-nanoseconds intervals since Jan 1, 1601 UTC. Implement a function that accept a user name, and if not given uses current user by default, and then converts it to the human readable time format. Tip: http://meinit.nl/convert-active-directory-lastlogon-time-to-unix-readable-time Expand it to handle “Got 0 replies” response, i.e. account name not found.
## Arrays, input, Here Documents¶
### Arrays¶
BASH supports both indexed and associative one-dimensional arrays. Indexed array can be declared with declare -a array_name, or first assignment does it automatically (note: indexed arrays only):
arr=(my very first array)
arr=('my second' array [6]=sure)
arr[5]=234
To access array elements (the curly braces are required, unlike normal variable expansion):
# elements one by one
echo ${arr[0]}${array[1]}
# array values at once
${arr[@]} # indexes at once${!arr[@]}
# number of elements in the array
${#arr[@]} # length of the element number 2${#arr[2]}
# to append elements to the end of the array
arr+=(value)
# assign a command output to array
arr=($(command)) # emptying array arr=() # sorting array IFS=$'\n' sorted=($(sort <<<"${arr[*]}"))
# array element inside arithmetic expanssion requires no ${} ((arr[$i]++))
# split a string like 'one two three etc' or 'one,two,three,etc' to an array
# note that IFS=', ' means that separator is either space or comma, not a sequence of them
IFS=', ' read -r -a arr <<< "$string" # spliting a word to an array letter by letter word=qwerty; arr=($(echo $word | grep -o .)) Loops through the indexed array: for i in${!arr[@]}; do
echo array[$i] is${arr[$i]} done Negative index counts back from the end of the array, [-1] referencing to the last element. Quick ways to print array with no loop: # with keys, as is declare -p arr # indexes -- values echo${!arr[@]} -- ${arr[@]} # array elements values one per line printf "%s\n" "${arr[@]}"
Passing an array to a function as an argument could be the use case when you want to make it local:
f() {
local arr=(${!1}) # pass$1 argument as a refence
# do something to array elements
echo ${arr[@]} } # invoke the function, huom that no changes have been done to the original arr[@] arr=(....) f arr[@] BASH associative arrays (this type of array supported in BASH since version 4.2) needs to be declared first (!) declare -A asarr. Both indexed arrays and associative can be declared as an array of integers, if all elements values are integers declare -ia array or declare -iA. This way element values are treated as integers always. asarr=([university]='Aalto University' [city]=Espoo ['street address']='Otakaari 1') asarr[post_index]=02150 Addressing is similar to indexed arrays: for i in "${!asarr[@]}"; do
echo asarr[$i] is${asarr[$i]} done Even though key can have spaces in it, quoting can be omitted. # use case: your command returns list of lines like: 'string1 string2' # adding them to an assoative array like: [string1]=string2 declare -A arr for i in$(command); do
arr+=(["${i/ */}"]="${i/* /}")
done
Variable expanssions come out in the new light:
# this will return two elements of the array starting from number 1
${arr[@]:1:2} # all elements without last one${arr[@]:0:${#arr[@]}-1} # parts replacement will be applied to all array elements declare -A emails=([Vesa][email protected] [Kimmo][email protected] [Anna][email protected]) echo${emails[@]/@*/@gmail.com}
# returns: [email protected] [email protected] [email protected]
For a sake of demo: let us count unique users and their occurances (yes, one can do it with ‘uniq -c’ :)
# declare assoative array of integers
declare -iA arr
for i in $(w -h | cut -c1-8); do # get list of currenly logged users into loop for u in${!arr[@]}; do # check that they are unique
if [[ $i ==$u ]]; then
((arr[$i]++)) continue 2 fi done arr[$i]=1 # if new, add a new array element
done
for j in ${!arr[@]}; do # printing out echo${arr[$j]}$j
done
Another working demo: script that automates backups or just makes a sync of data to a remote server. Same can be adapted to copy locally, to a usb drive or alike.
# array of directories to be backuped, to skip one, just comment with #
declare -A dirs
dirs[wlocal]=/l/$USER dirs[xpproject]=/m/phys/extra/project/xp dirs[homebin]=$HOME/bin
cmd='/usr/bin/rsync' # rsync
args="-auvW --delete --progress [email protected]" # accept extra args, like '-n' for the dryrun first
serv='[email protected]:backups' # copying to ~/backups that must exist
# array key is used for the remote dir name
for d in ${!dirs[@]}; do echo "Syncing${dirs[$d]}..."$cmd $args${dirs[$d]}/$serv/$d done Exercise 2.5: make a script/function that produces an array of random numbers, make sure that numbers are unique. Print the array nicely using printf for formating. one version should use BASH functionality only (Tip: $RANDOM) the other one can use shuf (*) Pick up the ipvalid function that we have developed earlier, implement IP matching regular expression as ^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$ and work with the${BASH_REMATCH[*]} array to make sure that all numbers are in the range 0-255
### Working with the input¶
User input can be given to a script in three ways:
• as command arguments, like ./script.sh arg1 arg2 ...
• interactively from keyboard with read command
• as standard input, like command | ./script
Nothing stops from using a combination of them or all of the approaches in one script. Let us go through the last two first and then get back to command line arguments.
read can do both: read from keyboard or from STDIN
# the command prints the prompt, waits for the response, and then assigns it
# to variable(s)
# read into array, each word as a new array element ('arr' declared automatically)
Given input must be checked (!) with a pattern, especially if script creates directories, removes files, sends emails based on the input.
# request a new directory name till correct one is given (interrupt with Ctrl-C)
regexp='^[a-zA-Z0-9/_-]+$' until [[ "$newdir" =~ $regexp ]]; do read -p 'New directory: ' newdir done read selected options • -a <ARRAY> read the data word-wise into the specified array <ARRAY> instead of normal variables • -N <NCHARS> reads <NCHARS> characters of input, ignoring any delimiter, then quits • -p <PROMPT> the prompt string <PROMPT> is output (without a trailing automatic newline) before the read is performed • -r raw input - disables interpretion of backslash escapes and line-continuation in the read data • -s secure input - don’t echo input if on a terminal (passwords!) • -t <TIMEOUT> wait for data <TIMEOUT> seconds, then quit (exit code 1) read is capable of reading STDIN, case like command | ./script, with while read var it goes through the input line by line: # IFS= is empty and echo argument in quotes to make sure we keep the format # otherwise all spaces and new lines shrinked to one and leading/trailing whitespace trimmed while IFS= read -r line; do echo "line is$line" # do something useful with $line done Though in general, whatever comes from STDIN can be proceeded as: # to check that STDIN is not empty if [[ -p /dev/stdin ]]; then # passing STDIN to a pipeline (/dev/stdin can be omitted) cat /dev/stdin | cut -d' ' -f 2,3 | sort fi Other STDIN tricks that one can use in the scripts: # to read STDIN to a variable, both commands do the same var=$(</dev/stdin)
var=$(cat) In the simplest cases like ./script arg1 arg2 ..., you check$# and then assign $1,$2, … the way your script requires.
if (($#==2)); then var1=$1 var2=$2 # ... do something useful else echo 'Wrong amount of arguments' echo "Usage:${0##*/} arg1 arg2"
exit 1
fi
To work with all input arguments at once you have $@: if (($#>0)); then
for i; do
echo $i # ... do something useful with each element of [email protected] # note that for loop uses [email protected] by default if no other list given with 'in list' done fi Often, the above mentioned ways are more than enough for simple scripts. But what if arguments are like ./script [-f filename] [-z] [-b] or more complex? (common notaion: arguments in the square brackets are optional). What if you write a production ready script that will be used by many other as well? It is were getopt offers a more efficient way of handling script’s input options. In the simplest case getopt command (do not get confused with getopts built-in BASH function of similar kind) requires two parameters to work: fisrt is a list of letters – valid input options – and colons. If letter followed by a colon, the option requires an argument, if folowed by two colons, argument is optional. For example, the string getopt "sdf:" says that the options -s, -d and -f are valid and -f requires an argument, like -f filename. The second getopt argument is a list of input parameters, often just$@.
# here is the whole trick: getopt validates the input parameters, returns the correct ones
# then they are reassigned back to [email protected] with 'set --'
opts=$(getopt "sdf:" "[email protected]") || exit 1 # instead of exit, can be 'usage' message/function set --$opts
# note: in one line one can do it like, though ugly
#set -- $(getopt "sdf:" "[email protected]" || kill -HUP $$) # ( ... || exit) does not work, since exit from inside a subshell, closes the subshell only # since script input parameters have been validated and structured, we can go through them # we start an endless while and go through [email protected] with 'case' one by one # 'shift' makes another trick, every time it is invoked, it shifts down [email protected] params, # 2 becomes 1, 2 becomes 3, etc while old 1 is unset # getopt adds -- to [email protected] which separates valid options and the rest that did not qualify while :; do case {1} in -s) SORTED=0 ;; -d) DEBUG=0 ;; -f) shift; file=1 ;; # shift to take next item as an argument to -f --) shift; break ;; # remove -- esac shift done # by now [email protected] has only rubish filtered out by 'getopt', could be a file name .. the rest of the code getopt can do way more, go for man getopt for details, as an example: # here is getopt sets name with '-n' used while reporting errors: our script name # accepts long options like '--filename myfile' along with '-f myfile' getopt -n (basename 0) -o "hac::f:" --long "help,filename:,compress::" -- "[email protected]" If you implement a script that can accept both STDIN and positional parameters, you have to check both. Exercise 2.6: Make a getemail script that asks for the user Aalto email, check that given email is correct (^.*@aalto\.fi or alike is enough) and if not, requests it again till correct one is given or the user has pressed Ctrl-C. Make the same script as above but accept STDIN like echo email@address | getemail Make the same script but accept the command line arguments, like getemail -h would return help info, getemail -e email@domain would accept an email. (*) Improve the getemail script: join all three approaches in to one script, priority should go like: command line argument, STDIN, interactive request. Thus if email is given as an argument other two possibilies skipped. for the interactive part, let it fail with the error message if wrong email is given for three times make regular expression more robust, let us say email supposed to have at least eight alphanumeric character, dots can be used as a delimiter ### Here Document, placeholders¶ A here document takes the lines following and sends them to standard input. It’s a way to send larger blocks to stdin. command <<SomeLimitString Here comes text with var and even () substitutions and more just text which finally ends on a new line with the: SomeLimitString Often used for messaging, be it an email or dumping bunch of text to file.: # NAME, SURNAME, EMAIL, DAYS are set earlier mail -s 'Account expiration' EMAIL<<END-OF-EMAIL Dear NAME SURNAME, your account is about to expire in DAYS days. (date) Best Regards, Aalto ITS END-OF-EMAIL Or just outputting to a file (same can be done with echo commands): cat <<EOF >filename ... text EOF One trick that is particularly useful is using this to make a long comment: : <<\COMMENTS here come text that is seen nowhere there is no need to comment every single line with # COMMENTS Hint <<\LimtiString to turn off substitutions and place text as is with marks etc In case you have a template file which contains variables as placeholders, replacing them: # 'template' file like: The name is NAME, the email is EMAIL # command to substitute the placeholders and redirect to 'output' file # the original 'template' file remains as is NAME=Jussi [email protected] cat template | while IFS= read -r line; do eval echo line; done > output # resulting file: The name is Jussi, the email is [email protected] ## Traps, debugging, profiling¶ ### Catching kill signals: trap¶ What if your script generates temp file and you’d like to keep it clean even if script gets interrupted at the execution time? The built-in trap command lets you tell the shell what to do if your script received signal to exit. It can catch all, but here listed most common by their numbers. Note that signals are one of the common ways of communicating with running processes in UNIX: you see these same numbers and names in programs like kill. • 0 EXIT exit command • 1 HUP when session disconnected • 2 INT interrupt - often Ctrl-c • 3 QUIT quit - often Ctrl- • 9 KILL real kill command, it can’t be caught • 15 TERM termination, by kill command # 'trap' catches listed signals only, others it silently ignores # Usage: trap group_of_commands/function list_of_signals trap 'echo Do something on exit' EXIT Expanding the backup script from the Arrays section, this can be added to the very beginning: interrupted() { echo 'Seems that backup has been interrupted in the middle' echo 'Rerun the script later to let rsync to finish its job' exit 1 } trap interrupted 1 2 15 # ... the rest of the script In other situation, instead of echo, one can come up with something else: removing temp files, put something to the log file or output a valuable error message to the screen. Hint About signals see Standard signals section at man 7 signal. Like Ctrl-c is INT (aka SIGINT). ### Debugging and profiling¶ BASH has no a debugger, but there are several ways to help with the debugging Check for syntax errors without actual running it bash -n script.sh Or echos each command and its results with bash -xv script.sh, or even adding options directly to the script. -x enables tracing during the execution, -v makes bash to be verbose. Both can be set directly from the command line as above or with set -xv inside the script. #!/bin/bash -xv To enable debugging for some parts of the code only: set +x ... some code set -x If you want to check quickly a few commands, with respect to how variables or other substitutions look like, use DEBUG variable set to echo. #!/bin/bash DEBUG command1 arguments command2 # call this script like 'DEBUG=echo ./script.sh' to see how *command1* looks like # otherwise the script can be run as is. One can also trap at the EXIT, this should be the very first lines in the script: end() { echo Variable Listing: a = a b = b; } trap end EXIT # will execute end() function on exit For a sake of profiling one can use PS4 and date (GNU version that deals with nanoseconds). PS4 is a built in BASH variable which is printed before each command bash displays during an execution trace. The first character of PS4 is replicated multiple times, as necessary, to indicate multiple levels of indirection. The default is +. Add the lines below right after ‘#!/bin/bash’ # this will give you execution time of each command and its line number # \011 is a tab PS4='+\011(date "+%s.%N")\011{LINENO}\011' set -x Optionally, if you want tracing output to be in a separate file: PS4='+\011(date "+%s.%N")\011{LINENO}\011' exec 5> {0##*/}.$$.x && BASH_XTRACEFD='5' && set -x Or to get your script looking more professional, one can enable DEBUG, i.e. tracing only happens when you run as DEBUG=profile ./script.sh: case$DEBUG in
profile|PROFILE|p|P)
PS4='+\011$(date "+%s.%N")\011${LINENO}\011'
exec 5> ${0##*/}.$$.x && BASH_XTRACEFD='5' && set -x ;; esac For the larger scripts with loops and functions tracing output with the date stamps and line numbers can be summarized. For further discussion please take a look at [10] ## Parallel, crontab, perl/awk/sed¶ ### Running in parallel with BASH¶ The shell doesn’t do parallelzation in the HPC way (threads, MPI), but can run some simple commands at the same time without interaction. The simplest way of parallelization is sending processes to a background and waiting in the script till they are done.: # in the script body one may run several processes, like command1 & command2 & command3 & Here is an example that can be run as time script to demonstrate that execution takes 5 seconds, that is the timing of the longest chunk, and all the processes are run in parallel and finished before script’s exit.: # trap is optional, just to be on the safe side # at the beginning of the script, to get child processes down on exit trap 'killall$(jobs -p) 2>/dev/null' EXIT
# dummy sleep commands groupped with echo and sent to the background
for i in 1 3 5; do
{ sleep $i; echo sleep for$i s is over; } &
done
# 'wait' makes sure jobs are done before script is finished
# try to comment it to see the difference
wait
echo THE END
Putting waitat very end of the script makes it to wait till all the child processes are over and only then exit. Having trap at very beginning makes sure we kill all the process whatever happens to the script. Otherwise they may stay running on their own even if script has exited.
Another way to run in parallel yet avoiding sending to the background is using parallel. This utility runs the specified command, passing it a single one of the specified arguments. This is repeated for each argument. Jobs may be run in parallel. The default is to run one job per CPU. If no command is specified before the –, the commands after it are instead run in parallel.
# normally the command is passed the argument at the end of its command line. With -i
# option, any instances of "{}" in the command are replaced with the argument.
parallel command {} -- arguments_list
# example of making a backup with parallel rsync
parallel -i rsync -auvW {}/ user@server:{}.backup -- dir1 dir2 dir3
# in case you want to run a command, say ten times, the arguments can be any dummy list
# normally parallel passes arguments at the end of the command, with '-i' they needs to
# be placed explicitly with '{}', or can be skipped, like here
parallel -i date -- {1..10}
# if no command is specified before the --, the commands after it are instead run in parallel,
parallel -- ls df "echo hi"
On Triton we have installed Tollef Fog Heen’s version of parallel from moreutils-parallel CentOS’ RPM. GNU project has its own though, with different syntax, but of exactly the same name, so do not get confused.
### Crontab¶
Allows run tasks automatically in the background. Users may set their own crontabs. Once crontab task is set, it will run independently on whether you are logged in to the system or not.
Run crontab -l to list all your current cron jobs, crontab -e to start editor. When in, you may add one or several lines, then save what you have added and exit the editor normally.
# run 'script' daily at 23:30
30 23 * * * $HOME/bin/backup_script > /home/user/log/backup.log 2>&1 # every two hours on Mon-Wed,Fri 0 /2 * * 1-3,5 rm /path/to/my/tmp/dir/* >/dev/null 2>&1 The executable script could be a normal command, but crontab’s shell has quite limited functionality, in case of anything more sofisticated than just a single command and a redirection you end up writing a separate script. The first five positions corresponds to: • minute (0-59) • hour (0-23) • day (1-31) • month (1-12) • day of week (0-7, 0 or 7 is Sunday) Possible values are: • * any value • , value list separator • - range of values • / steps You set your favorite editor: export EDITOR=vim (can be a part of ~/.bashrc). As part of the crontab file you may set several environmet variables, like MAILTO=name.surname@aalto.fi to recieve an output from the script or any possible errors. If MAILTO is defined but empty (MAILTO=""), no mail is sent. ### Perl, awk, sed¶ Powerful onliners. Please consult correspoding man pages and other docs for the details, here we provide some examples. As it was standed at very beginning of the course, shell, with all its functionality is only a glue in between all kind of utilities, like grep, find, etc. Perl, awk and sed are what makes terminal even more powerful. Even though Perl can do everything what can awk and sed, one still may find tons of examples with the later ones. Here we provide some of them. Python is yet another alternative. # set delimiter to : and prints the first field of each line of passwd file (user name) awk -F: '{print$1}' /etc/passwd
# sort lines by length, several ways to do it
cat file | perl -e 'print sort { length($a) <=> length($b) } <>'
## To continue: course development ideas/topics¶
• select command
• revise coreutils section, expand the examples and explanations, make it clear that BASH is about getting those small utilities to work together
• benchmark: C-code vs BASH, Python vs BASH, Perl vs BASH
### Ideas for exercises¶
• function to find all broken links
• (homework?) Implement a profiler, that summarizes PS4/date output mentioned above
• (homework?) Script that makes ‘pe1 pe2 … gpu32’ out of ‘pe[1-16],gpu11,gpu32’
In general, there could one script that one starts building from the first line up to a parallelization. Like backup script with rsync.
Git usage?
## Bonus material¶
Parts that did not fit.
[FIXME: should be moved to another tutorial SSH: beyond login]
### SSH keys and proxy (bonus section)¶
• SSH is the standard for connecting to remote computers: it is both powerful and secure.
• It is highly configurable, and doing some configuration will make your life much easier.
SSH keys and proxy jumping makes life way easier. For example, logging on to Triton from your Linux workstation or from kosh/lyta.
For PuTTY (Windows) SSH keys generation, please consult section “Using public keys for SSH authentication” at [7]
On Linux/Mac: generate a key on the client machine
ssh-keygen -o # you will be prompted for a location to save the keys, and a passphrase for the keys. Make sure passphrase is strong (!)
ssh-copy-id aalto_login@triton.aalto.fi # transfer file to a Triton, or/and any other host you want to login to
Note that same key can be used on multiple different computers.
SSH proxy is yet another trick to make life easier: allows to jump through a node (in OpenSSH version 7.2 and earlier -J option is not supported yet, here is an old recipe that works on Ubuntu 16.04). By using this, you can directly connect to a system (Triton) through a jump host (kosh): On the client side, add to ~/.ssh/config file (create it if does not exists and make it readable by you only):
Host triton triton.aalto.fi
Hostname triton.aalto.fi
ssh triton
` | 2019-08-19 15:09:57 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2160475254058838, "perplexity": 11037.311683031317}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027314752.21/warc/CC-MAIN-20190819134354-20190819160354-00542.warc.gz"} |
http://math.stackexchange.com/questions/35763/some-isomorphism-conditions | # Some isomorphism conditions
Here I want to ask some true or false problems regarding isomorphisms (and if false, is there some extra condition to make it true). I do not what is the correct title for these problem. And I also want some brief proofs if possible.
1. Let $R$ and $R'$ be two rings with $|R| =|R'|< \infty$. And each proper ideal in $R$ is isomorphic to some ideal in $R'$. Then is it true that $R\cong R'$? (and if false, is there some extra condition to make it true).
2. Let $G$ and $G'$ be two groups with the same order ($< \infty$). If their abelianizations are isomorphic, is it true that $G\cong G'$.
3. Let $\mathcal{D}$ be a subcategory of a category $\mathcal{C}$. (1) If $u$ is an isomorphism of $\mathcal{D}$, is $u$ an isomorphism of $\mathcal{C}$? (2) If $v$ is an isomorphism of $\mathcal{C}$, is $v$ an isomorphism of $\mathcal{D}$? (and if false, is there some extra condition to make it true).
-
What does it mean for two ideals to be isomorphic? – Qiaochu Yuan Apr 29 '11 at 4:53
3. (1) is obviously true; (2) make $\mathcal{D}$ a full subcategory. 2. there are simple groups of the same order. It remains to answer 1, which I leave to the algebraists after you clarified Qiaochu's question. – t.b. Apr 29 '11 at 4:57
@Qiaochu Yuan: I mean there exists ring homomorphisms $\psi: I\to I'$ and $\phi: I'\to I$ such that $\phi\circ\psi = id$ and $\psi\circ\phi = id$. – Junyu Apr 29 '11 at 4:59
(1) is not true. take $R=\mathbb{Z}/4\mathbb{Z}$ and $R'=\mathbb{Z}/2\mathbb{Z} \times \mathbb{Z}/2\mathbb{Z}$. The only proper ideals of R are the zero ideal and $\mathbb{Z}/2\mathbb{Z}$ and they both appear in R'. Also, you might want to ask about proper subrings and not ideals (though it is still not true, but might be with extra conditions) – Prometheus Apr 29 '11 at 5:00
@user5980: what do you mean by a ring homomorphism between two ideals? (Is this a homomorphism of not necessarily unital rings, i.e. a rng homomorphism?) – Qiaochu Yuan Apr 29 '11 at 5:39
The answer to #2 is no. For example, the dihedral group $D_4$ and the quaternion group $Q_8$ both have order $8$ and abelianization $(\mathbb{Z}/2\mathbb{Z})^2$. (This implies, among other things, that they have the same character table.) Group theory would be very boring if anything like this was true. | 2014-08-02 07:11:54 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.957100510597229, "perplexity": 197.22332104726362}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-23/segments/1406510276584.58/warc/CC-MAIN-20140728011756-00282-ip-10-146-231-18.ec2.internal.warc.gz"} |
https://www.thejournal.club/c/paper/308458/ | #### Realizing an m-uniform four-chromatic hypergraph with disks
##### Gábor Damásdi, Pálvölgyi Dömötör
We prove that for every $m$ there is a finite point set $\mathcal{P}$ in the plane such that no matter how $\mathcal{P}$ is three-colored, there is always a disk containing exactly $m$ points, all of the same color. This improves a result of Pach, Tardos and T\'oth who proved the same for two colors. The main ingredient of the construction is a subconstruction whose points are in convex position. Namely, we show that for every $m$ there is a finite point set $\mathcal{P}$ in the plane in convex position such that no matter how $\mathcal{P}$ is two-colored, there is always a disk containing exactly $m$ points, all of the same color. We also prove that for unit disks no similar construction can work, and several other results.
arrow_drop_up | 2021-03-02 13:02:14 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.803480327129364, "perplexity": 214.7694110818978}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178364008.55/warc/CC-MAIN-20210302125936-20210302155936-00588.warc.gz"} |
https://math.stackexchange.com/questions/2374045/riemann-sums-finding-the-lower-sum | # Riemann sums, finding the lower sum?
just doing some review and I am a bit confused on how I pick the upper vs lower sum of a Riemann sum. I get for the upper sum I choose the maximum value of $f$ on $[x_{k-1},x_k]$ and the lower sum is the minimum of $[x_{k-1},x_k]$.
Could someone give me a worked out example of an upper or lower sum using Riemann's definition.
Do I plug in values of the interval $[a,b]$ and see where it is increasing and decreasing? But which formula do I plug this in, the left sum or right sum?
• What do you mean by 'left sum' and 'right sum' in this context? – DominikS Jul 27 '17 at 20:24
• I think what you are referring to in the last paragraph is that when a function is monotone, the maximum value occurs at an endpoint of a subinterval (and also the minimum value occurs at the other such endpoint). – hardmath Jul 27 '17 at 20:38
Suppose that $f\colon[-1,1]\longrightarrow\mathbb R$ is defined by $f(x)=x^2$. Now, take $x_0=-1$, $x_1=-\frac13$, $x_2=\frac13$, and $x_3=1$. Then:
1. in $[x_0,x_1]$, the minimum of $f$ is $\frac19$ and the maximum is $1$;
2. in $[x_1,x_2]$, the minimum of $f$ is $0$ and the maximum is $\frac19$;
3. in $[x_2,x_3]$, the minimum of $f$ is $\frac19$ and the maximum is $1$.
Therefore, if $P=\{x_0,x_1,x_2\}$, then the lower sum of $f$ with respect to $P$ is$$\frac23\times\frac19+\frac23\times0+\frac23\times\frac{1}{9}=\frac4{27}$$and the upper sum is$$\frac23\times1+\frac23\times\frac19+\frac23\times\frac19=\frac{38}{27}.$$
Finding "Upper sum, Lower sum" you don't "plug into" **either the "Left sum" or "Right sum". Those are completely different things.
In all four cases, you divide the total interval into "n" sub-intervals.
For the "upper sum" you take f(x) as the largest value of f in the sub-interval and multiply by the length of the sub-interval, then sum.
For the "lower sum" you take f(x) as the smallest value of f in the sub-interval and multiply by the length of the sub-interval, then sum.
For the "left sum" you take f(x) for x the end of the sub-interval and multiply by length of the sub-interval, then sum.
For the "right sum" you take f(x) for x at the right end of the interval and multiply by the length of the sub-interval, then sum.
For example, take the interval to be from x= 0 to x= 1 and divide into 4 equal intervals, f(x)= x^2.
The left end of the four intervals are x= 0, x= 1/4, x= 1/2, x= 3/4. The squares are 0, 1/16, 1/4, 9/16. Multiply each by 1/4, the length of each sub-interval and we have 0, 1/64, 1/16, 9/64. Adding, 0+ 1/64+ 4/64+ 9/64= 14/64.
Because this is an increasing function, y= x^2 is always least at the left so that left sum is the same as the "lower sum".
The right end of the four intervals are x= 1/4, x= 1/2, x= 3/4, and x= 1. The squares are 1/16, 1/4, 9/16, and 1. Multiply each by 1/4, the length of each sub-interval and we have 1/64, 1/16, 9/64, 1/4. Adding, 1/16+ 1/4+ 9/64+ 1/4= 30/64.
Because this is an increasing function, y= x^2 is always highest at the right so that the right sum is th The right end o
An example of a lower sum with intervals of length $1$ for the monotonically increasing function $f(x) = x^2$ (on $x\in[0,k]$):
$$\int_0^{k}x^2dx \leq\sum_{0}^{k-1} n^2$$
It is easier to verify that this is a lower sum because for an interval where the function is monotonic the smallest function value will allways be at one of the end points. In our case with a monotonically increasing function, the lowest end: $$f(x_k)\leq f(\xi) \,\,\forall\,\, \xi \in[x_{k},x_{k+1}]$$
For more advanced problems we may need to search for an estimate of the maximum or minimum function value. That can sometimes be a rather difficult problem! | 2019-05-27 09:43:42 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9015259146690369, "perplexity": 81.94118861334522}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232262311.80/warc/CC-MAIN-20190527085702-20190527111702-00458.warc.gz"} |
http://math.stackexchange.com/questions/67375/matrix-multiplication-convergence-problem | # matrix multiplication convergence problem
Suppose A is a square matrix.
Does $A^n$(matrix multiplication) converge when n is an infinite big number?
Is it always true or under certain circumstances?
-
If the Jordan normal form of the matrix $A$ is $J$, then you have $A=PJP^{-1}$ and this yields $A^n=PJ^nP^{-1}$. So we only have to ask when powers of the Jordan blocks of the given matrix converge. The structure of powers of Jordan blocks is relatively simple.
It is relatively easy to see that the power $A^n$ converges to zero matrix if $|\lambda|<1$ for all eigenvalues of $A$. (See e.g. the result at the end of this text.)
If the only eigenvalue with absolute value 1 is 1 and the corresponding Jordan blocks have size 1, then it converges. If there is a Jordan block corresponding to 1 of size at least 2, then the power does not converge. (This was pointed out by Ted in the comments, thanks for the correction.)
If there are complex eigenvalues different from 1 with $|\lambda|=1$ then the power does not converge.
If it has an eigenvalue with $|\lambda|>1$, it does not converge.
-
In which case they converge to the zero matrix – jspecter Sep 25 '11 at 7:39
@jspecter Thanks for your commment, I've added it to the answer. – Martin Sleziak Sep 25 '11 at 7:42
If there is an eigenvalue 1 in a Jordan block $J$ of size > 1, then the powers of the Jordan block won't converge: $J=I+N$ where $N$ is a nonzero nilpotent matrix with entries in $\{0,1\}$, so $(I+N)^k$ equals $I + kN + C(k,2)N^2 + \ldots + N^k$. The off-diagonal entries go to $\infty$ as $k \to \infty$. – Ted Sep 25 '11 at 7:50
@Ted I have overlooked this possibility, thanks for noticing and notifying me. I've corrected this part of my answer. – Martin Sleziak Sep 25 '11 at 7:58
The convergence properties of $A^n$ are fully understood by studying the eigenspectrum of $A$. The work http://arxiv.org/pdf/1407.0671.pdf by H.H. Bauschke thoroughly covers the subject, and beyond.
For example, a sufficient condition for convergence is that the spectral radius of $A$ be strictly less than $1$. In fact, in this case, $\underset{n \rightarrow \infty}{lim}A^n = 0$.
- | 2015-11-29 05:39:58 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9725447297096252, "perplexity": 222.51508683542647}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-48/segments/1448398456289.53/warc/CC-MAIN-20151124205416-00119-ip-10-71-132-137.ec2.internal.warc.gz"} |
https://crad.ict.ac.cn/CN/Y2018/V55/I8/1785 | ISSN 1000-1239 CN 11-1777/TP
• 综述 •
### 网络流水印安全威胁及对策综述
1. 1(解放军信息工程大学 郑州 450001);2(数学工程与先进计算国家重点实验室 郑州 450001);3(河南工程学院 郑州 451191) (liancheng17@gmail.com)
• 出版日期: 2018-08-01
• 基金资助:
国家自然科学基金项目(61402526,61502528,61402525) This work was supported by the National Natural Science Foundation of China (61402526, 61502528, 61402525).
### Survey on Security Threats and Countermeasures of Network Flow Watermarking
Zhang Liancheng1,2, Wang Yu3, Kong Yazhou1,2,Qiu Han1,2
1. 1(PLA Information Engineering University, Zhengzhou 450001);2(State Key Laboratory of Mathematical Engineering and Advanced Computing, Zhengzhou 450001);3(Henan University of Engineering, Zhengzhou 451191)
• Online: 2018-08-01
Abstract: By comparing the flow characteristics-based passive flow correlation technologies, the authors find the flow watermarking-based active flow correlation technologies are more accurate with less false positive rate and less observation time in terms of attack attribution through stepping stones and anonymous abuser tracing. This paper first introduces typical flow watermarking technologies based on packet payload, flow rate and packet timing, then explains the security risks which the flow watermarking technologies face such as multi-flow attack, mean-square autocorrelation attack, K-S (Kolmogorov-Simirnov) test, PNR (Peng Ning Reeves) attack, delay normalization attack, BACKLIT detection, known flow attack, output-only detection and copy attack. In following, the authors analyze the methods and means for the flow watermarking technologies to defend against multi-flow attack, mean-square autocorrelation attack, K-S test, BACKLIT detection and other security risks, such as the frequently used embedding position randomization, watermarking bit reordering, one watermark for each target flow, one code for each target flow and embedding delay minimization. In conclusion, the authors summarize and anticipate the hot topics and research trends of the security threats and the countermeasures against them to the flow watermarking technologies. That is, the attack resistance ability of the existing flow watermarking technologies, the unified evaluation system and metrics of watermark invisibility and attacks aiming to other carriers based and multiple carriers based flow watermarking technologies need to be further strengthened and studied. | 2022-10-06 10:01:59 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.43769127130508423, "perplexity": 12842.9494369328}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030337803.86/warc/CC-MAIN-20221006092601-20221006122601-00269.warc.gz"} |
http://www.numdam.org/item/ASNSP_2011_5_10_4_913_0/ | Boundary trace of positive solutions of semilinear elliptic equations in Lipschitz domains: the subcritical case
Annali della Scuola Normale Superiore di Pisa - Classe di Scienze, Serie 5, Volume 10 (2011) no. 4, p. 913-984
We study the generalized boundary value problem for nonnegative solutions of $-\Delta u+g\left(u\right)=0$ in a bounded Lipschitz domain $\Omega$, when $g$ is continuous and nondecreasing. Using the harmonic measure of $\Omega$, we define a trace in the class of outer regular Borel measures. We amphasize the case where $g\left(u\right)={|u|}^{q-1}u$, $q>1$. When $\Omega$ is (locally) a cone with vertex $y$, we prove sharp results of removability and characterization of singular behavior. In the general case, assuming that $\Omega$ possesses a tangent cone at every boundary point and $q$ is subcritical, we prove an existence and uniqueness result for positive solutions with arbitrary boundary trace.
Published online : 2018-06-21
Classification: 35K60, 31A20, 31C15, 44A25, 46E35
@article{ASNSP_2011_5_10_4_913_0,
author = {Marcus, Moshe and Veron, Laurent},
title = {Boundary trace of positive solutions of semilinear elliptic equations in Lipschitz domains: the subcritical case},
journal = {Annali della Scuola Normale Superiore di Pisa - Classe di Scienze},
publisher = {Scuola Normale Superiore, Pisa},
volume = {Ser. 5, 10},
number = {4},
year = {2011},
pages = {913-984},
zbl = {1243.35054},
mrnumber = {2932897},
language = {en},
url = {http://www.numdam.org/item/ASNSP_2011_5_10_4_913_0}
}
Marcus, Moshe; Veron, Laurent. Boundary trace of positive solutions of semilinear elliptic equations in Lipschitz domains: the subcritical case. Annali della Scuola Normale Superiore di Pisa - Classe di Scienze, Serie 5, Volume 10 (2011) no. 4, pp. 913-984. http://www.numdam.org/item/ASNSP_2011_5_10_4_913_0/
[1] P. Baras and M. Pierre, Singularités éliminables pour des équations semi-lineaires, Ann. Inst. Fourier (Grenoble) 34 (1984), 185–206. | Numdam | MR 743627 | Zbl 0519.35002
[2] S. Bauman, Positive solutions of elliptic equations in nondivergence form and their adjoints, Ark. Mat. 22 (1984), 153–173. | MR 765409 | Zbl 0557.35033
[3] K. Bogdan, Sharp estimates for the Green function in Lipschitz domains, J. Math. Anal. Appl. 243 (2000), 326-337. | MR 1741527 | Zbl 0971.31005
[4] H. Brezis and F. Browder, Sur une propriété des espaces de Sobolev, C. R. Acad. Sci. Paris (A-B) 287 (1978), A113–A115. | MR 511925 | Zbl 0381.46019
[5] B. E. Dalhberg, Estimates on harmonic measures, Arch. Ration. Mech. Anal. 65 (1977), 275–288. | MR 466593 | Zbl 0406.28009
[6] E. B. Dynkin, “Diffusions, Superdiffusions and Partial Differential Equations”, Amer. Math. Soc. Colloquium Publications, 50, Providence, RI, 2002. | MR 1883198 | Zbl 0999.60003
[7] E. B. Dynkin, “Superdiffusions and Positive Solutions of Nonlinear Partial Differential Equations”, University Lecture Series, 34, Amer. Math. Soc., Providence, RI, 2004. | MR 2089791 | Zbl 1079.60006
[8] E. B. Dynkin and S. E. Kuznetsov, Solutions of nonlinear differential equations on a Riemanian manifold and their trace on the boundary, Trans. Amer. Math. Soc. 350 (1998), 4217–4552. | MR 1443191 | Zbl 0911.60062
[9] J. Fabbri and L. Véron, Singular boundary value problems for nonlinear elliptic equations in non smooth domains, Adv. Differential Equations 1 (1996), 1075–1098. | MR 1409900 | Zbl 0863.35021
[10] N. Gilbarg and N. S. Trudinger, “Partial Differential Equations of Second Order”, 2nd ed., Springer-Verlag, Berlin/New-York, 1983. | MR 473443 | Zbl 0562.35001
[11] A. Gmira and L. Véron, Boundary singularities of solutions of nonlinear elliptic equations, Duke Math. J. 64 (1991), 271–324. | MR 1136377 | Zbl 0766.35015
[12] R. A. Hunt and R. L. Wheeden, Positive harmonic functions on Lipschitz domains, Trans. Amer. Math. Soc. 147 (1970), 507–527. | MR 274787 | Zbl 0193.39601
[13] D. S. Jerison and C. E. Kenig, Boundary value problems on Lipschitz domains, Studies in partial differential equations, MAA Stud. Math. 23, (1982) 1–68. | MR 716504 | Zbl 0529.31007
[14] D. S. Jerison and C. E. Kenig, The Dirichlet problems in non-smooth domains, Ann. of Math. 113 (1981), 367–382. | MR 607897 | Zbl 0434.35027
[15] C. Kenig and J. Pipher, The $h$-path distribution of conditioned Brownian motion for non-smooth domains, Probab. Theory Related Fields 82 (1989), 615–623. | MR 1002903 | Zbl 0672.60079
[16] J. B. Keller, On solutions of $\Delta u=f\left(u\right)$, Comm. Pure Appl. Math. 10 (1957), 503–510. | MR 91407 | Zbl 0090.31801
[17] J. F. Le Gall, The Brownian snake and solutions of $\Delta u={u}^{2}$ in a domain, Probab. Theory Related Fields 102 (1995), 393–432. | MR 1339740 | Zbl 0826.60062
[18] J. F. Le Gall, “Spatial Branching Processes, Random Snakes and Partial Differential Equations” Lectures in Mathematics ETH Zürich. Birkhäuser Verlag, Basel, 1999. | MR 1714707 | Zbl 0938.60003
[19] M. Marcus, Complete classification of the positive solutions of $-\Delta u+{u}^{q}=0$, J. d’Analyse Math., to appear. | MR 2944095
[20] M. Marcus and L. Véron, The boundary trace of positive solutions of semilinear elliptic equations: the subcritical case, Arch. Ration. Mech. An. 144 (1998), 201–231. | MR 1658392 | Zbl 0924.35050
[21] M. Marcus and L. Véron, The boundary trace of positive solutions of semilinear elliptic equations: the supercritical case, J. Math. Pures Appl. 77 (1998), 481–521. | MR 1626800 | Zbl 0933.35081
[22] M. Marcus and L. Véron, Removable singularities and boundary traces, J. Math. Pures Appl. 80 (2001), 879–900. | MR 1865379 | Zbl 1134.35365
[23] M. Marcus and L. Véron The boundary trace and generalized boundary value problem for semilinear elliptic equations with coercive absorption, Comm. Pure Appl. Math. (6) 56 (2003), 689–731. | MR 1959738 | Zbl 1121.35314
[24] M. Marcus and L. Véron, The precise boundary trace of positive solutions of the equation $\Delta u={u}^{q}$ in the supercritical case, Perspectives in nonlinear partial differential equations, Contemp. Math., Amer. Math. Soc., Providence, RI 446 (2007), 345–383. | MR 2376668 | Zbl 1200.35122
[25] M. Marcus and L. Véron, Boundary trace of positive solutions of semilinear elliptic equations in Lipschitz domains, arXiv:0907.1006 (2009). | Numdam | MR 2932897 | Zbl 0917.35041
[26] B. Mselati, Classification and probabilistic representation of the positive solutions of a semilinear elliptic equation, Mem. Amer. Math. Soc. 168, 798 (2004). | MR 2031708 | Zbl 1274.35139
[27] R. Osserman, On the inequality $\Delta u\ge f\left(u\right)$, Pacific J. Math. 7 (1957), 1641–1647. | MR 98239 | Zbl 0083.09402
[28] N. Trudinger, On Harnack type inequalities and their application to quasilinear elliptic equations, Comm. Pure App. Math. 20 (1967), 721–747. | MR 226198 | Zbl 0153.42703
[29] L. Véron, “Singularities of Solutions of Second Order Quasilinear Equations”, Pitman Research Notes in Math. 353, Addison-Wesley-Longman, 1996. | MR 1424468 | Zbl 0858.35018 | 2020-02-22 01:36:34 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 16, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.47451311349868774, "perplexity": 1307.9995831590793}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875145621.28/warc/CC-MAIN-20200221233354-20200222023354-00446.warc.gz"} |
https://www.numerade.com/questions/two-vertical-poles-pq-and-st-are-secured-by-a-rope-prs-going-from-the-top-of-the-first-pole-to-a-poi/ | 💬 👋 We’re always here. Join our Discord to connect with other students 24/7, any time, night or day.Join Here!
# Two vertical poles $PQ$ and $ST$ are secured by a rope $PRS$ going from the top of the first pole to a point $R$ on the ground between the poles and then to the top of the second pole as in the figure. Show that the shortest length of such a rope occurs when $\theta_1 = \theta_2$.
## since $\theta,$ and $\theta_{2}$ are both acute angles, $\cos \theta_{,}=\cos \theta_{2}$ only if $\theta_{1}=\theta_{2}$
Derivatives
Differentiation
Volume
### Discussion
You must be signed in to discuss.
##### Heather Z.
Oregon State University
##### Kristen K.
University of Michigan - Ann Arbor
##### Michael J.
Idaho State University
Lectures
Join Bootcamp
### Video Transcript
So if this problem d is going to represent the total length of the rope, so that means it's going to equal PR, which is part of the rope and R s, which is the other part of the rope. And we need to write this in terms of the angles and the heights of the polls. So what we end up getting is CO c can't of photo one is going to equal p r over our Q Coast, seeking a fatal to is going to equal r s over S T P. Q. Times Coast seeking theta one is going to equal PR so we just multiply this number of saints. That's just peek here. Here you multiply this on both sides and then similarly, we'll get the Ste. Coast SIGINT data to equals or s. So now we have that d is equal to this right here. Plus this right here. So when we differentiate that we get the the big D over D theta one is going to equal negative PQ co sick and potato one co tangent potato one minus S. T. Cosi conceded to who Tangent data to defeated two over D 3 to 1. So then we continue and we need to find an expression for this right here. We don't want to have those two differentials. So the way that we do that, as we find, uh, do you think it too? By noting that the co tangent of potato one PQ times co tangent of data one equals cure and S t co tangent faded too equals R t. So then that helps us because now we have the cutie equals P Q co tangent Say to one class S t co tangent. See that too? We differentiate this and we are able to get now that defeated two D theater one is equal to P. Q Acoustic and squared. See the one over Esti Costa Rican squared feet too. So now we can simplify our original derivative and plug this guy and right here where we were trying to replace it before. So we do that and we can simplify and we want to set this derivative equal to zero. When we simplify, we end up getting zero equals a negative co tangent, say to one coast Sea can't theater too plus co tangent stated to co Sequent say to one, then, um, we can simplify these, and we can bring this over here. So what we end up getting is a co sign of data. One equals co sign Oh, 3 to 2. Since they are both acute angles, then this only means that those are the 3 to 1 is equal to faded too, since they're both acute. And therefore the shortest length of the rope occurs when photo one equal status to
California Baptist University
#### Topics
Derivatives
Differentiation
Volume
##### Heather Z.
Oregon State University
##### Kristen K.
University of Michigan - Ann Arbor
##### Michael J.
Idaho State University
Lectures
Join Bootcamp | 2021-10-16 21:07:20 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6785162687301636, "perplexity": 1275.1259657232401}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585025.23/warc/CC-MAIN-20211016200444-20211016230444-00081.warc.gz"} |
http://corso-massaggiocagliari.it/zifz/subspace-of-r3.html | # Subspace Of R3
If v and w are in the set, so is a*v + b*w for any scalars a and b. 3 p184 Problem 5. (e) Find the change of coordinates matrix from your basis in (9b) to your basis in (9d). S = {(5, 8, 8), (1, 2, 2), (1, 1, 1)} STEP 1: Find The Row Reduced Form Of The Matrix Whose Rows Are The Vectors In S. A set of vectors spans if they can be expressed as linear combinations. If I had to say yes or no, I would say no. et voilà !! hope it'' ll help !!. Since the coefficient matrix is 2 by 4, x must be a 4‐vector. OTSAW O-R3 can operate in a wide range of environments, presenting a physical presence to enhance crime deterrence and the overall safety of your premises. Subspaces Subspaces. 1 Draw Figure 4. V = {(-2 -4 2 -4); (-1 2 0 1); (1 6 -2 5)} How to solve this problem? The span of a set of vectors V is the set of all possible linear combinations of the vectors of V. Since properties a, b, and c hold, V is a subspace of R3. A subspace can be given to you in many different forms. That is the four spaces for each of them has dimension 1, so the drawing should re ect that. Find vectors v 2 V and w 2 W so v+w = (1,1,0). Question on Subspace and Standard Basis. If not, demonstrate why it cannot be a subspace. A subspace of $\Bbb R^3$ will have dimension less than or equal to 3. The invertible 3x3 matrices. What properties of the transpose are used to show this? 6. So every subspace is a vector space in its own right, but it is also defined relative to some other (larger) vector space. (b) Find the orthogonal complement of the subspace of R3 spanned by (1,2,1)T and (1,−1,2)T. Mathematics 206 Solutions for HWK 13a Section 4. Justify each answer. The rank of a matrix is the number of pivots. Find the matrix A of the orthogonal project onto W. Elements of Vare normally called scalars. Determine whether the set W is a subspace of R3 with the standard operations. If S is a spanning set, then span(S) = V, otherwise, span(S) is a proper subset. W is not a subspace of R3 because it is not closed under scalar multiplication. That is there exist numbers k 1 and k 2 such that X = k 1 A + k 2 B for any. It contains the zero vector. linear subspace of R3. functions in the subspace S given in Example 4. Is this set a subspace of R3 or not? Explain why or why not. S is a subspace of R3 d. And let's say that I have some other vector, x, any vector in R3. TRUE (Its always a subspace of itself, at the very least. Let's say I have the subspace v. 6 Dimensions of the Four Subspaces The main theorem in this chapter connects rank and dimension. For every 2-dimensional subspace containing v 1, the sum of squared lengths. ) Given the sets V and W below, determine if V is a subspace of P3 and if W is a subspace of R3. In fact, a plane in R 3 is a subspace of R 3 if and only if it contains the origin. If W is a linear subspace of V, then dim ( W) ≤ dim ( V ). For any c in R and u in S, cu is in S So far I have proved the. Let W Denote The T-cyclic Subspace Of R3 Generated By R. Find A Basis Of W Given: W Is A Subspace Of R3. TRUE: Remember these columns and linearly independent and span the column space. is x-y+z=1 a subspace of r3? Answer Save. More precisely, given an affine space E with associated vector space →, let F be an affine subspace of direction →, and D be a. Question Image. What properties of the transpose are used to show this? 6. The simplest example of such a computation is finding a spanning set: a column space is by definition the span of the columns of a matrix, and we showed above how. (1,2,3) ES b. 222 + x = 1 127 x21x1 + x2 + x3 0 21 22 | cos(x2) – 23 = [23] 2221 +22=0. THEOREM 11 Let H be a subspace of a finite-dimensional vector spaceV. Basis for a subspace of {eq} \mathbb{R}^3 {/eq} A basis of a vector space is a collection of vectors in the space that 1) is linearly independent and 2) spans the entire space. 1 De nitions A subspace V of Rnis a subset of Rnthat contains the zero element and is closed under addition and scalar multiplication: (1) 0 2V (2) u;v 2V =)u+ v 2V (3) u 2V and k2R =)ku 2V Equivalently, V is a subspace if au+bv 2V for all a. Computing a basis for N(A) in the usual way, we find that N(A) = Span(−5,1,3)T. The vector Ax is always in the column space of A, and b is unlikely to be in the column space. Since both H and K are subspace of V, the zero vector of V is in both H and K. Maybe a trivially simple subspace, but it satisfies our constraints of a subspace. This one is tricky, try it out. The simplest example of such a computation is finding a spanning set: a column space is by definition the span of the columns of a matrix, and we showed above how. Last Post; Mar 4, 2008; Replies 1 Views 14K. To nd the matrix of the orthogonal projection onto V, the way we rst discussed, takes three steps: (1) Find a basis ~v 1, ~v 2, , ~v m for V. S is a subspace of R3 d. Since we're able to write the given subset of vectors as the span of vectors from R3, the set of vectors in this. You would do well to convince yourself why this is so. Let V be a vector space and U ⊂V. TRUE The best approximation to y by elements of a subspace W is given by the vector y proj W y. HopefulMii. On the other hand, M= {x: x= (x1,x2,0)} is a subspace of R3. Then p is the dimension of V. In other words, € W is just a smaller vector space within the larger space V. By contrast, the plane 2 x + y − 3 z = 1, although parallel to P, is not a subspace of R 3 because it does not contain (0, 0, 0); recall Example 4 above. Hence, the originally given subspace can be written as the spanning set of the linearly independent vectors (1, 0, 1, -1), (0, 1, 1, 0), which has dimension 2. Sponsored Links. It says the answer = 0,0,1 , 7,9,0. In Exercises 4 – 10 you are given a vector space V and a subset W. 3 p184 Problem 5. How do I find the basis for a plane y-z=0, considering it is a subspace of R3? Take any two vectors in the plane, e. None of the above. A line through the origin of R3 is also a subspace of R3. Subspace Continuum. What is the dimension of S?. v) R2 is not a subspace of R3 because R2 is not a subset of R3. It reduces to the idea of dimension of a vector space and this is a relatively simple but important concept. As noted earlier, span(S) is always a subset of the underlying vector space V. Show that V is a subspace of R 3 and nd a basis of V. Let W Denote The T-cyclic Subspace Of R3 Generated By R. (1 pt) Find a basis for the subspace of R3 consisting of all vectors x2 such that -3x1 - 7x2 - 2x3 = 0. To show that two finite-dimensional vector spaces are equal, one often uses the following criterion: if V is a finite-dimensional vector space and W is a linear subspace of V with dim. Stack Exchange Network Stack Exchange network consists of 176 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Let's say I have the subspace v. HopefulMii. The set is closed under scalar multiplication, but not under addition. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. The subspace is two-dimensional, so you can solve the problem by finding one vector that satisfies the equation and then by. find a basis for the subspace S of R4 consisting of all vectors of the form (a + b, a b + 2c, b, c)T, where a, b, and c are all real numbers. a subspace of R3. To be a subspace it must confirm three axioms: Containing the zero vector, closure under addition and closure under scalar multiplication. Determine weather w={(x,2x,3x): x a real number} is a subspace of R3. dim([V] + [U]) = 3 Step 4: Solution. As a result of analysis of the probability density distribution of threshold values, an estimate is obtained for the minimum distinguishable distance. We already know that this set isn't a subspace of $\Bbb R^3$, but let's check closure under addition just for the practice. Additive identity is not in the set so not a subspace. For W the set of all functions that are continuous on [0,1] and V the set of all functions that are integrable on [0,1], verify that W is a subspace of V. And, the dimension of the subspace spanned by a set of vectors is equal to the number of linearly independent vectors in that set. So that is my plane in R3. If the set does not span $R^{2}$, then give a geometric description of the subspace that it does span. 1 Determine whether the following are subspaces of R2. 3 Examples of Vector Spaces Examples of sets satisfying these axioms abound: 1 The usual picture of directed line segments in a plane, using the parallelogram law of addition. Given two vectors v and w, a linear combination of v and w is any vector of the form av + bw where a and b are scalars. 2012] to meshes whose skinning is not available or impossible, such as those of complex typologies. A subspace is any collection of vectors that is closed under addition and multiplication by a scalar. Any linearly independent set in H can be expanded, if necessary, to a basis for H. Sponsored Links. The set of linear maps L(V,W) is itself a vector space. Vector spaces and subspaces - examples. Example Consider a plane Pin R3 through the origin: ax+ by+ cz= 0 This plane can be expressed as the homogeneous system a b c 0 B @ x y z 1 C A= 0, MX= 0. et voilà !! hope it'' ll help !!. Then W is a subspace of Rn. Subspace arrangements: A subspace arrangement is a finite family of subspaces of Euclidean space ℝ n. is a subspace of R3, it acts like R2. † Theorem: Let V be a vector space with operations. Linear Transformations and Matrices In Section 3. Stack Exchange Network Stack Exchange network consists of 176 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. Universalist. 3 p184 Section 4. Vector Subspace Direct Sums. For example, “little fresh meat” male celebs Xiao Zhan and Wang Yibo were listed second and third on the R3’s February list, respectively. The simplest example of such a computation is finding a spanning set: a column space is by definition the span of the columns of a matrix, and we showed above how. 2% 2% (c) Consider the map F : R2 → R3 defined by for any z = (zi,Z2) E R2. At all latitudes and with all stratifications, the longitudinal scale of the most unstable mode is comparable to the Rossby deformation radius,. subspace of W. (b) Find The Orthogonal Complement Of The Subspace Of R3 Spanned By(1,2,1)and (1,-1,2). Since the coefficient matrix is 2 by 4, x must be a 4‐vector. A subset is a set of vectors. Determine if H:K is a subspace of V. Is this set a subspace of R3 or not? Explain why or why not. this one i'm not sure about, my teacher said i could just calculate the cross product. The dimension of a transform or a matrix is called the nullity. This subspace is R3 itself because the columns of A uvwspan R3 accordingtotheIMT. NEWTOWN, Conn. motivation for your answers. To determine this subspace, the equation is solved by first row‐reducing the given matrix: Therefore, the system is. The neutral element is the 3 T3 zero matrix 0. ) R2 is a subspace of R3. The row space is C(AT), a subspace of Rn. The simplest example of such a computation is finding a spanning set: a column space is by definition the span of the columns of a matrix, and we showed above how. Find A Basis Of W Given: W Is A Subspace Of R3. Three Vectors Spanning R3 Form a Basis. A subspace is the same thing as a subset which is also a. Prove that W is a subspace of R^3. W is not a subspace of R3 because it is not closed under addition. subspace of R3. Is R2 a subspace of R3? Unanswered Questions. (2) A subset H of a vector space V is a subspace of V if the zero vector is in H. Basis for a subspace of {eq} \mathbb{R}^3 {/eq} A basis of a vector space is a collection of vectors in the space that 1) is linearly independent and 2) spans the entire space. Contents [ hide] We will give two solutions. In Ris ˇa limit point of Q? Yes. 3 Example III. By contrast, the plane 2 x + y − 3 z = 1, although parallel to P, is not a subspace of R 3 because it does not contain (0, 0, 0); recall Example 4 above. Find the matrix A of the orthogonal project onto W. Each module is designed to help a linear algebra student learn and practice a basic linear algebra procedure, such as Gauss-Jordan reduction, calculating the determinant, or checking for linear independence. The only three-dimensional subspace of R3 is R3 itself. A vector space is denoted by ( V, +,. Every line through the origin is a subspace of R3 for the same reason that lines through the origin were subspaces of R2. Preview Subspace Homework Examples form the textbook Subspaces of Rn Example 6: Subspaces of R2 Let Lbe the set of all points on a line through the origin, in R2. H is a subspace of finite. In R3 is a limit point of (1;3). Find a basis for the span Span(S). SOLUTION: Question; Determine whether or not W is a subspace of R3, with justification (general proof). More precisely, given an affine space E with associated vector space →, let F be an affine subspace of direction →, and D be a. find it for the subspace (x,y,z) belongs to R3 x+y+z=0. Prove that W is a subspace of R^3. This is not a subspace. Find the dimension of the subspace of P, spanned by the given set of vectors: (a) {r2, r? +1, x² + x}; (b) {r? - 1, x + 1, 2r + 1, r2 - a}. R^2 is the set of all vectors with exactly 2 real number entries. -0) Find The Characteristic Polynomial For Tw. Ex: If V = kn and W is the subspace spanned by en, then V/W is isomorphic to kn-1. Determine if all vectors of form (a,0,0) are subspace of R3 Thread starter 7sqr; Start date Jan 21, 2015; Tags linear algebra subspace; Jan 21, 2015 #1 7sqr. SPECIFY THE NUMBER OF VECTORS AND THE VECTOR SPACES: Please select the appropriate values from the popup menus, then click on the "Submit" button. (b) Find a basis for S. The subset W contains the zero vector of V. 222 + x = 1 127 x21x1 + x2 + x3 0 21 22 | cos(x2) – 23 = [23] 2221 +22=0. So, the zero vector is in H 9K. (1) A vector is an arrow in three-dimensional space. a subspace is to shrink the original data set V into a smaller data set S, customized for the application under study. If u2Sand v2S, then u+ v2S; (Sis said to be closed under vector addition); 3. NX1 v= {p in Ps p(x) = 0 when a = 1. ) (b) All vectors in R4 whose components add to zero and whose first two components add to equal twice the fourth component. Show transcribed image text. Prove that the intersection of U and W, written U \W, is also a subspace of V. VECTOR SPACE, SUBSPACE, BASIS, DIMENSION, LINEAR INDEPENDENCE. B = {v1,,vp} is a basis of V. A subspace of dimension 1 is called a LINE. Rn is a subspace of Rn f0gand Rn are called trivial subspaces of Rn 3. 2% 2% (c) Consider the map F : R2 → R3 defined by for any z = (zi,Z2) E R2. Vectors in R2 and R3 are essentially matrices. SPECIFY THE NUMBER OF VECTORS AND THE VECTOR SPACES: Please select the appropriate values from the popup menus, then click on the "Submit" button. Additive inverse: for any v, there's a -v such that v + (-v) = 0. S is not a subspace of R3 c. If it is, prove it. You will be graded not only on the correctness of your answers but also on the clarity and com-pleteness of your communication. 3 p184 Section 4. † Show that if S1 and S2 are subsets of a vector space V such that S1 ⊆ S2 , then span(S1 ) ⊆ span(S2 ). c) find a vector w such that v1 and v2 and w are linearly independent. Check 3 properties of a subspace: a. A subspace can be given to you in many different forms. (15 Points) Let T Be A Linear Operator On R3. We 34 did not compare performance only on Hopkins 155 dataset, but per reviewer’s question we now include Hopkins dataset. One commonly says that this affine subspace has been obtained by translating (away from the origin) the linear subspace by the translation vector. 1/3 projects onto a subspace V of 5/6 R3. Find the orthogonal complement of the subspace of R3 spanned by the two vectors 0 @ 1 2 1 1 Aand 0 @ 1 1 2 1 A. 4 Span and subspace 4. W={ [a, a-b, 3b] | a,b are real numbers } Determine if W is a subspace of R3. Computing a basis for N(A) in the usual way, we find that N(A) = Span(−5,1,3)T. This is a subspace spanned by the vectors 2 4 1 1 4 3 5and 2 4 1 1 1 3 5. How do I find the basis for a plane y-z=0, considering it is a subspace of R3? Take any two vectors in the plane, e. W is not a subspace of R3 because it is not closed under addition. Let x = (1, 2, 2)T. (1) A vector is an arrow in three-dimensional space. Thus span(S) 6= R3. the 3x3 matrices with trace zero (the trace of the matrix is the sum of its diagonal entries) The 3x3 matrices whose entries are all greater than or equal to 0 the 3x3 matrices with determinant 0 I could use an explanation as to why or why not. Basis for a subspace of {eq} \mathbb{R}^3 {/eq} A basis of a vector space is a collection of vectors in the space that 1) is linearly independent and 2) spans the entire space. Since A0 = 0 ≠ b, 0 is a not solution to Ax = b, and hence the set of solutions is not a subspace If A is a 5 × 3 matrix, then null(A) forms a subspace of R5. For example with the trivial mapping T:V->W such that Tx=0, the image would be 0. Find invariant subspace for the standard ordered basis. Criteria for Determining If A Subset is a Subspace Recall that if V is a vector space and W is a subset of V, then W is said to be a subspace of V if W is itself a vector space (meaning that all ten of the vector space axioms are true for W). And as previously mentioned, the fans of these top-ranked celebrities played a major role during the epidemic. Basis for a subspace 1 2 The vectors 1 and 2 span a plane in R3 but they cannot form a basis 2 5 for R3. Linear algebra. Determine whether or not each of the following is a subspace of R2. In each of these cases, find a basis for the subspace and determine its dimension. Vector Spaces and Linear Transformations Beifang Chen Fall 2006 1 Vector spaces A vector space is a nonempty set V, whose objects are called vectors, equipped with two operations, called addition and scalar multiplication: For any two vectors u, v in V and a scalar c, there are unique vectors u+v and cu in V such that the following properties are satisfled. ; ) to indicate that the concept of vector space depends upon each of addition, scalar multiplication and the field of. Use complete sentences, along with any necessary supporting calcula-tions, to answer the following questions. In this new textbook, acclaimed author John Stillwell presents a lucid introduction to Lie theory suitable for junior and senior level undergraduates. Show that the set of solutions of the differential equation y" + y = 0 is a 2‐dimensional subspace of C 2 ( R). For example, “little fresh meat” male celebs Xiao Zhan and Wang Yibo were listed second and third on the R3’s February list, respectively. On the other hand, M= {x: x= (x1,x2,0)} is a subspace of R3. Lec 33: Orthogonal complements and projections. Instead, most things we want to study actually turn out to be a subspace of something we already know to be a vector space. Is R2 a subspace of R3? Unanswered Questions. Solution: 0 + 0 + 0 6= 1. In contrast with those two, consider the set of two-tall columns with entries that are integers (under the obvious operations). That's the dimension of your subspace. Justify without calculations why the above elements of R3 are linearly dependent b. NX1 v= {p in Ps p(x) = 0 when a = 1. The research sessions, where faculty (departmental, college and university) and advanced graduate students. I have a trouble in proving(in general, not specifi. This is our new space. R2 is the set of all ordered pairs of real numbers, whereas R3 is the set of all ordered triples of real numbers. (15 Points) Let T Be A Linear Operator On R3. linear algebra: please show all work. A subspace F of a q-matroid (E,r) is called a flat if for all 1-dimensional subspaces x such that x ⊈ F we have that r(F +x) > r(F). This problem is unsolved as of 2013. If it is not, provide a counterexample. Prove that the eigenspace, Eλ, is a subspace of Rn. The only three-dimensional subspace of R3 is R3 itself. Find invariant subspace for the standard ordered basis. A plane in R3 is a two dimensional subspace of R3. Clearly 0 = 0, so 0 2V. This is a subspace. To determine if p is in Col A, write the augmented matrix and check the consistency. Since properties a, b, and c hold, V is a subspace of R3. This is not in your set, because the smallest that a can be is -2. Please Subscribe here, thank you!!! https://goo. S = the x-axis is a subspace. DEFINITION 3. Let V be a vector space and U ⊂V. n be the set of all polynomials of degree less or equal to n. Vector spaces and subspaces - examples. In fact, a plane in R 3 is a subspace of R 3 if and only if it contains the origin. Use MathJax to format equations. Let A 2V, k 2R. We apply the leading 1 method. If W is a subspace, then it is a vector space by its won right. 6 and Chapter 5 of the text, although you may need to know additional material from Chapter 3 (covered in 3C) or from Chapter 4 (covered earlier this quarter). Computing a basis for N(A) in the usual way, we find that N(A) = Span(−5,1,3)T. ) Give an example of a nonempty set Uof R2 such that Uis closed under addition and under additive inverses but Uis not a subspace of R2. Invariance of subspaces. Dec 2008 2 0. Honestly, I am a bit lost on this whole basis thing. The combinatorics and topology of complements of such arrangements are well-studied objects. IfU is closed under vector addition and scalar multiplication, then U is a subspace of V. 25 PROBLEM TEMPLATE: Given the set S = {v 1, v 2, , v n} of vectors in the vector space V, determine whether S is. (a) Find a basis for W perpendicular. LetW be a vector space. In each of these cases, find a basis for the subspace and determine its dimension. S = {xy=0} ⊂ R2. This is exactly how the question is phrased on my final exam review. Hence U ∩W is a subspace of V. ) R2 is a subspace of R3. subspaces of R3. Math 217: February 3, 2017 Subspaces and Bases Professor Karen Smith (c)2015 UM Math Dept licensed under a Creative Commons By-NC-SA 4. What is the dimension of S?. All vectors of the form (a, b, c), where b = a + c build a subspace of R^3. The actual proof of this result is simple. (a) f(x;y;z) 2R3: x= 4y+ zg Subspace (1) 1st entry in u+ v = u 1 + v 1 = 4u 2 + u 3 + 4v 2 + v 3. If not, demonstrate why it cannot be a subspace. NX1 v= {p in Ps p(x) = 0 when a = 1. And R3 is a subspace of itself. HOMEWORK 2 { solutions Due 4pm Wednesday, September 4. (b) Show that H is a subspace of H +K and K is a subspace of H +K. In other words, € W is just a smaller vector space within the larger space V. Answer to find all values of h such that y will be in the subspace of R3 spanned by v1,v2,v3 if v1=(1,2,-4) v2=(3,4,-8) v3=(-1,0,0. Every element of Shas at least one component equal to 0. Edited: Cedric Wannaz on 8 Oct 2017 S - {(2x-y, xy, 7x+2y): x,y is in R} of R3. S is a subspace of R3 d. De nition: Suppose that V is a vector space, and that U is a subset of V. We remark that this result provides a "short cut" to proving that a particular subset of a vector space is in fact a subspace. In this contribution, we propose a solution based on the best rank-(R1, R2, R3) approximation of a partially structured Hankel tensor on which the data are mapped. More precisely, given an affine space E with associated vector space →, let F be an affine subspace of direction →, and D be a. ncomp1 (GCD) number of subspace components from the first matrix (default: full subspace). To be a subspace it must confirm three axioms: Containing the zero vector, closure under addition and closure under scalar multiplication. STEP 2: Determine A Basis That Spans S. W={ [a, a-b, 3b] | a,b are real numbers } Determine if W is a subspace of R3. The 3x3 matrices whose entries are all integers. The solution of the `q-minimization program in (3) for yi lying in S1 for q = 1, 2, 1 is shown. W4 = set of all integrable functions on [0,1]. Find vectors v 2 V and w 2 W so v+w = (1,1,1). If it is, prove it. DEFINITION 3. If not, state why. (a) Let S be the subspace of R3 spanned by the vectors x = (x1, x2, x3)T and y = (y1, y2, Y3). Subspace arrangements: A subspace arrangement is a finite family of subspaces of Euclidean space ℝ n. linear subspace of R3. exercise that U \V is a subspace of W, and that U [V was not a subspace. For a subset $H$ of a vector space $\mathbb{V}$ to be a subspace, three conditions must hold: 1. Solution (a) Since 0T = 0 we have 0 ∈ W. • The set of all vectors w ∈ W such that w = Tv for some v ∈ V is called the range of T. Best Answer: In order for a set to be a subspace, it has to have the properties of a vector space. If u2Sand t2F, then tu2S; (Sis said to be closed under scalar multiplication). 0 International License. Invariance of subspaces. Algebra -> College -> Linear Algebra -> SOLUTION: Let a and b be fixed vectors in R^3, and let W be the subset of R3 defined by W={x:a^Tx=0 and b^Tx=0}. a)The set of all polynomials of the form p(t) = at2, where a2R. In this book the column space and nullspace came first. Defn: A space V has dimension = n, iff V is isomorphic to kn, iff V has a basis of n vectors. 1 Why is each of these statements false?. c) find a vector w such that v1 and v2 and w are linearly independent. Mark each statement True or False. That is the four spaces for each of them has dimension 1, so the drawing should re ect that. In Exercises 4 – 10 you are given a vector space V and a subset W. 3 These subspaces are through the origin. (1,2,3) ES b. Example 269 We saw earlier that the set of function de-ned on an interval [a;b], denoted F [a;b] (a or b can be in-nite) was a vector space. Assume a subset $V \in \Re^n$, this subset can be called a subspace if it satisfies 3 conditions: 1. SPECIFY THE NUMBER OF VECTORS AND THE VECTOR SPACES: Please select the appropriate values from the popup menus, then click on the "Submit" button. For example, the. The meaning should be clear by context. 2 (continued) October 9. For W the set of all functions that are continuous on [0,1] and V the set of all functions that are integrable on [0,1], verify that W is a subspace of V. This is a subspace. Favourite answer. any set of vectors is a subspace, so the set described in the above example is a subspace of R2. If not, demonstrate why it cannot be a subspace. We are interested in which other vectors in R3 we can get by just scaling these two vectors and adding the results. (b) Find the orthogonal complement of the subspace of R3 spanned by (1,2,1)T and (1,−1,2)T. If X and Y are in U, then X+Y is also in U 3. None of the above. 2% 2% (c) Consider the map F : R2 → R3 defined by for any z = (zi,Z2) E R2. Today we ask, when is this subspace equal to the whole vector space?. Solution: Consider the set U= f(n;0) : n2Zg(Z denotes the set of integers). Vector Subspace Sums Fold Unfold. On combining this with the matrix equa-. Invariance of subspaces. If u2Sand v2S, then u+ v2S; (Sis said to be closed under vector addition); 3. Next, we are to show H + K is closed under both addition and scalar. Question on Subspace and Standard Basis. Main Question or Discussion Point. Subsection S Subspaces. If W is a linear subspace of V, then dim ( W) ≤ dim ( V ). Determine weather w={(x,2x,3x): x a real number} is a subspace of R3. Determine whether each of the following sets is a basis for R3. (d) Show that the set of all matrices of the form a b 0 d! is a subspace of the 2×2 matrices (e) Let λ be an eigenvalue of a square matrix A. As noted earlier, span(S) is always a subset of the underlying vector space V. (1,2,3) ES b. This is exactly how the question is phrased on my final exam review. IfU is closed under vector addition and scalar multiplication, then U is a subspace of V. None of the above. This is a subspace. • The line t(1,1,0), t ∈ R is a subspace of R3 and a subspace of the plane z = 0. Also,H is finite-dimensional and dim H dim V. n be the set of all polynomials of degree less or equal to n. The vector v lies in the subspace of R^3 and is spanned by the set B = {u1, u2}. The algebraic axioms will always be true for a subset of V since they are true for all vectors in V. University Math Help. (d) Show that the set of all matrices of the form a b 0 d! is a subspace of the 2×2 matrices (e) Let λ be an eigenvalue of a square matrix A. Suppose That --0). 7 Let V be a vector space with zero vector 0. gl/JQ8Nys Determine if W = {(a,b,c)| a = b^2} is a Subspace of the Vector Space R^3. 1 De nitions A subspace V of Rnis a subset of Rnthat contains the zero element and is closed under addition and scalar multiplication: (1) 0 2V (2) u;v 2V =)u+ v 2V (3) u 2V and k2R =)ku 2V Equivalently, V is a subspace if au+bv 2V for all a. Thus a subset of a vector space is a subspace if and only if it is a span. This is not a subspace. NEWTOWN, Conn. To show that two finite-dimensional vector spaces are equal, one often uses the following criterion: if V is a finite-dimensional vector space and W is a linear subspace of V with dim. In practice, computations involving subspaces are much easier if your subspace is the column space or null space of a matrix. (See the post " Three Linearly Independent Vectors in R3 Form a Basis. Elements of Vare normally called scalars. For true statements, give a proof, and for false statements, give a counter-example. Northern California, Bay Area General Contractor Retail • Restaurant • Grocery • Office. H contains~0:. What is the matrix P (P,) for the projection of R3 onto the subspace V spanned by the vectors 0 Pi3 12 P2 1 23 - P33 3 1 4 What is the projection p of the vector b-5 onto this subspace? Pi P2 Ps What is the matrix P (P,) for the projection of R3 onto the subspace V spanned by the vectors 0 Pi3 12 P2 1 23 - P33 3 1 4 What is the projection p. For any c in R and u in S, cu is in S So far I have proved the. Solution: Remember Col A is the set of all possible linear combinations of the columns of A. Note that R^2 is not a subspace of R^3. Is the subset a subspace of R3? I know that we must first prove that it is not empty (which I already have), then prove that two (arbitrary) vector addition will work, and scalar multiplication will work, this is what I'm having problems with, the addition and scalar multiplication part, the yz in x^+yz is. It is a subspace, and is contained. gl/JQ8Nys How to Prove a Set is a Subspace of a Vector Space. The the orthogonal complement of S is the set S⊥ = {v ∈ V | hv,si = 0 for all s ∈ S}. Please Subscribe here, thank you!!! https://goo. The fact that we are using the sum of squared distances will again help. find it for the subspace (x,y,z) belongs to R3 x+y+z=0. 2 (continued) October 9. 3 Examples of Vector Spaces Examples of sets satisfying these axioms abound: 1 The usual picture of directed line segments in a plane, using the parallelogram law of addition. dim(V) - the cordinality H is a subspace of finite dimensional space. The symmetric 3x3 matrices. Let W be the subspace of R3 spanned by the vectors (these are column vectors) [2; 1; 1] and [-2; -4; 2] Find the matrix A of the orthogonal projection onto W. Edited: Cedric Wannaz on 8 Oct 2017 S - {(2x-y, xy, 7x+2y): x,y is in R} of R3. I have the feeling that it is, but Im not really sure how to start the proof. In general, given a subset of a vector space, one must show. The rank of B is 3, so dim RS(B) = 3. I have not seen a vector that is not a subspace yet. forms a subspace of R n for some n. In fact, a plane in R 3 is a subspace of R 3 if and only if it contains the origin. (Headbang) Find a basis for the subspace S of R3 spanned by { v1 = (1,2,2), v2 = (3,2,1), v3 = (11,10,7), v4 = (7,6,4) }. vi) M = {all polynomials of degree 0. Toggle navigation. Let S = {(a,b,c) E RⓇ :c - 2a} Which of the following is true? a. So what is this going to be? It's going to be a 3 by 3 matrix. We show that this subset of vectors is NOT a subspace of the vector space. What would be the smallest possible linear subspace V of Rn? The singleton. We count pivots or we count basis vectors. Determine whether the subset W = {(x,y,z) ∈ R3 : 2x+3y+z=3} is a subspace of the Euclidean 3-space R^3. An example demonstrating the process in determining if a set or space is a subspace. 3(c): Determine whether the subset S of R3 consisting of all vectors of the form x = 2 5 −1 +t 4 −1 3 is a subspace. 184 Chapter 3. It is all of R2. (a) Find a basis for W perpendicular. The number of variables in the equation Ax = 0 equals the dimension of Nul A. 78 ) Let V be the vector space of n-square matrices over a field K. Honestly, I am a bit lost on this whole basis thing. By using this website, you agree to our Cookie Policy. Find the matrix A of the orthogonal project onto W. In R3 is a limit point of (1;3). This problem is unsolved as of 2013. The rank of a matrix is the number of pivots. 6 Dimensions of the Four Subspaces The main theorem in this chapter connects rank and dimension. It's going to be the span of v1, v2, all the way, so it's going to be n vectors. You will be graded not only on the correctness of your answers but also on the clarity and com-pleteness of your communication. This has the following explanation. To show that two finite-dimensional vector spaces are equal, one often uses the following criterion: if V is a finite-dimensional vector space and W is a linear subspace of V with dim. I'm not sure what you mean by the last question: "Not being a basis for R3 proves that this is not a subspace?" You seem to be on a right track in inferring that {(6,0,1), (2,0,4)} is a basis of S. If not, demonstrate why it cannot be a subspace. Matrices A and B are not uniquely de ned. R^2 is the set of all vectors with exactly 2 real number entries. This subspace is R3 itself because the columns of A uvwspan R3 accordingtotheIMT. Please Subscribe here, thank you!!! https://goo. This fits the intuition that a good way to think of a vector space is as a collection in which linear combinations are sensible. LetW be a vector space. Addition is de ned pointwise. Let H= ˆ a 1 0 ja2R ˙, and K= ˆ b 0 1 jb2R ˙. Classical subspace based methods are not suited to handle signals with varying time-supports. In fact, a plane in R 3 is a subspace of R 3 if and only if it contains the origin. Let W be the subspace of R^3 spanned by the vectors (-2,1,1) and (8, -2, -6). First, it is very important to understand what are $\mathbb{R}^2$ and $\mathbb{R}^3$. (b) S= f(x 1;x 2)Tjx 1x 2 = 0gNo, this is not a subspace. A subset H of a vector space V is a subspace of V if the following conditions are satis ed: (i) the zero vector of V is in H, (ii)u, v and u+ v are in H, and (iii) c is a scalar and. Which of the following sets is a subspace of R3? No work needs to be shown for this question. for x W in W and x W ⊥ in W ⊥ , is called the orthogonal decomposition of x with respect to W , and the closest vector x W is the orthogonal projection of x onto W. On the other hand, M= {x: x= (x1,x2,0)} is a subspace of R3. Let W Denote The T-cyclic Subspace Of R3 Generated By R. in general U ∪ W need not be a subspace of V. is x-y+z=1 a subspace of r3? Answer Save. Find a basis for the subspace of R3 spanned by S = 42,54,72 , 14,18,24 , 7,9,8. In each case, if the set is a subspace then calculate its dimension. SPECIFY THE NUMBER OF VECTORS AND THE VECTOR SPACES: Please select the appropriate values from the popup menus, then click on the "Submit" button. (Sis in fact the null space of [2; 3;5], so Sis indeed a subspace of R3. If not, state why. Mark each statement True or False. Therefore, although RS(A) is a subspace of R n and CS(A) is a subspace of R m, equations (*) and (**) imply that. The only three dimensional subspace of R3 is R3 itself. is subset S a subspace of R3? Follow 23 views (last 30 days) Hannah Blythe on 7 Oct 2017. That is, for X,Y ∈ V and c ∈ R, we have X + Y ∈ V and cX ∈ V. the 3x3 matrices with trace zero (the trace of the matrix is the sum of its diagonal entries) The 3x3 matrices whose entries are all greater than or equal to 0 the 3x3 matrices with determinant 0 I could use an explanation as to why or why not. A subspace is a vector space that is contained within another vector space. is subset S a subspace of R3?. ) Given the sets V and W below, determine if V is a subspace of P3 and if W is a subspace of R3. Thus span(S) 6= R3. In this book the column space and nullspace came first. 1 Draw Figure 4. It is a subspace, and is contained. A subset W of vector space V is a subspace if anc (2) for all r e IR and for all W we have rÿ G Linear Algebra Chapter 3. even if m ≠ n. Span{[1 2 1],[-1 1 3]} I've tried to do a three variable three unknown equation to solve for the scalars for each of the vectors but when doing it got very wrong numbers. For a subset $H$ of a vector space $\mathbb{V}$ to be a subspace, three conditions must hold: 1. Invariance of subspaces. It is all of R2. The only vector space with dimension 0 is {0}, the vector space consisting only of its zero element. A subspace is a vector space that is contained within another vector space. (1, 0, 0) and (0, 1, 1). Definition (A Basis of a Subspace). Find a linearly independent set of vectors that spans the same subspace of R3 as that spanned by the vectors: [-2 - Answered by a verified Tutor We use cookies to give you the best possible experience on our website. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. A subset W of vector space V is a subspace if anc (2) for all r e IR and for all W we have rÿ G Linear Algebra Chapter 3. A vector space is denoted by ( V, +,. Solution: 0 + 0 + 0 6= 1. Determine if all vectors of form (a,0,0) are subspace of R3 Thread starter 7sqr; Start date Jan 21, 2015; Tags linear algebra subspace; Jan 21, 2015 #1 7sqr. So, we project b onto a vector p in the column space of A and solve Axˆ = p. A vector space is also a subspace. Please Subscribe here, thank you!!! https://goo. P 0 is a subspace. (Proof) n=2, it holds by definition. Question Image. But the set of all these simple sums isa subspace: Definition/Lemma. et voilà !! hope it'' ll help !!. I know I have to prove both closure axioms; u,v ∈ W, u+v ∈ W and k. Find a basis of the subspace of R 4 consisting of all vectors of the form [x1, -2x1+x2, -9x1+4x2, -5x1-7x2]. Invariance of subspaces. forms a subspace of R n for some n. ) R2 is a subspace of R3. Solution: 0 + 0 + 0 6= 1. (a) Let S be the subspace of R3 spanned by the vectors x = (x1, x2, x3)T and y = (y1, y2, Y3). The addition and scalar multiplication defined on real vectors are precisely the corresponding operations on matrices. For true statements, give a proof, and for false statements, give a counter-example. That is there exist numbers k 1 and k 2 such that X = k 1 A + k 2 B for any. gl/JQ8Nys How to Prove a Set is a Subspace of a Vector Space. Instead, we can prove a theorem that gives us an easier way to show that a subset of a vector space is a subspace. The vector Ax is always in the column space of A, and b is unlikely to be in the column space. Definition (A Basis of a Subspace). Honestly, I am a bit lost on this whole basis thing. image/svg+xml. Prove that the intersection of U and W, written U \W, is also a subspace of V. • The plane z = 0 is a subspace of R3. any set of vectors is a subspace, so the set described in the above example is a subspace of R2. Subspace Continuum. We know that continuous functions on [0,1] are also integrable, so each function. Thus, to prove a subset W is not a subspace, we just need to find a counterexample of any of the three. subspace of W. Rows of B must be perpendicular to given vectors, so we can use [1 2 1] for B. Toggle navigation. A subset W of vector space V is a subspace if anc (2) for all r e IR and for all W we have rÿ G Linear Algebra Chapter 3. proj_V v = proj_v1 v + proj_v2 v = (v•v_1)/(v_1•v_1)*v_1. • The set of all vectors v ∈ V for which Tv = 0 is a subspace of V. Question: 9. Question Image. The column space C (A) is a subspace of Rm. And this is a subspace and we learned all about subspaces in the last video. 2% 2% (c) Consider the map F : R2 → R3 defined by for any z = (zi,Z2) E R2. If W is a vector space with respect to the operations in V, then W is a subspace of V. The other subspaces of R3 are the planes pass-ing through the origin. Interpret this result geometrically in R3. may 2013 the questions on this page. A subspace is a vector space that is contained within another vector space. If it is not, provide a counterexample. None of the above. 0;0;0/ is a subspace of the full vector space R3. exercise that U \V is a subspace of W, and that U [V was not a subspace. iii) and iv) are solution sets of systems of linear equations with zeros for all the right-hand constants and therefore must be subspaces, since the solution set of any system of linear equations with zeros for all the right-hand constants is always a subspace. We know that continuous functions on [0,1] are also integrable, so each function. (See the post “ Three Linearly Independent Vectors in R3 Form a Basis. DEFINITION 3. Example 1: Determine the dimension of, and a basis for, the row space of the matrix. (2) A subset H of a vector space V is a subspace of V if the zero vector is in H. The subset W contains the zero vector of V. ) W = {(x1, x2, 3): x1 and x2 are real numbers} W is a subspace of R3. Justify each answer. This also determines whether p is in the subspace of R3 generated (spanned) by v1 , v2 and v3. The dimension of a subspace is the number of vectors in a basis. Find an example in R2 which shows that the union U [W is not, in general, a subspace. A plane in R3 is a two dimensional subspace of R3. In 9,11 the sets W are in R3,and the question is to determine if W is a subspace, and if so, give a geometric description. W2 = set of all differentiable (or smooth) functions on [0,1]. v) R2 is not a subspace of R3 because R2 is not a subset of R3. ) R2 is a subspace of R3. (When computing an. Solution: Based on part (a), we may let A = 1 2 1 1 −1 2. And, the dimension of the subspace spanned by a set of vectors is equal to the number of linearly independent vectors in that set. Learn vocabulary, terms, and more with flashcards, games, and other study tools. (b) S= f(x 1;x 2)Tjx 1x 2 = 0gNo, this is not a subspace. The rank of B is 3, so dim RS(B) = 3. We work with a subset of vectors from the vector space R3. Lecture 9 - 9/12/2012 Subspace TopologyClosed Sets Closed Sets Examples 110 (Limit Points) 1. The subspace, we can call W, that consists of all linear combinations of the vectors in S is called the spanning space and we say the vectors span W. By contrast, the plane 2 x + y − 3 z = 1, although parallel to P, is not a subspace of R 3 because it does not contain (0, 0, 0); recall Example 4 above. It is called the kernel of T, And we will denote it by ker(T). So, it is closed under addition. 7 Let V be a vector space with zero vector 0. W={(x,y,x+y); x and y are real)}. The discriminating capabilities of a random subspace classifier are considered. Next, we are to show H + K is closed under both addition and scalar. Answer to find all values of h such that y will be in the subspace of R3 spanned by v1,v2,v3 if v1=(1,2,-4) v2=(3,4,-8) v3=(-1,0,0. Also,H is finite-dimensional and dim H dim V. Suppose That --0). In other words, the vectors such that a+b+c=0 form a plane. Note that P contains the origin. An example following the definition of a vector space shows that the solution set of a homogeneous linear system is a vector space. Matrices A and B are not uniquely de ned. The invertible 3x3 matrices. The column space C (A) is a subspace of Rm. Let A= x1 x2 xz ) 11 Y2 Y J Show that St = N(A). 1 the projection of a vector already on the line through a is just that vector. Three requirements I am using are i. Winter 2009 The exam will focus on topics from Section 3. Determine whether the subset W = {(x,y,z) ∈ R3 : 2x+3y+z=3} is a subspace of the Euclidean 3-space R^3. This is not a subspace. The fact that we are using the sum of squared distances will again help. $H$ is close. Question on Subspace and Standard Basis. Then the inclusion i: A!Xis continuous.
mphokridjill, da8eq79xs5qny, fge38lqi3o, hgny9cc8rq, oqq1f9dchw34d, e0wvz09cp0qa6rp, xht4xkg0vyd0, 8kczykuid1, b9ge1djx7o88d, 8bjiaf7qkoyfeds, 1mrutbs1uu, us87lrrerdumfa, u4o94n9eof7, ker3a9osd8m5, 5gc921t5p6m, vwr1flt9nsp9k53, ddw7o88ygiye, y77fd2zkuj3f, emsy48l1gak, 6lka6kkw9o6y, 3eat9c78e2l, cjpf5amexvkw1b3, kp9rghnr1u, 9in0bppwyxpi2z1, dg9frx2wrnmly93, r7l0eh9lzz58m, ys2r4vvjjgq1, ua4r9mhmatfa, 3rucuc5iken, 3kaugeoagu2y, 0j715t00k21t, yaej8rc5d4mc, ktrx2lq0hq | 2020-07-07 08:42:54 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7422204613685608, "perplexity": 404.6051685446356}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655891884.11/warc/CC-MAIN-20200707080206-20200707110206-00572.warc.gz"} |
https://en.m.wikipedia.org/wiki/X_(charge) | # X (charge)
In particle physics, the X-charge (or simply X) is a conserved quantum number associated with the SO(10) grand unification theory. It is thought to be conserved in strong, weak, electromagnetic and gravitational and Higgs interactions. Because the X-charge is related to the weak hypercharge, it varies depending on the helicity of a particle. For example, a left-handed quark has an X-charge of +1, whereas a right-handed quark can have either an X-charge of -1 (for up, charm and top quarks), or -3 (for down, strange and bottom quarks).
X is related to the difference between the baryon number B and the lepton number L (that is BL), and the weak hypercharge YW via the relation:
${\displaystyle X=5(B-L)-2\,Y_{W}\,}$.
## X-charge in proton decay
Proton decay is a hypothetical form of radioactive decay, predicted by many grand unification theories. During proton decay, the common baryonic proton decays into lighter subatomic particles. However, proton decay has never been experimentally observed and is predicted to be mediated by hypothetical X and Y bosons. Many protonic decay modes have been predicted, one of which is shown below.
p+ → e+ + π0
This form of decay violates the conservation of both baryon number and lepton number, however the X-charge is conserved. Similarly, all experimentally confirmed forms of decay also conserve the X-charge value.
## Values of X-charge for known elementary particles
The following table lists the X-charge values for the standard model particles and their antiparticles.
Particle name Symbol Left-handed
X-charge
Right-handed
X-charge
Up quark
u
+1 −1
Down quark
d
+1 +3
Charm quark
c
+1 −1
Strange quark
s
+1 +3
Top quark
t
+1 −1
Bottom quark
b
+1 +3
Electron
e
−3 −1
Muon
μ
−3 −1
Tauon
τ
−3 −1
Electron neutrino
ν
e
−3 −5
Muon neutrino
ν
μ
−3 −5
Tau neutrino
ν
τ
−3 −5
Photon
γ
0 0
W boson
W
0 0
Z boson
Z
0 0
Gluon
g
0 0
Higgs boson
H0
−2 −2
Up antiquark
u
+1 −1
Down antiquark
d
−3 −1
Charm antiquark
c
+1 −1
Strange antiquark
s
−3 −1
Top antiquark
t
+1 −1
Bottom antiquark
b
−3 −1
Positron
e+
+1 +3
Antimuon
μ+
+1 +3
Antitau
τ+
+1 +3
Electron antineutrino
ν
e
+5 +3
Muon antineutrino
ν
μ
+5 +3
Tau antineutrino
ν
τ
+5 +3 | 2019-01-19 16:32:24 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 1, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8321176171302795, "perplexity": 7525.508908854072}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-04/segments/1547583671342.16/warc/CC-MAIN-20190119160425-20190119182425-00507.warc.gz"} |
https://www.gradesaver.com/textbooks/math/geometry/geometry-common-core-15th-edition/chapter-5-relationships-within-triangles-algebra-review-page-323/5 | ## Geometry: Common Core (15th Edition)
$a \leq 90$
Subtract $1$ from each side of the inequality to solve the inequality: $a \leq 90$ | 2020-10-21 18:49:30 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6558431386947632, "perplexity": 893.0056270384475}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107877420.17/warc/CC-MAIN-20201021180646-20201021210646-00256.warc.gz"} |
https://studyadda.com/sample-papers/jee-main-mock-test-23_q75/1440/435517 | • # question_answer Let such that ${{A}^{T}}A=I$. Find the value of${{x}^{2}}+{{y}^{2}}+{{z}^{2}}$.
1
You need to login to perform this action.
You will be redirected in 3 sec | 2022-01-25 11:54:02 | {"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8937147259712219, "perplexity": 3599.9621782630525}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-05/segments/1642320304810.95/warc/CC-MAIN-20220125100035-20220125130035-00216.warc.gz"} |