text:
## Compiler IDE API

As I am working (slowly) on a compiler at the moment, I have started thinking about IDE integration. It occurs to me (as I am sure it has to everyone else) that a compiler should not be a command-line program, but a library that can be integrated with applications and IDEs. The command line interface for the compiler should be just another client of the library.

So my question is, in an ideal environment (starting from scratch) what should an API for a compiler (targeting IDE integration as well as other runtime uses) look like? Obviously some method to build the code, some methods for auto-completion, type checking, type inference.

Other thoughts are that all the above functions need to operate in a dynamic environment, where incomplete code fragments exist, without breaking the compiler, and hopefully still offering useful feedback.

## Logic Production Systems (LPS)

A new mixed logic/imperative programming language by Bob Kowalski and Fariba Sadri:

“Logic-based Production System" is a new computer language that combines the characteristics of an imperative programming language with those of a declarative database and knowledge representation language. It is the result of over a decade of research led by Bob Kowalski and Fariba Sadri at Imperial College London.

The kernel of LPS consists of a database, together with reactive rules of the form if antecedent then consequent. The database changes destructively in response to actions and external events, according to a domain-specific causal theory. Computation consists in making the reactive rules true, by performing actions to make the consequent true whenever the antecedent becomes true. In addition, LPS includes Prolog-like logic programs both to recognise when antecedents become true and to generate plans of actions that make consequents true.

The page links to papers and slides that describe the language in more detail and there is an online playground to try it out.

## Rust's language ergonomics initiative

Aaron Turon has a nice blog post about Rust's language ergonomics initiative. It contains a description of how the Rust language design team currently thinks about "implicit" features (those that do something without the user having to write anything explicitly at this point in the program), how to design such features or detect issues with existing features.

There are three dimensions of the reasoning footprint for implicitness:

Applicability.
Where are you allowed to elide implied information? Is there any heads-up that this might be happening?
Power.
What influence does the elided information have? Can it radically change program behavior or its types?
Context-dependence.
How much of do you have to know about the rest of the code to know what is being implied, i.e. how elided details will be filled in? Is there always a clear place to look?

Various existing or proposed Rust features are then discussed and critiqued along these evaluation axes. I found the blog post interesting on several levels and thought it could be a nice starting point for discussion.

One thing that is important to keep in mind is that, despite the generality of the claims made about programming language design, this text is mostly about a set of design tools that has been conceived to solve a specific category of ergonomics problem. LtU regulars will be quick to point out that the interaction with programming tools, for example, is not discussed or considered at all while it is a central aspect of ergonomics in many cases (including, I think, implicitness decision). I would personally recommend trying to stay within the approximate scope of the Rust discussion (generalizing to other languages and systems), rather than discussing all aspects of "Language Ergonomics" at once, which would result in discussions all over the place (but with less people interested in each sub-discussion).

A parting remark on the end paragraph which I foud interesting:

And, perhaps most importantly, we need empathy for each other. Transformative insights can be fragile; they can start out embedded in ideas that have lots of problems. If we’re too quick to shut down a line of thought based on those problems, we risk foreclosing on avenues to something better. We’ve got to have the patience to sit with ideas that are foreign and uncomfortable, and gain some new perspective from them.

Clearly Aaron Turon is getting at the tone of online discussions which can become heated, even for details of programming language feature design. But what I think of reading those lines is that such discussion are helped by one aspect of our work as language designers, which is to produce tests and criterions to evaluate language features (and, yes, shut down some proposals more quickly than others). I fully agree that, in a foreign land of creativity, one should not judge too quickly or too harshly. But I think that the development and wider adoption of these design tests would not only result in seeing the flaws in some proposals more quickly, it would also let people iterate more quickly on their own designs, applying the tests themselves to recognize the issues without having to go through public feedback (and potential harshness).

I see similarities with the notion that mechanized proof assistants made it much easier to teach how to write rigorous mathematical proofs to beginners, as they can get direct feedback (from the computer) on whether their proof attempts are correct, without having to ask for the explicit approval of another human (their teacher or their student colleagues), with the various inhibition effects that it created. Having this internal feedback is what the design principles, laws, and various meta-theorems that our community developed enable, and it is one of the side-benefits of formalism.

## notes on a C-ish memory manager design

I am (re)designing a C runtime memory manager for hosting fibers, DSLs, and lightweight daemons. I started teaching my early-20s sons to program (in C++ and C), and the idea is to give them a library allowing progressive elaboration of tools written in Unix philosophy: i.e. simple and composeable processes. The idea is to use interfaces that allow embedding, so pipelines can run in threads at first, then later fibers within a thread, without code rewrites beyond automatic translation for CPS (continuation passing style) to run in fibers. The "app" would be a daemon hosting a user space operating system, with services like an http agent on a port for a browser-based UI. The idea is to give my sons an undergraduate CS education in terms of what happens here, and in stuff they write to execute inside.

My only aim in this post is to briefly describe its memory management, and the relation to programming language implementation, since a couple different (Smalltalk-ish) Lisp interpreters will run inside, as DSL examples, one simple and one fancy. The paragraph above was just context, since otherwise you might wonder "why in the world I want to do that?" about each detail. This is for your entertainment only, since I would find a helpful comment surprising. My current version of this sort of thing is much nicer than any I did before. I was trying to solve the problem of making everything refcounted, without something terribly awkward happening. (Embedded sub-processes can garbage collect as they like without refcounting, though; my fancy interpreter would use stop-and-copy.)

Each runtime instance uses interfaces defined in the library only. The world outside is abstracted as an environment, so all calls to the outside world go through an env instance. This helps later automatic code rewriting, so blocking calls can be handled as async calls to a worker thread pool to avoid blocking a fiber. (Such calls park instead of blocking.)

The idea is to have multiple independent runtimes in one host operating system process, so there is no global memory manager unless glue code for the environment does that (whatever mechanism gets memory from native interfaces). There is at least one instance of environment E in the OS process, which has function pointers for every external interface supported. For memory management purposes, it must have a memalign() function pointer, to allocate large blocks of aligned memory. (This can be simulated with malloc() by allocating very big blocks, then chopping off misaligned start and end parts, using those for other purposes.)

Each runtime instance has at least one vat, acting as the heap, which allocates only aligned memory blocks. For example, each thread would have its own dedicated vat, which is single-threaded, so no races exist between threads. (All dataflow between threads is copied from one vat to another, mediated by thread-safe queues in the runtime.) Each vat allocates only large uniform blocks from the env, perhaps several at once for efficiency, where every block is 1MiB in size, or 2^20 bytes, and aligned to a 1MiB address. (The standard block size could be another power of two instead of 1MiB, but I will speak as if it could never change.) Since there will be fragmentation, this design only makes sense when allocating a lot of total memory, on the order of gigabytes. So you would not want this runtime on a system with limited resources.

Each vat describes its address space as a book, a set of 1MiB pages, where each 2^20-aligned block of 2^20 bytes is called a bp for book page -- or just page for short when book is understood. The main purpose of each bp is usually sub-allocation of smaller aligned memory blocks to satisfy vat allocation requests, but a garbage-collected vat would use its book any way it liked (an address space with page granularity). A vat used for C style allocation would return blocks that are powers-of-two in size, each aligned to the same power-of-two bytes, as small as 16 bytes and as large as, say, 256K. You can cheaply test any address for membership in a vat by seeing if the aligned bp address is in the book hashmap of bp addresses. Each allocated aligned block is called a rod, short for refcounted, because each one is reference counted by metainfo at the start of each book page.

Each bp begins with a standard bp header, describing page format and detail common to the page, followed by as many rh rod headers as needed to describe each rod sub-block in the rest of the page. (A garbage collected vat would have only the bp header for each bp.) Each rod head is 16 bytes in size and 16-byte aligned, with a 32-bit refcount a 32-bit checksum, and several descriptive fields, including a 16-bit generation number and a pair of 16-bit ids characterizing format and optional allocation context (naming a backtrace for memory usage analysis). Starting from the address of a rod -- some block inside a bp -- getting its refcount touches two cache lines in the general case, one for the bp head and one for the rh. Except for very small rods, this is only one cache line worse than co-locating the refcount inside the block itself. And that would only happen when the refcount was actually needed. (In my model, refcount is NOT linear in aliases; it is only linear in official handles which other aliases can borrow when their scope is clearly inside the handle scope.)

The purpose of a checksum in the rh for each rod is dynamic support for immutable values. When a rod is frozen to immutability, so it cannot be changed again before deallocation, the checksum must still be unchanged when the last reference goes away. You might only audit this in debug mode, but you an ask a rod if it is immutable, and enforce absence of mutation by accident.

Now here's the interesting part: each bp header has a pointer to the parent vat, and to the env. So the cost of those pointers is amortized across all the rods in the same page. In effect, every object allocated from a vat is a subclass of rod, and every rod has a pointer to the allocating vat and to the runtime env interface at zero space cost. It becomes unnecessary to pass vat and env as separate function arguments, since they are always available from any object in a vat. You can also add a handle reference to any sub-object inside a rod, because you can find the associated rh for any address in the page that is part of the rod space. So you can hold references to sub-fields which keep the parent object alive, without any problem, as long as you avoid accidental fragmentation cost (keeping something larger alive only to use a small sub-field).

What about details related to programming languages?

My overall objective is to write tools converting content into different forms, including source code rewrite transformations. (I tell my sons that most of programming is turning inputs into different outputs.) But that is little affected much by memory management per se. Except the i/o model of embedded languages can stream refcounted immutable rods between agents in a process pipeline. That helps get operating system style features into programming language semantics, where a language can also have a process model.

I expect to write a garbage collected Lisp using a vat as the heap, which allocates new bp instances for stop-and-copy before releasing old instances. The uniform use of standard book pages makes re-use efficient without fragmentation across multiple vats.

For bootstrapping, I probably want a simpler and dumber Lisp first, just to perform operations on S-expressions used to express whatever high level policies are used by the system in configuration, or in manifests describing large scale transformations. This can be done with a primitive AST interpreter over a refcounted tree of nodes allocated by C-oriented code. Graph cycles would be pathological unless manually handled or automatically detected. But it's not worse than other C manual memory schemes.

One field in each rh with metainfo describing each rod is the ID of a schema descriptor: the plan of any struct inside the rod. Among other things, it would exactly describe the location of embedded handles in the rod, so reference releasing can be automated. The idea is to be able to release all resources when a lightweight process is killed, without requiring as much manual intervention by a user. A secondary purpose is to make releasing large graphs incremental and uniform, managed by a background rod releaser, which incrementally walks a graph using the rod metainfo as a guide.

A second purpose in putting a plan ID in the rh for each rod is generic debug printing support: I want to be able to print everything. But manually writing a print method for everything is a pain. I would rather write a standard metainfo description of everything, especially since this can be emitted from a source code analysis tool. Then a single generic printer util can process this standard format guide when walking graphs. (Note: to stop huge graphs from being printed, a field in a plan can be marked as best cited briefly, rather than printed in full, and this also helps prevent following cycles due to back pointers.)

Note I am not describing handles, which are like smart pointers, as they little affect memory management and PL topics. But each rod refcount comes from an alias in a handle, which associated metainfo with the rod pointer, including a copy of the plan ID and generation number, which must match when the ref is released. (That detects failures to keep refcounted objects alive as expected.) Refcounting is not manual. It occurs as a side effect of aliasing via handles. When auditing is enabled, each handle can hold the ID of a backtrace that added a reference, and this finds refcount leaks. On a 64-bit system, the size of a handle is twice the size of a pointer: the metainfo is pointer-sized in total. This requires a library provide standard collection classes that work with handles too, when ownership of objects is expressed as collection membership. Each handle includes a bitflag field which, among other things, allows a reference to be denoted readonly, even if the rod is mutable, for copy-on-write data structures like btrees that share structure. (This is useful for transient collections expressing "the original collection plus any patches that might occur" without altering the original collection.)

## Controlling Reductions

Haskell has an option for user defined reductions. I have no idea how it works.

Felix also has two ways to do this.

The first way is complete but hard to use: the parser accepts user defined patterns in the form of grammar productions, and then the user writes Scheme code to manipulate the parse tree to produce any combination of a fixed set of AST terms they like.

The second way is simpler but typed, and looks roughly like this:

reduce strings
| (a:string,b:string) : a + b=> scat ([b,a]) ;
reduce scat2
| (x:list[string], y:string) : scat ([y, scat x]) => scat (Snoc (x,y)) ;

Its polymorphic though that's not seen in this example. The vertical bar indicates you can provide several alternatives which are tried in sequence. The algorithm applies each reduction, and each is applied top down. The above example doesn't work! The intent was to replace string concatenation using a left associative binary operator with a faster function scat, operating on a list. Clearly I needed the algo to work bottom up.

The contrast between these two methods is that the first method has a complete general purpose programming language available to perform the reductions, the pattern matching uses a fixed algorithm (the GLR+ parser). The second method recognises terms and performs the reductions using a fixed algorithm so is much weaker.

What I want is something less complex than having to hand write the whole reduction machinery in a general purpose language (I could do that, using dynamically compiled and loaded Ocaml modules but it's too hard for end users).

So I'm looking for a *compromise* which is reasonably simple, but also reasonably capable. I added alternatives for this reason and am thinking to add an adjective which specifies if a reduction should be applied top down or bottom up. A more complex option is to allow for nested reductions (so that if one reduction succeeds it triggers another one).

Any ideas?

## CFL parsing, and another way to look at the CNF...

I'll implement it and try to break it when I get a chance, but it seems the below should exhibit O(|G| |U|2 n2 log n) worst case behavior (in time), where |G| is the total size of the grammar, |U| is the number of distinct nonterminals in the subset of unary productions U -> w in G, and n the input's length.

Or, what am I missing?

We consider only unambiguous CFGs in Chomsky Normal Form (CNF).

We devise a sort of "type system" over rewritings of the input as we process it from right to left, from end to beginning.

We'll look at the algorithm's work environment as being made of a left context, say Lc, a current symbol, say w (talking about a terminal) and a right context, say Rc.

The left context (Lc) is always a (length-decreasing*) prefix string w0...wi...w of terminals of the actual input (equal to the entire input s = w0...wn-1 initially, and empty at the end, when no more production type rewritings can be applied).

(* albeit, non-strictly)

The right context (Rc) is a mutating list of computed S-expressions storing what has been consumed and "typed" by reading the input from right to left, from end to beginning.

In this scheme, it is constructed so as to be, also, the recorded value of the rightmost-derivative of the parse tree, at the "point" Lc \ w, before Lc gets empty and reduction to the grammar start symbol (if possible) happens, eventually finalizing Rc as the single S-expr (S w0...wn-1) (or failing to do so).

Initially, Rc is empty, and Lc equals the entire input.

In the CNF grammar, we treat the two distinct types of productions thusly:

Productions of the form U -> w (aka rule R1)

Rule R1: U -> w  will be said to "type" w between Lc and Rc as... w: U ("the utterance of w is of type U between any Lc and Rc")

that is, whenever Lc ends with w

rewrite...

Rewriting via R1

Lc Rc ~> (Lc \ w) (U w) Rc
new Lc> \------/ \------/ <new Rc

(takes a list of S-exprs as Rc and prepends the new S-expr (U w) to it, making a new Rc longer by one S-expr, while Lc gets shorter by one terminal, w)

Productions of the form U -> P R (aka rule R2)

Rule R2: U -> P R  will be said to "type" P followed by R in Rc as... P: R -> U ("the utterance of P applied to Rc typed as R promotes Rc to U")

that is, whenever head(Rc) = (P x) and head(tail(Rc)) = (R y)

rewrite...

Rewriting via R2

\----------------------------------------/ <new Rc

(takes a list of S-exprs as Rc and turns it into a new Rc shorter by one S-expr, Lc left unchanged)

Notice the one to one correspondence between mutually ambiguous grammar productions and mutually unsound production types, btw:

E.g., having, in the grammar, the mutually ambiguous

A -> BC
D -> BC

would yield, in this "type system", attempts at applying the mutually unsound (if only signature-wise)

B: C -> A
B: C -> D

Which would obviously be intrinsically problematic from either / both perspectives, and no matter what the input may be, as soon as said input will contain utterances of (a substring already reduced to) B, followed by (a substring already reduced to) C.

Anyway.

Now for a concrete example (full parse / derivation); consider the grammar in CNF (informal meaning given in parentheses):

(nonterminal-only RHS)

S  -> NP  VP  ("a noun phrase followed by a verb phrase reduces as a sentence")
VP -> Vt  NP  ("a transitive verb followed by a noun phrase reduces as a verb phrase")
NP -> Det N   ("a determinative followed by a noun reduces as a noun phrase")
N  -> Adj N   ("an adjective followed by a noun reduces as a noun")

and

(terminal-only RHS)

Det-> a       ("'a' reduces as a determinative")
Det-> the     ("'the' reduces as a determinative")
N  -> boy     ("'boy' reduces as a noun")
N  -> dragon  ("'dragon' reduces as a noun")
Vt -> saw     ("'saw' reduces as a transitive verb")

Which we'll use to "type" thru rewritings of S-exprs in Rc, as:

NP : VP -> S  ("the utterance of 'NP' applied to Rc typed as 'VP' promotes Rc to 'S'")
Vt : NP -> VP ("the utterance of 'Vt' applied to Rc typed as 'NP' promotes Rc to 'VP'")
Det: N  -> NP ("the utterance of 'Det' applied to Rc typed as 'N' promotes Rc to 'NP'")
Adj: N  -> N  ("the utterance of 'Adj' applied to Rc typed as 'N' promotes Rc to 'N'")

and

a     : Det   ("the utterance of 'a' is of type 'Det' between any Lc and Rc")
the   : Det   ("the utterance of 'the' is of type 'Det' between any Lc and Rc")
young : Adj   ("the utterance of 'young' is of type 'Adj' between any Lc and Rc")
boy   : N     ("the utterance of 'boy' is of type 'N' between any Lc and Rc")
dragon: N     ("the utterance of 'dragon' is of type 'N' between any Lc and Rc")
saw   : Vt    ("the utterance of 'saw' is of type 'Vt' between any Lc and Rc")

After iteration 0 (init)

   (the          young          boy         saw         a         dragon)
Lc>\--------------------------------------------------------------------/ ( ) <initial Rc

(NB: Rc = empty list)

After iteration 1, via R1

   (the          young          boy         saw         a)        dragon
Lc>\-----------------------------------------------------/       (N dragon)1
\--------/ <new Rc
(NB: Rc = list of one root S-expression)

After iteration 2, via R1

   (the          young          boy         saw)        a          dragon
Lc>\-------------------------------------------/       (Det a)1   (N dragon)2
\-------------------/ <new Rc

(NB: Rc = list of two root S-expressions)

After iteration 3, via R2

   (the          young          boy         saw)        a         dragon
Lc>\-------------------------------------------/   (NP (Det a)   (N dragon))1
\-----------------------/ <new Rc
(NB: Rc = list of one root S-expression)

After iteration 4, via R1

   (the          young          boy)        saw          a         dragon
Lc>\-------------------------------/       (Vt saw)1(NP (Det a)   (N dragon))2
\--------------------------------/ <new Rc

(NB: Rc = list of two root S-expressions)

After iteration 5, via R2

   (the          young          boy)        saw         a         dragon
Lc>\-------------------------------/
the          young          boy    (VP (Vt saw)(NP (Det a)   (N dragon)))1
\------------------------------------/ <new Rc

(NB: Rc = list of one root S-expression)

After iteration 6, via R1

   (the          young)         boy          saw         a         dragon
Lc>\------------------/
the          young       (N boy)1   (VP (Vt saw)(NP (Det a)   (N dragon)))2
\-----------------------------------------------/ <new Rc

(NB: Rc = list of two root S-expressions)

After iteration 7, via R1

   (the)         young           boy          saw         a         dragon
Lc>\---/
the         (Adj young)1  (N boy)2   (VP (Vt saw)(NP (Det a)   (N dragon)))3
\-------------------------------------------------------------/ <new Rc

(NB: Rc = list of three root S-expressions)

After iteration 8, via R2

   (the)         young          boy          saw         a         dragon
Lc>\---/
the      (N (Adj young)  (N boy))1  (VP (Vt saw)(NP (Det a)   (N dragon)))2
\---------------------------------------------------------------/ <new Rc

(NB: Rc = list of two root S-expressions)

After iteration 9, via R1 (final Lc is empty)

    the           young          boy          saw         a         dragon
(Det the)1 (N (Adj young)  (N boy))2  (VP (Vt saw)(NP (Det a)   (N dragon)))3
\--------------------------------------------------------------------------/ <new Rc

(NB: Rc = list of three root S-expressions)

After iteration 10, via R2

    the          young          boy          saw         a         dragon
(NP(Det the) (N (Adj young)  (N boy)))1 (VP (Vt saw)(NP (Det a)   (N dragon)))2
\----------------------------------------------------------------------------/ <new Rc

(NB: Rc = list of two root S-expressions)

After iteration 11, via R2

       the          young          boy         saw         a         dragon
(S (NP(Det the) (N (Adj young)  (N boy))) (VP (Vt saw)(NP (Det a)   (N dragon))))1
\-------------------------------------------------------------------------------/ <new Rc

(NB: Rc = list of one root S-expression)

Success, with the expected parse binary tree:

       the          young          boy         saw         a         dragon
Det          Adj            N           Vt          Det       N
N                                   NP
NP                                     VP
S

Disclaimer edit:

this is just genuine amateur research from a practitioner who's never been in academia (that would be me). I've obviously posted it here on a friendly LtU only because I'm (still) wondering if I'm on to something / or what am I missing. Bear with me (and thank you in advance).

## Refining Structured Type System

This is my first more serious paper on Structured Type System.

[Abstract]
...
As every theory needs some syntax form to express its elements, a road to a theory about theories leads through a syntax defining land, so structured type system, in the first place, provides a flexible generalized text parser that builds up internal abstract syntax trees (AST) from input data. The other aspect of theory about theories inevitably covers the meaning of input data. This is called semantics, and this is the point where structured type system provides a possibility to define deeper connections between syntactic elements of AST-s. For this purpose, structured type system uses a kind of functions known from functional programming paradigm. These functions are able to process any data corpus, being natural or artificial language translation, which in turn happens to be just enough for running any complexity task used to analyze existing and calculate new data from an input.
...

In short, we use BNF-ish grammars as types for function parameters and function results. Some nice constructions can be made by combining grammars and functions. One of the most important properties of structured type system is its ability to additionally extend grammars outside the grammars definitions, all based on function result types. It is fairly simple: where a certain type of expression is expected, there a grammar that results with the same type can be used, and there goes syntax extensibility. Conveniently, we can combine grammar definitions and their inputs in the same source code file.

I was hoping to get some feedback and critics from this community before attempting to get more publicity to the paper. This is an important milestone to me and I want to thank You all for being so inspirational community during my research.

## Cool stuff from recent conferences

I heard of some good stuff. How about someone who was there post the headline worthy papers?

## Céu: Structured Synchronous Reactive Programming (SSRP)

Céu is a Esterel-based synchronous language:

It appeared in LtU in the past in an announcement of the "SPLASH: Future of Programming Workshop" program.

In this new public version, we are trying to surpass the academic fences with a more polished work (docs, build, etc).

In summary:

• Reactive: code executes in reactions to events
• Synchronous: reactions run to completion in discrete logical units of time (there's no implicit preemption nor real parallelism)
• Structured: programs use structured/imperative control mechanisms, such as "await" and "par" (to combine multiple awaiting lines of execution)

Structured programming avoids deep nesting of callbacks letting programmers code in direct/sequential/imperative style. In addition, when a line of execution is aborted, all allocated resources are safely released.

The synchronous model leads to deterministic execution and simpler reasoning, since it does not demand explicit synchronization from the programmer (e.g., locks and queues). It is also lightweight to fit constrained embedded systems.

We promote SSRP as a complement to classical structured/imperative programming like FRP is now to functional programming.

## Archaeological dig to find the first Lisp example of the Y-combinator

I'm trying to find the first Lisp examples of the Y-combinator. Beyond that I am also trying to find the first time the Y-combinator was demonstrated using the factorial function and the mutually recursive definition of odd/even.

What works should I be looking at? The first Scheme paper references fixed-point combinators at page 16 and also shows the familiar LISP definition of the factorial function. But, it does not express the factorial function using a fixed-point operator.


text:
# Can the warlock use his familiar as the point of origin for telepathy?

One of my players plays as a Warlock with the Great Old One patron and the Pact of the Chain boon.

My question is: can he use telepathy while controlling his familiar (i.e. seeing with its eyes), on a target that is in the range of the familiar but not in the range of the Warlock? Thank you.

# No, a Warlock is not able to use their telepathy through their Familiar.

The section referencing sharing sight/hearing only pertains to sharing those senses. The Warlock is not possessing or otherwise present where the Familiar is, whereas the Awakened Mind class feature references (emphasis mine):

You can communicate telepathically with any creature you can see within 30 feet of you.

Since the Warlock is not actually present where their familiar is, any targets the familiar (and therefore a sense-sharing Warlock) can see are not valid targets.

# No.

PHB page 110, the wording is limited to within 30 feet of you.

You can communicate telepathically with any creature you can see within 30 feet of you.

format: plain


text:
# P4613 [COCI2017-2018#5] Olivander

• 467通过
• 705提交
• 题目提供者 da32s1da
• 评测方式 云端评测
• 标签 COCI 2018 高性能
• 难度 入门难度
• 时空限制 1000ms / 64MB
• 提示：收藏到任务计划后，可在首页查看。

## 题目描述

Harry Potter has damaged his magic wand in a fight with Lord Voldemort. He has decided to get a new wand in Olivander's wand shop. On the floor of the shop, he saw N wands and N wand boxes. The lengths of the wands are, respectively, $X_1$ ,$X_2$ ...$X_n$ , and the box sizes are $Y_1$ ,$Y_2$ ...$Y_n$ . A wand of length X can be placed in a box of size Y if X ≤ Y . Harry wants to know if he can place all the wands in boxes so that each box contains exactly one wand. Help him solve this difficult problem.

## 输入输出格式

输入格式：

The first line of input contains the positive integer N (1 ≤ N ≤ 100), the number from the task. The second line contains N positive integers $X_i$ (1 ≤ $X_i$ ≤ $10^9$ ), the numbers from the task. The third line contains N positive integers $X_i$ (1 ≤ $X_i$ ≤ $10^9$ ), the numbers from the task.

输出格式：

If Harry can place all the wands in boxes, output “DA” (Croatian for yes), otherwise output “NE” (Croatian for no).

## 输入输出样例

输入样例#1： 复制
3
7 9 5
6 13 10
输出样例#1： 复制
DA
输入样例#2： 复制
4
5 3 3 5
10 2 10 10
输出样例#2： 复制
NE
输入样例#3： 复制
4
5 2 3 2
3 8 3 3
输出样例#3： 复制
DA

## 说明

In test cases worth 60% of total points, it will hold N ≤ 9.

Clarification of the first test case:

Harry can place the wands in boxes. For example, he can place the wand of length 5 in a box of size 6, wand of length 7 in a box of size 13, and wand of length 9 in a box of size 10.

Clarification of the second test case:

Harry can’t place the wands in boxes because the box of size 2 can’t fit any of the wands.

提示
标程仅供做题后或实在无思路时参考。
请自觉、自律地使用该功能并请对自己的学习负责。
如果发现恶意抄袭标程，将按照I类违反进行处理。


text:
# CONFORMATIONS AND INTERNAL ROTATION BARRIERS IN t- BUTYLACETALDEHYDE AND t-BUTYLACETYL HALIDES

Please use this identifier to cite or link to this item: http://hdl.handle.net/1811/10920

Files Size Format View
1979-RF-08.jpg 84.91Kb JPEG image

 Title: CONFORMATIONS AND INTERNAL ROTATION BARRIERS IN t- BUTYLACETALDEHYDE AND t-BUTYLACETYL HALIDES Creators: True, Nancy S.; Thomas, Lawrence P.; Bohn, Robert K. Issue Date: 1979 Publisher: Ohio State University Abstract: Band series from three spectroscopically distinct species are observed in the low resolution microwave (LRMW) Spectra of t-butylacetaldehyde, t-butylacetyl fluoride and t-butylacetyl cyanide. Two of the series from each compound are readily assignable to the syn ($\tau_{OCCC} = 0^{\circ}$) and skew ($\tau_{OCCC} = 120^{\circ}$) conformations. The third band series from each compound is due to a species with average energy about 1.5 Kcal/mol higher than the approximately equally stable syn and skew forms and has a rotational constant B+C value corresponding to $\tau -90^{\circ}$. This species is not a third stable rotamer but is composed of those species freely rotating about $\tau_{OCCC}$ above the internal rotation barrier. The torsional barrier in each compound is essentially 3-fold with a height of 500 (+400, -200) cal/mol. t-Butylactyl chloride only displays bands from a syn rotamer. The skew minimum and low internal rotation barrier appear to be ellminated by the bulky chloride substituent. Description: Author Institution: URI: http://hdl.handle.net/1811/10920 Other Identifiers: 1979-RF-08


text:
## donnie1999 one year ago Select the factored form of the expression. If it cannot be factored, select” already in factored form” 100x^2-9 a. (10x+9)(10x-9) b. (10x+3)(10x-3) c. Already in factored form d. (10x-3)(10x-3)

1. Nnesha

difference of square $\huge\rm a^2 - b^2 = (a+b)(a-b)$

2. donnie1999

@Nnesha im confused

3. Nnesha

take square root of first term and square root of 2nd term write ur answer (sqrt of first number + sqrt of 2nd number ) (sqrt of first number - sqrt of 2nd number )


text:
How to do this on my Prime ?
09-29-2017, 11:56 AM
Post: #1
 ggauny@live.fr Senior Member Posts: 423 Joined: Nov 2014
How to do this on my Prime ?
Hi,

I am learn how to calculate a fonction of parabole with 3 points given.
Me I do at hand pincil and paper, after I have resolve I obtain a system of 3 equations what I resolve with app linear solver. But I have to calculation by hand
the system as I say.

On internet I have see on a computer hand I dont' know the name a solution automatic, which I have tryied on Prime but no work. May be is a way to do same ?

In attachement I give what I do with hand and the other picture, may be you help me to do with Prime. Because I know how to do with hand ,it save me time for excercizes further if there is a solution automatic with Prime.

I hope it is clear because it is difficult for me to speek american.

Attached File(s) Thumbnail(s)

Gérard.
09-29-2017, 12:26 PM
Post: #2
 AlexFekken Member Posts: 141 Joined: May 2016
RE: How to do this on my Prime ?
1 - The quickest way might be to determine the Lagrange polynomial:

lagrange([1 -2 3], [2 1 4])

(then simplify the result).

2 - If you really want to solve the linear equations then you can do that as follows:

linsolve([a+b+c=2 4*a-2*b+c=1 9*a+3*b+c=4], [a b c])

3 - Or if you want to imitate the approach in your second screenshot:

f(x):=a*x^2+b*x+c
solve({f(1)=2,f(-2)=1,f(3)=4},[a b c])
09-29-2017, 12:32 PM
Post: #3
 Dieter Senior Member Posts: 1,666 Joined: Dec 2013
RE: How to do this on my Prime ?
(09-29-2017 11:56 AM)ggauny@live.fr Wrote:  I am learn how to calculate a fonction of parabole with 3 points given.
Me I do at hand pincil and paper, after I have resolve I obtain a system of 3 equations what I resolve with app linear solver. But I have to calculation by hand
the system as I say.

I am sure there is a more elegant way on the Prime, but all you need is the linear equation solver. For a parabola the equation system is as follows:

Code:
   | x1² x1  1 |   →     | y1 |    | x2² x2  1 | * p =   | y2 |    | x3² x3  1 |         | y3 |

So simply start the linear solver and fill the matrix.
Consider the example in your screenshot:

Enter the x-values into the center column and the y-values on the right-hand side:

Code:
   | _  1  _ |   →     | 2 |    | _ -2  _ | * p =   | 1 |    | _  3  _ |         | 4 |

Fill the left column with the squares of the center column:

Code:
   | 1  1  _ |   →     | 2 |    | 4 -2  _ | * p =   | 1 |    | 9  3  _ |         | 4 |

Fill the right column with 1s:

Code:
   | 1  1  1 |   →     | 2 |    | 4 -2  1 | * p =   | 1 |    | 9  3  1 |         | 4 |

Now solve this system and you're done.

Dieter
09-29-2017, 12:52 PM (This post was last modified: 09-29-2017 01:00 PM by Gerson W. Barbosa.)
Post: #4
 Gerson W. Barbosa Senior Member Posts: 883 Joined: Dec 2013
RE: How to do this on my Prime ?
Interesting ideas in this old thread (others, not mine).
09-29-2017, 01:22 PM
Post: #5
 AlexFekken Member Posts: 141 Joined: May 2016
RE: How to do this on my Prime ?
(09-29-2017 12:52 PM)Gerson W. Barbosa Wrote:  Interesting ideas in this old thread (others, not mine).

And as you already suggested: Cramer's Rule is not very efficient in general and should probably be avoided for numerical calculations, especially when the dimension goes up.

And I am not 100% sure, but I seem to remember that the determinant calculations are also quite sensitive to rounding (not if all you care about are integer x values of course). Again, this becomes more of a problem as the dimension goes up.
09-29-2017, 02:59 PM
Post: #6
 ggauny@live.fr Senior Member Posts: 423 Joined: Nov 2014
RE: How to do this on my Prime ?
Hi,

One again many thank you at all.

You are great teachers mathematician !

Have a good day.

Gérard.
09-29-2017, 04:53 PM (This post was last modified: 09-29-2017 04:58 PM by toshk.)
Post: #7
 toshk Member Posts: 133 Joined: Feb 2015
RE: How to do this on my Prime ?
(09-29-2017 12:32 PM)Dieter Wrote:
(09-29-2017 11:56 AM)ggauny@live.fr Wrote:  I am learn how to calculate a fonction of parabole with 3 points given.
Me I do at hand pincil and paper, after I have resolve I obtain a system of 3 equations what I resolve with app linear solver. But I have to calculation by hand
the system as I say.

I am sure there is a more elegant way on the Prime, but all you need is the linear equation solver. For a parabola the equation system is as follows:

Code:
   | x1² x1  1 |   →     | y1 |    | x2² x2  1 | * p =   | y2 |    | x3² x3  1 |         | y3 |

So simply start the linear solver and fill the matrix.
Consider the example in your screenshot:

Enter the x-values into the center column and the y-values on the right-hand side:

Code:
   | _  1  _ |   →     | 2 |    | _ -2  _ | * p =   | 1 |    | _  3  _ |         | 4 |

Fill the left column with the squares of the center column:

Code:
   | 1  1  _ |   →     | 2 |    | 4 -2  _ | * p =   | 1 |    | 9  3  _ |         | 4 |

Fill the right column with 1s:

Code:
   | 1  1  1 |   →     | 2 |    | 4 -2  1 | * p =   | 1 |    | 9  3  1 |         | 4 |

Now solve this system and you're done.

Dieter
[[2],[1],[4]]/vandermonde([1,-2,3])
for ill/weird/large/spare matrix: try
LSQ(vandermonde([1,-2,3]),[[2],[1],[4]])
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)


text:
# What are positive and negative circles in weighted digraph?

I am going through Warshall and Floyd algorithms and I read that Floyd's algorithm does not hold if a graph has negative circle. I have not been able to fully figure out what negative circle means. Therefore, I would like to know more about positive and negative circles.

A circle is a path in the graph ($v\to u_1 \to u_2 \to \cdots \to v$) starting from some node $v$, that goes back to node $v$, thus "closing a circle".


text:
# EvaluateLn x dx xs

###### Question:

Evaluate Ln x dx xs

#### Similar Solved Questions

##### C) 3e2x+1+5 =14 (round to three decimals)d) (5)* = (0.2)*'-
c) 3e2x+1+5 =14 (round to three decimals) d) (5)* = (0.2)*'-...
##### If a rectangular prism has a vloume of 36 cubic centimeters list 4 possible dimensions it could have
if a rectangular prism has a vloume of 36 cubic centimeters list 4 possible dimensions it could have...
##### [10 marks] If a = (1,~2,3) and b = (8,-1,-2), find (a) Ia] (6) a + b (c) 2a 3b (d) a . b (e) a X b (f) bx a (g the angle between a and b_
[10 marks] If a = (1,~2,3) and b = (8,-1,-2), find (a) Ia] (6) a + b (c) 2a 3b (d) a . b (e) a X b (f) bx a (g the angle between a and b_...
##### John Fleming, chief administrator for Valley View Hospital, is concerned about the costs for tests in...
John Fleming, chief administrator for Valley View Hospital, is concerned about the costs for tests in the hospital's lab. Charges for lab tests are consistently higher at Valley View than at other hospitals and have resulted in many complaints. Also, because of strict regulations on amounts reim...
##### A plate of glass with parallel faces having a refractive index of 1.46 is resting on...
A plate of glass with parallel faces having a refractive index of 1.46 is resting on the surface of water in a tank. A ray of light coming from above in air makes an angle of incidence 37.5 ? with the normal to the top surface of the glass. (Figure 1) What angle ?3 does the ray refracted into the wa...
##### Name: Date: ID: A Different forms of Linear equations Multiple Choice Identify the choice the best...
Name: Date: ID: A Different forms of Linear equations Multiple Choice Identify the choice the best completes the statement or answer the question 1. For a service call, a plumber charges a $95 initial fee, plus$45 for each hour he works. Write an equation to represent the total cost, Cdollars, for ...
##### Two events are independentifthe occurrence of one does not affect theprobability of the occurrence of the otheris an ordered arrangement of objects whereas ais a collection of objects in which order does not matter:In hypothesis testing we assume the null hypothesis isof anexperiment is the collection of all possible outcomesany collection ofone more outcomesQuestion 1510 pts
Two events are independent ifthe occurrence of one does not affect the probability of the occurrence of the other is an ordered arrangement of objects whereas a is a collection of objects in which order does not matter: In hypothesis testing we assume the null hypothesis is of anexperiment is the co...
##### The planets travel in elliptical orbits with the sun at one focus. Assume that the focus is at the pole, the major axis lies on the polar axis, and the length of the major axis is $2 a$ (see figure). Show that the polar equation of the orbit of a planet is $r=\frac{\left(1-e^{2}\right) a}{1-e \cos \theta}$ where $e$ is the eccentricity.
The planets travel in elliptical orbits with the sun at one focus. Assume that the focus is at the pole, the major axis lies on the polar axis, and the length of the major axis is $2 a$ (see figure). Show that the polar equation of the orbit of a planet is r=\frac{\left(1-e^{2}\right) a}{1-e \cos ...
##### Why RAS mutation screening is recommended before prescribing cetuximab?
why RAS mutation screening is recommended before prescribing cetuximab?...
##### SYNTHESIZE YOUR KNOWLEDGESome mutations result in proteins that function well at one temperature but are nonfunctional at a different (usually higher) temperature. Slamese cats have such a "temperature-sensitive" mutation in a gene encoding an enzyme that makes dark pigment in the fur. The mutation results in the breed's distinctive point markings and lighter body color (see the photo). Using this information and what you learned in the chapter, explain the pattern of the cat'
SYNTHESIZE YOUR KNOWLEDGE Some mutations result in proteins that function well at one temperature but are nonfunctional at a different (usually higher) temperature. Slamese cats have such a "temperature-sensitive" mutation in a gene encoding an enzyme that makes dark pigment in the fur. T...
##### Question 1 (20 points) The decomposition of hydrogen peroxide produces -98200 J of heat per mole...
Question 1 (20 points) The decomposition of hydrogen peroxide produces -98200 J of heat per mole of H202 decomposed. How much heat is evolved when 45.0 mL of 0.1501 M H2O2 decomposes? Round your answer off to a whole number (no decimal places) and give the correct units Your Answer: Answer units Vie...
##### 1.4.RA-4 0 of 1 Point Question Help Suppose the size of a population is N 5500...
1.4.RA-4 0 of 1 Point Question Help Suppose the size of a population is N 5500 and the sample size desired is n 14. What value of k should be used to obtain a systematic sample from this population? (Round down to the nearest whole number as needed.) Enter your answer in the answer box and then clic...
##### 17.9 SALES INCREASE Paladin Furnishings generated S4 million in sales during 2015, and its year-end total...
17.9 SALES INCREASE Paladin Furnishings generated S4 million in sales during 2015, and its year-end total assets were $3.2 million. Also, at vear end 2018, current liabilities were$500,000, consisting of $200,000 of notes payable, 5200,000 of accounts payable, and$100,000 of accrued liabilities. L...
##### Okun's Law describes an empirically observed correlation between the unemployment rate (usually plotted on the horizontal...
Okun's Law describes an empirically observed correlation between the unemployment rate (usually plotted on the horizontal axis and the real output gap (ie potential GDP net actual GDP). Given what you have learned about Macroeconomics, which of the following would you deduce? Select an answer an...
##### Write .25 tabs in correct pharmacological form
write .25 tabs in correct pharmacological form...
##### Tx latrirp-edietellyStrBailed shovla seech From e+low fijurz But 4 tle need reech abovt seethVc Por. $" vttUwi$ Cetplease eplair it the 'sfr Rch% t
Tx latr irp-edietelly Str Bailed shovla seech From e+low fijurz But 4 tle need reech abovt seeth Vc Por. $" vtt Uwi$ Cet please eplair it the 'sfr Rch% t...
##### Calculus (1) Sec1 Question I f () 36 tthen f" (c) = Noryet Select one: answiercd None Marked outof 100 cht (coshz+29 Flacquestion coshz7z 2rosh"_LLcosheL2dubh ICMl IPREVIOUS PAGE
Calculus (1) Sec1 Question I f () 36 tthen f" (c) = Noryet Select one: answiercd None Marked outof 100 cht (coshz+29 Flacquestion coshz7z 2rosh"_LLcosheL2dubh ICMl I PREVIOUS PAGE...
##### A $400-g$ block with an initial speed of $80 \mathrm{~cm} / \mathrm{s}$ slides along a horizontal tabletop against a friction force of $0.70 \mathrm{~N}$. $(a)$ How far will it slide before stopping? (b) What is the coefficient of friction between the block and the tabletop? (a) Take the direction of motion as positive. The only unbalanced force acting on the block is the friction force, $-0.70 \mathrm{~N}$. Therefore, $\Sigma F=m a \quad$ becomes $\quad-0.70 \mathrm{~N}=(0.400 \mathrm{~kg})(a)$
A $400-g$ block with an initial speed of $80 \mathrm{~cm} / \mathrm{s}$ slides along a horizontal tabletop against a friction force of $0.70 \mathrm{~N}$. $(a)$ How far will it slide before stopping? (b) What is the coefficient of friction between the block and the tabletop? (a) Take the direction o...
##### 3. (20 pts) Consider the diflerential equation2y" 31y 3y = 0Find the first four terms of the power series solution about I = 0 and give general expression 0f the coeflicients in the power series (i.e.. find the recurrence relation:
3. (20 pts) Consider the diflerential equation 2y" 31y 3y = 0 Find the first four terms of the power series solution about I = 0 and give general expression 0f the coeflicients in the power series (i.e.. find the recurrence relation:...
##### Which of the following is TRUE with regard to Grignard reactions?the reagents and glassware must be scrupulously dried (no water can be present)Grignard reagents don't react with esters they require work-up with a base to deprotonate the final product the reaction should be run in aqueous acid
Which of the following is TRUE with regard to Grignard reactions? the reagents and glassware must be scrupulously dried (no water can be present) Grignard reagents don't react with esters they require work-up with a base to deprotonate the final product the reaction should be run in aqueous aci...
##### For the Fourier expansion of the function flc) = I on [~T,] what are the coefficients G and @n for the Cos expansion and bn for the sin where n > 1: Select one: 0 a @0 0 and an 244 and bu 0 0 b Q0 0 and Qn 0 and bn 24" 6 c None of the others d, @o and Un 0 and bn 24 @o 0 and Gn 242 and bn 24
For the Fourier expansion of the function flc) = I on [~T,] what are the coefficients G and @n for the Cos expansion and bn for the sin where n > 1: Select one: 0 a @0 0 and an 244 and bu 0 0 b Q0 0 and Qn 0 and bn 24" 6 c None of the others d, @o and Un 0 and bn 24 @o 0 and Gn 242 and bn 2...
##### Answer is A, please explain how to get that answer 8. A solid wooden door, 90...
answer is A, please explain how to get that answer 8. A solid wooden door, 90 cm wide by 2.0 m tall, has a mass of 35 kg. It is open and at rest. A small 500-g ball is thrown perpendicular to the door with a speed of 20 m/s and hits the door 60 cm from the hinged side, causing it to begin turning. T...
##### A compound has an empirical formula of CzHANS and a molar mass of 222.4 g/mol. What is the molecular formula of this compound?C6H1ZN3S3CZHANSCAHBN2S2C3HGN2S
A compound has an empirical formula of CzHANS and a molar mass of 222.4 g/mol. What is the molecular formula of this compound? C6H1ZN3S3 CZHANS CAHBN2S2 C3HGN2S...
##### Suppose you start with a full tank of gas (15 gallons) in your truck After driving 3 hours, you now Jhave 7 'gallons left:If xis the number of hours you have been driving; then y is the number of gallons left in the tankAt what rate is your truck using gas? State your answer as a reduced fractiongallons per hourFind an equation of a linein the form y = mx b that describes the amount ofigas inyour tank
Suppose you start with a full tank of gas (15 gallons) in your truck After driving 3 hours, you now Jhave 7 'gallons left: If xis the number of hours you have been driving; then y is the number of gallons left in the tank At what rate is your truck using gas? State your answer as a reduced fra...
Please help! I have been stuck on this problem for so long!! Thank you! 2. Kaeo Koal Company, Inc. purchased a new mining machine at a total cost of $1,800,000 on the first day of its fiscal year. The firm estimates that the machine has a useful life of six years or 8,000,000 tons of coal and a re... 5 answers ##### The vibrating _ part of your string has length of 132.0 cm and a mass of 4.49 g A mass of [2874 g hung' from section of the string that is drapped over pulley: What frequency will the oscillator need to be set to produce standing wave that corresponds to the Ist harmonic The vibrating _ part of your string has length of 132.0 cm and a mass of 4.49 g A mass of [2874 g hung' from section of the string that is drapped over pulley: What frequency will the oscillator need to be set to produce standing wave that corresponds to the Ist harmonic... 5 answers ##### Supporc$ XzX ArC ltlpqkit Idcntkcally distribuled (id) Sibbles of tlc probabllity dcusity functlon (fxln: f6;0) ( 0)4 0 <4< 1 Thcn thc etinalion Of â‚¬ using tlve Icthod of moment cslinatof (MME) Ix:aX-1 0 = 28 - 1 X+1 0 = 2b.C21 - 1 0 = -1d0 = x
Supporc \$ XzX ArC ltlpqkit Idcntkcally distribuled (id) Sibbles of tlc probabllity dcusity functlon (fxln: f6;0) ( 0)4 0 <4< 1 Thcn thc etinalion Of â‚¬ using tlve Icthod of moment cslinatof (MME) Ix: a X-1 0 = 28 - 1 X+1 0 = 2 b. C 21 - 1 0 = -1 d 0 = x...
##### If the European euro were to decline in value (depreciate) in the foreign exchange market, would it be easier or harder for the French to sell their wine in the United States? Suppose you were planning a trip to Paris. How would depreciation of the euro change the dollar cost of your trip?
If the European euro were to decline in value (depreciate) in the foreign exchange market, would it be easier or harder for the French to sell their wine in the United States? Suppose you were planning a trip to Paris. How would depreciation of the euro change the dollar cost of your trip?...
##### Outsourcing (Make-or-Buy) Decision Mountain Air Limited manufactures a line of room air purifiers. Management is currently...
Outsourcing (Make-or-Buy) Decision Mountain Air Limited manufactures a line of room air purifiers. Management is currently evaluating the possible production of an air purifier for automobiles. Based on an annual volume of 10,000 units, the predicted cost per unit of an auto air purifier follows. ...
##### Point)A boat leaves dock at 2:00 PM: and travels due south at a speed of 5 km/h. Another boat has been heading due east at 30 km/h and reaches the same dock at 3.00 PM: How many minutes past 2.00 PM_ were the boats closest together?3030 minutes
point) A boat leaves dock at 2:00 PM: and travels due south at a speed of 5 km/h. Another boat has been heading due east at 30 km/h and reaches the same dock at 3.00 PM: How many minutes past 2.00 PM_ were the boats closest together? 30 30 minutes...


text:
# zbMATH — the first resource for mathematics

Martingales and first passage times of AR(1) sequences. (English) Zbl 1148.60061
The exponential boundedness for the first passage time $$\tau_a$$ over a level for an ergodic autoregressive sequence $X_n=\lambda X_{n-1}+\eta_n,\quad n\geq 1, \quad 0<\lambda<1,$ where $$\{\eta_n\}$$ are i.i.d. random variables, is shown. By using martingale arguments under some conditions the exact representation of $$E\tau_a$$ is obtained. This representation is used for obtaining the upper bound for $$E\tau_a$$ in the general case.

##### MSC:
 60J55 Local time and additive functionals 49J15 Existence theories for optimal control problems involving ordinary differential equations
Full Text:
##### References:
 [1] DOI: 10.1080/15326340500294702 · Zbl 1083.60064 · doi:10.1080/15326340500294702 [2] Borovkov A.A., Applications of Mathematics (1973) · Zbl 0283.60029 [3] Doney R.A., Fluctuation Theory for Levy Processes (2005) [4] Frisen M., Sequential Anal. 25 pp 379– (2006) [5] DOI: 10.2307/1426747 · Zbl 0443.60037 · doi:10.2307/1426747 [6] M. Jacobsen, Exit times for a class of autoregressive sequences and random walks, Preprint No 5, Department of Applied Mathematics and Statistics, University of Copenhagen, 2007 [7] M. Jacobsen and A. Jensen, Exit times for a class of piecewise exponential Markov processes with two-sided jumps, Preprint No 5, Department of Applied Mathematics and Statistics, University of Copenhagen, 2006 · Zbl 1125.60080 [8] Jeffreys H., Methods of Mathematical Physics pp 406–, 3. ed. (1988) [9] Kyprianou A.E., Introductory Lectures on Fluctuations of Lèvy Processes with Applications (2006) · Zbl 1104.60001 [10] DOI: 10.1137/1135035 · Zbl 0723.60044 · doi:10.1137/1135035 [11] Novikov A.A., Theory Probab. Appl. 48 pp 340– (2003) [12] Novikov A.A., Proc. Steklov Math. Inst. 202 pp 169– (1993) [13] DOI: 10.1016/j.probengmech.2004.04.005 · doi:10.1016/j.probengmech.2004.04.005 [14] DOI: 10.2307/2291599 · Zbl 0881.62105 · doi:10.2307/2291599 [15] Sukparungsee S., KMITL Sci. J.: Int. J. Sci. Appl. Sci. 6 pp 373– (2006) [16] DOI: 10.2307/1426858 · Zbl 0417.60073 · doi:10.2307/1426858
This reference list is based on information provided by the publisher or from digital mathematics libraries. Its items are heuristically matched to zbMATH identifiers and may contain data conversion errors. It attempts to reflect the references listed in the original paper as accurately as possible without claiming the completeness or perfect precision of the matching.


text:
1
JEE Main 2022 (Online) 27th June Morning Shift
+4
-1

A projectile is launched at an angle '$$\alpha$$' with the horizontal with a velocity 20 ms$$-$$1. After 10 s, its inclination with horizontal is '$$\beta$$'. The value of tan$$\beta$$ will be : (g = 10 ms$$-$$2).

A
tan$$\alpha$$ + 5sec$$\alpha$$
B
tan$$\alpha$$ $$-$$ 5sec$$\alpha$$
C
2tan$$\alpha$$ $$-$$ 5sec$$\alpha$$
D
2tan$$\alpha$$ $$+$$ 5sec$$\alpha$$
2
JEE Main 2022 (Online) 27th June Morning Shift
+4
-1

A girl standing on road holds her umbrella at 45$$^\circ$$ with the vertical to keep the rain away. If she starts running without umbrella with a speed of 15$$\sqrt2$$ kmh$$-$$1, the rain drops hit her head vertically. The speed of rain drops with respect to the moving girl is :

A
30 kmh$$-$$1
B
$${{25} \over {\sqrt 2 }}$$ kmh$$-$$1
C
$${{30} \over {\sqrt 2 }}$$ kmh$$-$$1
D
25 kmh$$-$$1
3
JEE Main 2022 (Online) 25th June Evening Shift
+4
-1

Given below are two statements. One is labelled as Assertion A and the other is labelled as Reason R.

Assertion A : Two identical balls A and B thrown with same velocity 'u' at two different angles with horizontal attained the same range R. IF A and B reached the maximum height h1 and h2 respectively, then $$R = 4\sqrt {{h_1}{h_2}}$$

Reason R : Product of said heights.

$${h_1}{h_2} = \left( {{{{u^2}{{\sin }^2}\theta } \over {2g}}} \right)\,.\,\left( {{{{u^2}{{\cos }^2}\theta } \over {2g}}} \right)$$

A
Both A and R are true and R is the correct explanation of A.
B
Both A and R are true but R is NOT the correct explanation of A.
C
A is true but R is false.
D
A is false but R is true.
4
JEE Main 2022 (Online) 25th June Evening Shift
+4
-1

Two buses P and Q start from a point at the same time and move in a straight line and their positions are represented by $${X_P}(t) = \alpha t + \beta {t^2}$$ and $${X_Q}(t) = ft - {t^2}$$. At what time, both the buses have same velocity?

A
$${{\alpha - f} \over {1 + \beta }}$$
B
$${{\alpha + f} \over {2(\beta - 1)}}$$
C
$${{\alpha + f} \over {2(1 + \beta )}}$$
D
$${{f - \alpha } \over {2(1 + \beta )}}$$
JEE Main Subjects
Physics
Mechanics
Electricity
Optics
Modern Physics
Chemistry
Physical Chemistry
Inorganic Chemistry
Organic Chemistry
Mathematics
Algebra
Trigonometry
Coordinate Geometry
Calculus
EXAM MAP
Joint Entrance Examination


text:
Ball Thrown WELL !!

Classical Mechanics Level pending

What is the maximum angle (x) to the horizontal at which a ball can be thrown such that its distance from the thrower is always increasing. Find the value of the square of 3sinx .

×


text:
# injectivity of the pull-back via a finite map

Let $f:X \to Y$ be a finite map of (smooth, compact) complex algebraic varieties.

Then a map $f^*$ is defined at the level of Chow and cohomology rings. Say that for simplicity we work with rational coefficients.

Question: is $f^*$ injective? I know this is true when $f$ is the natural map onto the quotient via the action of a finite group. Indeed, it is simply the inclusion of the $G$-invariants.

In the case when $X$ and $Y$ are smooth and projective, is $f^*$ injective at the level of each individual $H^{p,q}$?

(in the case of cohomology, Proposition 2.2 of http://www.maths.ed.ac.uk/~aar/papers/smith2.pdf answers affirmatively my question, but I would anyway be curious of seeing a simpler proof in my generality)

-

Let $f:X\to Y$ be a finite surjective map of degree $d$ between smooth projective varieties of dimension $n$. Then $f$ is flat (apply EGA IV 2 Prop 6.1.5), so Example 1.7.4 of Fulton's Intersection Theory shows that $f_{\ast}\circ f^{\ast}$ is multiplication by $d$ on the Chow groups $CH^*(Y)$. Hence the kernel of $f^{\ast}$ on $CH^{\ast}(Y)$ is of $d$-torsion.

It remains true that $f_{\ast}\circ f^{\ast}$ is multiplication by $d$ on the integral cohomology of $Y$, hence that the kernel of $f^{\ast}$ on $H^{\ast}(Y,\mathbb{Z})$ is of $d$-torsion. It may be seen as follows. Recall that if $\alpha\in H^{k}(Y)$ and $\beta\in H^{k}(X)$, their Poincaré-dual classes are $\alpha\cap [Y]\in H_{n-k}(Y)$ and $\beta\cap [X]\in H_{n-k}(X)$ and that $f_*:H^{k}(X)\to H^{k}(Y)$ is defined to be the push-forward at the level of Poincaré-dual classes. Combining the projection formula $f_{\ast}(f^{\ast}\alpha\cap[X])=\alpha\cap f_{\ast}[X]$ and the fact that $f_{\ast}[X]=d[Y]$ because $f$ is a degree $d$ map, we get the formula $f_{\ast}\circ f^{\ast}(\alpha)= d\alpha$ we wanted to prove.

This shows that $f^{\ast}$ is injective on Chow groups modulo torsion, on integral cohomology modulo torsion, on rational cohomology, on cohomology with complex coefficients... This last point moreover implies that $f^{\ast}$ is injective on the pieces $H^{p,q}(Y)$ of the Hodge decomposition.

However, $f^{\ast}$ need not be injective on the integral cohomology. If $Y$ is an Enriques surface and $X$ is its universal cover (a K3 surface), $H^2(Y,\mathbb{Z})_{tors}=\mathbb{Z}/2\mathbb{Z}$ and $H^2(X,\mathbb{Z})$ has no torsion so that $f^{\ast}$ is not injective on $H^2$.

Torsion in cohomology is not the only reason why $f^{\ast}$ may fail to be injective on $CH^{\ast}(Y)$. For example, let $X$ be an elliptic curve. Suppose that its $2$-torsion is generated by $\sigma$ and $\tau$, and let $Y=X/\sigma$. We still denote by $\tau$ the image of $\tau$ in $Y$. Then, working in $CH^1=Pic$, we get $f^*(\tau-0)=\tau-0+\tau+\sigma-0-\sigma=2\tau-2.0=0$, so that $f^{\ast}$ is not injective on $CH^1$.

When dealing with $0$-cycles, it is possible to apply the theorem of Roitman. For example, if $H^1(Y,\mathbb{C})=0$, $f^*$ is injective on $CH_0$. Indeed, the Albanese variety of $Y$ is then trivial, and, by Roitman, $CH_0$ has no torsion.

-
Thanks for the very nice answer. Is it also easy to see that $f^*$ is injective at the level of rational cohomology and at the level of rational algebraic cohomology? – calc May 13 '12 at 19:18
Yes it is : the kernel of $f^{\ast}$ is torsion, so that if you look at a "cohomology theory" without torsion, such as rational cohomology, $f^{\ast}$ will be injective. – Olivier Benoist May 14 '12 at 8:17
As for rational cohomology, the injectivity of $f$ is automatic as soon as $f$ is surjective (not necessarily finite), cf the second paragraph of mathoverflow.net/questions/92532/… – Henri May 14 '12 at 9:15


text:
# EMF Induced In A UHF Loop Antenna

A square loop of wire of a single turn, used as a UHF antenna, is located $$10^{5}$$ meters from an antenna broadcasting at a frequency of $$300 \text{ MHz}$$. The power of the source is 50 kilowatts. The loop of wire is oriented so that the magnetic component of the electromagnetic wave produced by the antenna is perpendicular to the plane of the loop and the wave number vector is parallel to two sides of the loop, and has side $$S$$ equal to the wavelength of the signal from the antenna.

What is the root mean square electromotive force $$(\text{emf})$$ generated in the loop?

×


text:
# Can a proper prior lead to an improper posterior?

It is my understanding that if we have an improper prior, we may either get a proper or a posterior distribution. My question is if there are cases where a proper prior distribution may, when combined with the likelihood function, result in an improper posterior. Are there any trivial cases? Thanks!

## 1 Answer

I think that everything you need is contained in the several answers for this related but slighly different question (Does the Bayesian posterior need to be a proper distribution?). Here is a proposal of summary for your specific question:

From the sketch of proof https://stats.stackexchange.com/a/89157/14346: if the prior is proper and $p(x|\theta)$ none degenerate then the set of observations for which the posterior is improper is a Lesbegue null set. In other words: $$\mbox{proper prior} \Rightarrow \mbox{proper posterior almost everywhere}.$$ So, there exists some observations $x$ (but a null set) leading to an improper $p(\theta|x)$. An example of such $x$ for a given $p(\theta|x)$ is given here https://stats.stackexchange.com/a/89150/14346.

Nevertheless, (as pointed out in the comment of the example below) density functions are equivalent (roughly, can be treated as the same) if they only differ on a null set. So the specific observations leading to improperness are complelety arbitrary depending on which specific forms of the density you choose from the equivalent sets.


text:
# Tulips and daffodils

Farm cultivated tulips and 211 units on 50 units more daffodils. How many spring flowers grown together?

x =  472

### Step-by-step explanation:

$x=211+\left(211+50\right)=472$

We will be pleased if You send us any improvements to this math problem. Thank you!

## Related math problems and questions:

• Roses and tulips
At the florist are 50 tulips and 5 times fewer roses. How many flowers are in the flower shop?
• Tulips and daffodils
Two hundred twenty tulips and daffodils are planted in the flowerbed. One-third of all tulips and one-sixth of all daffodils equals the number of all tulips. How many tulips and how many daffodils?
• Crocuses
The garden grows daffodils, crocuses, and roses. 1400 daffodils, crocuses are 462 more, and roses are 156 more than crocuses. How many are all the flowers in the garden?
• Two florists
At the market, the florist sold 10 times more varieties of flowers than the florist at the stand opposite. It had 90 varieties of roses, 70 varieties of tulips, and 50 varieties of daffodils. How many varieties of each species did the florist offer in the
• I think number
I think number.When I add 841 to it and subtract 157, I get a number that is 22 greater than 996. What number I thinking?
• Concert
On a Concert were sold 150 tickets for CZK 360, 235 tickets for 240 CZK and 412 for 180 CZK. How much was the total revenues for tickets?
• Conference 2
9 people attended a conference on behalf of their company. The conference fee was £520 per person and the company paid a total of £856 in travel costs for the 9 people. How much did the conference cost the company altogether?
• Twelve flowers
A florist has roses, tulips, daffodils, and carnations to use in flower arrangements. If she were to make an arrangement using 12 flowers, how many different combinations of these 4 types of flowers would be possible?
• Tomatoes
There were 2414 crates of tomatoes in the barn, but 735 crates of tomatoes were rotten and had to be thrown out. Joe sold 813 crates and canned 756 crates of tomatoes. How many crates of tomatoes does Joe have left?
• On the farm
The farm took 221 tons of potatoes from 17 hectares. How many tons of potatoes taken from one hectare?
• Theatre
The theatrical performance started at 15:50 and ended at 18:50. How many minutes long?
• Rectangles
How many different rectangles with sides integers (in mm) have a circumference exactly 1000 cm? (a rectangle with sides of 50cm and 450cm is considered to be the same as a rectangle with sides of 450cm and 50cm)
• Bouquet
Gardener tying bouquet of flowers for 8 and none was left. Then he found that he could tying bouquet of 6 flowers and also none was left. How many have gardener flowers (minimum and maximum) if they had between 50 and 100 flowers?


text: This is a set of Frequently Asked Questions (FAQ) for English-speaking users of TeX. width=xx: Specify the preferred width of the imported image to xx. An ... resize pdf figure in latex The width is obviously the width of the figure. Werewolf prop 1:1 scale Movie Lifesize Wolf Prop and Movie Wolf Replica Werewolf collectibles Lycans Figure A comprehensive LaTeX guide with easy to understand examples ... You can also scale the image to a some specific width and height. Want to know when a new release is available? Sierra Scale Models is owned and operated by Dave Barron, an NMRA Master Model Railroader. Do you have a question regarding this example, TikZ or LaTeX in general? Introduction. Kittipat's Homepage. This is homepage of QuickLaTeX service which allows easy inclusion of math formulas and graphics in WordPress using LaTeX & TikZ. 159. Do you have a question regarding this example, TikZ or LaTeX in general? There is an option without additional packages that works under pdflatex. Extend a figure 100% horizontally with a fixed height in LaTeX? \argis arg (math mode). The Basics. To search the catalogue, press Ctrl and F simultaneously, or Cmd and F on a Mac, and scroll through the relevant lots. LaTeX and the document class will normally take care of page layout issues for you. If an image width or height exceed the maximum, it need to be resized proportionally . height=xx: Specify the preferred height of the imported image to xx. up vote 6 down vote favorite. En franais: TeXnique.fr. This is the width of figure box. Getting to Grips with LaTeX Floats, figures and captions. If you are the content provider, read HTML. You can also add an option like height, width, scale.Figures and graphs are created using the figure environment given below. Pyplot tutorial matplotlib.pyplot is a collection of command style functions that make matplotlib work like MATLAB. This says to make the image fill the width and height of the text area on the page. 1. Math operator in specifying figure width in LaTeX. That is, \includegraphics[width=50mm,scale=1.5]{method.eps}. To search the catalogue, press Ctrl and F simultaneously, or Cmd and F on a Mac, and scroll through the relevant lots. Introduction. The code below is executing properly: \begin{figure} \includegraphics{name1} \caption{Figure 1}\label{name1} \end{figure} However when I add width and height There are two basic types of rubber used in the rubber industry: natural and synthetic. Some tips on dealing on images with latex figures. Figures, Tables, and Equations. Oder frag auf Deutsch auf TeXwelt.de. Louis S. Beliczky and John Fajen. Introduction to HTML/CSS. This is homepage of QuickLaTeX service which allows easy inclusion of math formulas and graphics in WordPress using LaTeX & TikZ. Addendum From Beyond The Beyond: Hold onto your hats, it's your time-travelling host here with some retroactive advice from the not-so-distant future. Chapter 80 - Rubber Industry GENERAL PROFILE. Lets look at some ways how to size a figure with RMarkdown. En franais: TeXnique.fr. How to use graphics in LaTeX. LaTeX source ... To insert a figure in a LaTeX ... You can also specify the width of the image. Pyplot tutorial matplotlib.pyplot is a collection of command style functions that make matplotlib work like MATLAB. T he captions for figures, tables, subfigures and subtables in LaTeX can be customized in various ways using the caption and subcaption packages. Introduction. \arraycolsep| width of the space between columns in an arrayenvironment. Using System.Drawing.Image. Welcome to the UK List of TeX Frequently Asked Questions. Welcome to the UK List of TeX Frequently Asked Questions. 2 LATEX Command Summary \arctanis arctan (math mode). Introduction. Just ask in the LaTeX Forum. Subscribe to pandoc-announce, a low-volume mailing list that is just for announcements of new releases. A "figure" consists of image data (including image options), an optional caption (a single paragraph), and an optional legend (arbitrary body elements). Just ask in the LaTeX Forum. Use the scale=1.5 option in the \includegraphics command to resize the image to 150% of its original size. ... respect to the width or height of the paper ... for each figure. LaTeX and the document class will normally take care of page layout issues for you. This will include a copy of the image 5cm tall, with the aspect ratio maintained (the width will scale with the height). If you are the graphic designer, read CSS. Oder frag auf Deutsch auf TeXwelt.de. Ask Question. This is a set of Frequently Asked Questions (FAQ) for English-speaking users of TeX.


text:
# Tag Info

## New answers tagged surface-code

1

What is a “temporal” or “timelike” logical error in the surface code? An example of an undetectable timelike error is a stabilizer measurement being consistently wrong. For example, when you initialize your data qubits to be $|0\rangle$, all the X stabilizer measurements project randomly into their +1 or -1 eigenspaces. If one of the X stabilizers happens ...

0

I guess you are confusing Stabilizer types. Brown plaquettes(X Stabilizer) & Yellow plaquettes(Z Stabilizer) So if there is Error Z_topleft or Error Z_beneath, it gives same Syndrome. if this is your question, Imagine if there are only Z Error occurred on the Rotated Surface Code ( Figure c). Z_topleft Z_beneath is one of stabilizer. So we can choose ...

1

Well I also had a similar issue. As far as I know, when you are considering Lattice Surgery specifically Merging Operation, you get the final output state depending on Measurement result. For applying CNOT operation between two Logical qubits, according to what result(Merging Operation) you get, you decide whether you should apply Logical operator or not. In ...

Top 50 recent answers are included


text:
# Why can't I pattern match Dt?

A simple question:

MatchQ[f[a], f[x_]]
(* True *)

MatchQ[D[a], D[x_]]
(* True *)

MatchQ[Dt[a], Dt[x_]]
(* False *)

Why doesn't the last test succeed? Is this a bug or am I doing something wrong? (Mathematica 10.2 on Mac.)

• Maybe because D[a] evaluates to a and Dt[a] does not evaluate? – yarchik Sep 10 '16 at 17:31
• @yarchik Not really. -- In MatchQ, the second argument is not held; it is evaluated (see the output of Trace). Thus, Dt[x_] is evaluated, creating this weird expression: Dt[x]*Derivative[1, 0][Pattern][x, _]. (Dt tries to take the derivative of the Pattern function) Of course Dt[a] looks nothing similar to this, so MatchQ returns False. I believe this is unintended (perhaps MatchQ should have HoldRest attribute). – JungHwan Min Sep 10 '16 at 17:45

## 1 Answer

The symbol MatchQ does not have an Hold* attribute,

Attributes[MatchQ]
(* {Protected} *)

so its arguments are evaluated before the internal definition of MatchQ fires. This means that the pattern-matcher is called only after the evaluation of the arguments. (See for instance the standard evaluation sequence in this tutorial.)

First situation

MatchQ[f[a], f[x_]]
(* True *)

The evaluation of each argument returns the argument itself, so you are effectively asking for a match between the typed expression.

Second situation

MatchQ[D[a], D[x_]]
(* True *)

The arguments are evaluated to what they contain, so you are asking for a match between a and x_, which returns True.

Last situation

MatchQ[Dt[a], Dt[x_]]
(* False *)

While the argument Dt[a] remains unchanged, the argument Dt[x_] gets evaluated to:

Dt[x] Derivative[1, 0][Pattern][x, _]

which then results in False once the pattern-matcher is called.

The fact that Dt[x_] evaluates to this output can be understood by seeing the symbol Pattern as an inert head in the evaluation sequence. You would obtain an output with the same structure by evaluating for instance Dt[f[x, 1]].

This is what happens: a) x_ is represented internally as Pattern[x, Blank[]], and b) Dt takes the total derivative of this expression of head Pattern with respect to all variables, namely with respect to all expressions at level 1 or deeper that are AtomQ and have head Symbol,

Level[Pattern[x, Blank[]], {1}]
(* {x, _} *)

AtomQ /@ %
(* {True, False} *)

Head /@ %%
(* {Symbol, Blank} *)

Level[Pattern[x, Blank[]], {2}]
(* {} *)

so here only with respect to x.

Solution

To avoid the evaluation of the second argument, you can wrap it into HoldPattern:

MatchQ[Dt[a], HoldPattern[Dt[x_]]]
(* True *)

• Nice. For tracking down such things when one is confused, Trace[] or especially WReach's traceView functions can help show a user where his or her assumptions about evaluation diverge from reality. – Michael E2 Sep 10 '16 at 18:44


text:
# Mass changes by absorbing light energy with Doppler shift

Suppose you have a mass that is moving at relativistic speed wrt (with respect to) a powerful laser pointed at the mass. As the laser shines on the mass, assume it absorbs all the energy (and momentum), and therefore grows in mass (and it's momentum increases). The light undergoes a Doppler shift in the frame of the mass (but not in the frame of the laser), so in the frame of the mass it absorbs a different amount of energy than in the frame of the laser. Therefore, in each frame it has a different mass.

This does not seem possible, so does anyone know where my conceptual mistake is?

In each reference frame the body has an energy $E$ given by its rest mass $m$ plus the relativistic three-momentum $p$. In natural units ($c$ = 1), it is $E = \sqrt{p^2 + m^2}$.


text:
# Target Encoder for Logistic regression

I have a data set that has many categorical values, I want to build a linear model using Logistic regression algorithm. One way of handling Categorical variables is to use Target Encoder (among others like OneHotEncodng or LabelEncoding).

Is this method suitable for a logistic regression model ? What should we consider while using this type of encoding ?

## 2 Answers

Surely you can do so, but why? Maybe some ideas here: Strange encoding for categorical features can help, Or if the problem is that you have a categorical variable with very many levels, see Principled way of collapsing categorical variables with many levels?.

One problem with target encoding is that you effectively encodes a variable with its marginal effect. In the case that variable works better together with some other variables, maybe you will not detect that? In addition, if one level has few observations, the encoding will be noisy.

Whenever you're using any encoding that uses the target, you'll want to make sure that you're careful about not using leakage. Especially if you're using cross-fold validation you'll want that encoder to be "trained" only on the portion of the training data for each iteration. This is where you might use sklearn's Pipelines to help.

Specifically to address your question, my favorite technique for pairing with Logistic Regression is Weight-of-Evidence encoding. I typically like to add some random noise as well. If your dataset is small, or your categorical variables have extremely high cardinality, you may not get the best results. However, this is my "favorite" method of encoding that pairs especially well with Logistic Regression.

One of the best packages I've found in python is CategoryEncoders.