text:
# Outer alignment and imitative amplification

post by evhub · 2020-01-10T00:26:40.480Z · score: 28 (6 votes) · LW · GW · 11 comments

## Contents

  Understanding the outer alignment problem
Outer alignment at optimum
The case for imitative amplification
None

## Understanding the outer alignment problem

What really is outer alignment? In “Risks from Learned Optimization,” we defined outer alignment in the context of machine learning as “aligning the specified loss function with the intended goal.” But that's not a perfectly well-defined statement—what does it mean for a loss function to be “aligned” with the intended goal? If the goal we care about is maximizing , do we need exactly for constants ? That's a pretty high bar.

Well, what exactly do we want outer alignment for? At the end of the day, we care about whether the model that pops out the other end of our training procedure will be safe, which is a complicated question involving the loss function, the architecture, the implicit inductive biases, and so on. In what sense, then, is it even reasonable to look at just the lost function in isolation and ask whether it's aligned or not?

I think the strongest case for outer alignment being a meaningful problem in isolation comes from the argument that loss functions seem to scale pretty well with generic machine learning progress. If, as a silly example, your outer alignment scheme is to “train image classification models,” that's something that ML has progressively gotten better at over time. Compare that to the silly inner alignment scheme of “train a straightforward CNN”—that's something that ML has passed by pretty rapidly in favor of architectural improvements like residual connections even just for the task of image classification. Of course, outer alignment alone does not an aligned AGI make, so you still have to have some notion of how you're going to do inner alignment in mind—but loss functions scaling better is still a perfectly valid reason for focusing on outer alignment.[1]

Thus, it does seem quite reasonable to me to put effort into finding “aligned” loss functions. But that still brings us back to the question of what exactly makes a loss function “aligned.” In the context of a specific training/inner alignment scheme, we can say that a loss function is aligned if, when plugged into that training scheme, it produces models which are aligned with our goals. But in the absence of any specific training scheme, what does it mean to say that a loss function is aligned in isolation? We can of course ask for as I stated previously, though in my opinion I think achieving something like that is likely to be nearly impossible.

## Outer alignment at optimum

I think there is another version of “outer aligned in isolation,” however, which is both meaningful and (at least somewhat) achievable which I will call outer aligned at optimum. Intuitively, I will say that a loss function is outer aligned at optimum if all the possible models that perform optimally according to that loss function are aligned with our goals—that is, they are at least trying to do what we want. More precisely, let and . For a given loss function , let . Then, is outer aligned at optimum if, for all such that , is trying to do what we want.

That's the definition—now why should we care? In basically any practical setting we're never going to reach perfect loss, so why should it matter if those functions which do have perfect loss are aligned or not? In my opinion, I think there is a strong argument for loss functions which are aligned at optimum being significantly less susceptible to Goodhart's Law as we scale up ML capabilities. Suppose you know that a loss function is aligned for current ML capabilities. When you then scale up those capabilities and push harder on minimizing , you immediately run into all the issues of Goodhart's Law where can quickly cease to be a good proxy for alignment as you push harder on it. If you have a guarantee that is aligned at optimum, however, then, while still quite possible, it's a lot harder for Goodhart's Law to bite you. In particular, if you think about the Goodhart taxonomy [AF · GW], alignment at optimum almost entirely rules out both Causal and Extremal Goodhart—since you know the relationship is valid and doesn't break down at the extremes—and ensures that Regressional and Adversarial Goodhart won't show up in the limit, though you could still see them before that point. Though this obviously doesn't just give you an alignment guarantee—before you get to the true optimum, you can still get Regressional Goodhart biting you through proxy alignment [AF · GW] or Adversarial Goodhart biting you through deceptive alignment [AF · GW], for example—I think it is nevertheless still a very nice thing to have.

## The case for imitative amplification

With all of that being said, I can get to the reason that I want to talk about all of this: I think that specifically what I will call imitative amplification—in contrast to other amplification [AF · GW]-based approaches or debate-based approaches—has a strong claim to being outer aligned at optimum.[2] Specifically, when I say imitative amplification, I mean the class of training procedures which are attempting to produce models which approximate HCH as closely as possible. As a concrete example, consider the scheme where you train a model to minimize the difference between its output and the output of a human consulting that model. I want to contrast this with approval-based amplification, by which I mean the class of training procedures where the loss is generated using an approval signal from an amplified overseer. As a concrete example, consider the scheme where you train a model to maximize the extent to which a human consulting that model would approve of that model's output.[3]

So, why does imitative amplification have a stronger case for being outer aligned at optimum than approval-based amplification or debate? Well, precisely because we know what the optimum of imitative amplification is—it's HCH—whereas we really don't know what perfect approval-based amplification or perfect debate look like.[4] Though some challenges have been raised regarding whether HCH is actually aligned or not [AF · GW], I tend to be fairly skeptical of these challenges—HCH is just a bunch of humans after all and if you can instruct them not to do things like instantiate arbitrary Turing machines, then I think a bunch of humans put together has a strong case for being aligned.[5] That being said, the same argument does not at all apply to approval-based amplification or debate.

First, let's consider approval-based amplification.[6] We know what the optimum of imitative amplification looks like—but what is the optimum of approval-based amplification? At first glance, one might imagine that the optimum of approval-based amplification looks like a model whose output is selected to be maximally approved of by HCH. That's very much not the case for the approval-based scheme I described earlier, however. If each step of training is done via maximizing an approval signal, then instead of a tree of humans you get a tree of models trying to maximize the approval that their parents in the tree would assign to their answers. And if you think that human approval can be gamed—which seems extremely likely in my opinion given that we see exactly that sort of gaming happening in our world already all the time—then this is very much not a safe tree. Now, one could make the argument that approval-based amplification can just become imitative amplification if the humans determine their approval by computing a distance function between what they would have said and what the model produced as its output. For example, you could ask your humans to come up with their answers first, then show them the model's answer and ask them to rate how close it was. I'm pretty skeptical of this approach, however—it doesn't seem at all clear to me that this gets around the approval-gaming problem, since the humans still get to see the model's answer and doing so could significantly change how they're thinking about the rating problem.[7]

Now, second, let's consider debate with a human judge. In many ways, debate was designed as an approach meant to fix the problems of approval-based reward signals. With a standard approval-based reward signal, the argument goes, it's easy to be tricked by a bad argument that you don't fully understand. In a debate setup, however, you get the benefit of having two competing systems trying to point out flaws in each other's arguments, which hopefully should prevent you from being tricked by bad arguments and thus fix the approval-gaming problem. I'm not convinced, though—false things can be significantly easier to argue for than true things just because there are fewer ways to attack them, they're more rhetorically powerful, or any other number of possible ways in which an argument can be subtly wrong yet still persuasive.[8] Regardless, however, I think the more fundamental objection is just that we really have no way of knowing what optimal play in debate looks like, which makes it very difficult to ever know whether it is outer aligned at optimum or not. With HCH, we know that it just looks like a tree of humans, which at least means we can reason about the parts and how they interact. With optimal debate, however, we have to somehow analyze, understand, and be confident in the alignment of superhuman play on a game involving humans assessing arbitrary strings of characters, which is something that in my opinion seems extremely difficult to do.

All of that is an argument for why we should prefer imitative amplification from an alignment standpoint. However, there's also the problem of imitative amplification just not being competitive in terms of capabilities with other approaches. First of all, I think it's important to remember the importance of putting safety first—if something isn't safe, then we shouldn't build it. Of course, arms race dynamics could end up pushing one's hand into going with a best available current option in order to beat some other team which one believes will produce an AI which is even less likely to be safe, though I think it's important to remember that that's a last resort, not the default option. Furthermore, even in such a situation, it's still probably fine to eat an overhead cost that is just something like a constant factor worse.

With that being said, I still think there are strong arguments to be made for why imitative amplification can be done competitively. First, like the silly outer alignment scheme of “just train an image classification model” from earlier, imitative amplification gets to piggy-back off of generic ML progress. Imitative amplification is just a language modeling problem, which means generic progress on language modeling should generally be transferable to imitative amplification. Second, I think there is a strong case for language being sufficiently rich as a dataset for training an AGI (EDIT: where “language” is construed to also include embedded images, videos, etc.), at least for the sorts of tasks which I think you will want to use your first AGI for.[9] For example, if the primary/most important purpose of your first AGI is to help you build your second AGI by helping you improve your AGI design, that's the sort of highly cognitive task which I think language is sufficient for. Certainly, if you needed your first AGI to be able to do fine motor control to be competitive, then imitative amplification probably won't get you there—but it seems pretty unlikely to me that ability to do fine motor control will be an important desiderata. Third, a common criticism of imitative amplification is that because imitation treats all data points the same, it won't be able to focus on the most important ones. However, that's not something that's fundamental to the task of imitation. For example, you could use active learning to select the most important data points rather than just using a fixed curriculum.[10] Or, you could even weight different data points in your imitation loss using some outside importance criterion while still maintaining the guarantee of perfect imitation at optimum.

Regardless, I think the case for imitative amplification's safety is a strong argument in favor of at least focusing on figuring out whether it works and is safe first, before we give up and move to other approaches. Furthermore, even if imitative amplification on its own isn't competitive, I don't think that means we have to abandon it completely—there are modifications to imitative amplification that can be made to help improve competitiveness without sacrificing all of its benefits. For example, you could do reward-modeling-based distillation (e.g. RL + IRL as the distillation step) instead of imitation-based distillation, which, while not imitative (as the optimum isn't HCH anymore), also isn't based on human approval, which could be a nice property. Alternatively, you could first train an HCH model, and then use that model as the judge to train a debate model, which could have significant benefits over just using a human judge. While I don't think we should be focusing on those sorts of things now, the fact that such options exist makes it more likely that imitative amplification work can transfer to future approaches even if imitative amplification itself ends up not being competitive. In any event, I think the case for focusing on imitative amplification right now both from an outer alignment perspective as well as from a competitiveness perspective is quite strong.[11]

1. There is still lots of potential for outer alignment work to be outdated by machine learning progress, however—see, for example, Daniel Kokotajlo's “A dilemma for prosaic AI alignment [LW · GW].” ↩

2. I mentioned this previously a bit in this comment [AF · GW]. ↩

3. Note that the two categories of “imitative” and “approval-based” amplification do not cover the entire space of possible amplification-based approaches—there are other possible schemes in this domain as well. For example, you could use imitative amplification to train an HCH approximator, then do RL to produce a model which maximizes that model's approval—or even use your HCH model as a judge in a debate. Alternatively, you could do imitative amplification but instead of using standard imitation learning you could do IRL + RL instead. All of these different approaches have different alignment properties—I have singled out imitative amplification, approval-based amplification, and debate with a human judge because they are the approaches I'm most interested in talking about there, though they are far from the only ones. ↩

4. Note that for the optimum of imitative amplification to be precisely HCH, you need it to be the case that you progressively enlarge your training data as you go along. The fact that you don't get good guarantees for finite datasets is certainly a problem, though it's one that you basically have to solve via inner alignment techniques and thus not one I want to focus on right now. ↩

5. The question of whether theoretical HCH is aligned or not is a pretty complicated question that I don't really want to go into in full detail right now, so if you strongly disagree just take it as a given for this post. ↩

6. Though there was a previous claim by William Saunders that RL amplification and imitative amplification are equivalent [AF · GW], I think that both of William's proposals there fall into my approval-based category, not my imitative category. See Rohin Shah's [AF · GW] and Wei Dai's [AF · GW] comments on William's post to that effect. ↩

7. In particular, this breaks the analogy to counterfactual oracles [LW · GW]. ↩

8. I have a lot more to say on this point regarding reasons why false arguments can be more persuasive than true ones, though that's not something I want to go into in too much detail right now. ↩

9. Much of my thinking here owes a debt to Geoffrey Irving. I also talked about the case for language being all you need a bit previously in this comment [LW · GW]. ↩

10. Such an active learning scheme could even borrow lessons from across-episode exploration in RL [AF · GW]. ↩

11. I also think imitative amplification has some nice inner alignment properties as well, since it gives you an amplified overseer to use for transparency [AF · GW]/relaxed adversarial training [AF · GW]. ↩

comment by Wei_Dai · 2020-01-11T06:39:05.641Z · score: 21 (6 votes) · LW(p) · GW(p)

Aside from some quibbles, this matches my understanding pretty well, but may leave the reader wondering why Paul Christiano and Ought decided to move away from imitative amplification to approval-based amplification. To try to summarize my understanding of their thinking (mostly from an email conversation in September of last year between me, you (Evan), Paul Christiano, and William Saunders):

• William (and presumably Paul) think approval-based amplification can also be outer aligned. (I do not a good understand why they think this, and William said "still have an IOU pending to provide a more fleshed out argument why it won't fail.")
• Paul thinks imitative amplification has a big problem when the overseer gets amplified beyond the capacity of the model class that's being trained. (Approximating HCH as closely as possible wouldn't lead to good results in that case unless we had a rather sophisticated notion of "close".)
• I replied that we could do research into how the overseer could effectively dumb itself down, similar to how a teacher would dumb themselves down to teach a child. One approach is to use a trial-and-error process, for example ramping up the difficulty of what it’s trying to teach and then backing down if the model stops learning well, and trying a different way of improving task performance and checking if the model can learn that, and so on. (I didn't get a reply on this point.)
• William also wrote, "RL-IA is easier to run human experiments in, because the size of trees to complete tasks, and the access to human experts with full knowledge of the tree (eg the Ought reading comprehension experiments) I'd lean towards taking the position that we should try to use SL-IA where possible, but some tasks might just be much easier to work with in RL-AI"
comment by Wei_Dai · 2020-01-11T06:42:14.663Z · score: 5 (2 votes) · LW(p) · GW(p)

I may have asked this already somewhere, but do you know if there's a notion of "outer aligned" that is applicable to oracles/predictors in general, as opposed to trying to approximate/predict HCH specifically? Basically the problem is that I don't know what "aligned" or "trying to do what we want" could mean in the general case. Is "outer alignment" meant to be applicable in the general case?

This post talks about outer alignment of the loss function. Do you think it also makes sense to talk about outer alignment of the training process as a whole, so that for example if there is a security hole in the hardware or software environment and the model takes advantage of the security hole to hack its loss/reward, then we'd call that an "outer alignment failure". Or would it make more sense to use different terminology for that?

Intuitively, I will say that a loss function is outer aligned at optimum if all the possible models that perform optimally according that loss function are aligned with our goals—that is, they are at least trying to do what we want.

So technically, one should say that a loss function is outer aligned at optimum with respect to some model class, right?

Also, related to Ofer's comment, can you clarify whether it's intended for this definition that the loss function only looks at the model's input/output behavior, or can it also take into account other information about the model?

HCH is just a bunch of humans after all and if you can instruct them not to do dumb things like instantiate arbitrary Turing machines

I believe the point about Turing machines was that given Low Bandwidth Overseer [LW · GW], it's not clear how to get HCH/IA to do complex tasks without making it instantiate arbitrary Turing machines. But other issues arise with HBO, as William Saunders wrote in the above linked post:

The reason for this system [LBO] being introduced is wanting to avoid security issues as the system scales. The fear is that there would be an “attack” on the system: an input that could be shown to an overseer that would cause the overseer to become corrupted and try to sabotage the system. This could be some kind of misleading philosophical argument, some form of blackmail, a human adversarial example, etc. If an input like this exists, then as soon as the first agent is corrupted, it can try to spread the attack to other agents. The first agent could be corrupted either by chance, or through an attack being included in the input.

I understand you don't want to go into details about whether theoretical HCH is aligned or not here, but I still want to flag that "instruct them not to do dumb things like instantiate arbitrary Turing machines" seems rather misleading. I'm also curious whether you have HBO or LBO in mind for this post.

comment by evhub · 2020-02-03T21:19:11.155Z · score: 2 (1 votes) · LW(p) · GW(p)

Another thing that maybe I didn't make clear previously:

I believe the point about Turing machines was that given Low Bandwidth Overseer, it's not clear how to get HCH/IA to do complex tasks without making it instantiate arbitrary Turing machines.

I agree, but if you're instructing your humans not to instantiate arbitrary Turing machines, then that's a competitiveness claim, not an alignment claim. I think there are lots of very valid reasons for thinking that HCH is not competitive—I only said I was skeptical of the reasons for thinking it wouldn't be aligned.

comment by Wei_Dai · 2020-02-04T01:50:45.989Z · score: 6 (3 votes) · LW(p) · GW(p)

I think there are lots of very valid reasons for thinking that HCH is not competitive—I only said I was skeptical of the reasons for thinking it wouldn’t be aligned.

But if you put aside competitiveness, can't HCH be trivially aligned? E.g., you give the humans making up HCH instructions to cause it to not be able to answer anything except simple arithmetic questions. So it seems that a claim of HCH being aligned is meaningless unless the claim is about being aligned at some level of competitiveness.

comment by evhub · 2020-02-04T06:18:35.451Z · score: 2 (1 votes) · LW(p) · GW(p)

That's a good point. What I really mean is that I think the sort of HCH that you get out of taking actual humans and giving them careful instructions is more likely to be uncompetitive than it is to be unaligned. Also, I think that “HCH for a specific H” is more meaningful than “HCH for a specific level of competitiveness,” since we don't really know what weird things you might need to do to produce an HCH with a given level of competitiveness.

comment by evhub · 2020-01-11T22:46:36.483Z · score: 2 (1 votes) · LW(p) · GW(p)

Is "outer alignment" meant to be applicable in the general case?

I'm not exactly sure what you're asking here.

Do you think it also makes sense to talk about outer alignment of the training process as a whole, so that for example if there is a security hole in the hardware or software environment and the model takes advantage of the security hole to hack its loss/reward, then we'd call that an "outer alignment failure".

I would call that an outer alignment failure, but only because I would say that the ways in which your loss function can be hacked are part of the specification of your loss function. However, I wouldn't consider an entire training process to be outer aligned—rather, I would just say that an entire training process is aligned. I generally use outer and inner alignment to refer to different components of aligning the training process—namely the objective/loss function/environment in the case of outer alignment and the inductive biases/architecture/optimization procedure in the case of inner alignment (though note that this is a more general definition than the one used in “Risks from Learned Optimization [AF · GW],” as it makes no mention of mesa-optimizers, though I would still say that mesa-optimization is my primary example of how you could get an inner alignment failure).

So technically, one should say that a loss function is outer aligned at optimum with respect to some model class, right?

Yes, though in the definition I gave here I just used the model class of all functions, which is obviously too large but has the nice property of being a fully general definition.

Also, related to Ofer's comment, can you clarify whether it's intended for this definition that the loss function only looks at the model's input/output behavior, or can it also take into account other information about the model?

I would include all possible input/output channels in the domain/codomain of the model when interpreted as a function.

I'm also curious whether you have HBO or LBO in mind for this post.

I generally think you need HBO and am skeptical that LBO can actually do very much.

comment by rohinmshah · 2020-01-10T02:50:53.270Z · score: 5 (2 votes) · LW(p) · GW(p)
a loss function is outer aligned at optimum if all the possible models that perform optimally according that loss function are aligned with our goals—that is, they are at least trying to do what we want.

Why is the word "trying" necessary here? Surely the literal optimal model is actually doing what we want, and never has even benign failures?

The rest of the post makes sense with the "trying to do what we want" description of alignment (though I don't agree with all of it); I'm just confused with the "outer alignment at optimum" formalization, which seems distinctly different from the notion of alignment used in the rest of the post.

comment by evhub · 2020-01-10T05:29:18.738Z · score: 8 (4 votes) · LW(p) · GW(p)

I think I'm quite happy even if the optimal model is just trying to do what we want. With imitative amplification, the true optimum—HCH—still has benign failures, but I nevertheless want to argue that it's aligned. In fact, I think this post really only makes sense if you adopt a definition of alignment that excludes benign failures, since otherwise you can't really consider HCH aligned (and thus can't consider imitative amplification outer aligned at optimum).

comment by ofer · 2020-01-10T11:54:28.251Z · score: 4 (2 votes) · LW(p) · GW(p)

Intuitively, I will say that a loss function is outer aligned at optimum if all the possible models that perform optimally according that loss function are aligned with our goals—that is, they are at least trying to do what we want.

I would argue that according to this definition, there are no loss functions that are outer aligned at optimum (other than ones according to which no model performs optimally). [EDIT: this may be false if a loss function may depend on anything other than the model's output (e.g. if it may contain a regularization term).]

For any model that performs optimally according to a loss function there is a model that is identical to except that at the beginning of the execution it hacks the operating system or carries out mind crimes [LW · GW]. But for any input, and formally map that input to the same output, and thus also performs optimally according to , and therefore is not outer aligned at optimum.

comment by Matthew Barnett (matthew-barnett) · 2020-01-20T12:29:10.993Z · score: 3 (2 votes) · LW(p) · GW(p)
I tend to be fairly skeptical of these challenges—HCH is just a bunch of humans after all and if you can instruct them not to do things like instantiate arbitrary Turing machines, then I think a bunch of humans put together has a strong case for being aligned.

Minor nitpick: I mostly agree, but I feel like a lot of work is being done by saying that they can't instantiate arbitrary Turing machines, and that it's just a bunch of humans. Human society is also a bunch of humans, but frequently does things that I can't imagine any single intelligent person deciding. If your model breaks down for relatively human-human combinations, I think there is a significant risk that true HCH would be dangerous in quite unpredictable ways.

comment by William_S · 2020-02-16T01:04:53.418Z · score: 1 (1 votes) · LW(p) · GW(p)

Overall, I think imitative amplification seems safer, but I maybe don't think the distinction is as clear cut as my impression of this post gives.

if you can instruct them not to do things like instantiate arbitrary Turing machines

I think this and "instruct them not to search over arbitrary text strings for the text string that gives the most approval", and similar things, are the kind of details that would need to be filled out to make the thing you are talking about actually be in a distinct class from approval-based amplification and debate (My post on imitation and RL amplification [AF · GW] was intended to argue that without further restrictions, imitation amplification is in the same class as approval-based amplification, which I think we'd agree on). I also think that specifying these restrictions in a way that still lets you build a highly capable system could require significant additional alignment work (as in the Overseer's Manual scenario here [AF · GW])

Conversely, I also think there are ways that you can limit approval-based amplification or debate - you can have automated checks, for example, that discard possible answers that are outside of a certain defined safe class (e.g. debate where each move can only be from either a fixed library of strings that humans produced in advance or single direct quotes from a human-produced text). I'd also hope that you could do something like have a skeptical human judge that quickly discards anything they don't understand + an ML imitation of the human judge that discards anything outside of the training distribution (don't have a detailed model of this, so maybe it would fail in some obvious way)

I think I do believe that for problems where there is a imitative amplification decomposition that solves the problem without doing search, that's more likely to be safe by default than approval-based amplification or debate. So I'd want to use imitative amplification as much as possible, falling back to approval only if needed. On imitative amplification, I'm more worried that there are many problems it can't solve without doing approval-maximizing search, which brings the old problems back in again. (e.g. I'm not sure how to use imitative amplification at the meta-level to produce better decomposition strategies than humans use without using approval-based search)


text:
DEtools[rifsimp] Common Options - Maple Programming Help

Home : Support : Online Help : Mathematics : Differential Equations : Rif : rifsimp usage : DEtools/rifsimp/options

DEtools[rifsimp] Common Options

 Calling Sequence rifsimp(system, options) rifsimp(system, vars, options)

Parameters

 system - list or set of polynomially nonlinear PDEs or ODEs (may contain inequations) vars - (optional) list of the main dependent variables options - (optional) sequence of options to control the behavior of rifsimp

Description

 • The rifsimp options are given after the input system, and optionally the vars. The following are the most commonly used options:
 • vars
 This is the optional second argument to rifsimp. It indicates which indeterminates are to be solved for. By default rifsimp attempts to solve for all dependent variables with the same differential order and differentiations with equal precedence, breaking ties alphabetically. rifsimp solves for constants when only constants remain in an equation.
 The selection of the solving indeterminate (called the leading indeterminate) of an equation is performed based on the ranking imposed on the system. This argument can be used in nested list form to modify the indeterminates to solve for. For example, if $f\left(x\right)$, $g\left(x\right)$, and $h\left(x\right)$ were the dependent variables of a problem, and we wanted to isolate all of these with equal precedence, we could specify vars as $\left[f,g,h\right]$. If instead we wanted to eliminate $f\left(x\right)$ from as much of the system as possible, we could specify $\left[\left[f\right],\left[g,h\right]\right]$ instead, which tells rifsimp to solve for $f\left(x\right)$ and its derivatives with higher precedence than $g\left(x\right)$, $h\left(x\right)$ and any of their derivatives, regardless of the differential order of $f\left(x\right)$. Under this nested list ranking, and equation of the form $g\text{'}\text{'}\text{'}f-g\text{'}\text{'}h\text{'}\text{'}=0$ would be solved for $f$ giving $f=g\text{'}\text{'}\frac{h\text{'}\text{'}}{g\text{'}\text{'}\text{'}}$. See rifsimp[ranking] and checkrank for more detail.
 • $\mathrm{indep}=[\mathrm{ind1},\mathrm{ind2},...]$
 This option specifies the names of the unknowns to be treated as independent variables. By default, only those unknowns given in the dependency list of all unknown functions in the input system are considered to be independent variables. All other unknowns are considered constants. Treating an independent variable as though it were a constant will result in an incomplete answer, so you must use this option when required (see examples below). Please note that rifsimp always views unknowns present in a dependency list of an unknown function as independent variables, even when not specified by this option.
 The order in which the independent variables are specified in this option affects the selection of the leading indeterminate (the indeterminate to be solved for) in an equation. See rifsimp[ranking] and checkrank for details.
 • $\mathrm{arbitrary}=[\mathrm{v1},\mathrm{v2},...]$
 This option specifies a list of parameters or functions that should be treated as arbitrary. Any special cases where these parameters or functions take on specific values are rejected as inconsistent cases. Note: This means that no relations purely in the arbitrary parameters or functions can be present in the input system (with the sole exception of dependency related equations such as $\frac{\partial }{\partial y}f\left(x,y\right)=0$). If a constraint is required for one of these unknowns, then it is no longer truly arbitrary, but rather restricted, so at least one of the unknowns in the constraint must be a solving variable.
 This option generalizes the concept of a field of constants as used in the DifferentialAlgebra package to functions of the independent variables. It is most useful when only generic results are needed, but it may be the case that the result is invalid for specific values of these parameters (for example, if $a$ was a parameter, and it occurred as a denominator, then the solution is only valid for $a\ne 0$).
 • casesplit
 This option indicates that the program should explore all cases. A case split is most often introduced when, among the remaining unsolved equations, there is an equation that is linear in its highest ranked indeterminate (called the leading indeterminate, see rifsimp[ranking] or checkrank), and the coefficient of that indeterminate (called the pivot) may or may not be zero (see rifsimp[cases]) .
 Isolation of the leading indeterminate in this equation introduces a case split -- namely the two possibilities, pivot <> 0 and pivot = 0. The more generic case, pivot <> 0, is explored first. Once that case (possibly containing further case splits) is completed, the case with pivot = 0 is explored. This results in a case tree, which can be represented graphically (see caseplot).
 In addition to producing multiple cases, this option changes the output of rifsimp. For more detail, see rifsimp[output].
 • gensol
 This option indicates that the program should explore all cases that have the possibility of leading to the most general solution of the problem. Occasionally it is possible for rifsimp to compute only the case corresponding to the general solution of the ODE/PDE system. When this option is given, and this occurs, rifsimp will return the single case corresponding to the general solution. When it is not possible for rifsimp to detect (during the computation) where in the case tree the general solution is, then multiple cases are returned, one or more of which correspond to the general solution of the ODE/PDE system, and others may correspond to singular solutions. For some particularly difficult problems, it is possible that the entire case tree is returned. This option is not a post-processing option, as it is designed primarily to reduce the explored cases to those that will contain the general solution, so in some cases the output will contain cases that are clearly singular in comparison to others. If only very specific initial data is required for the output cases, the maxdimsystems command should be used instead. Note: this option cannot be used with the casesplit,casecount, and mindim options.
 • $\mathrm{ctl}='\mathrm{time}'$
 This option imposes a limit on the amount of time (in CPU seconds) that would be required to compute each case from scratch (i.e. using the extended option $\mathrm{casesplit}=[...]$ described in rifsimp[adv_options]). It is clear that this option may count computation time more than once, as the time prior to a case split is counted for each case after the split. This bounds the total time consumed to be no greater than the imposed limit times the number of cases obtained (and most often, significantly less as per the prior comment). For highly nonlinear systems, it may be impossible to obtain all cases in a reasonable amount of time. Use of this option allows the simpler cases to be computed, and the more expensive cases to be deferred. Note: there are two other time limit related options, stl and itl, and these are discussed in the rifsimp[adv_options] page.
 • clean=[cleaning criteria]
 This option is a fine-tuning control over the system(s) output by rifsimp. There are three types of cleaning that the algorithm can perform:
 Pivots: These are the inequations resulting from case splitting in the system (or present on input). As an example, consider the pivot $\frac{ⅆ}{ⅆx}f\left(x\right)\ne 0$. This pivot clearly implies that $f\left(x\right)\ne 0$, so on completion, the pivot $f\left(x\right)\ne 0$ is considered to be redundant. There are three options for specification of pivot cleaning:

 nopiv perform no cleaning, returning all pivots obtained in the course of the computation. piv perform cleaning of obvious redundant pivots (i.e. those that can be detected by inspection of the pivots list on output. fullpiv perform thorough cleaning of pivots, including removal of pivots that are redundant only for solutions of the output case/system.

 Note that the $\mathrm{fullpiv}$ criteria may remove pivots that would require a great deal of computation to recover. For example, consider the simple case described earlier for $\frac{ⅆ}{ⅆx}f\left(x\right)\ne 0$. If later in the algorithm, $\frac{ⅆ}{ⅆx}f\left(x\right)$ was reduced, and looked nothing like the original pivot, on completion $f\left(x\right)\ne 0$, which is a consequence of the original pivot, would be removed.
 One-Term Equations: These are simply equations of the form derivative=0. These are retained in the course of the computation (for efficiency) even when they reduce modulo one of the other equations of the system. These equations can be quite helpful in attempting to integrate of the results of rifsimp. The oneterm criteria indicates that the redundant one-term equations should be removed, while nooneterm indicates that they should be retained.
 Spawn: The spawning process is only used with nonlinear equations in rifsimp, and results in equations that are derivatives of any nonlinear equations in the output. These spawned equations are necessary for the proper running of initialdata and rtaylor. The following options specify spawned equation cleaning:

 nospawn do not remove any redundant spawned equations spawn remove any redundant spawned equations that are guaranteed to retain the same solution structure fullspawn remove all possibly redundant spawned equations.

 Note: Use of the fullspawn option may enlarge the solution space by removing too many equations (the remaining system still always contains the solutions, though it may contain more).
 By default, the clean settings are $\left[\mathrm{piv},\mathrm{oneterm},\mathrm{nospawn}\right]$.
 • $\mathrm{fullclean}$
 This is a shortcut specification for the clean options for rifsimp (see above). This corresponds to the specification $\mathrm{clean}=\left[\mathrm{fullpiv},\mathrm{oneterm},\mathrm{spawn}\right]$.

Examples

 > $\mathrm{with}\left(\mathrm{DEtools}\right):$

This example highlights the difference between treating the unknown y as a constant and treating it as an independent variable; by default, the code assumes that y is a constant.

 > $\mathrm{sys1}≔\left[yf\left(x\right)+g\left(x\right)\right]$
 ${\mathrm{sys1}}{≔}\left[{y}{}{f}{}\left({x}\right){+}{g}{}\left({x}\right)\right]$ (1)
 > $\mathrm{rifsimp}\left(\mathrm{sys1}\right)$
 ${\mathrm{table}}\left(\left[{\mathrm{Pivots}}{=}\left[{y}{\ne }{0}\right]{,}{\mathrm{Case}}{=}\left[\left[{y}{\ne }{0}{,}{f}{}\left({x}\right)\right]\right]{,}{\mathrm{Solved}}{=}\left[{f}{}\left({x}\right){=}{-}\frac{{g}{}\left({x}\right)}{{y}}\right]\right]\right)$ (2)

Specification of y as an independent variable gives the following.

 > $\mathrm{rifsimp}\left(\mathrm{sys1},\mathrm{indep}=\left[x,y\right]\right)$
 ${\mathrm{table}}\left(\left[{\mathrm{Solved}}{=}\left[{f}{}\left({x}\right){=}{0}{,}{g}{}\left({x}\right){=}{0}\right]\right]\right)$ (3)

This next example demonstrates the use of the casesplit option. We consider the Lie-symmetry determining system for the following ODE:

 > $\mathrm{ODE}≔\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}y\left(x\right)+\left(2y\left(x\right)+f\left(x\right)\right)\left(\frac{ⅆ}{ⅆx}y\left(x\right)\right)+\left(\frac{ⅆ}{ⅆx}f\left(x\right)\right)y\left(x\right)$
 ${\mathrm{ODE}}{≔}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{y}{}\left({x}\right){+}\left({2}{}{y}{}\left({x}\right){+}{f}{}\left({x}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{y}{}\left({x}\right)\right){+}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}{y}{}\left({x}\right)$ (4)

The Lie symmetries are given as the solution of the following system of determining PDEs (as generated using DEtools[odepde]):

 > $\mathrm{sys}≔\left\{\mathrm{coeffs}\left(\mathrm{expand}\left(\mathrm{DEtools}[\mathrm{odepde}]\left(\mathrm{ODE},\left[\mathrm{ξ}\left(x,y\right),\mathrm{η}\left(x,y\right)\right],y\left(x\right)\right)\right),\mathrm{_y1}\right)\right\}$
 ${\mathrm{sys}}{≔}\left\{{-}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{y}}^{{2}}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){,}\frac{{{\partial }}^{{2}}}{{\partial }{{y}}^{{2}}}{}{\mathrm{η}}{}\left({x}{,}{y}\right){-}{2}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{y}{}{\partial }{x}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){+}{4}{}\left(\frac{{\partial }}{{\partial }{y}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}{y}{+}{2}{}\left(\frac{{\partial }}{{\partial }{y}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}{f}{}\left({x}\right){,}\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}{}{\mathrm{η}}{}\left({x}{,}{y}\right){+}{\mathrm{η}}{}\left({x}{,}{y}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){+}{2}{}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{η}}{}\left({x}{,}{y}\right)\right){}{y}{+}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{η}}{}\left({x}{,}{y}\right)\right){}{f}{}\left({x}\right){+}{2}{}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}{y}{-}\left(\frac{{\partial }}{{\partial }{y}}{}{\mathrm{η}}{}\left({x}{,}{y}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}{y}{+}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)\right){}{y}{,}{2}{}\left(\frac{{{\partial }}^{{2}}}{{\partial }{y}{}{\partial }{x}}{}{\mathrm{η}}{}\left({x}{,}{y}\right)\right){-}\left(\frac{{{\partial }}^{{2}}}{{\partial }{{x}}^{{2}}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){+}{2}{}{\mathrm{η}}{}\left({x}{,}{y}\right){+}{2}{}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}{y}{+}\left(\frac{{\partial }}{{\partial }{x}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}{f}{}\left({x}\right){+}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){+}{3}{}\left(\frac{{\partial }}{{\partial }{y}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}{y}\right\}$ (5)

So running this system with rifsimp:

 > $\mathrm{ans}≔\mathrm{rifsimp}\left(\mathrm{sys},\left[\mathrm{ξ},\mathrm{η}\right]\right):$
 > ${\mathrm{ans}}_{'\mathrm{Solved}'}$
 $\left[{\mathrm{ξ}}{}\left({x}{,}{y}\right){=}{0}{,}{\mathrm{η}}{}\left({x}{,}{y}\right){=}{0}\right]$ (6)

And we see that the given ODE has no point symmetries for general $f\left(x\right)$.

We may want to know if there are particular forms of $f\left(x\right)$ for which point symmetries exist (this is called a classification problem). Running rifsimp with casesplit:

 > $\mathrm{ans}≔\mathrm{rifsimp}\left(\mathrm{sys},\left[\mathrm{ξ},\mathrm{η}\right],\mathrm{casesplit}\right):$
 > ${\mathrm{ans}}_{'\mathrm{casecount}'}$
 ${4}$ (7)

so we see there are cases.

We could use the caseplot command to give a pictorial view of the case tree with the following command.

 > $\mathrm{caseplot}\left(\mathrm{ans}\right)$

Looking at case 3 in detail:

 > $\mathrm{copy}\left({\mathrm{ans}}_{3}\right)$
 ${\mathrm{table}}\left(\left[{\mathrm{Pivots}}{=}\left[\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right){\ne }{0}\right]{,}{\mathrm{Case}}{=}\left[\left[{-}{2}{}{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right)}^{{2}}{}{f}{}\left({x}\right){+}{2}{}{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right)}^{{2}}{}{y}{+}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)\right){}{{f}{}\left({x}\right)}^{{2}}{+}{2}{}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)\right){}{f}{}\left({x}\right){}{y}{+}\left(\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}{}{f}{}\left({x}\right)\right){}{f}{}\left({x}\right){+}{2}{}\left(\frac{{{ⅆ}}^{{3}}}{{ⅆ}{{x}}^{{3}}}{}{f}{}\left({x}\right)\right){}{y}{-}{3}{}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}\left(\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)\right){=}{0}{,}{\mathrm{ξ}}{}\left({x}{,}{y}\right)\right]{,}\left[\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right){\ne }{0}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right)\right]\right]{,}{\mathrm{Solved}}{=}\left[\frac{{\partial }}{{\partial }{x}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right){=}\frac{{-}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){-}{2}{}{\mathrm{η}}{}\left({x}{,}{y}\right)}{{f}{}\left({x}\right){+}{2}{}{y}}{,}\frac{{\partial }}{{\partial }{x}}{}{\mathrm{η}}{}\left({x}{,}{y}\right){=}\frac{\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}\left({{f}{}\left({x}\right)}^{{2}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right){+}{2}{}{f}{}\left({x}\right){}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}{y}{+}{2}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){+}{4}{}{\mathrm{η}}{}\left({x}{,}{y}\right)\right)}{{2}{}{f}{}\left({x}\right){+}{4}{}{y}}{,}\frac{{\partial }}{{\partial }{y}}{}{\mathrm{ξ}}{}\left({x}{,}{y}\right){=}{0}{,}\frac{{\partial }}{{\partial }{y}}{}{\mathrm{η}}{}\left({x}{,}{y}\right){=}\frac{{-}{\mathrm{ξ}}{}\left({x}{,}{y}\right){}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){-}{2}{}{\mathrm{η}}{}\left({x}{,}{y}\right)}{{-}{f}{}\left({x}\right){-}{2}{}{y}}{,}\frac{{{ⅆ}}^{{2}}}{{ⅆ}{{x}}^{{2}}}{}{f}{}\left({x}\right){=}{-}\left(\frac{{ⅆ}}{{ⅆ}{x}}{}{f}{}\left({x}\right)\right){}{f}{}\left({x}\right)\right]\right]\right)$ (8)

so we see we have a 2 parameter Lie group for the specific form of $f\left(x\right)$ given by:

 > $\mathrm{dsolve}\left(\frac{{ⅆ}^{2}}{ⅆ{x}^{2}}f\left(x\right)=-f\left(x\right)\left(\frac{ⅆ}{ⅆx}f\left(x\right)\right)\right)$
 ${f}{}\left({x}\right){=}\frac{{\mathrm{tanh}}{}\left(\frac{{1}}{{2}}{}\frac{\left({x}{+}{\mathrm{_C2}}\right){}\sqrt{{2}}}{{\mathrm{_C1}}}\right){}\sqrt{{2}}}{{\mathrm{_C1}}}$ (9)

format: plain


text:
# What is the Mach angle of the flow ?

What is the Mach angle for a flow at Mach 2.0 ?

Asked on 2nd October 2019 in
Mach angle for a flow is defined as $\mu =sin^{-1}\left ( \frac{1}{M} \right )$
$$\\\Rightarrow \mu =sin^{-1}\left ( \frac{1}{2.0} \right ) \\\Rightarrow \mu =sin^{-1}\left ( 0.5 \right ) \\\Rightarrow \mu =30^{\circ}$$


text:
# 2.14.1.9 imgFile

## Brief Information

Open dialog to select image file

X-Function not designed for Auto GetN Dialog.

 1. imgFile; // the image full path will be stored in system variable fname$ 2. imgFile title:="String As Input";  ## X-Function Execution Options ## Variables Display Name Variable Name I/O and Type Default Value Description image file fname Output string fname$

The string that will receive path and name of the user's chosen file.

dialog title title

Input

string

input dialog title.

## Description

This X-Function opens a dialog to select an image file and store the file name in a string variable.

## Examples

The following example shows how to pick an external image and then use insertImg2g X-Function to insert the image as the background of your graph:

    if (exist(%H, 3) == 3) {    // check if the current activated page is a graph window or not
string strImgFullPath$; imgFile fname:=strImgFullPath$ title:="Pick Your Image"; //open a dialog to pick image. the full path of the selected file will be stored in a string variable called strImgFullPath$insertImg2g fname:=strImgFullPath$ type:=0 xyp:=2;    // insert the picked image into the current graphlayer as background
}


text:
Try out our new practice tests completely free!
Solved

# Assume Markup Is Based on Cost

Question 66
Essay
Question 66
Essay

## Assume markup is based on cost. If the cost of a table is $62 and it sells for$110, what is the percent of markup based on cost? Round to the nearest hundredth percent.

Choose question tag

10+ million students use Quizplus to study and prepare for their homework, quizzes and exams through 20m+ questions in 300k quizzes.

Explore our library and get Management Homework Help with various study sets and a huge amount of quizzes and questions

Get Free Access Now!
Textbook Solutions

Find all the solutions to your textbooks, reveal answers you would’t find elsewhere

Search By Image

Scan any paper and upload it to find exam solutions and many more

Flashcards

Studying is made a lot easier and more fun with our online flashcards


text:
PythonServer Side ProgrammingProgramming

Suppose we have given two non-empty linked lists. These two lists are representing two non-negative integer numbers. The digits are stored in reverse order. Each of their nodes contains only one digit. Add the two numbers and return the result as a linked list. We are taking the assumption that the two numbers do not contain any leading zeros, except the number 0 itself. So if the numbers are 120 + 230, then the linked lists will be [0 → 2 → 1] + [0 → 3 → 2] = [0 → 5 → 3] = 350.

To solve this, we will follow these steps

• Take two lists l1 and l2. Initialize head and temp as null
• c := 0
• while l1 and l2 both are non-empty lists
• if l1 is non-empty, then set a := 0, otherwise set a := l1.val
• if l2 is non-empty, then set b := 0, otherwise set b := l2.val
• n := a + b + c
• if n > 9, then c := 1 otherwise 0
• node := create a new node with value n mod 10
• head := node and temp := node

• otherwise
• l1 := next node of l1, if l1 exists
• l2 := next node of l2, if l2 exists
• if c is non-zero, then
• node := new node with value 1, next of head := node
• return temp

Example(Python)

Let us see the following implementation to get a better understanding

Live Demo

class ListNode:
def __init__(self, data, next = None):
self.val = data
self.next = next
def make_list(elements):
for element in elements[1:]:
while ptr.next:
ptr = ptr.next
ptr.next = ListNode(element)
print('[', end = "")
while ptr:
print(ptr.val, end = ", ")
ptr = ptr.next
print(']')
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
temp = None
c = 0
while l1 or l2:
if not l1:
a= 0
else:
a = l1.val
if not l2:
b=0
else:
b = l2.val
n = a +b + c
c = 1 if n>9 else 0
node = ListNode(n%10)
temp = node
else:
l1 = l1.next if l1 else None
l2 = l2.next if l2 else None
if c:
node = ListNode(1)
return temp
ob1 = Solution()
l1 = make_list([0,2,1])
l2 = make_list([0,3,2])
print_list(ob1.addTwoNumbers(l1, l2))

Input

[0,2,1]
[0,3,2]

Output

[0,5,3]
Updated on 27-Apr-2020 11:03:33


text:
Signals and Systems questions

1. Aug 28, 2005

mathrocks

I have a question about finding the signal energy of a signal? What exactly are you suppose to do when you are given a certain function like
x(t)=rect(t) sin(2*pi*t)?

2. Aug 28, 2005

Staff: Mentor

To calculate energy, you will need the voltage and current relationships over time, or else the voltage over time and the impedance that the voltage is across. What's the context of the question?

3. Aug 28, 2005

Antiphon

You would assume that X(t) is a voltage on a resistor and compute the
time integral of $$1/2 x^2(t) /R$$.

4. Aug 30, 2005

balakrishnan_v

0.5 is the energy

5. Oct 5, 2005

abdo375

What the Hell are you all talking about ?
to find the signals energy you need to find
the limit when t tends to infinity of the the integration of the square of the given function over it's period


text:
# (TCO 1) The principle managers follow when they only investigate significant departures from the...

(TCO
1) The principle managers follow when they only investigate significant
departures from the plan is commonly known as

small
amounts don’t matter

only
materials and labor deserve attention

management
by exception

exceptional
costs yield exception results

2.

Question :

(TCO
1) Which of the following isnot likely to
be a fixed cost?

Direct
materials

Rent

Depreciation

Salary of the
human resources director

3.

Question :

(TCO
2) Which of the following is not a manufacturing cost?

Manufacturing

Direct materials

Direct
labor

expenses

4.

Question :

(TCO
2) An allocation base is

a
common characteristic that jobs share, which is used to spread the overhead
costs among the various jobs.

the
minimum amount of overhead assigned to a job.

used to determine
how many labor hours were needed to complete a job.

used
to authorize the release of materials from the storeroom to the production
area.

5.

Question :

(TCO
3) Equivalent units are calculated by

taking
the units needed to complete the beginning inventory, adding
units started and taking the equivalent units in ending inventory

taking
the units completed plus the equivalent units in ending inventory.

taking
the total units to account for and subtracting equivalent units in ending
inventory

taking
units started plus units transferred out.

6.

Question :

(TCO
3) In the assembly department, all the direct materials are added at the
beginning of the processing. Beginning Work in Process inventory consists
of 2,000 units with a direct materials cost of $31,860. During the period, 15,000 units are started and direct materials costing$250,000 are charged
to the department. If there are 1,000 units in ending inventory, what is
the cost per equivalent unit?

$15.93$15.63

$14.83$16.58

7.

Question :

(TCO
4) Regression analysis

uses
all the available data points to estimate a cost equation

can
be performed by many spreadsheet programs

provides an
equation that can be used to estimate total costs at different levels

all of the
above

8.

Question :

(TCO
4) The number of units that must be sold to exactly cover its fixed and
variable costs is the

contribution
margin

break-even
point

relevant range

margin of
safety

9.

Question :

(TCO
5) Which of the following is treated as a product cost in variable costing?

Sales
commissions

salaries

Fixed

Direct
labor

10.

Question :

(TCO
5) If the number of units sold is less than the number of units produced

full
costing and variable costing will yield the same net income.

.gif” alt=”CORRECT”>

full
costing will assign some fixed manufacturing overhead to the units in the
ending inventory.

net
income will be higher under variable costing than under full costing.

inventory
levels will decrease.

11.

Question :

(TCO
6) A contract which specifies that the suppler will be paid for the cost of
production as well as some fixed amount or percentage of cost is called
a(n)

approved
overrun.

.gif” alt=”CORRECT”>

cost-plus
contract.

allocation
plan.

indirect
cost budget.

12.

Question :

(TCO
6) Which of the following is not generally true when a company compares ABC

13.

Question :

(TCO
7) Fixed costs that will be eliminated if a particular course of action is
undertaken are called

(TCO 7) Common costs

2.

Question :

(TCO
8) Target costing

3.

Question :

(TCO
8) Which of the following are relevant in deciding whether to accept or
reject a special order?

4.

Question :

(TCO
9) Present value techniques

5.

Question :

(TCO
9) The internal rate of return

6.

Question :

(TCO
10) A method of budget preparation that requires all budgeted amounts to be
justified by the department, even if the amounts were supported in prior
periods, is called

7.

Question :

(TCO
10) Which budget is prepared first?

8.

Question :

(TCO
10) The standard cost is

9.

Question :

(TCO
10) In general, an unfavorable material variance arises from

10.

Question :

(TCO
10) The type of center that has responsibility for generating revenue as
well as controlling costs is a(n)

11.

Question :

(TCO
10) Responsibility accounting holds managers responsible for

12.

Question :

(TCO
10) Which ratio measures the rate earned on total capital provided by the
owners?

(TCO 1) Distinguish managerial accounting from financial accounting.
Include a brief discussion of the differences in the types of information
provided to users as well as the differences of the users of the accounting
information.

2.

Question :

(TCO
6) Booth Financial Services, LLC has two revenue producing
departments, Financial Planning and Business Consulting. The
accounting department is trying to determine the best method to allocate
$1,000,000 of common costs (secretarial staff, reception personnel, etc), either by salary or number of employees. Information on the revenue departments are as follows: Department Employees Salaries Financial Planning 150 employees$10,000,000

Consulting

50 employees

$5,000,000 (a) Allocate the$1,000,000 common costs to the two revenue departments
using both methods.

(b) Why are allocations called arbitrary?

3.

Question :

(TCO
10) Charlie Corp sells it products on both credit and cash
basis. Monthly sales are sold 20% for cash, 80% for
credit. Credit sales are collected 40% in the month of sale and 60%
the following month. Sales for the first quarter are as follows:

January $100,000 February$150,000

March $125,000 Compute cash collections for February. 4. Question : (TCO 2) Acme Fireworks uses a traditional overhead allocation based on direct labor hours. For the current year overhead is estimated at$1,000,000 and direct labor hours are budgeted at 200,000
hours. Actual hours worked were 195,000 and actual overhead was
$978,000. (a) Compute the predetermined manufacturing overhead rate. (b) Compute the applied manufacturing overhead. (c) Compute the amount of over/under applied manufacturing overhead. (TCO 9) An investment of$185,575 is expected to generate returns of
$65,000 per year for each of the next four years. What is the investment’s internal rate of return? 2. Question : (TCO 4) Legal Docs Inc is a legal services firm that files incorporation papers for small businesses. They charge$1,000 per application. This
year’s income statement shows the following:

Sales $1,295,000 Variable Expenses$1,023,000

Contribution margin $272,000 Fixed costs$250,000

Profit $22,000 Required: (a) Compute the break-even point in units. (b) Compute the contribution margin ratio. (c) Compute the current margin of safety. (d) How many applications must the company sell to make a profit of$350,000?

3.

Question :

(TCO
5) The following data has been taken from Air-Tite company in its first

Units produced 100,000

Units sold 80,000

Units in ending inventory 20,000

(a) Compute the amount of fixed manufacturing overhead that would be
expensed in the current year if full absorption costing is used.

(b) Compute the amount of fixed manufacturing overhead that would be
expensed in the current year if variable costing is used.

(c) Compute the amount of fixed manufacturing overhead that would be
included in ending inventory under full absorption costing.


text:
# \gls inside caption without protect

Is it possible to use \gls (from the glossaries package) inside a caption without \protecting it every single time? The glossaries package says the \gls command is not fragile... but I get errors unless I protect it.

Kind of annoying since half the advantage of a glossary/acronym package is reducing the amount of typing you have to repeat.

\documentclass{article}
\usepackage{caption}
\usepackage{glossaries}

\newglossaryentry{Name}{name={Name},description={Description}}

\makeglossaries

\begin{document}

\begin{figure}[h]
\caption{Blah blah \protect\gls{name}}
\end{figure}

\end{document}

If you remove the protect it will complain about an extra }.

-
Robustify appears to have worked. Thanks! Why would it compile without that for you but not me? –  Jack Oct 7 '11 at 9:00


text:
# Achieving a True Global Shutter with Large Format, Back-Illuminated CMOSTechnical Notes

## Introduction

CMOS sensor technology has steadily improved over the last decade, and is now the standard for many applications such as security, machine vision, and handheld imaging systems. Compared to long established sensor technologies such as CCD and EMCCD, CMOS delivers the optimal combination of speed, noise performance, low power and compact size. In addition, large scale production of these sensors has enabled the expansion of vision technology into many new and expanding markets.

However, two factors have limited the adoption of CMOS sensors into more demanding applications. Firstly the ‘rolling shutter’ architecture of CMOS devices can introduce artifacts for imaging dynamic objects, not present with the ‘global shutter’ architecture of CCD and EMCCD sensors. Secondly the reduced quantum efficiency (sensitivity to photons) of so-called ‘front-illuminated’ CMOS, compared to the more sensitive ‘back-illuminated’ sensors common for CCD and EMCCD.

Scientific CMOS sensors have been developed previously able to improve on one of these factors, but never both. But thanks to innovations in the design of LACera™ Technology sensors, global shutter, back-illuminated sensors are now possible in scientific imaging, enabling CMOS technology to lead the way in yet more imaging applications.

## What is Global Shutter?

When cameras have finished exposing an image, the acquired signal must be read out. The pixel will be reset, the signal in the form of collected photoelectrons cleared, and the sensor made ready to expose the next frame. Ideally, this process should happen simultaneously across the entire sensor as found in full frame CCD’s. For the majority of CMOS cameras however, this process is performed row-by-row, ‘rolling’ down the sensor, called a rolling shutter. This means the exposure of the sensor to light occurs at different times for each line of l the sensor. This is shown in Figure 1A below.

In applications where there is no relative motion between the subject and the camera, rolling shutter is not an issue. However, in dynamic scenes, due to motion or varying light/signal intensity, rolling shutter mode will introduce image distortions. These ‘rolling shutter artifacts’ are discussed more on the next page. For many imaging applications, a far more desirable sensor modality would be a Global Shutter which exposes and resets every row of the camera simultaneously, as shown in Figure 1B.

## Limitations of current CMOS cameras

### Rolling Shutter Artifacts

When imaging moving objects, or moving a camera’s field of view during acquisition, all cameras are susceptible to some imaging artifacts such as motion blur when using an exposure time that is long compared to the motion of the object. But for rolling shutter cameras, an additional artifact can be introduced if any movement is of a similar timescale to the rolling shutter sequence.

For large-scale movements such as large objects in view, or simultaneous movement across the whole field of view, the ‘frame time’, which is the time between the start of the exposure of the top and bottom lines as shown in Figure 1, is the relevant timescale. For CMOS cameras, frame times vary but can typically be around 20ms. If the object moves visibly during 20ms, rolling shutter artifacts such as Figure 2 will be visible.

For small-scale movements, for example an object that covers only several pixels of the field of view, faster movements can still be captured, as now the ‘line time’, the time for the rolling shutter to move from one line to the next, is relevant. This is the frame time divided by the number of rows, typically around 10 microseconds.

With global shutter acquisition, these artifacts are avoided, which can be key for many applications. Global shutter CMOS cameras are more rare than rolling shutter CMOS cameras, and producing highly sensitive global shutter CMOS cameras is an even greater challenge. CMOS cameras allow higher speed acquisition than either CCD or EMCCD, the previous dominant technologies. Thanks to innovations in Teledyne sensor technology, even greater sensitivity is possible, which is key for enabling short exposure times and high speed acquisition.

### High Speed Events

Not only does the rolling shutter introduce the possibility of artifacts, it also determines the effective minimum exposure time for the entire sensor. Some high-speed events occur on timescales much shorter than the ~20ms frame time for a typical CMOS, however the rolling shutter means that whatever exposure time we choose, the entire frame will have been captured over 20ms. This could be 3 or more orders of magnitude longer than the true minimum exposure time of a global shutter camera.

### Increasing Sensitivity: Front vs Back-Illuminated CMOS Sensors

For practically all aspects of imaging, especially high-speed imaging, camera sensitivity is a vital aspect of the suitability of a camera to an application. One key factor that determines sensitivity is Quantum Efficiency (QE), the effectiveness of the camera to produce electronic charge (electrons) from incident light (photons), before measurement. QE is defined as a percentage of photons converted to electrons.

The main determining factor of Quantum Efficiency is the sensor’s use of Front or Back-side illumination. When sCMOS technology was first emerging, all CMOS sensors were front-illuminated, meaning that a certain fraction of each pixel surface was covered by metal wiring and circuitry for collection and transportation of charge. This was a simpler way to manufacture sensors, but had the drawback of making these areas light-insensitive, physically blocking light (as seen in Fig.3) being detected.

Higher QEs were made possible through adding microlenses onto the sensor surface (see Figure 3), which could focus incident light onto the silicon substrate. However, even with optimally designed microlenses, at least 20% of incoming photons will be lost, with many more lost if the light approaches the sensor at an angle, as shown in Figure 4. For challenging applications such as astronomy, this sensitivity cost is typically too high.

To improve quantum efficiency, CCDs and EMCCDs have used an alternative sensor design called Back Illumination for many years. Back-illuminated sensors are essentially flipped over so that light enters directly into the silicon substrate, the silicon is thinned down to only the light-sensitive region.

The result is a sensor with a near-perfect 90+% QE at the peak. However, due to the greater challenges to manufacture back-illuminated CMOS devices, back-illumination only came to scientific-grade CMOS cameras in 2016. Compared to front-illumination, back-illumination results in a 10-15% QE increase across the standard 400-1100 nm field, even unlocking additional wavelengths less than 400 nm. Further, back-illumination also removes the dependence of the QE upon the angle of incidence.

## The Challenge of Back-Illuminated Global Shutter CMOS

### How is Global Shutter achieved on CMOS?

Whether a CMOS camera has a rolling shutter or a global shutter, the process of reading the signals happens row-by-row, as each row is passed to that column’s Analogue to Digital Converter (ADC) to be measured. For rolling shutter cameras, the readout for a row happens immediately after the end of the exposure of the row, moving on to the next row once readout is complete. To achieve a global shutter, exposure must start and end simultaneously, with readout happening after all pixels are exposed. In this case the exposure is ended through simultaneously moving each pixel’s acquired photoelectrons into a storage area in the pixel. The exposure and readout sequence then is the following:

1. Begin exposure for all rows simultaneously by resetting the charges stored in the pixel (the photodiode), and the storage (called the floating diffusion, FD).
2. Photons are then collected for the specified exposure time
3. End the exposure of the image formed by moving the acquired photoelectrons into the storage area within each pixel, where they await readout.
4. Row by row, read the voltage corresponding to each pixel from the floating diffusion.
5. Reset the floating diffusion’s voltage to the default ‘bias’ value, and measure this once again to give a more accurate baseline for the signal. Repeat for the next row.
6. Repeat this sequence for each frame

### Parasitic Light Sensitivity

The Floating Diffusion (FD) where charge is stored before readout is in fact light-sensitive, meaning if photons reach this area after the end of an exposure but before the readout process occurs for that pixel, anomalous signal can be recorded. This is known as ‘parasitic’ light sensitivity (PLS). This is defined as:

${\mathrm{PLS}}_{}=\frac{\mathrm{Additional Photoelectrons}}{\mathrm{Signal Photoelectrons}}x\mathrm{100%}$

For front-illuminated devices, the FD is hidden under the wiring that blocks incoming photons. In this case, the FD is exposed to very few photons, with only a small number being deflected into the FD by the microlenses of the camera.

For back-illuminated devices however, global shutter acquisition without appreciable PLS was previously impossible for scientific cameras, as the rearrangement of the pixel to allow greater sensitivity also exposed the FD to light. PLS could effectively introduce rolling shutter artifacts into global shutter images, and lead to uneven exposure to light across the frame. For precise scientific imaging applications, despite the advantages of back-illumination for sensitivity, PLS previously ruled out the use of global shutter sensor architecture.

## LACera Technology: Achieving Back-Illuminated Global Shutter CMOS

To bring together the unmatched sensitivity of back-illuminated CMOS and the distortion-free images of Global Shutter would require a fundamental redesign of components of the sensor. At Teledyne, we were able to leverage our influence over the sensor production process for LACera technology to optimize the pixel geometry and significantly reduce the possibility of parasitic light capture.

Through this innovation, sensitivity and optimum sensor behavior are united in a single scientific-grade sensor technology for the first time. For applications requiring high-speed, low-light or distortion-free images, LACera technology opens the door to CMOS technology and all the improvements it brings for scientific imaging.

LACera represents a critical element of advanced imaging solutions and is only possible with the nature and scale of Teledyne. From pixel, sensor, and ROIC design, through low noise electronics, to deep cooling, and system interface, Teledyne is the only company capable of delivering this one hundred percent organic solution in large-format CMOS.

## Conclusions

With LACera technology, there is no longer any compromise between maximizing sensitivity through light collection and the ability to capture images at high speed free of rolling shutter artifacts, essential for many applications.


text:
Physics | eguruchela | all physics formulas at one place

### Mechanics

 Dynamics Forces Statics Conservation Laws Work And Energy Mechanics Of Fluids


text:
0

# I am having a problem with teleporting a tool with coordinates?

Edited 2 months ago

I'm trying to make it so when you touch this button, the tool clones itself and teleports to these coordinates (-98.839, -111.395, -59.275) but I can't figure it out. My script:

game.Workspace.spawnbutton.Transparency = 0
local clone = game.Workspace.RoomKey:Clone()
local KEYDOOR = game.Workspace.RoomKey
script.Parent.Touched:Connect(function()
game.Workspace.spawnbutton.Transparency = 1
clone.Parent = workspace
clone:SetPrimaryPartCFrame(CFrame.new(246.009, 3.819, 252.988))
wait (3)
game.Workspace.spawnbutton.Transparency = 0
--script.Parent.ClickDetector.MouseClick:Connect((onclick))
end)

0
The tool doesn't have the ':SetPrimaryPartCFrame' function; only 'Models' do. Try teleporting the tool's handle. DiamondComplex 270 — 2mo

0

Your defining CFrame incorrectly. CFrame contains both position and orientation. ex.

local CFrame = CFrame.new(position, orientation)

In addition when defining information like position you need to do so as a Vector3, which are their own data type. ex.

Part.Position = Vector3.new(10,15,20)

In your case, I would suggest editing the position of the tool rather than its CFrame, this is just cause personally I'm not too experienced and I don't understand some of the more nuanced functions of CFrame. But if your dead set on using CFrame I would suggest looking online for some more on how to use CFrame such as:


text:
# What's next in the series: Sum, Product, ...

• Feb 11th 2011, 05:54 AM
idmillington
What's next in the series: Sum, Product, ...
Its been a while since my undergrad math, and I couldn't find this by obvious searching.

So I know about hyper operations: addition, multiplication, exponentiation, tetration, pentation etc. And about the various ways to write them.

Now, multiplication is repeated addition. And a summation expression is also repeated addition (just with the possibility of different summands), similarly a product expression is a generalisation of exponentiation with different products. What is the equivalent of tetration?

In other words, how would you write

$a_1^{a_2^{a_3^{...^{a_n}}}$

where $a_1,a_2,a_3, ..., a_n$ are given by some expression in terms of n, and what is it called (if anything), if I want to find out more about its mathematical properties?

The best I came up with was using Knuth's big-arrow notation as:

$\mathop{\mbox{\Large \uparrow}^0}\limits_{1}^{n} a_n$

Which would obviously be elegant for things higher than repeated exponentiation, but that zero superscript looks inelegant.

And besides, it doesn't help me know if it has a name or where to find its properties.

Or yet another, simpler, way: what's next in the series: Sum, Product, ...?


text:
# How to exclude a range of values in an interval

i'm trying to draw an irrotational vortex with this function:

ListVectorPlot[Table[{-y/(x^2 + y^2), x/(x^2 + y^2)}, {x, -3, 3, 3}, {y, -3, 3, 3}]]

But as you can see this function has a singularity in the origin, so how can i exclude a certain range of values close to the origin?

Thanks?

• Could use If[] in Table[] to eliminate the singular points at the outset. – J. M.'s technical difficulties Oct 15 '18 at 9:09
• Thanks but how? If[x==y==0, ?, ?] – MementoMori Oct 15 '18 at 9:16
• Yes, like that. Table[If[x == y == 0, {0, 0}, (* stuff *)], (* stuff *)]. – J. M.'s technical difficulties Oct 15 '18 at 9:23

A bit hacky, but you can do this:

Quiet[
ListVectorPlot[
Table[
{-y/(x^2 + y^2), x/(x^2 + y^2)},
{x, -3, 3, 1}, {y, -3, 3, 1}
] /. Indeterminate -> 0
]
]

ListVectorPlot[
Table[{y/(x^2+y^2+2),-x/(x^2+y^2+2)},{x,-3,3,0.3},{y,-3,3,0.3}],PlotTheme -> "Minimal"]

You can pre-specify the points you wish to plot. Here's one way of doing so using CirclePoints, which allows you to easily specify a minimum radius:

With[{pts =
Flatten[Table[CirclePoints[n/2, 4*n + 1], {n, 1, 6}], 1]},
ListVectorPlot[
N@Map[Replace[p : {x_, y_} :> {p, {-y, x}/(x^2 + y^2)}], pts]]]


text:
Timing attacks on homomorphic encryption

I've been wondering for a long time about programs that could potentially break fully homomorphic encryption schemes:

//Given input vector A
if(A[0] == A[1])
while(true) ; // or do any time consuming calculation
else
return <anything>;

System could execute such programs and using timing methods determine information about encrypted data. It could of course ask more clever questions about the data than equality and possibly decode full encrypted vector.

What is wrong with my thinking here?

1 Answer

It is not possible since the IF condition with semantically secure FHE's can be implemented as

$$Q = (A * S) + (B * S'),$$ this circuit is the combinational logic of the if/else statement and we can construct this with FHE.

• FHE encrypted $$S$$ is the input by the if statement ( the boolean expression part).
• FHE encrypted $$A$$ is the input by the then statement
• FHE encrypted $$B$$ is the input by the else statement
• FHE encrypted $$Q$$ is the output of the expression.

This is for calculation of the ternary operator Q = S ? A : B;

The IF condition must be implemented in this way. This is due to the semantical security that prevents the output of the comparison circuit to be known to the evaluator. The above circuit will reveal nothing to any observer. Actually, a similar calculation is also performed during normal programming to mitigate the side-channels.

Note that the == can be achieved with 2's complement and substruction. For a little detail see this answer : Representing a function as FHE circuit

One might also wonder that does the comparison circuits in FHE are constant timing, the answer yes since we don't have IF then return/break statements.


text:
DeepAI

# Improved Concentration Bounds for Conditional Value-at-Risk and Cumulative Prospect Theory using Wasserstein distance

Known finite-sample concentration bounds for the Wasserstein distance between the empirical and true distribution of a random variable are used to derive a two-sided concentration bound for the error between the true conditional value-at-risk (CVaR) of a (possibly unbounded) random variable and a standard estimate of its CVaR computed from an i.i.d. sample. The bound applies under fairly general assumptions on the random variable, and improves upon previous bounds which were either one sided, or applied only to bounded random variables. Specializations of the bound to sub-Gaussian and sub-exponential random variables are also derived. A similar procedure is followed to derive concentration bounds for the error between the true and estimated Cumulative Prospect Theory (CPT) value of a random variable, in cases where the random variable is bounded or sub-Gaussian. These bounds are shown to match a known bound in the bounded case, and improve upon the known bound in the sub-Gaussian case. The usefulness of the bounds is illustrated through an algorithm, and corresponding regret bound for a stochastic bandit problem, where the underlying risk measure to be optimized is CVaR.

• 4 publications
• 21 publications
08/06/2018

### Concentration bounds for empirical conditional value-at-risk: The unbounded case

In several real-world applications involving decision making under uncer...
07/29/2021

### Wasserstein Conditional Independence Testing

We introduce a test for the conditional independence of random variables...
02/04/2021

### Sharper Sub-Weibull Concentrations: Non-asymptotic Bai-Yin Theorem

Arising in high-dimensional probability, non-asymptotic concentration in...
12/22/2019

### Estimation of Spectral Risk Measures

We consider the problem of estimating a spectral risk measure (SRM) from...
07/01/2020

### The Restricted Isometry of ReLU Networks: Generalization through Norm Concentration

While regression tasks aim at interpolating a relation on the entire inp...
07/11/2016

### Minimum Description Length Principle in Supervised Learning with Application to Lasso

The minimum description length (MDL) principle in supervised learning is...
04/27/2018

### Convergence and Concentration of Empirical Measures under Wasserstein Distance in Unbounded Functional Spaces

We provide upper bounds of the expected Wasserstein distance between a p...


text:
Table 4

Sensitivity and scenario analyses to assess the impact of the uncertainties around productivity, mortality and economic data inputs on productivity-adjusted life years (PALY) lost in those with diabetes in the Bangladeshi population and the associated economic impact

 PALYs lost due to diabetes % change in PALYs lost compared with base case GDP lost (US$billion) GDP lost per person with diabetes (US$) Base case 9 273 217 97.4 16 987 Productivity indices upper uncertainty bound* 8 773 791 −5.4 92.3 16 098 Productivity indices lower uncertainty bound* 9 417 270 +1.6 98.8 17 241 Labour force dropout upper uncertainty bound† 7 728 881 −16.7 81.8 14 275 Labour force dropout lower uncertainty bound† 10 817 553 +16.7 112.9 19 699 Upper uncertainty bound of all-cause mortality risk associated with diabetes‡ 11 159 921 +20.5 118.0 20 574 Lower uncertainty bound of all-cause mortality risk associated with diabetes‡ 8 466 438 −8.7 88.6 15 446 Temporal trend in population mortality risk is doubled to a 2% reduction per year§ 9 158 579 −1.2 96.1 16 759 No temporal trend in population mortality risk§ 9 401 616 +1.2 98.9 17 243 Annual GDP growth rate is doubled to 3.6% per year¶ 112.9 19.692 No temporal trend in GDP¶ 81.9 14 283 Annual discount rate increased to 5%** 7 691 123 −17.1 79.0 13 780 Annual discount rate reduced to 1.5%** 10 875 985 +17.3 116.5 20 313
• *Sensitivity analyses 1 and 2 apply (1) a 25% reduction and (2) a 25% increase in absenteeism estimate, holding all other model inputs constant.

• †Sensitivity analyses 3 and 4 apply (3) a 25% reduction and (4) a 25% increase in diabetes-related labour force dropout estimates, holding all other model inputs constant.

• ‡Sensitivity analyses 5 and 6 apply (5) the lower bound of the 95% CI and (6) the upper bound of the 95% CI around the estimate of relative risk of all-cause mortality associated with diabetes, holding all other model inputs constant.

• §Scenario analyses 7 and 8 apply (7) double the annual reduction in mortality risk to 2% per year and (8) no temporal trend in population mortality risk, holding all other model inputs constant.

• ¶Sensitivity analyses 9 and 10 apply (9) double the annual growth rate in GDP to 3.6% per year and (10) no temporal trend in GDP across the model, holding all other model inputs constant. These sensitivity analyses do not affect the number of PALYs lived but do affect their assumed value and therefore the resulting GDP lost.

• **Sensitivity analyses 11 and 12 apply an annual discount rate (11) increased to 5% (in line with the WHO standard annual rate) and (12) reduced to 1.5%.

• GDP, gross domestic product.


text:
# Hex, Bugs and More Physics | Emre S. Tasci

a blog about physics, computation, computational physics and materials…

## POSCAR2findsymm

### March 24, 2009 Posted by Emre S. Tasci

A very simple code I wrote while studying the Python language that fetches the information from a VASP POSCAR file and prepares (and feeds) the input for Harold Stokes’ findsym (you should actually download the executable included in the ISOTROPY package instead of the referred web version) program to find the unit cell symmetry.

#!/usr/bin/python
# -*- coding: utf-8 -*-

"""
POSCAR2findsym.py
/* Emre S. Tasci <e.tasci@tudelft.nl>                    *
A simple python code that parses the POSCAR file,
prepares an input file for Harold Stokes' findsym
(http://stokes.byu.edu/isotropy.html)
executable.

Then, checks the current system to see if findsym is
accessible: if it is, then feeds the prepared file
and directly outputs the result; if findsym is not
executable then outputs the generated input file.

If you are interested only in the results section of
the findsymm output, you should append "| grep "\-\-\-\-\-\-" -A1000"
to the execution of this code.

Accepts alternative POSCAR filename for argument
(default = POSCAR)

If a second argument is proposed then acts as if
findsym is not accessible (ie, prints out the input
file instead of feeding it to findsymm)

10/03/09 */
"""

import sys
import re
from numpy import *
from os import popen
import commands

force_output = False

if len(sys.argv)<2:
filename="POSCAR"
elif len(sys.argv)<3:
filename=sys.argv[1]
else:
filename=sys.argv[1]
force_output = True

f = open(filename,'r')

tolerance = 0.00001
latt_vec_type = 1 # We will be specifying in vectors

lat_vec = array([])
for i in range(0,3):

species_count = re.split('[\ ]+', species_count.strip())
species_count = map(int,species_count)
number_of_species = len(species_count)
total_atoms = sum(species_count)

initial_guess = "P" # For the centering

species_designation = array([])
for i in range(1,number_of_species+1):
for j in range(0,species_count[i-1]):
species_designation = append(species_designation,i)

species_designation = map(str,map(int,species_designation))
# print species_designation
sep = " "
# print sep.join(species_designation)

pos_vec = array([])
for i in range(0,total_atoms):

# print pos_vec

findsym_input = array([])
findsym_input = append(findsym_input, title)
findsym_input = append(findsym_input, tolerance)
findsym_input = append(findsym_input, latt_vec_type)
findsym_input = append(findsym_input, lat_vec)
findsym_input = append(findsym_input, 2)
findsym_input = append(findsym_input, initial_guess)
findsym_input = append(findsym_input, total_atoms)
findsym_input = append(findsym_input, species_designation)
findsym_input = append(findsym_input, pos_vec)
# print findsym_input
sep = "\n"
findsym_input_txt = sep.join(findsym_input)
# print findsym_input_txt

# Check if findsym is accessible:
status,output =  commands.getstatusoutput("echo \"\n\n\"|findsym ")
# if it is not there, then just output the input
print findsym_input_txt
elif(status==6144):
# feed it to findsym
pipe = popen("echo \""+findsym_input_txt+"\" | findsym").readlines()
for line in pipe:
print line.strip()
quit()

Example Usage:

sururi@husniya POSCAR2findsym $cat POSCAR Si(S)-Au(Pd) -- Pd3S 1.00000000000000 4.7454403619558345 0.0098182468538853 0.0000000000000000 -1.4895902658503473 4.5055989020479856 0.0000000000000000 0.0000000000000000 0.0000000000000000 7.2191545483192190 6 2 Direct 0.1330548697855782 0.5102695954022698 0.2500000000000000 0.4897304045977232 0.8669451452144267 0.7500000000000000 0.5128136657304309 0.1302873334247993 0.2500000000000000 0.8697126665752007 0.4871863042695738 0.7500000000000000 0.0013210250693640 0.9986789749306360 0.0000000000000000 0.0013210250693640 0.9986789749306360 0.5000000000000000 0.6856021298170862 0.6825558526447357 0.2500000000000000 0.3174442073552622 0.3143978111829124 0.7500000000000000 sururi@husniya POSCAR2findsym$ python POSCAR2findsym.py
FINDSYM, Version 3.2.3, August 2007
Written by Harold T. Stokes and Dorian M. Hatch
Brigham Young University

Si(S)-Au(Pd) -- Pd3S
Tolerance:    0.00001
Lattice vectors in cartesian coordinates:
4.74544   0.00982   0.00000
-1.48959   4.50560   0.00000
0.00000   0.00000   7.21915
Lattice parameters, a,b,c,alpha,beta,gamma:
4.74545   4.74545   7.21915  90.00000  90.00000 108.17579
Centering: P
Number of atoms in unit cell:
8
Type of each atom:
1  1  1  1  1  1  2  2
Position of each atom (dimensionless coordinates)
1   0.13305   0.51027   0.25000
2   0.48973   0.86695   0.75000
3   0.51281   0.13029   0.25000
4   0.86971   0.48719   0.75000
5   0.00132   0.99868   0.00000
6   0.00132   0.99868   0.50000
7   0.68560   0.68256   0.25000
8   0.31744   0.31440   0.75000
------------------------------------------
Space Group  40  C2v-16    Ama2
Origin at    0.00000   0.00000   0.50000
Vectors a,b,c:
0.00000   0.00000   1.00000
-1.00000  -1.00000   0.00000
1.00000  -1.00000   0.00000
Values of a,b,c,alpha,beta,gamma:
7.21915   5.56683   7.68685  90.00000  90.00000  90.00000
Atomic positions in terms of a,b,c:
Wyckoff position b, y = -0.17834, z =  0.31139
1   0.75000   0.17834   0.31139
2   0.25000   0.82166   0.31139
Wyckoff position b, y =  0.32155, z =  0.19126
3   0.75000   0.17845   0.69126
4   0.25000   0.82155   0.69126
Wyckoff position a, z =  0.00132
5   0.50000   0.00000   0.00132
6   0.00000   0.00000   0.00132
Wyckoff position b, y = -0.31592, z =  0.00152
7   0.75000   0.81592   0.50152
8   0.25000   0.18408   0.50152

## Update on the things about the scientific me since October..

### March 23, 2009 Posted by Emre S. Tasci

Now that I’ve started to once again updating this scientific blog of mine, let me also talk about the things that occured since the last entry on October (or even going before that).

Meeting with Dr. Villars
The biggest event that occured to me was meeting with Dr. Pierre Villars, the person behind the Pauling File database which I have benefitted and still benefitting from. When I had registered to the “MITS 2008 – International Symposium on Materials Database”, an event hosted by the NIMS Materials Database, I had no idea that Dr. Villars would also be attending to the event, so it was a real surprise learning afterwards that I’d have a chance to meet him in person.

You can read the sheer happiness from my face on the occasion of meeting Dr. Villars

Dr. Villars is a very kind and a cheerful person, I had a greatest time knowing him and afterwards I had the privilege of visiting him in his home office in the lovely town of Vitznau, Switzerland where I enjoyed the excellent hospitality of the Villars family. Dr. Villars helped me generously in providing the data in my research project for finding transformation toughening materials through datamining which I’m indebted for.

The MITS 2008 – Int’l Symposium on Materials Database
I was frequently using the databases on the NIMS’ website and had the honour to participate in the last year’s event together with my dear supervisor Dr. Marcel Sluiter. On that occasion, I presented two talks – a materials based one, and another about database query&retrieval methods- titled “Inference from Various Material Properties Using Mutual Information and Clustering Methods” and “Proposal of the XML Specification as a Standard for Materials Database Query and Result Retrieval”, respectively.

I have an ever growing interest on the Japanese Culture since I was a youngster and due to this interest, my expectations from this trip to Japan was high enough for me to be afraid of the fact that I may have disappointed since it was next-to-impossible for anything to fulfill the expectations I had built upon. But, amazingly, I was proved false: the experience I had in Japan were far more superior to anything I had anticipated. The hospitality of the organizing commitee was incredible: everything had been taken care of and everyone was as kind as one could be. I had the chance to meet Dr. Villars as I’ve already wrote about above, and also Dr. Xu, Dr. Vanderah, Dr. Dayal and Dr. Sims and had a great time. It was also due to this meeting, I met a dear friend.

Ongoing Projects
During my time here, I still don’t have anything published and that’s the number one issue that’s bothering me. Apart from my research on the transformation toughening materials, I worked for a time on a question regarding to a related phenomenon, namely about the martensitic transformation mechanism on some transition-metal alloy types. We were able to come up with a nice equation and adequate coefficients that caught the calculation results but couldn’t manage to transfer it to -so to say- a nicely put theory and that doomed the research to being an “ad-hoc” approach. I’ll be returning to it at the first chance I get, so currently, it’s been put on ice (and now remembering how, in the heat of the research I was afraid that someone else would come up with the formula and it would be too late for me.. sad, so sad..). One other (side) project was related to approximate a specific amorphous state in regards with some basis structures obtained using datamining. This project was really exciting and fun to work on because I got to use different methods together: first some datamining, then DFT calculations on the obtained structures and finally thermodynamics to extrapolate to higher temperatures. We’re at the stage of revising the draft at the moment (gratefully!).

Life in the Netherlands & at the TUDelft
It has been almost one and a half year since I started my postdoc here in TUDelft. When we first came here, my daughter was still hadn’t started speaking (yet she had been practicing walking) and now she approximately spent the same amount of time in the Netherlands as she had spent in Turkey (and thankfully, she can speak and also running to everywhere! 8).

When I had come here, I was a nano-physicist, experienced in MD simulations and -independently- a coder when the need arouse. Now, I’m more of a materials guy and coding for the purpose.. 8) I enjoy the wide variety of the jobs & disciplines people around me are working on and definitely benefitting from the works of my friends in our group. I couldn’t ask for more, really. (OK, maybe I’d agree if somebody would come up with an idea for less windy and more sunny weather here in Delft. That’s the one thing I couldn’t still get used to. Delft is a marvelous city with bikes and kind people everywhere, canals full of lillies in the spring, historical buildings everywhere, Amsterdam, Den Haag and Rotterdam just a couple of train stations away and if you wish, Antwerpen, Brussels and Brugges (Belgium) is your next-door neighbour but this dark and closed weather can sometimes be a little mood lowering.) TUDelft is really a wonderful place to be with all the resources and connections that makes you feel you can learn anything and meet anyone that is relevant to the work you’re doing without worrying about the cost. And you’re being kept informed about the events taking place about you through the frequent meetings in your group, in your section, in your department, in your field. I’ve learned a lot and I’m really happy I was accepted here.

(And just when you think I was out of photos!.. 8)

So that’s about the things I’ve enjoyed experiencing and living through.. And I promise, I’ll be posting more regularly and frequently from now on..

Yours the chatty.

## LaTeX to PNG and all that equations..

### Posted by Emre S. Tasci

After migrating this blog to a new server, I had some difficulties in writing up the equations. It was due to the fact that on this server, I wasn’t able to execute the necessary commands to parse the latex code and convert it to PNG format.

Last week, some need arouse for this and I finally coded the necessary way around to be able to convert LaTeX definitions to their PNG counterparts. Before I start to quote the necessary code and explanations, let me tell that, this method only will work if you can successfully manage to produce this conversation at your -local- computer since what the code does is to generate the image on your local computer and then copy it to the server where your blog (/or whatever you have) resides. So, make sure:

• You can convert LaTeX code to PNG on your -own- computer.
• You are running a httpd server so that the code can copy the output PNG file from your local computer

What the code does:
It has 3 seperate processes. Let’s designate them A, B & C.

• Part A is called on the remote server. It presents a form with textbox in it where you can type the LaTeX code. The form’s target is the same file but this time on your local server, so when you submit the data —
• Part B is called on your local server. Using the texvc code, an open source software that also comes packed with mediawiki, it converts the LaTeX code into a PNG image and places it under the relative math/ directory of your local server. After doing this, via the META tag ‘refresh’ it causes the page to refresh itself loading its correspondence in the remote server, hence initiating —
• Part C where the generated image identified by the MD5 hashname is fetched from the local server and copied unto the relative math/ directory on the remote server. The LaTeX code that was used is also passed in the GET method and it is included in the generated code as the title of the image, so if necessary, the equation can be modified in the future.

The code is as follows:

<?PHP if($_GET["com"]||(!$_POST["formula"] && !$_GET["file"])){?>  <form action="http://yourlocalserver.dns.name/tex/index.php" method="post" name=postform id=postform> <textarea name="formula" cols=40 rows=5 id=formula> </textarea>
 <input type="submit" value="Submit" /> <?PHP } if($_POST["formula"])
{
// NL
$lol = './texvc ./mathtemp ./math "'.$_POST["formula"].'" iso-8859-1';
exec($lol,$out);
$file = substr($out[0],1,32);
$formula = base64_encode($_POST["formula"]);
$html = '  <META http-equiv="refresh" content="0;URL=http://remoteserver.dns.name/tex/index.php?formula='.$formula.'&file='.$file.'"> '; echo$html;
}
else if($_GET["file"]) { // COM$file = "math/".$_GET["file"].".png"; if(!copy("yourlocalserver.dns.name/tex/".$file, $file)) exit( "copy failed
");$formula = base64_decode($_GET["formula"]); ?> <form action="http://yourlocalserver.dns.name/tex/index.php" method="post"> <textarea name="formula" cols=40 rows=5><?PHP echo$formula; ?>
</textarea>

<input type="submit" value="Submit" />
<?

echo "

";
echo "<img src=\"/tex/".$file."\" title=\"".$formula."\">
";
}
?>

To apply this:

1. Create a directory called ‘tex’ on both servers.
2. Create subdir ‘math’ on both servers
3. Create subdir ‘mathtemp’ on the local server
4. Modify the permissions of these subdirs accordingly
5. Place the executable ‘texvc’ in the ‘tex’ directory
6. Place the code quoted above in the ‘tex’ directories of both servers in a file called ‘index.php’

If everything well up to this point, let’s give it a try and you shall have some output similar to this:

For an input LaTeX code of:
\sum_{n=0}^\infty\frac{x^n}{2n!}

where you can immediately see the resulting image, modify the code if there’s something wrong or copy the IMG tag and put it to your raw HTML input box in your text…