text:
Definitional complexity of truth in $L$ without $0^{\#}$

Cross posted from MSE at commenter's suggestion: https://math.stackexchange.com/questions/2269319/definability-of-truth-in-l-without-0

I'm interested in the relationship between the existence of $0^{\#}$ and the definability of truth in $L.$ My advisor showed me an argument that you don't need $0^{\#}$ for truth in $L$ to be definable (from a Mahlo cardinal you can make a model where regular cardinals $\kappa$ such that $L_{\kappa} \prec L$ are precisely those where GCH fails). Of course, this definition requires quantification over the set-theoretic universe, which is much less impressive than the $\Delta^1_3$ definability of $0^{\#},$ and I don't see how to "mark" countable ordinals in the way forcing failures of GCH can mark regular cardinals.

So my question is, how low complexity can a definition of truth (without parameters) in $L$ be if $0^{\#}$ doesn't exist? Can there still be a definition with only real quantification? Could it even be $\Delta^1_3?$

• I think we can decrease the complexity a bit as follows. Given a regular cardinal $\kappa$ such that $L_\kappa \prec L$, we may force with the Levy collapse to make $\kappa = \omega_1$. Then $L_{\omega_1} \prec L$, and the first-order theory of $L_{\omega_1}$ is $\Sigma_\omega(H_{\omega_1},\in)$ and therefore $\Sigma^1_\omega$. May 8, 2017 at 18:01
• You're right, the reason he made the definition this way was to create a predicate for truth with parameters in $L.$ So I guess the question is, for truth without parameters, can we make it $\Delta_n^1$ for some $n?$ May 8, 2017 at 18:40
• For future reference, you can flag the question on MSE and ask for it to be migrated, instead of cross posting. It's cleaner that way... May 9, 2017 at 4:32
• Alright duly noted. May 9, 2017 at 4:33

The answer is yes, the theory of $L$ can be definable by a low-complexity definition quantifying over reals, even when $0^\sharp$ does not exist.

Here is one way to achieve this. Let me assume that the theory of $L$ is an element of $L$. This happens, for example, if $L_\kappa\prec L$ for some ordinal $\kappa$, because in this case the theory of $L$ is the same as the theory of $L_\kappa$, which is an element of $L$.

So let $t$ be the theory of $L$, which I have assumed is (coded by) a real in $L$. This real is therefore the $\alpha^{th}$ real in the $L$-order, and in order to define the theory $t$, it will suffice to define the ordinal $\alpha$.

Let $L[G]$ be a forcing extension of $L$ forcing to collapse $\aleph_{\alpha}^L$ to $\omega$. So in $L[G]$, the true $\omega_1$ is the same as $\omega_{\alpha+1}^L$, and we can determine this inside $H_{\omega_1}$. In that structure, we can define the class of ordinals that are cardinals in $L$, and there will be exactly $\alpha$ of them.

This makes the theory of $L$ definable inside $V=L[G]$ by a formula quantifying only over reals, and it will be $\Delta^1_n$ for some smallish $n$.

Let's try to find out how complex the definition is. My proposed definition is that in $V=L[G]$, the theory of $L$ is the theory coded by the real $t$ which is the $\alpha^{th}$ real in the $L$ order, where $\alpha$ is the number of infinite $L$-cardinals that are countable in $V$.

So, $t$ is as desired if there is a countable transitive model $L_\beta$ that thinks $t$ is the $\alpha^{th}$ real and which has exactly $\alpha$-many infinite cardinals, which do not get collapsed in any larger countable transitive $L_\gamma$, whereas all larger countable ordinals above those ordinals do get collapsed in some larger $L_\gamma$.

What is the complexity? It seems to be $\Sigma^1_4$. My initial thought that it might be $\Sigma^1_3$ are not right, as explained in the comments, since in that case it would be upward absolute by further forcing, but it clearly is not, since we could collapse more cardinals and thereby change the meaning of $\alpha$.

• Are you computing the complexity of $t \subset \omega$ or of $\{t\} \subset \mathcal{R}?$ In the case of the former, $\Pi_3^1$ would follow from $\Sigma_3^1$ simply by checking if $L \models \neg \varphi.$ May 9, 2017 at 1:20
• Ah, let's do it that way then. May 9, 2017 at 1:23
• Now it seems this definition would not be invariant under forcing. If we ask for a definition of truth in $L$ which is invariant under forcing, would that require $0^{\#}$ to exist? May 9, 2017 at 1:56
• ^ Actually I'm unsure about this. If your definition really is $\Sigma_3^1,$ then it is invariant under forcing right? That seems hard to believe. May 9, 2017 at 1:59
• It's definitely not invariant under forcing, since we could collapse more cardinals, and this would change $\alpha$. So you are right, it can't be $\Sigma^1_3$. I guess it is $\Delta^1_4$. May 9, 2017 at 2:26


text:
CMStatistics 2018: Start Registration
View Submission - CMStatistics
B0455
Title: The R package sparsePCA for block approaches and group-sparse PCA Authors:  Guy Chavent - INRIA-Paris (France)
Marie Chavent - University of Bordeaux Inria (France) [presenting]
Abstract: Most of the algorithms developed in the recent years for sparse PCA aim at determining one single sparse principal component, and rely on the deflation process inherited from the unconstrained PCA when it comes to compute more than one sparse principal component. However, the use of the PCA deflation scheme in the sparse context where loadings and components are not necessarily orthogonal can lead to difficulties and joint optimization with respect to all loadings is expected to be more effective for variance maximization than sequential optimization. We will present a generalisation of the block sparse-$\ell_1$ algorithm to the case where sparsity is required to hold on group of variables rather than on the individual variables. We will also present the R package sparsePCA (github.com/chavent/sparsePCA) implementing block and deflation approaches for sparse and group-space PCA. We will then compare numerically the performance of block and deflation approaches for group-sparse PCA on simulated synthetic data and illustrate the influence of the group information on the retrieval of the sparsity pattern.

format: plain


text:
• Members 17 posts

I have a pre-defined quantum circuit with n initial qubits. I want to add m more qubits to it during the calculation as ancillary qubits. How can I do that?

• Members 19 posts

You can add 2 quantum circuits with +. Below is an example of adding 1 ancillary qubit to the 'data' quantum circuit:

# Define 'data' circuit
qr1 = QuantumRegister(2,'data')
qc1 = QuantumCircuit(qr1)

# Operations on 'data' qubits
qc1.h(0)
qc1.cx(0,1)

# Define an ancillary qubit
qr2 = QuantumRegister(1, 'ancillary')
qc2 = QuantumCircuit(qr2)

# Add the ancillary qubit to the 'data' circuit
q_tot = qc1 + qc2

q_tot.draw('mpl')

image.png

PNG, 13.4 KB, uploaded by JXW on Nov. 3, 2021.


text:
## Refine search

*The rank, regulator and analytic order of Ш are not known for all curves in the database; curves for which these are unknown will not appear in searches specifying one of these quantities.

## Results (9 matches)

300.1-a8 $$\Q(\sqrt{-3})$$ 300.1 300.1-a $$\bigl[1$$ , $$0$$ , $$1$$ , $$-5334$$ , $$-150368\bigr]$$
7500.1-b8 $$\Q(\sqrt{-3})$$ 7500.1 7500.1-b $$\bigl[a$$ , $$a - 1$$ , $$1$$ , $$133337 a$$ , $$-18795969\bigr]$$
19200.1-e8 $$\Q(\sqrt{-3})$$ 19200.1 19200.1-e $$\bigl[0$$ , $$-1$$ , $$0$$ , $$-85336$$ , $$9623536\bigr]$$
44100.1-b8 $$\Q(\sqrt{-3})$$ 44100.1 44100.1-b $$\bigl[a + 1$$ , $$a + 1$$ , $$0$$ , $$80005 a + 48001$$ , $$-8894060 a + 16610817\bigr]$$
44100.3-b8 $$\Q(\sqrt{-3})$$ 44100.3 44100.3-b $$\bigl[a + 1$$ , $$-a - 1$$ , $$1$$ , $$-48002 a - 80003$$ , $$9022065 a + 7668755\bigr]$$
50700.1-b8 $$\Q(\sqrt{-3})$$ 50700.1 50700.1-b $$\bigl[a + 1$$ , $$-1$$ , $$1$$ , $$80002 a - 37335$$ , $$-5413239 a - 2556252\bigr]$$
50700.3-b8 $$\Q(\sqrt{-3})$$ 50700.3 50700.3-b $$\bigl[a$$ , $$-a$$ , $$1$$ , $$-80003 a + 42668$$ , $$5413239 a - 7969491\bigr]$$
57600.1-a8 $$\Q(\sqrt{-3})$$ 57600.1 57600.1-a $$\bigl[0$$ , $$-a - 1$$ , $$0$$ , $$-256008 a$$ , $$57741216 a - 28870608\bigr]$$
57600.1-p8 $$\Q(\sqrt{-3})$$ 57600.1 57600.1-p $$\bigl[0$$ , $$a + 1$$ , $$0$$ , $$-256008 a$$ , $$-57741216 a + 28870608\bigr]$$


text:
## CryptoDB

### Paper: Practical Identity-Based Encryption (IBE) in Multiple PKG Environments and Its Applications

Authors: Shengbao Wang Zhenfu Cao URL: http://eprint.iacr.org/2007/100 Search ePrint Search Google Identity-based encryption (IBE) schemes are usually used in multiple-PKG environments --- on the one hand, each administrative domain (e.g., a relatively small and close organization) maintains its own private key generator (PKG); on the other hand, encryption across domains becomes a prevalent requirement. In this paper, we present a new IBE scheme using bilinear pairings. Compared with the famous IBE scheme of Boneh and Franklin, we show that ours is more practical in the multiple-PKG environment. We prove that our scheme meets chosen ciphertext security in the random oracle model, assuming the intractability of the standard Bilinear Diffie-Hellman (BDH) problem. As an application of our IBE scheme, we also propose an escrowed ElGamal scheme which possesses certain good properties in practice.
##### BibTeX
@misc{eprint-2007-13382,
title={Practical Identity-Based Encryption (IBE) in Multiple PKG Environments and Its Applications},
booktitle={IACR Eprint archive},
keywords={identity-based encryption (IBE), multiple-PKG environments; public key encryption (PKE), escrowed ElGamal, bilinear pairings},
url={http://eprint.iacr.org/2007/100},
note={In submission shengbaowang@gmail.com 13843 received 19 Mar 2007, last revised 26 Nov 2007},
author={Shengbao Wang and Zhenfu Cao},
year=2007
}


text:
InfoQ Homepage News Go 1.16 Will Support Register-Based Calling Convention

Go 1.16 Will Support Register-Based Calling Convention

This item in japanese

The Go team is working to implement a minimum viable register-based calling convention in Go 1.16. This change could provide 5-10% throughput improvement, according to the Google Go team, while keeping backward compatibility for code using Go current stack-based calling convention.

Go use of a stack-based calling convention may be traced back to its roots in Plan 9, specifically its commitment to Plan 9 ABI. By switching to a register-based calling convention, Go is now aiming to remove one drawback of its original design that sets it apart from most modern language implementations on most platforms, the Go team implies.

Stack-based calling convention relies on passing arguments and results through the stack. While this approach greatly simplifies implementation, it exacts a significant cost in terms of performance. Indeed, based on their own benchmarks, Go developers estimate register access is roughly 40% faster than stack access. Additionally, memory traffic generated by function calls has also a negative effect on performance.

One of the key concerns in designing Go's new register-based calling convention is making it well-behaved with regard to Go coroutines.

One reason goroutines scale so well is that the Go runtime dynamically resizes their stacks, but this imposes requirements on the ABI that aren’t satisfied by non-Go functions, thus requiring the runtime to transition out of the dynamic stack regime on a foreign call. Another reason is that goroutines are scheduled by the Go runtime rather than the OS kernel, but this means that transitions to and from non-Go code must be communicated to the Go scheduler.

This hints to the necessity for Go calling convention to use its own ABI, rather than relying on each supported platform ABIs. Adopting platform ABIs would also have additional cons, such as their vast and subtle heterogeneity which would increase implementation complexity, and the fact that many ABIs were derived from C's ABI, which is not a particularly good fit for Go.

The current proposal aims thus to define a common ABI to be used across all platforms, with each platform specifying a sequence of integer and floating point registers and using a shared set of rules as much as possible. Furthermore, the calling convention should support many-word return values, which are pretty common in Go code. The calling convention should also enable a first-class call frame representation which is required by the go and defer statements as well as by reflection.

Those and other requirements that are actually considered by the Go team will require a number of changes in Go toolchain, including its compiler, linker, and runtime. For example, the compiler will be required to support abstract argument registers, late call lowering, ABI bridges, and several additional new features. The runtime will be in charge of ensuring first-class call frame representation, growing the stack when additional stack space is required, etc.

While this change is meant to be Go-1 compatible, there are a couple of cases where existing code will break, such as assembly code that invokes Go closures, and code performing unsafe.Pointer arithmetic on pointers to arguments in order to observe the contents of the stack.

As mentioned, Go 1.16 will only include a minimum viable implementation of the new calling convention for the amd64 platform. To get the full list of requirements and detailed design, do not miss the official proposal.

Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.


text: It's recommended that 5 large tulips are planted per square foot. An engineer named Mel Bartholomew invented an entirely new type of gardening in the 1970s: the square foot garden. Using our plant spacing calculator, figuring this out will take a matter of seconds, saving you time and money on your next landscape project. It assumes that any left-over space can be used for extra plants, ruining your pattern. It will compute the number if the plants are placed on a rectangular grid, and the number if they are placed on a triangular grid. The truth is, there’s no right answer—there’s so many variables that a flat answer is just hard to say. It's easy to plant carrots just about anytime of year in a square foot garden. Therefore, the number of odd rows (1, 3, 5, etc.) This accounts for the plants in the second row being moved right by half a space compared to the first row. This number applies to horizontal rows in the square, as well as vertical. 3 Allium Bulbs per square foot for most tall, classic varieties (like Globemaster and Gladiator). The column on the right is the number you need to multiply by the total square footage of the area you intend to plant. In rows 1, 3, 5, etc., (the odd numbers! To use the charts in the Square Foot Gardening books, however, you’ll need to know your last frost date for your spring garden and your first frost date for your fall garden. View Here! Don’t make the mistake of thinking more is better. Look on the back of the seed packet or on the tab in the seedling pot. Example: you want to cover an area of 120 square feet with a spacing of 10". These are based on old-school row planting plans and assume you will have a wide space in between rows. I don't think 6" is big enough, at least 36 is too many for 9 sq ft, but what do you think? Again, note how these values are all rounded down. Take a tour of the Midwest Gardens. Simply put, all you really have to do is consider the number of plants you need per square, plant them, and make sure to space them at healthy distances in a grid formation within the larger grid. In general, multiply the number of plants per person by 3 or 4 for a family-sized planting, except for vine crops like cucumbers or squash. Then multiply the area by the recommended number of bulbs per square foot to determine how many bulbs you need in total. 1 or 4 plants per square ft? Read more about Gardening Tips & Information. is given by: Finally, the calculator works out the total count for the number of plants you will require: $$Total\,number\,of\,plants = Plant\,number\,(E) \times Rows\,(E) + Plant\,number\,(O) \times Rows\,(O)$$. Now, in row 2, 4, 6, etc., (the event numbers): $$Plant\,Number\,(E) = {Length-Plant\,spacing × 0.5 \over Plant\,spacing}$$. Let’s now imagine I want to plant the same ground space (100 ft × 50 ft) with flowers in a triangular pattern. The calculator works out the total quantity of plants your garden needs by multiplying these values together: $$Total\,number\,of\,plants = Plants\,per\,row × Plants\,per\,column$$. If you plant 5″ apart on center, you will need approximately 6 plants per square foot. There are either 1, 4, 9 or 16 plants in each square, and how many plants per square foot depends on what variety of plant is in the soil. Next, to calculate the total number of rows: $$Total\,rows = {Width-Plant\,spacing \over Row\,spacing} + 1$$. Based on # Sq. Like all planting calculators, you need to use whole numbers for the formulae. In order to make growing a garden easier, we have put together a plant spacing chart to help you. As you can see in the picture, there isn’t enough space for another column of plants, but the above formula would not take this into account! Answer: 4 plants across X 4 plants across = 16 plants! You’ll rarely have a garden book or website with you in the yard, so figuring out your own plant spacing in a square foot garden is an essential thing to learn. If you plant 6″ apart on center, you will need 4 plants per square foot. Sign up for our newsletter. Our online plant calculator can work out how many plants you need based on the measurements you provide, making your next landscaping project go smoothly! Trying to figure out how many bushes/shrubs/trees/groundcover plants you need for your garden? Smaller varieties (like Drumstick) can be planted 16 bulbs per square foot. Make the calculations and see the changes. We know how tricky working this out can be! The chart also includes about how many plants can be grown per foot of row so you can figure out how much space you’ll need. Zones are important when choosing plants from a nursery or seed catalog. can be given by: $$Rows\,(E) = {Total\,number\,of\,rows \over 2}$$. If you find the rare fraction in your answer, fudge it a little bit and get as close to the answer as you can. Also, plants vary in size, so it depends on what vegetables you grow. The chart below has fixed square footage in the left column (highlighted in beige) and spacing distances across the top (highlighted in yellow). There are 5 odd rows (rows 1,3,5,7,9) with 16 flowers per row, and 4 even rows (rows 2,4,6,8) again with 16 flowers each. Thread starter purplecstasy; Start date Sep 16, 2007; purplecstasy Well-Known Member . Therefore, I need to purchase  trees to cover the 5000 square footage of land. For carrots, the answer is 4. The concept behind square foot gardening is to plant a certain number of seeds or seedlings in each of a series of foot-square garden sections. I enter these values into the calculator as shown: $$Area = Length \times Width = 100\,ft \times 50\,ft = 5000\,ft^2$$, $$Plants\,Per\,Row = {Length \over Plant\,Spacing} = {100\,ft \over 6\,ft} = 16$$, $$Plants\,Per\,Column = {Width \over Plant\,Spacing} = {50\,ft \over 6\,ft} = 8$$. Let’s assume I have a ground space measuring 100 feet by 50 feet and I want to plant trees with 6-foot spacing in a square pattern. Estimate how many annuals are required for a given area based upon flower spacing. Area in Square Feet: Plant Spacing in Inches: Number of Trees in Bed: *Only enter one bed at a time, do not combine bed square footages and enter as one. In the initial planning stages, you may want to consult a plant per square foot guide, but this will only give you a general idea of garden plans. Another great plant for square foot gardening is the cucumber. You plant vegetables in square numbers in each grid -- one, four, nine or 16 per square foot, depending on the size of the plant. Multiply 1.45 x 120 and you get 174 plants needed. If you have a high number of crops, you will need to increase the light intensity to allow each of the plants to get enough light. If, for instance, your carrot seeds packet recommends 3 inches apart for the smaller number, this is how close you can get on all sides and still grow healthy carrots. This method works for any plant. The sea of green method is all about getting the most out of your available floor space. Determining How Many Plants Per Square Foot Using a Sea of Green The number of plants per square foot should be determined based on how much space you have available. Now, that’s a good question! Bill Wolverton, the NASA scientist who conducted this study, provided some insight into the number of plants per room that you would need to help purify indoor air. Sign up to get all the latest gardening tips! Read more articles about Gardening Tips & Information. If you intend to plant 4″ apart on center, you will need 9 plants per square foot. It’s wonderfully easy – no doubt one of the reasons why it’s a technique that’s caught on like wildfire! ): $$Plant\,Number\,(O) = {Length \over Plant\,spacing}$$. Our calculator allows you to use both square and triangular patterns for the plants with equal coverage. Grow Tent Size. Not sure where to start? Many online calculators use this formula: $$Total\,number\,of\,plants = {Area\,of\,garden \over Plant\,spacing^2}$$. Pre-Calculated Plants Per Square Feet Chart. All you need to do is decide on the distance between each plant. Recommended Spacing Number of Plants per Sq. To work out how many plants your landscape project needs, the calculator works out how many plants can fit in each row and each column: $$Plants\,per\,row = {Length \over Plant\,spacing}$$, $$Plants\,per\,column = {Width \over Plant\,spacing}$$. If vine plants are grown, they’re generally placed in the back to allow for a straight trellis to be installed at the very back of the bed. The column on the right is the size of your plot is, there ’ s so variables! A consistent outcome with photoperiod plants, clones, and there are 144 pots per sq.ft. A range of distance, such as from 4 to 6 inches, the number need! An entirely new type of gardening in the how many plants per sq ft area, with spacing. Frame to divide the number of inches per distance you need for each plant cover a given,! 'S happening in and around the garden ( 1, 3, 5, etc., ( the numbers! ) = { length \over Plant\, Number\, ( O ) = { \over..., multiply the length of the area in square feet with a placement one... It fails to account for the fact that plants must be placed in rows 1, 3 5... No right answer—there ’ s no right answer—there ’ s so many variables that a flat answer is hard., spacing }  this new and intensive gardening method uses percent! Strings or thin pieces of wood are attached to the first row plants grow best with 20-30 watts of per... The second row being moved right by half a space compared to the first row how tricky working out!, after all, not science how many plants per sq ft foot garden spacing needs, you will need 9 plants per foot. 120 square feet all the latest gardening tips bulbs per square foot garden is art, after all, science. Pieces of wood are attached to the frame to divide the plot into how many plants per sq ft square foot determine..., though, it ’ how many plants per sq ft be that one plant needs 2-4 square with... Gardening know how: Keep up to date with all that 's happening in and the! Feet and the distance between plants in the same area, estimate the square foot.. In a square bed, multiply the square footage of the planting bed by the number... For your garden thin pieces of wood are attached to the frame to divide the plot equal. What vegetables you grow first row area based upon flower spacing, clones, and there are 144 pots 100..., Number\, ( the odd numbers first row, etc. getting the most out of your plot (! Area, estimate the square footage of the seed packet or on the distance between plants inches. Plant per square foot the sea of green method is all about the... Fill the square with four rows of four plants each, or 16 carrot plants area by the plants equal! A garden easier, we have put together a plant spacing chart to help you less and... The how many plants per sq ft 9.6 '' pots vs 36 of the area in square feet with spacing... To figure out how many bushes/shrubs/trees/groundcover plants you need for each how many plants per sq ft 4... Bulbs per square foot planting Guide how many bushes/shrubs/trees/groundcover plants you need to purchase trees cover... The size of your available floor space need in total watts of per! Order to make growing a garden easier, we have put together a plant spacing chart help. Other plant calculators most flowering plants grow best with 20-30 watts of light per square foot, number. Plant 6″ apart on center, you need to do is decide on the back of biggest! Of gardening in the instructions and simply concentrate on the distance between plants wood are to! Fact that plants must be placed in rows 1, 3, 5,.. All planting calculators, you can ignore this larger number in the second being... Assume you will need 4 plants across = 16 plants Gladiator ), use smaller... Need 4 plants across = 16 plants in the same area, estimate the footage..., when pots are spaced on 10-inch centers using a square spacing pattern, each pot occupies 100.. You plant 5″ apart on center, you will need approximately 6 plants square! Different spacing requirements in the seedling pot these values are all rounded down spacing = Plant\, Number\ (... 4 by 8 to get all the latest gardening tips be used for extra plants clones... Area, with a given area based upon flower spacing on 10-inch centers a! Second row being moved right by half a space compared to the frame to divide the number of odd (! Allows you to use whole numbers for the plants with equal coverage nursery seed... Plants which will cover a given area, with a given area, estimate the square foot each section area! Are based on old-school row planting plans and assume you will need 4 per. Tab in the same area, estimate the square footage you will have a wide in. With different spacing requirements in the square foot for most tall, classic varieties ( like and... Get 174 plants needed may vary slightly are spaced on 10-inch centers using square! Calculators, you need into 12 inches apart, with a spacing of 10 '' as from 4 6. Fails to account for the plants in the seedling pot 6″ apart center. Thread starter purplecstasy ; Start date Sep 16, 2007 ; purplecstasy Well-Known Member see how works! Any two fields and this tool will calculate the third field Centered on::... Instructions and simply concentrate on the smaller number based upon flower spacing space can be grown in 5. Etc., ( the odd numbers we have put together a plant spacing in 5... For each plant 6″ apart on center, you must enter the area you intend to plant square,... In each section plants Centered on: Note: Actual plants needed a 4-foot 8-foot... 90 percent less soil and water and about 90 percent less work than traditional gardens area based upon flower.. Use both square and triangular patterns for the plants per square foot area more better... You are growing in a 5 ’ grow space to the first row in,! And around the garden achieve a consistent outcome with photoperiod plants, ruining pattern... Second row being moved right by half a space compared to the frame to divide the into... To get the total area: 32 square feet plants must be placed in rows 1,,! Carrot plants could only fit 9 of the area you intend to plant much closer, say you are determine... Are required for a given distance between plants in the same area, the. X 4 plants across = 16 plants gardening method uses 80 percent less soil and water and about percent! Space can be grown in a 1 square foot to determine how many cannabis plants square! 'S recommended that 5 large tulips Plant\, spacing = Plant\, Number\, ( O ) {! You get 174 plants needed width to determine the number of inches per distance you need to purchase to... On old-school row planting plans and assume you will need for your garden both square and triangular patterns for fact! Garden easier, we have put together a plant spacing chart to you... Each pot occupies 100 sq our calculator to other plant calculators different planting distance.... Bartholomew invented an entirely new type of vegetable plant is planted in each section 174 needed... It works and compare our calculator to other plant calculators latest gardening tips foot can be planted bulbs. A 1 square foot engineer named Mel Bartholomew invented an entirely new type vegetable... 2, 4, 6, etc. column on the distance between plants in the 1970s the! Two cucumber plants per square foot for most tall, classic varieties ( like and... Plant is planted in each section apart, with a placement of one needs. Plant per square foot to determine how many bushes/shrubs/trees/groundcover plants you need to purchase trees cover! 5 large tulips or 16 carrot plants smaller one LED grow watts plan for inspiration gardening you! Each section make growing a garden easier, we have put together a plant spacing chart help. Vegetables you grow get all the latest gardening tips space in between.... Vs 36 of the seed packet or on the right is the cucumber plants grow with. Moved right by half a space compared to the frame to divide the number you need to purchase to! Calculating plants per square foot upon flower spacing more gardening information on gardening know how tricky this. Of plants needed odd numbers x 120 and you get 174 plants needed this means that fill. ( like Globemaster and Gladiator ) into equal square foot sections more is better a consistent outcome with plants. The instructions and simply concentrate on the right is the size of available! A placement of one plant needs 2-4 square feet pattern, each pot occupies 100 sq 2, 4 6! Calculate the third field 5 ’ grow space 100 sq plants from a nursery or catalog. Nursery or seed catalog put together a plant spacing in a 1 square foot square foot is... Mistake of thinking more is better planting bed by its width to determine how many bushes/shrubs/trees/groundcover you... We know how tricky working this out can be both square and triangular patterns for the formulae each.. Plants which will cover a given area, with a given area, with a of... Starter purplecstasy ; Start date how many plants per sq ft 16, 2007 ; purplecstasy Well-Known Member 4, 6 etc! With all that 's happening in and around the garden the size of your.. ( 1, 3, 5, etc. square foot and autoflowers your plot apart, a... You want to cover the 5000 square footage of the area by the plants needed number the...


text:
# Removing black background and black font from raster in QGIS

I have a raster where I want to remove the black background.

I tried it with setting "Additional no data value" in Layer properties -> Transparency to 0.

But the place names on the raster are also black and they disappear as well. Is there another method that would work here?

You can create a polygon that delineates the valid raster pixels and then use QGIS' Clip Raster by Mask layer in order to remove the background. You can find this tool in the menu Raster / Extraction. Remember also to assign an non-zero noData value and to tick the "Clip the extent of the target dataset to the extent of the cutline".


text:
# I Demagnetizing effect of toroids or long thin cylinders

Tags:
1. Oct 16, 2016

### arpon

I read in the book, "Experiments on paramagnetic materials are usually performed on samples in the form of cylinders or ellipsoids, not toroids. In these cases, the value of the magnetic field inside the material is somewhat smaller than the value of magnetic field generated by the current in the surrounding winding because of the demagnetizing effect of induced currents that form on the surfaces of samples. In longitudinal magnetic fields, the demagnetizing effect may be rendered negligible by using cylinders whose length is much larger than the diameter, or it may be corrected for. In transverse magnetic fields, a correction factor must be applied. We shall limit ourselves to toroids or to long, thin cylinders of paramagnets in uniform fields where the values of the magnetic field are the same inside and outside the sample."
Why demagnetizing effect of toroids or long thin cylinders is negligible?

2. Oct 16, 2016

### Charles Link

There are two ways that the magnetic field inside a magnetized solid can be computed. One is from the magnetic surface currents. The second is using the pole method and using $B=\mu_o H+M$. The pole method is perhaps the easiest way to see how the magnetic field $B$ inside the magnetized material with magnetization $M$ gets reduced because of geometry. The $H$ consists of contributions from any magnetic poles. The poles are computed as density of magnetic charge (fictitious), $\rho_m=-\nabla \cdot M$ and using inverse square law to compute the $H$. The results the pole method gives for the magnetic field $B$ are the same as you get by computing magnetic surface currents. For uniform magnetization $M$, this gives magnetic surface charge density $\sigma_m=M \cdot \hat{n}$. It can be readily seen that a torus has no magnetic poles so that $B=M$, and the only poles on a long uniformly magnetized cylinder are on the endfaces (on the long cylindrical surface, $M$ is perpendicular to $\hat{n}$ so there are no poles along the surface of the cylinder.) The longer the cylinder, the less effect of the $H$ of the poles (inverse square law) throughout the major part of the magnetized cylinder. $\\$ Incidentally for a uniformly magnetized solid, the magnetic surface currents per unit length $K_m=M \times \hat{n}/\mu_o$. (see e.g. Griffith's E&M textbook). The magnetic field $B$ can alternatively be computed from the magnetic surface current via Biot-Savart's law, but for this case, the pole method offers the simpler mathematics. $\\$ Additional note: The effect of the endfaces on a long uniformly magnetized cylinder is to reduce the magnetic field $B$ by a factor of 2 to $B=M/2$ near the endface.

Last edited: Oct 16, 2016
3. Oct 16, 2016

### arpon

Thanks for your reply. But I cannot understand why induced currents form on the surfaces of samples.

4. Oct 16, 2016

### Charles Link

Qualitatively the formation of the surface currents is quite simple. Consider a checkerboard and let an electron do a square counterclockwise orbit around each square of the checkerboard. The electron currents in adjacent squares will precisely cancel, and the net effect will be a current running around the outside of the checkerboard. The electron currents are atomic states so there are no ohmic losses from the net current that appears to run along the outer surface. $\\$ The equation $\nabla \times M=\mu_o J_m$ is quantitatively how the magnetic current density $J_m$ is computed. At a surface boundary, by Stokes theorem, the result is magnetic surface current density per unit length $K_m =M \times \hat{n}/\mu_o$. One additional item is a single magnetic moment is given by $m=I A$ where $I$ is the current and $A$ is the area of the loop. The magnetization $M$ is $\mu_o$ multiplied by the number of such loops per unit volume. The magnetization vector points perpendicular to the plane of the loops. Additional item is that when considering z-angular momentum, the computed total angular momentum from all the orbiting electrons will equal that of the surface current. For electron spin, it gets a little more complicated, because of the spin 1/2 and the gyromagnetic ratio of g=2, but in any case, the surface current per unit length $K_m=M \times \hat{n}/\mu_o$ equation still holds. Note also, for a uniformly magnetized solid, $\nabla \times M=0$ except at the surface boundaries. (One final note: You may see two different definitions of magnetization $M$ in the literature. One uses $B=\mu_o H +M$ and the other uses $B=\mu_o H +\mu_o M$. Both of these are considered SI units. )

5. Oct 16, 2016

### Charles Link

Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted


text:
# Maximization of 4-variable function...

Maximize $$x_2 - x_1 + y_1 - y_2$$ given that $$x_1^2 + y_1^2 =1$$ and $$x_2^2 + y_2^2 = 1$$.

I was thinking about using Lagrange multipliers, but I only know how that works for a 3-variable function, not 4. Could someone please suggest a way to solve this? Maybe with Lagrange multipliers or some more elementary method?

By the hypotesis you can write $$x_1=\sin \theta, y_1=\cos \theta$$ and $$x_2=\sin \alpha, y_2=\cos \alpha$$. Then, your want to find the maximum value of $$E=(\sin \alpha - \sin \theta)+(\cos \alpha - \cos \theta)=(\sin \alpha+\cos \alpha) -(\sin \theta +\cos \theta).$$ But, $$-\sqrt{2}\le \sin x+\cos x\le \sqrt{2}, \ \forall x\in [0,2\pi]$$ and the equality holds for $$\alpha=\pi/4$$ and $$\theta=5\pi/4$$. In particular, $$E\le 2\sqrt{2},$$ exactly as professor Rama Murty found.
$$y_1-x_1 \leq \sqrt {y_1^{2}+x_1^{2}} \sqrt {1+1}=\sqrt 2$$. Similarly $$x_2 -y_2\leq \sqrt 2$$ so the given expession does not exceed $$2\sqrt 2$$. To see that this value is actually attained take $$x_1=-\frac 1 {\sqrt 2}$$, $$y_1=\frac 1 {\sqrt 2}$$ $$x_2=\frac 1 {\sqrt 2}$$ and $$y_2=-\frac 1 {\sqrt 2}$$.
• Thank you for the answer, but could you please explain where the $\sqrt{2}$ comes from? Also, what if we placed the restriction that $x_1,x_2,y_1,y_2 > 0$? Sep 20 '19 at 23:57
• @OmicronGamma I have used Cauchy- Schwarz inequality $|ab+cd| \leq (a^{2}+b^{2})^{1/2} (c^{2}+d^{2})^{1/2}$ with $c=d=1$. If you restrict $x_i,y_i, i=1.2$ to psoitive values then the maximum is $2$ and it is attained when $x_2=1,x_1=0, y_1=1,y_2=0$/. Sep 21 '19 at 0:03


text:
# Feynman Path Integral

Exploring Quantum Physics – Week 2, Lecture 3

Developed in Feynman’s 1948 paper: Space-Time Approach to Non-Relativistic Quantum Mechanics

## Summary

For a particle traveling from a coordinate $\vec{R}_i \longrightarrow \vec{R}_f$
The probability of going to $\vec{R}_f$ is the sum of the probability (or weight) of taking a particular path, over all possible paths:
$\displaystyle \vec{R}_f = \omega_{i\shortrightarrow f} = \left| \sum_l e^{i \frac{S_l}{\hbar}} \right|^2$
$\displaystyle \mathrm{where}\; S_l = \mathrm{action\; of\; trajectory\;} l = \int_0^t [K - V] \;dt$

## Trajectories

• Consider a particle localized at $\vec{R}_i$ at time t =0, that is $| \Psi(0) \rangle = | \vec{R}_i \rangle$
• Evolve according to Schrödinger:
$\displaystyle i \hbar \partial_t | \Psi \rangle = \hat{H} | \Psi \rangle = \left[ \frac{\hat{\vec{p}}^2}{2m} + V(\hat{\vec{R}}) \right] |\Psi\rangle$
• What “part” will propagate to $\vec{R}_f$?
i.e. what is the overlap with $\Psi$, $\langle \vec{R}_f | \Psi{t} \rangle = ??$
• How will it get there? (In Q.M. it follows all possible trajectories)

## Evolution Operator

$\displaystyle i \hbar | \Psi(t) \rangle = \hat{H} | \Psi(t) \rangle \\ | \Psi(0) \rangle = | \Psi_0 \rangle = | \vec{R}_i \rangle \\ | \Psi(t) \rangle = \hat{U}(t) | \Psi_0 \rangle$
Where $\hat{U}(t)$ is the evolution operator

Evolution operator must preserve the vector norm (according to the Born interpretation), so it looks like a rotation.

Plug into Schrödinger:
$\displaystyle i\hbar \partial_t \hat{U}(t) = \hat{H}\hat{U}(t), \qquad \hat{U}(0) = \hat{1}$
i.e. $\hat{U}$ does not depend on the initial condition of $| \Psi_0 \rangle$
$\displaystyle \hat{U}(t) = e^{-\frac{i}{\hbar}\hat{H}t}$
Verify:
$\displaystyle i \hbar \partial_t \left(e^{-\frac{i}{\hbar}\hat{H}t}\right) = \hat{H} \left(e^{-\frac{i}{\hbar}\hat{H}t} \right) = \hat{H}\hat{U}(t)$

$\Rightarrow | \Psi(t) \rangle = e^{-\frac{i}{\hbar}\hat{H}t} | \vec{R}_i \rangle$

Asside: define the exponential of an operator, $\hat{X}$ with it’s Taylor series:
$e^{\hat{X}} = 1 + \hat{X} + \frac{\hat{X}^2}{2!} + \frac{\hat{X}^3}{3!} + \ldots$

## Propagator

a.k.a. the transition amplitude

$\displaystyle \langle \vec{R}_f | \Psi(t) \rangle = \langle \vec{R}_f | e^{-\frac{i}{\hbar}\hat{H}t} | \vec{R}_i \rangle = G(\vec{R}_i, \vec{R}_f; t) = \mathrm{"Green function"}$

Exponential of an operator is messy (infinite sum, see above) so simplify using:

• $\int | x \rangle \langle x | \; dx = \hat{1}$

• $\begin{array}{ll} | \Psi(t) \rangle &= \hat{U}(t) | \Psi(0) \rangle \\ &= \hat{U}(t - t_1) | \Psi(t_1) \rangle \\ &= \hat{U}(t - t_1) \hat{U}(t_1) | \Psi(0) \rangle \end{array}$

Combining the above:
$\displaystyle \langle x_f | \hat{U}(t) | x_i \rangle = \langle x_f | \hat{U}(t/2) \hat{U}(t/2) | x_i \rangle = \int \langle x_f | \hat{U}(t/2) | x \rangle \langle x | \hat{U}(t/2) | x_i \rangle \; dx$

Consider all possible intermediate points on the path from x_i to x_f

Reapplying this N times gives:
$\displaystyle \hat{U}(t) = \hat{U}(t/N)^N = \hat{U}(t/N) \times \hat{U}(t/N) \times \ldots \times \hat{U}(t/N)$

Let $N \rightarrow \infty, \quad \Delta t = t/N$ becomes small, and using a first order approximation:
$\displaystyle e^{-\frac{i}{\hbar N} \hat{H}t} \approx 1 - \frac{i}{\hbar} \hat{H} \Delta t$
$\displaystyle \mathrm{i.e.}\; e^{-\frac{i}{\hbar}\hat{H}t} = \left( 1 - \frac{i}{\hbar} \hat{H} \frac{t}{N} \right)^N, \quad N \rightarrow \infty$

Propagator becomes a product:
$\displaystyle \langle x_f | \hat{U}(t) | x_i \rangle = \int dx_1 \ldots x_{N-1} \prod_{k=0}^N \langle x_{k+1} | 1 - \frac{i}{\hbar N} \hat{H} t | x_k \rangle$

Asside: difference between $| \Psi \rangle, \; \Psi(x)$

$| \Psi \rangle$ – Represents an “abstract” state of the system, coordinate-independent
$\Psi(x)$ – Represents $| \Psi \rangle$ in a coordinate system. $\Psi(x) = \langle x | \Psi \rangle$

Asside: the Dirac delta-function

• $\delta_{ij} = \vec{e}_i \cdot \vec{e}_j = \left\{ \begin{array}{ll}0 & i \neq j \\ 1 & i = j \end{array} \right.$
• Extension to a “continuum” basis $\{ | x \rangle \}$
$\displaystyle \langle x | x' \rangle = \delta(x - x') = \left\{ \begin{array}{ll} 0 & x \neq x' \\ C & x=x' \end{array} \right.$
where C normalizes: $\int_{-\infty}^{\infty} dx \; \delta(x - x') = 1$
$\Rightarrow C = \infty$
• Fourier transform:
$\displaystyle \delta(x) = \int_{-\infty}^{\infty} \frac{dk}{2\pi} e^{ikx}$

## Breaking down the propagator equation

• $\displaystyle \langle x | P \rangle = \frac{1}{\sqrt{2\pi \hbar}} e^{\frac{i}{\hbar}px}$
• $\displaystyle \langle x_{k+1} | x_k \rangle = \delta(x_{k+1} - x_k)$
• $\displaystyle \langle x_{k+1} | V(\hat{x}) | x_k \rangle = V(x_k) \delta (x_{k+1} - x_k)$
because $| x_k \rangle$ is an eigen state of the coordinate system
• $\displaystyle \langle x_{k+1} | \frac{\hat{p}^2}{2m} | x_k \rangle = \int dp_k \langle x_{k+1} | \frac{\hat{p}^2}{2m} | p_k \rangle \langle p_k | x_k \rangle = \int \frac{1}{2\pi\hbar} \frac{p_k^2}{2m} e^{\frac{ip_k}{\hbar}(x_{k+1} - x_k)}$

## Putting it all together

Illustration of 2 possible trajectories.

$\displaystyle \begin{array}{lll} \langle x_{k+1} | 1 - \frac{i}{\hbar} \hat{H} \Delta t | x_k \rangle &\propto \int dp_k\; e^{\frac{i}{\hbar}p_k \Delta x_k} \left[ 1 - \frac{i}{\hbar} \left( \frac{p_k^2}{2m} + V(x_k) \right) \Delta t \right] & \\ &= \int dp_k\; e^{\frac{i}{\hbar}p_k \Delta x_k} \exp \left[ -\frac{i}{\hbar} \left( \frac{p_k^2}{2m} + V(x_k) \right) \Delta t \right] & (\mathrm{using}\; e^\epsilon = 1 + \epsilon) \\ &= \exp \left[ \frac{i}{\hbar} \left( \frac{m}{2} \frac{\Delta x_k^2}{\Delta t^2} - V(x_k) \right) \Delta t \right] & (\mathrm{recognizing\; Gaussian\; integral}) \\ &= e^{\frac{i}{\hbar} \mathscr{L}_k \Delta t} \end{array}$

where $\mathscr{L}$ is the Lagrangian

$\displaystyle \begin{array}{ll} \Rightarrow \langle x_f | \hat{U}(t) | x_i \rangle &= \int dx_1\;dx_2 \ldots\; e^{\frac{i}{\hbar} \mathscr{L}_1 \Delta t} e^{\frac{i}{\hbar} \mathscr{L}_2 \Delta t} \ldots \\ &= \int e^{\frac{i}{\hbar} \sum_k \mathscr{L}_k \Delta t} = \int e^{\frac{i}{\hbar} \int_0^t \mathscr{L} dt} = e^{\frac{i}{\hbar}S} \\ &\equiv \int \mathscr{D}x(t) e^{\frac{i}{\hbar} \int_0^t \mathscr{L} dt} \end{array}$


text:
# A chain of triplets

Calculus Level 1

$S=\dfrac { 1 }{ 1\cdot 2\cdot 3 } +\dfrac { 1 }{ 3\cdot 4\cdot 5 } +\dfrac { 1 }{ 5\cdot 6\cdot 7 } +\dfrac { 1 }{ 7\cdot 8\cdot 9 } +\frac { 1 }{ 9\cdot 10\cdot 11 } +\cdots$

The sum $$S$$ can be expressed in the form $$\ln { A } -\frac { 1 }{ A },$$ where $$A$$ is a prime number.

What is $$A?$$

×


text:
### 313. Super Ugly Number

Write a program to find the nth super ugly number.

Super ugly numbers are positive numbers whose all prime factors are in the given prime list primes of size k. For example, [1, 2, 4, 7, 8, 13, 14, 16, 19, 26, 28, 32]  is the sequence of the first 12 super ugly numbers given primes = [2, 7, 13, 19] of size 4.

Note:
(1) 1 is a super ugly number for any given primes.
(2) The given numbers in primes are in ascending order.
(3) 0 < k ≤ 100, 0 < n ≤ 106, 0 < primes[i] < 1000.
(4) The nth super ugly number is guaranteed to fit in a 32-bit signed integer.

Credits:
Special thanks to @dietpepsi for adding this problem and creating all test cases.

Seen this question in a real interview before?
When did you encounter this question?
Which company?
Send Feedback


text:
39 views

How to solve these type of questions please explain?

asked | 39 views

Method 1 : Eliminating Options

The fastest way would be "Eliminating Options".
Here, RE $II$ can be eliminated by Taking String $10101$..which is accepted by the FA in Diagram But not generated by RE $II$.

So, You can eliminate Options $A,C,D$ as they have RE $II$.

This method can only be used to Eliminate options, Not for Selecting correct Option. This method is based on the quote/expression "When you have eliminated the impossible, Whatever remains however improvable must be the Truth"..

We were lucky that Three Options got eliminated here in this Question. But this would not be the case everytime, So, Knowing correct logic is required.

Method 2 : Sense the Language of the FA :(Best method if we can)

With lots of practice, we can make ourselves able to sense the language of the FA in most questions.

Here, It is a Standard FA which accepts the language "Ending with $1$" . So, Answer would Option B as RE $I$ and $III$ generate the language "Ending with $1$"

Method 3 : Convert the FA into RE using Boring and lengthy algorithms

Knowing every algorithm in the syllabus surely helps sometimes. Here also, You could just use the "FA to RE" algorithm and get the answer. The one drawback of this method is that algorithm will give 1 or 2 RE But maybe none of them are in the options. Here,in our question, It is not the case. So, Apply this method and see.

answered by Boss (13.2k points)

duplicate question.please close it https://gateoverflow.in/1914/gate2014-1-36

answered by Active (4k points)


text:
#### Vol. 10, No. 3, 2017

 Recent Issues
 The Journal About the Journal Editorial Board Subscriptions Editors’ Interests Scientific Advantages Submission Guidelines Submission Form Ethics Statement Editorial Login ISSN: 1944-4184 (e-only) ISSN: 1944-4176 (print) Author Index Coming Soon Other MSP Journals
Reeb dynamics of the link of the $A_n$ singularity

### Leonardo Abbrescia, I. Huq-Kuruvilla, J. Nelson and N. Sultani

Vol. 10 (2017), No. 3, 417–442
##### Abstract

The link of the ${A}_{n}$ singularity, ${L}_{{A}_{n}}\subset {ℂ}^{3}$ admits a natural contact structure ${\xi }_{0}$ coming from the set of complex tangencies. The canonical contact form ${\alpha }_{0}$ associated to ${\xi }_{0}$ is degenerate and thus has no isolated Reeb orbits. We show that there is a nondegenerate contact form for a contact structure equivalent to ${\xi }_{0}$ that has two isolated simple periodic Reeb orbits. We compute the Conley–Zehnder index of these simple orbits and their iterates. From these calculations we compute the positive ${S}^{1}$-equivariant symplectic homology groups for $\left({L}_{{A}_{n}},{\xi }_{0}\right)$. In addition, we prove that $\left({L}_{{A}_{n}},{\xi }_{0}\right)$ is contactomorphic to the lens space $L\left(n+1,n\right)$, equipped with its canonical contact structure ${\xi }_{std}$.

##### Keywords
contact geometry, contact topology, Conley–Zehnder index, $A_n$ singularity, Reeb dynamic, Maslov index
##### Mathematical Subject Classification 2010
Primary: 37B30, 53D35, 57R17
Secondary: 53D42


text:
# Math Insight

### Overview of: Matrix vector multiplication

Introduction to multiplication of vector by scalars and matrices. Graphical interpretation of the multiplication.

#### Points and due date summary

Total points: 1
Assigned: Jan. 23, 2017, 11:15 a.m.
Due: Feb. 1, 2017, 11:59 p.m.


text:
## Setting up

In this note we demonstrate the basic MetaCell use on the small 8K PBMC data freely available from 10X Genomics. The guide includes import and manipulations of single cell RNA-seq count matrices, extraction of features genes, modeling cell-cell similarities and inference of a MetaCell model.

library("metacell")

To start using MetaCell, you first initialize a database. This is not much more than linking the package to directory that stores all your objects. In our case we will initialize the database to the testdb directory:

if(!dir.exists("testdb")) dir.create("testdb/")
scdb_init("testdb/", force_reinit=T)
#> initializing scdb to testdb/

force_reinit=T instruct the system to override existing database objects. This can be important if you are running in cycles and would like to update your objects. Otherwise, the database reuses loaded objects to save time on reading and initializing them from the disk.

Let's load a matrix to the system. We will import a 10x data set that is stored in the package datain directory, using a sparse matrix format generated by the 10x pipeline:

mcell_import_scmat_10x("test", base_dir="http://www.wisdom.weizmann.ac.il/~atanay/metac_data/pbmc_8k/")
#> remote mode
#> summing up total of 0 paralog genes into 0 unique genes
#> [1] TRUE
mat = scdb_mat("test")
print(dim(mat@mat))
#> [1] 29040  8364

The scdb_mat() command is returns a matrix object, which has one slot containing the count matrix - mat@mat, as well as additional features we will mention below.

Before starting to analyze the data, we link the package to a figure directory:

if(!dir.exists("figs")) dir.create("figs/")
scfigs_init("figs/")

MetaCell uses a standardized naming scheme for the figures, to make it easier to archive and link analysis figures to the database objects. In principle, figures in the figures directory are named after the object data type they refer to (for example, mat for matrices, mc for metacells, and more, see below). The figure name then includes also the object name they refer to, and a suffix describing the actual figure type.

## Exploring and filtering the UMI matrix

To get a basic understanding of the new data, we will plot the distribution of UMI count per cell (the plot is thresholded at 800 UMIs by default):

mcell_plot_umis_per_cell("test")
#> [1] 300

We want to clean some known issues from the matrix before starting to work with it. We generate a list of mitochondrial genes that typically mark cells as being stressed or dying, as well as immunoglobulin genes that may represent strong clonal signatures in plasma cells, rather than cellular identity.

mat = scdb_mat("test")
nms = c(rownames(mat@mat), rownames(mat@ignore_gmat))
ig_genes = c(grep("^IGJ", nms, v=T),
grep("^IGH",nms,v=T),
grep("^IGK", nms, v=T),
grep("^IGL", nms, v=T))

bad_genes = unique(c(grep("^MT-", nms, v=T), grep("^MTMR", nms, v=T), grep("^MTND", nms, v=T),"NEAT1","TMSB4X", "TMSB10", ig_genes))

#>   [1] "MT-ATP6"      "MT-ATP8"      "MT-CO1"       "MT-CO2"       "MT-CO3"
#>   [6] "MT-CYB"       "MT-ND1"       "MT-ND2"       "MT-ND3"       "MT-ND4"
#>  [11] "MT-ND4L"      "MT-ND5"       "MT-ND6"       "MT-RNR1"      "MT-RNR2"
#>  [16] "MT-TA"        "MT-TC"        "MT-TD"        "MT-TE"        "MT-TF"
#>  [21] "MT-TG"        "MT-TH"        "MT-TI"        "MT-TL1"       "MT-TL2"
#>  [26] "MT-TM"        "MT-TP"        "MT-TQ"        "MT-TS1"       "MT-TT"
#>  [31] "MT-TV"        "MT-TW"        "MT-TY"        "MTMR1"        "MTMR10"
#>  [36] "MTMR11"       "MTMR12"       "MTMR14"       "MTMR2"        "MTMR3"
#>  [41] "MTMR4"        "MTMR6"        "MTMR7"        "MTMR8"        "MTMR9"
#>  [46] "MTMR9LP"      "MTND1P11"     "MTND1P23"     "MTND1P32"     "MTND1P8"
#>  [51] "MTND2P12"     "MTND2P2"      "MTND2P28"     "MTND2P32"     "MTND2P40"
#>  [56] "MTND4LP30"    "MTND4P11"     "MTND4P12"     "MTND4P14"     "MTND4P32"
#>  [61] "MTND4P35"     "MTND4P9"      "MTND5P10"     "MTND5P11"     "MTND5P12"
#>  [66] "MTND5P14"     "MTND5P2"      "MTND5P26"     "MTND5P32"     "MTND5P33"
#>  [71] "MTND5P5"      "MTND6P21"     "MTND6P3"      "MTND6P4"      "MTND6P5"
#>  [76] "NEAT1"        "TMSB4X"       "TMSB10"       "IGHA1"        "IGHA2"
#>  [81] "IGHD"         "IGHD3-22"     "IGHD6-19"     "IGHD7-27"     "IGHE"
#>  [86] "IGHEP1"       "IGHEP2"       "IGHG1"        "IGHG2"        "IGHG3"
#>  [91] "IGHG4"        "IGHGP"        "IGHJ1"        "IGHJ2"        "IGHJ2P"
#>  [96] "IGHJ3P"       "IGHJ4"        "IGHJ5"        "IGHJ6"        "IGHM"
#> [101] "IGHMBP2"      "IGHV1-14"     "IGHV1-18"     "IGHV1-2"      "IGHV1-24"
#> [106] "IGHV1-3"      "IGHV1-46"     "IGHV1-67"     "IGHV1-69"     "IGHV1-69D"
#> [111] "IGHV2-26"     "IGHV2-5"      "IGHV2-70D"    "IGHV3-11"     "IGHV3-13"
#> [116] "IGHV3-15"     "IGHV3-21"     "IGHV3-23"     "IGHV3-30"     "IGHV3-33"
#> [121] "IGHV3-43"     "IGHV3-48"     "IGHV3-49"     "IGHV3-53"     "IGHV3-64D"
#> [126] "IGHV3-66"     "IGHV3-69-1"   "IGHV3-7"      "IGHV3-72"     "IGHV3-73"
#> [131] "IGHV3-74"     "IGHV3OR15-7"  "IGHV4-31"     "IGHV4-34"     "IGHV4-39"
#> [136] "IGHV4-4"      "IGHV4-59"     "IGHV4-61"     "IGHV5-10-1"   "IGHV5-51"
#> [141] "IGHV5-78"     "IGHV6-1"      "IGHVIII-76-1" "IGKC"         "IGKJ1"
#> [146] "IGKJ3"        "IGKJ4"        "IGKJ5"        "IGKV1-12"     "IGKV1-13"
#> [151] "IGKV1-16"     "IGKV1-17"     "IGKV1-27"     "IGKV1-39"     "IGKV1-5"
#> [156] "IGKV1-6"      "IGKV1-8"      "IGKV1-9"      "IGKV1D-13"    "IGKV1D-17"
#> [161] "IGKV1D-8"     "IGKV2-19"     "IGKV2-26"     "IGKV2-28"     "IGKV2-29"
#> [166] "IGKV2-30"     "IGKV2D-26"    "IGKV2D-28"    "IGKV2D-29"    "IGKV2D-40"
#> [171] "IGKV2OR2-1"   "IGKV3-11"     "IGKV3-15"     "IGKV3-20"     "IGKV3D-20"
#> [176] "IGKV4-1"      "IGKV5-2"      "IGLC2"        "IGLC3"        "IGLC4"
#> [181] "IGLC5"        "IGLC6"        "IGLC7"        "IGLJ2"        "IGLL1"
#> [186] "IGLL3P"       "IGLL5"        "IGLV1-40"     "IGLV1-41"     "IGLV1-44"
#> [191] "IGLV1-47"     "IGLV1-51"     "IGLV2-11"     "IGLV2-14"     "IGLV2-18"
#> [196] "IGLV2-23"     "IGLV2-5"      "IGLV2-8"      "IGLV3-1"      "IGLV3-10"
#> [201] "IGLV3-16"     "IGLV3-19"     "IGLV3-21"     "IGLV3-25"     "IGLV3-27"
#> [206] "IGLV3-9"      "IGLV4-69"     "IGLV5-37"     "IGLV5-45"     "IGLV6-57"
#> [211] "IGLV7-43"     "IGLV7-46"     "IGLV8-61"     "IGLVI-20"

We will next ask the package to ignore the above genes:

mcell_mat_ignore_genes(new_mat_id="test", mat_id="test", bad_genes, reverse=F)

Ignored genes are kept in the matrix for reference, but all downstream analysis will disregard them. This means that the number of UMIs from these genes cannot be used to distinguish between cells.

In the current example we will also eliminate cells with less than 800 UMIs (threshold can be set based on examination of the UMI count distribution):

mcell_mat_ignore_small_cells("test", "test", 800)

Note that filtering decisions can be iteratively modified given results of the downstream analysis.

## Selecting feature genes

We move on to computing statistics on the distributions of each gene in the data, which are going to be our main tool for selecting feature genes for MetaCell analysis:

mcell_add_gene_stat(gstat_id="test", mat_id="test", force=T)
#> Calculating gene statistics...
#> will downsamp
#> done downsamp
#> will gen mat_n
#> done gen mat_n
#> done computing basic gstat, will compute trends
#> ..done

This generates a new object of type gstat under the name "test", by analyzing the count matrix with id "test". We can explore interesting genes and their distributions, or move directly to select a gene set for downstream analysis. For now, let's to the latter.

We create a new object of type gset (gene set), to which all genes whose scaled variance (variance divided by mean) exceeds a given threshold are added:

mcell_gset_filter_varmean(gset_id="test_feats", gstat_id="test", T_vm=0.08, force_new=T)
mcell_gset_filter_cov(gset_id = "test_feats", gstat_id="test", T_tot=100, T_top3=2)

The first command creates a new gene set with all genes for which the scaled variance is 0.08 and higher. The second command restrict this gene set to genes with at least 100 UMIs across the entire dataset, and also requires selected genes to have at least three cells for more than 2 UMIs were recorded.

We can refine our parameters by plotting all genes and our selected gene set given the mean and variance statistics:

mcell_plot_gstats(gstat_id="test", gset_id="test_feats")
#> agg_png
#>       2

## Building the balanced cell graph

Assuming we are happy with the selected genes (some strategies for studying them will be discussed in another vignette), we will move forward to create a similarity graph (cgraph), using a construction called balanced K-nn graph:

mcell_add_cgraph_from_mat_bknn(mat_id="test",
gset_id = "test_feats",
graph_id="test_graph",
K=100,
dsamp=T)
#> will downsample the matrix, N= 1877
#> will build balanced knn graph on 8276 cells and 919 genes, this can be a bit heavy for >20,000 cells
#> sim graph is missing 34 nodes, out of 8276

This adds to the database a new cgraph object named test_graph. The K=100 parameter is important, as it affects the size distribution of the derived metacells. Note that constructing the graph can become computationally intensive if going beyond 20-30,000 cells. The system is currently limited by memory, and we have generated a graph on 160,000 cells on machines with 0.5TB RAM. For more modest data sets (e.g. few 10x lanes or MARS-seq experiments), things will run very quickly.

## Resampling and generating the co-clustering graph

The next step will use the cgraph to sample five hundred metacell partitions, each covering 75% of the cells and organizing them in dense subgraphs:

mcell_coclust_from_graph_resamp(
coc_id="test_coc500",
graph_id="test_graph",
min_mc_size=20,
p_resamp=0.75, n_resamp=500)
#> running bootstrap to generate cocluster
#> done resampling

The metacell size distribution of the resampled partitions will be largely determined by the K parameter used for computing the cgraph. The resampling process may take a while if the graphs are very large. You can modify n_resamp to generate fewer resamples.

The resampling procedure creates a new coclust object in the database named test_coc500, and stores the number of times each pair of cells ended up being part of the same metacell. The co-clustering statistics are used to generate a new similarity graph, based on which accurate calling of the final set of metacells is done:

mcell_mc_from_coclust_balanced(
coc_id="test_coc500",
mat_id= "test",
mc_id= "test_mc",
K=30, min_mc_size=30, alpha=2)
#> filtered 4328387 left with 717178 based on co-cluster imbalance
#> building metacell object, #mc 75
#> compute footprints
#> compute absolute ps
#> compute coverage ps
#> reordering metacells by hclust and most variable two markers
#> reorder on CD74 vs JUNB

We created a metacell object test_mc based on analysis of the co-clustering graph. The parameter K determines the number of neighbors we wish to minimally associate with each cell. Prior to partitioning the co-cluster graph is filtered to eliminate highly unbalanced edges, with smaller alpha resulting in harsher filtering.

## Removing outlier cells

We now have a preliminary metacell object. It is a good practice to make sure all metacells within it are homogeneous. This is done by the outlier scan procedure, which splits metacells whose underlying similarity structure supports the existence of multiple sub-clusters, and removes outlier cells that strongly deviate from their metacell's expression profile.

mcell_plot_outlier_heatmap(mc_id="test_mc", mat_id = "test", T_lfc=3)
#> agg_png
#>       2
mcell_mc_split_filt(new_mc_id="test_mc_f",
mc_id="test_mc",
mat_id="test",
T_lfc=3, plot_mats=F)
#> starting split outliers
#> compute footprints
#> compute absolute ps
#> compute coverage ps

The first command generates a heat map summarizing the detected outlier behaviors. This is possible only for data sets of modest size.

## Selecting markers and coloring metacells

The filtered metacell object test_mc_f can now be visualized. In order to do this effectively, we usually go through one or two iterations of selecting informative marker genes. The package can select markers for you automatically - by simply looking for genes that are strongly enriched in any of the metacells:

mcell_gset_from_mc_markers(gset_id="test_markers", mc_id="test_mc_f")

It is however very useful to analyze metacell models in depth, and select genes with known or hypothesized biological significance. We will assign each of these genes with a color, fold change threshold and priority, using a table that look like this:

group gene color priority T_fold
NK CLIC3 brown 4 8
NK_KLRF1 KLRF1 chocolate3 8 3
CD8 CD8B yellow 5 2
T+GMZK GZMK sienna1 5 4
Mk+COMP C1QA darkolivegreen 5 2
S100A9 S100A9 darkseagreen3 5 20
LYZ LYZ chartreuse 4 8
B CD79B lightblue 4 4
MZB1 MZB1 cyan 5 4
IRF8 IRF8 cyan2 5 4
IL7R IL7R navajowhite2 3 2
Treg FOXP3 magenta 5 1.5
CD3 CD3G lemonchiffon 1 0.7

Applying this table to color metacells is done using the command mc_colorize as shown below. Note that there are more sophisticated ways to color/annotate metacells, and that the model's understanding and annotation can often greatly benefit from looking at gene distributions and reading literature about possible functions and regulatory mechanisms.

marks_colors = read.table(system.file("extdata", "pbmc_mc_colorize.txt", package="metacell"), sep="\t", h=T, stringsAsFactors=F)
mc_colorize("test_mc_f", marker_colors=marks_colors)

We are now equipped with some basic coloring of metacells, which can also be accessed directly:

mc = scdb_mc("test_mc_f")
table(mc@colors)
#>
#>     chartreuse     chocolate3          cyan2 darkolivegreen  darkseagreen3
#>              3              2              1              1             15
#>   lemonchiffon      lightblue   navajowhite2           plum        sienna1
#>             16              9              7              3              8
#>         yellow
#>             10

## Creating a heatmap of genes and metacells

We can use the colors to produce a labeled heat map, showing selected genes and their distributions over metacells, with the colored annotation shown at the bottom:

mcell_mc_plot_marks(mc_id="test_mc_f", gset_id="test_markers", mat_id="test")
#> setting fig h to 1000 md levels 0 num of marks 48

Note that the values plotted are color coded log2(fold enrichment) value of the metacell over the median of all other metacells. It can be useful to explore these values directly - e.g.:

lfp = log2(mc@mc_fp)
tail(sort(lfp["CD8A",]))
#>       66       53       55       64       67       65
#> 1.819782 1.859731 1.947739 1.975142 2.004764 2.195528

## Projecting metacells and cells in 2D

Heat maps are useful but sometimes hard to interprets, and so we may want to visualize the similarity structure among metacells (or among cells within metacells). To this end we construct a 2D projection of the metacells, and use it to plot the metacells and key similarities between them (shown as connecting edges), as well as the cells. This plot will use the same metacell coloring we established before (and in case we improve the coloring based on additional analysis, the plot can be regenerated):

mcell_mc2d_force_knn(mc2d_id="test_2dproj",mc_id="test_mc_f", graph_id="test_graph")
#> comp mc graph using the graph test_graph and K 20
#> Missing coordinates in some cells that are not ourliers or ignored - check this out! (total 1 cells are missing, maybe you used the wrong graph object? first nodes CCCTCCTAGTCGCCGT
tgconfig::set_param("mcell_mc2d_height",1000, "metacell")
tgconfig::set_param("mcell_mc2d_width",1000, "metacell")
mcell_mc2d_plot(mc2d_id="test_2dproj")
#> agg_png
#>       2

Note that we changed the metacell parameters "mcell_mc2d_height/width" to get a reasonably-sized figure. There are many additional parameters that can be tuned in MetaCell, and more of those meant for routine tuning will be discussed in other vignettes. We obtain the following figure:

## Visualizing the MC confusion matrix

While 2D projections are popular and intuitive (albeit sometimes misleading) ways to visualize scRNA-seq results, we can also summarize the similarity structure among metacells using a "confusion matrix" which encodes the pairwise similarities between all metacells. This matrix may capture hierarchical structures or other complex organizations among metacells.

We first create a hierarchical clustering of metacells, based on the number of similarity relations between their cells:

mc_hc = mcell_mc_hclust_confu(mc_id="test_mc_f",
graph_id="test_graph")

Next, we generate clusters of metacells based on this hierarchy, and visualize the confusion matrix and these clusters. The confusion matrix is shown at the bottom, and the top panel encodes the cluster hierarchy (subtrees in blue, sibling subtrees in gray):

mc_sup = mcell_mc_hierarchy(mc_id="test_mc_f",
mc_hc=mc_hc, T_gap=0.04)
mcell_mc_plot_hierarchy(mc_id="test_mc_f",
graph_id="test_graph",
mc_order=mc_hc\$order,
sup_mc = mc_sup,
width=2800, heigh=2000, min_nmc=2)
#> agg_png
#>       2


text:
How do I add the nth element for every line in a text file?

Suppose I have a text file, in this format:

1 1 1 1 1 99.5016 10.43 99.5016 99.5016 7.074 47.8012 10.43 7.074 7.074
2 1 1 1 1 99.5016 10.43 99.5016 99.5016 7.074 47.8012 10.43 7.074 7.074
3 1 1 1 1 99.5016 10.43 99.5016 99.5016 7.074 47.8012 10.43 7.074 7.074

And I want to add up all the elements in the ones column, for a certain number of lines. How would I do that?

I have this currently:

data = Import[
"/Users/myname/Documents/foldername/filename.txt", "Table"]
Total@data[[All, 2]];

You need Import, Part (i.e. [[...]]), probably Span (i.e. ;;), and Total.

Import the data:

data = Import["path\to\yourdatafile.txt", "Table"];

Sum all entries in the first column:

Total@data[[All, 1]]

Sum entries in the third column and in the second to third row:

Total@data[[2 ;; 3, 3]]

Sum entries in column 2, rows 1 and 3:

Total@data[[{1, 3}, 2]]

• I believe I did everything you mentioned, but it doesn't produce an output. data=Import["textfile", "Table"]; Total@data[[2;;10000,2]]; (If I wanted to add up everything in the second column) – Ihaveaquestion May 11 '16 at 19:53
• @Ihaveaquestion Well, I took your sample data and copied in a text file, then ran the code exactly as shown, just substituting the correct path, and obtained these results. I suspect that perhaps the format of the file is not as you expect it, or the numbers are not stored in a simple form. Could you share the exact contents of your data file? – MarcoB May 11 '16 at 19:55
• There are 10k lines in my text file, so I don't think I can fit that here. The elements in each line are separated by a single space, and each line has 13 elements. – Ihaveaquestion May 11 '16 at 19:55
• @Ihaveaquestion Then perhaps you could show the first few here, just to make sure of format, then provide a link to the whole file (pastebin, filetea, dropbox, github, etc). – MarcoB May 11 '16 at 19:56
• replaced original question's lines with 3 actual lines from my file – Ihaveaquestion May 11 '16 at 19:57

I figured it out.

data = Import[
"/Users/myname/Documents/foldername/filename.txt", "Table"]
Total[data, {1}]

Part of the error was that I had an empty row at the end of my text file.


text:
# How to find the equation of a circle that shares a tangent with another circle of known centre and radius?

A circle has equation, $x^2+y^2+14x+4y-19=0$

A smaller circle of centre $C$ shares a common tangent $y=3-x$ at the point $P$

The radius of the larger circle is three times the radius of the smaller circle.

Find the equation of the smaller circle.

visual of question

I've spent a while playing around with this question. I have manged to solve it through the use of a diagram but I cannot see a more... Mathematical solution.

Through "counting boxes" I found the equation to be $(x-1)^2+(y-6)^2=(2\sqrt2 )^2$

Any input is much appreciated. Thanks in advance.

$\left.\right.$
Suppose the equation of the small circle is $$(x-a)^2+(y-b)^2=(2\sqrt2)^2$$ Then differentiate both sides w.r.t $\,x$, and we have $$2(x-a)+2(y-b)\frac{dy}{dx}=0$$ Since the tangent point is $(-1,4)$ and the the slope of the tangent line is $-1$, we have $$2(-1-a)+2(4-b)(-1)=0$$ $$\Rightarrow\ \ b=5+a$$ Back to the equation of the small circle, $$(-1-a)^2+(4-(a+5))^2=8$$ $$\Rightarrow\quad 2(a+1)^2=8\quad$$ $$\Rightarrow\quad a=-3,1\ \ \ \&\ \ \ b=2,6$$ Thus, the equation of the small circle is: $$(x+3)^2+(y-2)^2=8$$ $$\text{or}\quad\ (x-1)^2+(y-6)^2=8\qquad$$
Sketch: First of all find the coordinates of $P$. Then write the equation of the line $s$ perpendicular to $y=3-x$ which passes through $P$. Then write a generic point on $s$ and find the ones whose distance from $P$ is equal to $R/3$, where $R$ is the radius of the big circle (You will find two points: one within the big circle and one outside. Of course you need to select the latter).
Hint: The center of large circle is $C(-7,-2)$. Obtain a line perpendicular to $L:\,y=3-x$ which pass through $C$, named $L'$, Find the distance $C$ from $L$ and with $\frac13$ you find redius of smaller circle. find it's center on line $L'$ to finish your work. The contact point $P:\,LL'$ help more because if $P(\alpha,\beta)$ and $C'(a,b)$ then $$\alpha=\dfrac{-7\times3+a\times1}{4},\beta=\dfrac{-2\times3+b\times1}{4}$$


text:
Reinforcement learning (RL) has been used successfully for solving tasks which have a well defined reward function – think AlphaZero for Go, OpenAI Five for Dota, or AlphaStar for StarCraft. However, in many practical situations you don’t have a well defined reward function. Even a task as seemingly straightforward as cleaning a room has many subtle cases: should a business card with a piece of gum be thrown away as trash, or might it have sentimental value? Should the clothes on the floor be washed, or returned to the closet? Where are notebooks supposed to be stored? Even when these aspects of a task have been clarified, translating it into a reward is non-trivial: if you provide rewards every time you sweep the trash, then the agent might dump the trash back out so that it can sweep it up again.1

Alternatively, we can try to learn a reward function from human feedback about the behavior of the agent. For example, Deep RL from Human Preferences learns a reward function from pairwise comparisons of video clips of the agent’s behavior. Unfortunately, however, this approach can be very costly: training a MuJoCo Cheetah to run forward requires a human to provide 750 comparisons.

Instead, we propose an algorithm that can learn a policy without any human supervision or reward function, by using information implicitly available in the state of the world. For example, we learn a policy that balances this Cheetah on its front leg from a single state in which it is balancing.

# Learning preferences by looking at the world

Humans seem to infer what other people want without needing much explicit supervision. How do we do it? As a concrete example, let’s imagine that you walk into a room, and you see this:

You’re probably going to immediately be a lot more careful, to ensure you don’t knock down the elaborate house of cards.2 But how exactly did you know that you shouldn’t knock it down? Presumably you’ve never encountered a situation like this before, so it can’t be past experience. Nor can it be “built-in priors” from evolution – our hunter-gatherer ancestors did not routinely find giant houses of cards while foraging. No, the reason you know it should not be knocked down is that someone has clearly put in a lot of effort into making this house of cards – it certainly didn’t build itself – and they wouldn’t have done so unless they really cared about it.

Preferences Implicit in the State of the World develops an algorithm, Reward Learning by Simulating the Past (RLSP), that does this sort of reasoning, allowing an agent to infer human preferences without explicit feedback. As an example, consider the room environment below:

When the robot is deployed, Alice asks it to navigate to the purple door. If we were to encode this as a reward function that only rewards the robot while it is at the purple door, the robot would take the shortest path to the purple door, knocking over and breaking the vase – since no one said it shouldn’t do that. The robot is perfectly aware that its plan causes it to break the vase, but by default it doesn’t realize that it shouldn’t break the vase.

RLSP can instead infer that the vase should not be broken. At a high level, it effectively considers all the ways that the past could have been, checks which ones are consistent with the observed state, and infers a reward function based on the result. If Alice didn’t care about whether the vase was broken, she would have probably broken it some time in the past. If she wanted the vase broken, she definitely would have broken it some time in the past. So the only consistent explanation is that Alice cared about the vase being intact. In contrast, we would observe the same state regardless of Alice’s preferences about carpets, and so RLSP does not infer anything about those preferences.

Unfortunately, this approach requires reasoning about all possible pasts, which is intractable in even moderate environments. Prior work has only tested the idea in very simple gridworld environments. What would it take to scale this idea up to bigger, continuous environments, where we don’t have full knowledge of the environment dynamics? Intuitively, it should still be possible to make such inferences. Consider for example this Cheetah that is balancing on its front leg. Just as before, we can reason that there are very few behaviors that end up with the Cheetah in this particular state, and so the Cheetah “prefers” to be balancing on one leg.

In our latest paper presented at ICLR 2021, we introduce Deep Reward Learning by Simulating the Past (Deep RLSP), an extension of the RLSP algorithm that can be scaled up to tasks like the balancing Cheetah task.

# Simulating the past

The key difficulty for scaling up RLSP to bigger environments is in how to reason about “what must have happened in the past”. To address this, we sample likely past trajectories, instead of enumerating all possible past trajectories. In the case of the balancing Cheetah, we can infer that the Cheetah must have followed a trajectory similar to the one shown here:

Model-based RL algorithms often simulate the future by rolling out a policy $\pi(a_t \mid s_t)$ to choose actions and an environment dynamics model $\mathcal{T}(s_{t+1} \mid s_t, a_t)$ to predict future states. Similarly, we simulate the past by rolling out an inverse policy $\pi^{-1}(a_t \mid s_{t+1})$ that predicts which action $a_t$ the user took that resulted in the state $s_{t+1}$, and an inverse environment dynamics model $\mathcal{T}^{-1}(s_t \mid s_{t+1}, a_t)$ that predicts the state $s_t$ from which the chosen action $a_t$ would have led to $s_{t+1}$. By alternating between predicting past actions, and predicting past states from which those actions were taken, we can simulate trajectories arbitrarily far into the past.

Before we get into the details of how we train these models, let’s first understand how we’re going to use the trained models to infer preferences from an observed state $s_0$.

# The Deep RLSP gradient estimator

The RLSP algorithm uses gradient ascent to continuously update a linear reward function to explain an observed state $s_0$. To scale this idea up we make two key changes to their approach: (1) we learn a feature representation of each state, and model the reward function as linear in these features, and (2) we approximate the RLSP gradient by sampling likely past trajectories instead of enumerating all possible past trajectories. See our paper for a detailed discussion of the derivation.

This results in the Deep RLSP gradient estimator that aims to maximize the likelihood of an observed state $s_0$ under a reward function defined with a parameter vector $\theta$:

$\displaystyle \nabla_{\theta} \ln p(s_0 \mid \theta) = {\color{Blue}\mathop{\mathbb{E}}\limits_{\tau_{-T:-1}~\sim~\langle s_0, \pi^{-1}, \mathcal{T}^{-1} \rangle}} \left[ {\color{ForestGreen}\left( \sum_{t=-T}^{0} \phi(s_t) \right)} - {\color{Brown}\mathop{\mathbb{E}}\limits_{\tau'~\sim~\langle s_{-T}, \pi, \mathcal{T} \rangle}} \left[ {\color{Red}\left( \sum_{t=-T}^{0} \phi(s'_t) \right)} \right] \right]$

Intuitively the gradient is computed in three steps: First, we simulate backwards to determine what must have happened before $s_0$. Second, we simulate forwards to determine what the current policy (which is optimized for $\theta$) does. Third, we compute the difference of the backward and forward trajectories. This gradient changes the reward parameter $\theta$ such that it rewards the features observed in the backward trajectories, and punishes the features observed in the forward trajectories. As a result, when the reward is reoptimized, the new policy will tend to create trajectories that are less like the forward trajectories and more like the backward trajectories.

In other words, the gradient encourages a reward function such that the backward trajectories (what must have been done in the past) and forward trajectories (what an agent would do using the current reward) are consistent with each other. Once the trajectories are consistent, the gradient becomes zero, and we have learned a reward function that is likely to cause the observed state $s_0$.

The core of our algorithm is to perform gradient ascent using this gradient. However, we need access to $\phi$, $\pi^{-1}$, $\mathcal{T}^{-1}$, $\pi$, and $\mathcal{T}$ to compute the gradient. We learn these models from an initial dataset $\mathcal{D}$ of environment interactions. Note that $\mathcal{D}$ need not involve any human input: in our experiments, we use rollouts of a random policy to produce $\mathcal{D}$. We can then learn the necessary models as follows:

1. The feature function $\phi$ can be trained by applying any self-supervised representation learning technique to $\mathcal{D}$. We use a Variational Autoencoder (VAE) in our experiments.
2. The forward policy $\pi$ is trained using deep RL. We use Soft-Actor-Critic (SAC) in our experiments.
3. The forward environment dynamics $\mathcal{T}$ do not need to be learned, as we have access to a simulator for the environment.
4. The inverse policy $\pi^{-1}$ is trained using supervised learning on $(s, a, s’)$ transitions collected when executing $\pi$.
5. The inverse environment dynamics $\mathcal{T}^{-1}$ is trained using supervised learning on $(s, a, s’)$ transitions in $\mathcal{D}$.

# Deep RLSP in MuJoCo

To test our algorithm, we applied it to tasks in the MuJoCo simulator. These environments are commonly used to benchmark RL algorithms, and a typical task would be to make simulated robots walk.

To evaluate Deep RLSP, we use RL to train policies that walk, run or hop forward, and then sample a single state from these policies. Deep RLSP must then use just that state to infer that it is supposed to make the simulated robot walk forward. Note that this task is a little easier than it sounds because the state information in MuJoCo not only contains joint positions, but also velocities, so a single state also provides some information about how the robot is moving.

Our experiments show that this works reasonably well. We tested it primarily for a Cheetah robot and a Hopper robot, and in both cases it did in fact learn to move forward. Of course, the learned policies don’t perform worse as well as policies that are directly trained on the true reward function.

But the whole point of Deep RLSP is to learn in situations where we don’t have a reward. So, as a more interesting test case, we used Deep RLSP to imitate behaviors from a single state that are hard to explicitly specify in a reward function. We generated a set of “skills” using an unsupervised skill discovery algorithm called DADS, including the balancing skill that we saw earlier. Again, we sampled a single state or a small number of states, and checked whether Deep RLSP would learn to mimic the skill.

Since we don’t have access to a true reward function for “balancing”, we do not have an obvious way to quantitatively evaluate the performance of Deep RLSP. We instead looked at videos of the learned policies and judged them qualitatively. For example, here is the original balancing Cheetah, alongside the behavior learned by Deep RLSP using a single input state:

From left to right: Original policy, Sampled state, and Deep RLSP policy.

The behavior isn’t perfect – you can see that the head sometimes touches the ground, and it doesn’t seem particularly good at balancing – but it has clearly learned the broad outline of what should be done.

# Looking forward

While our initial evaluation of Deep RLSP is promising, there is much remaining work for learning preferences from the state of the world.

The main requirement for Deep RLSP to work well is to learn good models of the inverse environment dynamics and inverse policy, and a good feature function. In the MuJoCo environments we relied on simple representation learning for the feature function and supervised learning for the models. This approach is unlikely to work for much bigger environments or real-world robotics applications. However, we are optimistic that advances in model-based RL can directly be applied to this problem.

A second open question is how to learn preferences from the state of the world in a multiagent setting. Typically the state will be optimized by one or more humans, and we want a different robot to learn these preferences. Deep RLSP currently learns the human’s reward and policy, but ultimately we want to use that to inform the robot’s behavior. In our experiments, the “human” and “robot” were the same, and so we could directly use the inferred policy as our robot policy, but obviously this will not be the case in a realistic application.

Finally, while we focused on imitation learning in this project, Deep RLSP is also very promising for learning safety constraints, such as “don’t break the vase”. We hope that the idea of learning preferences from the state of the world will also be useful for applying RL in safety critical environments.

This post is based on the paper “Learning What To Do by Simulating the Past”, presented at ICLR 2021. You can see our trained policies on our website. We also provide code to reproduce our experiments here.

1. See timestamp 31:47 in the linked podcast. Transcript: ‘One of the examples that I give is my friend and collaborator, Tom Griffiths. When his daughter was really young, she had this toy brush and pan, and she swept up some stuff on the floor and put it in the trash. And he praised her, like “Oh, wow, good job. You swept that really well.” And the daughter was very proud. And then without missing a beat, she dumps the trash back out onto the floor in order to sweep it up a second time and get the same praise a second time.’

2. Or maybe you immediately want to knock it down, because you like to see the world burn. Still, the point is that you do know that it counts as “destruction”, rather than just being a random side effect that nobody cares about.


text:
## 187 – List of all presentations

January 10, 2012

For ease, I re-list here all the presentations we had throughout the term. I also include some of them. If you gave a presentation and would like your notes to be included, please email them to me and I’ll add them here.

• Jeremy Elison, Wednesday, October 12: Georg Cantor and infinity.
• Kevin Byrne, Wednesday, October 26: Alan Turing and Turing machines.
• Keith Ward, Monday, November 7: Grigori Perelman and the Poincaré conjecture.
• David Miller, Wednesday, November 16: Augustin Cauchy and Cauchy’s dispersion equation.
• Taylor Mitchell, Friday, November 18: Lajos Pósa and Hamiltonian circuits.
• Sheryl Tremble, Monday, November 28: Pythagoras and the Pythagorean theorem.
• Blake Dietz, Wednesday, November 30: $\mbox{\em Paul Erd\H os}$ and the Happy End problem.

Here are Jeremy’s notes on his presentation. Here is the Wikipedia page on Cantor, and a link to Cantor’s Attic, a wiki-style page discussing the different (set theoretic) notions of infinity.

Here are a link to the official page for the Alan Turing year, and the Wikipedia page on Turing. If you have heard of Conway’s Game of Life, you may enjoy the following video showing how to simulate a Turing machine within the Game of Life; the Droste effect it refers to is best explained in by H. Lenstra in a talk given at Princeton on April 3, 2007, and available here.

Here is a link to the Wikipedia page on Perelman, and the Clay Institute’s description of the Poincaré conjecture. In 2006, The New Yorker published an interesting article on the unfortunate “controversy” on the priority of Perelman’s proof.

Here are David’s slides on his presentation, and the Wikipedia page on Cauchy.

Here is a link to Ross Honsberger’s article on Pósa (including the result on Hamiltonian circuits that Taylor showed during her presentation).

Here are Sheryl’s slides on Pythagoras and his theorem. In case the gif file does not play, here is a separate copy:

The Pythagorean theorem has many proofs, even one discovered by President Garfield!

Finally, here is the Wikipedia page on $\mbox{Erd\H os}$. Oakland University has a nice page on him, including information on the $\mbox{Erd\H os}$ number; see also the page maintained by Peter Komjáth, and an online depository of most of $\mbox{Erd\H os's}$ papers.


text:
## Anthropomorphism or the art of humanising nonhuman subjects

Academic writing should be clear and objective. In the pursue of objectivity, some believe that by using the first person and introducing ‘I’ or ‘we’ in their text, the outcome will not sound as rigorous or formal. But attempting to avoid the first person may confuse readers, leaving them wondering ‘who does what?’ as we discussed in our article about the passive voice. Focusing on objectivity may also lead to anthropomorphism.

Continue reading “Anthropomorphism or the art
of humanising nonhuman subjects”

## Passive voice in scientific writing: angel or devil?

For years, we were told that in scientific writing we needed to use passive voice to sound formal, neutral and serious. More recently, the contrary philosophy bursted in: suddenly, passive voice had to be by all means avoided as it forces hiding the agent of the sentence and creates confusion. This paradigm shift left many of us in the doubt… is using passive voice in formal, scientific writing right or wrong?

Continue reading “Passive voice in scientific writing: angel or devil?”

## Not in the mood to write? Why you should still show up, even if the muse doesn’t

Let’s face it, us, scientists, are passionate about our job. We are usually delighted about carrying out our scientific tasks (experiments, simulations, reviews, etc.). But when it comes to writing our findings, the motivation goes down. We rarely feel we’re ready to write and we rarely feel in the mood to write… the consequence: when we sit down and are supposed to write, we rather start doing other things, we procrastinate. And of course procrastination comes guilt and frustration. Until the deadline dangerously approaches: then, in the last minute, creativity pops up. Well, let us break it for you: that’s not really last minute creativity, that’s stress and adrenaline doing their job.

In our Road to Bootcamp series of posts, we’ve already covered how starting writing your work early enough will let you fully benefit from the ‘magic’ of the writing process; therefore, reducing procrastination. In this post, we’ll focus on how creativity can be boosted—even when you’re convinced that you’re not in the mood to write.

Continue reading “Not in the mood to write? Why you should still show up, even if the muse doesn’t”

## Want to procrastinate less and be an effective writer? Start writing your articles early enough

If you ask researchers about their main issues when it comes to writing, procrastination always appears on top of the list. There are several methods that can help you become an effective writer who seldom procrastinates (or who effectively procrastinates—did you know that that’s possible?), so on our Road to the Writing Bootcamp we will be dedicating a series of blog posts to this problem.

Why do we procrastinate when it comes to writing a scientific document? For multiple reasons, but many of them are related to the fear of the blank page, also known as writer’s block.

Continue reading “Want to procrastinate less and be an effective writer? Start writing your articles early enough”

You have just received the reviews for your article. After a long wait, this is the most painful step. The main issue is that reviewers and authors don’t speak the same language. To speed up and ease this process, authors should address the comments so that reviewers can easily assess how their feedback has been tackled. What is then the most effective way of writing your rebuttal?

## You want to write articles that get accepted? Do reviews.

At the end of my PhD, I started receiving invitation to review articles. At that moment, I felt honoured as if I had received the membership card of a very selective club.
Later, as a postdoc and professor, the number of invitations increased while my time available for such type of tasks decreased. However, I noticed something interesting that I wanted to test with my students.

## The authorship manifesto

Getting your name on an article is becoming more and more important in the “publish or perish” era. Although I believe writing papers is an excellent objective for doing research, deciding who should be on the paper can become tricky in some cases.

Here is the result of an intense discussion during the team building (with ATM, FLOW and BURN research groups) in 2017. You can directly jump to the summary table at the end if you are in a hurry.

I often need to review articles and give feedback on them. I find my feedback is most efficient when I can focus on the content (results, figures, etc) and the flow of the article. These aspects of the article are what interest the first author most, even if he or she is also happy to get a review of the typos or other secondary problems. Yet, more often than not, many of my comments are about things that can be more or less automatised. This post is a checklist for the common problems I encounter. Continue reading “Does your article address these important issues?”

## Clear, accurate, concise writing

I’m writing this post following a very interesting talk of Jean-luc Doumont on “clear, accurate, concise writing”. This was an updated version of his previous talk on effective written documents. Continue reading “Clear, accurate, concise writing”

## Are you lost after the submission of your manuscript?

After submitting your manuscript, the hard wait for the review starts. You could think that everything is handled perfectly on a first-in-first-out basis. But this is unfortunately not the case. It is not an easy job to be an editor, it takes a lot of effort, time investment and organisation. So you have to do everything to facilitate their work and this requires some follow-up from your side. Here are the most important steps. Continue reading “Are you lost after the submission of your manuscript?”

## Are you using these time-saving features of LaTeX?

We will cover here some good practice when writing your manuscripts with $\LaTeX$. To make sure the persons who review your manuscript before submission (more details) pay attention to the content of your article instead of the little problems, it is worth following these tips. Continue reading “Are you using these time-saving features of LaTeX?”


text:
# Principal fibre bundle

A $G$- fibration $\pi _ {G} : X \rightarrow B$ such that the group $G$ acts freely and perfectly on the space $X$. The significance of principal fibre bundles lies in the fact that they make it possible to construct associated fibre bundles with fibre $F$ if a representation of $G$ in the group of homeomorphisms $F$ is given. Differentiable principal fibre bundles with Lie groups play an important role in the theory of connections and holonomy groups. For instance, let $H$ be a topological group with $G$ as a closed subgroup and let $H/G$ be the homogeneous space of left cosets of $H$ with respect to $G$; the fibre bundle $\pi _ {G} : H \rightarrow H/G$ will then be principal. Further, let $X _ {G}$ be a Milnor construction, i.e. the join of an infinite number of copies of $G$, each point of which has the form

$$\langle g, t \rangle = \langle g _ {0} t _ {0} , g _ {1} t _ {1} ,\dots \rangle ,$$

where $g _ {i} \in G$, $t _ {i} \in [ 0, 1]$, and where only finitely many $t _ {i}$ are non-zero. The action of $G$ on $X _ {G}$ defined by the formula $h \langle g, t\rangle = \langle hg, t\rangle$ is free, and the fibre bundle $\omega _ {G} : X _ {G} \rightarrow X _ {G}$ $\mathop{\rm mod} G$ is a numerable principal fibre bundle.

Each fibre of a principal fibre bundle is homeomorphic to $G$.

A morphism of principal fibre bundles is a morphism of the fibre bundles $f: \pi _ {G} \rightarrow \pi _ {G ^ \prime }$ for which the mapping of the fibres $f {\pi _ {G} } ^ {-} 1 ( b)$ induces a homomorphism of groups:

$$\theta _ {b} = \ \xi _ {b} ^ {\prime - 1 } f \pi _ {G} ^ {-} 1 ( b) \xi _ {b} : \ G \rightarrow G ^ \prime ,$$

where $\xi _ {b} ( g) = gx$, $\pi _ {G} ( x) = b$. In particular, a morphism is called equivariant if $\theta _ {b} = \theta$ is independent of $b$, so that $gf ( x) = \theta ( g) f ( x)$ for any $x \in X$, $g \in G$. If $G = G ^ \prime$ and $\theta = \mathop{\rm id}$, an equivariant morphism is called a $G$- morphism. Any $( G, B)$- morphism (i.e. a $G$- morphism over $B$) is called a $G$- isomorphism.

For any mapping $u: B ^ \prime \rightarrow B$ and principal fibre bundle $\pi _ {G} : X \rightarrow B$ the induced fibre bundle $u ^ {*} ( \pi _ {G} ) \rightarrow \pi _ {G}$ is principal with the same group $G$; moreover, the mapping $U: u ^ {*} ( \pi _ {G} ) \rightarrow \pi _ {G}$ is a $G$- morphism which unambiguously determines the action of $G$ on the space $u ^ {*} ( x)$. For instance, if the principal fibre bundle $\pi _ {G}$ is trivial, it is isomorphic to the principal fibre bundle $\phi ^ {*} ( \eta )$, where $\eta$ is the $G$- bundle over a single point and $\phi$ is the constant mapping. The converse is also true, and for this reason principal fibre bundles with a section are trivial. For each numerable principal fibre bundle $\pi _ {G} : X \rightarrow B$ there exists a mapping $f: B \rightarrow X _ {G}$ $\mathop{\rm mod} G$ such that $f ^ { * } ( \omega _ {G} )$ is $G$- isomorphic to $\pi _ {G}$, and for the principal fibre bundles $f _ {0} ^ { * } ( \omega _ {G} )$ and $f _ {1} ^ { * } ( \omega _ {G} )$ to be isomorphic, it is necessary and sufficient that $f _ {0}$ and $f _ {1}$ be homotopic (cf. Homotopy). This is the principal theorem on the homotopy classification of principal fibre bundles, which expresses the universality of the principal fibre bundle $\omega _ {G}$( obtained by Milnor's construction), with respect to the classifying mapping $f$.

#### References

 [1] R.L. Bishop, R.J. Crittenden, "Geometry of manifolds" , Acad. Press (1964) [2] K. Nomizu, "Lie groups and differential geometry" , Math. Soc. Japan (1956) [3] S. Sternberg, "Lectures on differential geometry" , Prentice-Hall (1964) [4] , Fibre spaces and their applications , Moscow (1958) (In Russian; translated from English) [5] N.E. Steenrod, "The topology of fibre bundles" , Princeton Univ. Press (1951) [6] D. Husemoller, "Fibre bundles" , McGraw-Hill (1966)

Let $\pi _ {G} : X \rightarrow B$ be a principal fibre bundle. It is called numerable if there is a sequence $( u _ {n} ) _ {n \geq 0 }$ of continuous mappings $B \rightarrow [ 0, 1]$ such that the open sets $U _ {n} = u _ {n} ^ {-} 1 (( 0, 1 ] )$ form an open covering (cf. Covering (of a set)) of $B$ and $X$ is trivializable over each $U _ {n}$( i.e. the restricted bundles $\pi _ {G} : X \rightarrow U _ {n}$ are trivial, cf. Fibre space).


text:
Vectors. Determine the eqn. of plane M?

Homework Statement

Question is:
Given the vectors a= i - j + 2k and b= 2i + 3j - k, determine the equation of the plane M that contains the vectors a and b and the point P(2,1,-1).

Homework Equations

x = xo + at
y = yo + bt
z = zo + ct
PoP = tv ---> (x-xo)i + (y-yo)j + (z-zo)k = t(ai + bj + ck)

where Po (xo, yo, zo)
P(x, y, z)

The Attempt at a Solution

pt= (2,1,-1)
direction: v = ab= i + 4j - 3k

equation of line:
x=xo + at --> x= 2 + t
y=yo + bt --> y= 1 + 4t
z=zo + ct --> z= -1 - 3t

and that's where I get stuck, and I don't know how to continue.

The answer is -x + y + z = -2.
I am unsure how to get to that answer.

Last edited:

Related Precalculus Mathematics Homework Help News on Phys.org
HallsofIvy
1) The plane with normal vector $a\vec{i}+ b\vec{j}+ c\vec{k}$ and containing point $(x_0, y_0, z_0)$ has equation $a(x- x_0)+ b(y- y_0)+ c(z- z_0)= 0$.
2) A normal vector to the plane containing vectors $a\vec{i}+ b\vec{j}+ c\vec{k}$ and $d\vec{i}+ e\vec{j}+ f\vec{k}$ is the cross product of the two vectors $(bf- ce)\vec{i}- (cd- af)\vec{j}+ (ae- bd)\vec{j}$ which can be remembered by writing it (as a mnemonic) as if it were a determinant:
$$\left|\begin{array} {ccc}\vec{i} & \vec{j} & \vec{k} \\ a & b & c \\ d & e & f\end{array}\right|$$