text:
# Unity Unity Software Architecture - how to make reusable UI classes that inherit from MonoBehavior

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

## Recommended Posts

So I am working on an indie game in Unity and I've recently decided to move all of my UIs (user interfaces) into Canvas game objects, which is fine and dandy, but it does require me to re-write some code. Specifically, I have the following architecture that relies on the interface game objects having a GUITexture component:

public class InterfaceHandler : MonoBehaviour
{

/// <summary>
/// Hides the GUI Texture.
/// </summary>
public void Hide ()
{
GetComponent<GUITexture> ().enabled = false;
}

/// <summary>
/// Shows the GUI Texture.
/// </summary>
public virtual void Show ()
{
GetComponent<GUITexture> ().enabled = true;
}

void Start ()
{

}

// Update is called once per frame
void Update ()
{

}
}

public class InterfaceHandlerA : InterfaceHandler
{

public Texture2D[] Images;

private int _imageIndex = 0;

public int ImageIndex
{
get
{
return _imageIndex;
}
set
{
_imageIndex = value;
}
}

// Use this for initialization
void Start ()
{
Hide ();
}

// Update is called once per frame
void Update ()
{
GetComponent<GUITexture>().texture = Images[_imageIndex];
}

}

The problem is that with Canvas, there are no GUITextures. Instead I have to use RawImage or Image. So now I have to either re-write the code above (there are many more classes that inherit from InterfaceHandler, InterfaceHandlerA is just one of them) or write all new code that does the exact same thing, except with RawImage or Image instead of GUITexture.

This seems like a good opportunity to stop, take a step back, and really think about how to properly engineer this thing. I want it to be re-usable and maintainable, so that if a year from now Unity decides to replace Canvas with something else and there are no more RawImages, my code would still work. I am thinking maybe some kind of Dependency Injection might work here, or perhaps Generics, i.e. something like this:

public class InterfaceHandler<T> : MonoBehaviour

I tried the approach above, but it tells me that type T doesn't have a property called 'enabled'.

Any other ideas? What would be the best way to architecture this?

##### Share on other sites
I feel like I'm missing critical info here, but in general I wouldn't bother. This smells like over-engineering, but I also suspect that it's possibly motivated by mis-estimations of canvas.

How many uniquely coded UI elements do you really need to tamper with?

If you're doing something unusual then more information is necessary to answer questions about how to structure it. If you're not then look closer at what's available from the engine to makes sure you're not reinventing the wheel or missing some more concise way to do what you need.

##### Share on other sites

Is this some weird sort of sprite animation? I can't see any other reason why you'd be trying to switch a texture every frame.

If you want to hide a UI element in Unity, then you disable the object itself or the canvas.

It looks like you're trying to make a direct 1-to-1 translation of your old code, but the new system isn't meant to be treated that way.

##### Share on other sites

Yeah, the per-frame update doesn't make any sense. The index variable gets set on demand, but then the texture is updated every frame. Why not just update the texture in the set method?

##### Share on other sites

I feel like I'm missing critical info here, but in general I wouldn't bother. This smells like over-engineering, but I also suspect that it's possibly motivated by mis-estimations of canvas.

How many uniquely coded UI elements do you really need to tamper with?

If you're doing something unusual then more information is necessary to answer questions about how to structure it. If you're not then look closer at what's available from the engine to makes sure you're not reinventing the wheel or missing some more concise way to do what you need.

I am not very familiar with Canvas, so it may well be over-engineering, but I can't help but feel there is a way to design this so that it's re-usable and not tightly coupled to a GUITexture or RawImage or some other graphics class.

And I currently have 8 UI elements that have scripts inheriting from InterfaceHandler above. Most of them either call the Hide or Show method (or both) and set the texture property of the GUITexture component. Here is one more of them, this one alternates two image to create a very simply animation:

public class InterfaceHandlerB : InterfaceHandler
{
private int _imageIndex;
private float _speed;

public Texture2D[] sweepingFrames;

// Use this for initialization
void Start ()
{
_imageIndex = 0;
_speed = 3.0f;

Hide ();
}

// Update is called once per frame
void Update ()
{
if (CurrentState == State.Clean)
{
GetComponent<GUITexture> ().texture = sweepingFrames [_imageIndex];

_imageIndex -= 1;
_imageIndex = Mathf.Abs (_imageIndex);

CurrentState = State.None;
}
}

##### Share on other sites

Is this some weird sort of sprite animation? I can't see any other reason why you'd be trying to switch a texture every frame.

If you want to hide a UI element in Unity, then you disable the object itself or the canvas.

It looks like you're trying to make a direct 1-to-1 translation of your old code, but the new system isn't meant to be treated that way.

Nope. That particular script simply sets a texture, to the GUITexture component, that shows what level the player is on in a mini-game, i.e. something like Level 1, Level 2, etc. Although one of the other scripts inheriting from InterfaceHandler does simulate a very simple two image animation.

Basically, I need a generic, re-usable way to hide or show a GUITexture, RawImage, or Image component and to also provide capability to change the texture (or sprite if it's an Image, as Image doesn't seem to have texture) attribute of said component to different images.

##### Share on other sites

You can use mechanim within canvas so that it's a lot easier to edit and manage your animations and they can be timed instead of frame locked.

##### Share on other sites

Nope. That particular script simply sets a texture, to the GUITexture component

So doing it in the Update function is the wrong place.

If you want to animate graphics, use their Sprite system. If you're changing text, use the Text object and change that. If you want to hide or show images, enable or disable the object or the component. Wrap these calls in functions if you like but trying to abstract away the entire engine is just going to cause more trouble than it solves.

##### Share on other sites
As others pointed out already, it would be better for you to just direclty use the methods and properties already available. Hiding an Image should be done by deactivating the game object. (This way, it also doesn't matter if it is an image, a text, or a composition of multiple UI elements.)
Same goes for setting the image: just assign it directly, unless you want to apply some special logic that really needs to be encapsulated in another component.

Besides that: You should store references to components you're using multiple times. Searching for them every time using "GetComponent" takes more time. If it is done once a frame, it's really worth the refactoring.
Also, you should calculate your _imageIndex with something like this._imageIndex = (this._imageIndex + 1) % this.sweepingFrames.Length;

##### Share on other sites

Nope. That particular script simply sets a texture, to the GUITexture component

So doing it in the Update function is the wrong place.

If you want to animate graphics, use their Sprite system. If you're changing text, use the Text object and change that. If you want to hide or show images, enable or disable the object or the component. Wrap these calls in functions if you like but trying to abstract away the entire engine is just going to cause more trouble than it solves.

I am not sure that creating abstractions would cause more problems. For example, currently I have 8 UI scripts for the minigame in question, which are tightly coupled with GUITexture. Now that I am switching to Canvas and planning on using RawImage components, I have to write 8 more scripts, tightly coupled with RawImage. Then what happens if I decide to add some Image components? I have to write more scripts, tightly couple with Image. While if I can somehow write generic scripts that handle all image components, that would save me a lot of extra code.

Somebody above mentioned using the Graphic class, instead of RawImage or Image, since both inherit from it. That sort of works, but Graphic doesn't have texture or sprite attributes, so I still have to write tightly coupled code.

I am currently pondering an architecture utilizing the Adapter design pattern. That might be what I am looking for.

1. 1
2. 2
3. 3
Rutin
14
4. 4
5. 5

• 9
• 9
• 11
• 11
• 23
• ### Forum Statistics

• Total Topics
633676
• Total Posts
3013279
×


text:
# Quining a Pristine World

This challenge is based off of Helka Homba's question Programming a Pristine World. From that question, the definition of a pristine program is:

Let's define a pristine program as a program that does not have any errors itself but will error if you modify it by removing any contiguous substring of N characters, where 1 <= N < program length.

For example, the three character Python 2 program

8

is a pristine program (thanks, Sp) because all the programs resulting from removing substrings of length 1 cause errors (syntax errors in fact, but any type of error will do):

8

8

and also all the programs resulting from removing substrings of length 2 cause errors:

If, for example, 8 had been a non-erroring program then 8 would not be pristine because all the results of substring removal must error.

Notes:

• Compiler warnings do not count as errors.
• The erroring subprograms can take input or give output or do anything else as long as they error no matter what eventually.

Your task is to create a program of non-zero length that prints its own source code exactly, follows the rules for a proper quine, and is pristine.

Shortest answer in bytes for each language wins.

• I'm assuming languages that don't error can't compete? – ATaco Jul 11 '17 at 5:25
• @ATaco Unfortunately yes. Other languages, such as lisp, have the syntax structured in such a way that making a useful pristine program is impossible. – Shelvacu Jul 11 '17 at 5:28
• RIP Actually/Seriously – ATaco Jul 11 '17 at 5:29
• 'Shortest answer in bytes for each language wins.' I am not sure about short being the best measure for a pristine program. – P. Siehr Jul 11 '17 at 7:14
• @P.Siehr What would you reccomend instead? – Shelvacu Jul 11 '17 at 7:16

q x=if length x==132then putStr x else fail[];main=q$(++)<*>show$"q x=if length x==132then putStr x else fail[];main=q$(++)<*>show$"

Try it online!

This is an extension of the quine

main=putStr$(++)<*>show$"main=putStr$(++)<*>show$"

which works by concatenating the data string with a quoted version (by using show) of itself and printing the result. However, this is not pristine as any characters in the data string can be removed without failing and also the $(++)<*>show$ or (++)<*> part could be dropped without the program breaking.

To fix this, a custom print function q is defined which checks the length of the given string and calls fail if it's shorter than 132. This catches the removing of any sequence from the data string and also the removals of $(++)<*>show$ or (++)<*>, as in both cases the resulting string passed to q is shorter.

In q the number 132 could be shortened to 1, 13, 32 or 2, but in each case again fail is called.

As far as I can tell, the removal of any other substring causes either an syntax or type error, so the program does not even compile in the first place. (Haskell's strict type system comes in handy here.)

Edit: Thanks to Ørjan Johansen and Shelvacu for pointing out a flaws!

• I'm afraid fail[]|length x/=122 can be removed. fail[]:[putStr x|length x==122] might work better. – Ørjan Johansen Jul 11 '17 at 15:20
• Argh, no, then |length x==122 could be removed. if length x==122 then putStr x else fail[] perhaps? – Ørjan Johansen Jul 11 '17 at 15:30
• @ØrjanJohansen Good catch, I had an if then else before but thought I could shorten it. – Laikoni Jul 11 '17 at 15:51
• putStr x can become p x, which when I tried on my system ran for a very long time before I killed it, I suspect the tail call recursion was optimized, so it's an infinite loop. I don't know enough haskell to give any suggestions on how to fix it. – Shelvacu Jul 12 '17 at 8:35
• @Shelvacu Whoops. Renaming p to q should fix that. – Ørjan Johansen Jul 12 '17 at 13:18

# Python 3, 113 bytes

for[]in{113:[]}[open(1,"w").write((lambda s:s%s)('for[]in{113:[]}[open(1,"w").write((lambda s:s%%s)(%r))]:a'))]:a

Try it online!

### How it works

We can’t easily use multiple statements since the second one could be deleted, so we start with a single-expression quine:

print((lambda s:s%s)('print((lambda s:s%%s)(%r))'))

To protect it against substring deletions, we use open(1,"w").write instead of print. In Python 3, write returns the number of written characters, which we will verify is 113 to ensure that no part of the string was deleted. We do this by looking up the return value in the dictionary {113:[]}, and looping over the result with for[]in…:a, which will fail if we didn’t get an empty iterable or if the for statement is deleted.

• Could you give an explanation of how your code works? – Shelvacu Jul 17 '17 at 22:47
• @Shelvacu Yeah, added. – Anders Kaseorg Jul 17 '17 at 22:59

## Ruby, 78 bytes

eval(*[($>.write((s=%{eval(*[($>.write((s=%%{%s})%%s)-78).chr])})%s)-78).chr])

I wrote this when I thought of the challenge to make sure it was possible. It uses the same "wrapper" from one of my answers to the original pristine challenge.

Explanation:

• eval(*[ expr ])

This evaluates whatever code returns as a ruby program. This effectively tests that the string that code returns is a valid ruby program. Conveniently, ruby programs can be blank, or only consist of whitespace.

The "splat" operator * allows you to use an array as arguments to a function. This also means that if eval is removed, the resulting program is (*[ expr ]), which is not valid ruby.

• ($>.write( str )-78).chr $> is a short variable for STDOUT.

$>.write(foo) writes foo to STDOUT and, importantly for this code, returns the number of bytes written. $>.write(foo)-78: Here 78 is the length of the program, and so if the program is not mangled, will also be the number of bytes written. Therefor, in the unmangled case, this will return zero.

num.chr returns num as a character, eg 0.chr will return a string containing a single null byte. In the unmangled program, this will give a string with a single null byte to eval, which is a valid ruby program that is a no-op.

Also, the program can have a substring removed such that it's just eval(*[(78).chr]) or eval(*[(8).chr]), which means that the numeric constant cannot end with any of the numbers (0, 4, 9, 10, 11, 12, 13, 26, 32, 35, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 59, 64, 95) because they are ascii codes for valid single-character ruby programs.

• %{ str }

This is a lesser-known syntax for string literals in ruby. The reason it's used here is that balanced pairs of {} can be used within the string, which means this syntax can contain itself. For example, %{foo{bar}} is the same as "foo{bar}".

• (s=%{ data })%s

This defines the variable s which is the data of this quine, as a printf string.

Assignments in ruby return what was assigned, so this is the same as first assigning s and then running s%s

% on a string is syntatic sugar for ruby's equivalent of sprintf. The %s signifies where within the data the data itself should be embedded.

This bit of code defines the data portion of the quine and embeds it within itself to create the full code.

# Standard ML (MLton), 204182 189 bytes

val()=hd[(fn s=>let val$=s^"\""^String.toString s^"\"]"val(189,%)=(size$,$)in print%end)"val()=hd[(fn s=>let val$ =s^\"\\\"\"^String.toString s^\"\\\")\"val(189,%)=(size$,$)in print%end)"]

Try it online!

For MLton, full SML programs are either expressions delimited and terminated by ; (e.g. print"Hello";print"World";) or declarations with the var and fun keywords (e.g. var _=print"Hello"var _=print"World") where _ is a wild card which could also be replaced by any variable name.

The first option is useless for pristine programming because ; on its own is a valid program (which does nothing, but doesn't error either). The problem with the second approach is that declarations like var _=print"Hello" can be shortened to just var _="Hello" (or even var _=print) because the declaration with var works as long as the right-hand side is a valid SML expression or value (SML is a functional language, so functions can be used as values too).

At this point, I was ready to declare pristine programming in SML impossible, when by chance I stumbled upon pattern matching in val-declarations. It turns out that the syntax for declarations is not val <variable_name> = <expression> but val <pattern> = <expression>, where a pattern can consist of variable names, constants and constructors. As the print function has type string -> unit, we can use a pattern match on the unit-value () to enforce that the print function is actually applied to the string: val()=print"Hey". With this approach, removing either print or "Hey" results in a Pattern and expression disagree-error.

With this way of pristine printing at hand, the next step is to write a quine, before finally some more save-guarding needs to be added. I previously used an easy SML quine technique (see the revision history), but Anders Kaseorg pointed out a different approach which can save some bytes in his case. It uses the built-in String.toString function to handle string escaping and is of the general form <code>"<data>", where "<data>" is an escaped string of the code before:

val()=(fn s=>print(s^"\""^String.toString s^"\""))"val()=(fn s=>print(s^\"\\\"\"^String.toString s^\"\\\"\"))"

This is a working quine but not yet pristine. First of all Anders Kaseorg found out that MLton accepts a single quote " as code without producing errors, which means we cannot have code ending in a quote as above. The shortest way to prevent this would be to wrap everything after val()= in a pair of parenthesis, however then the code could be reduced to val()=(). The second shortest way I found is to use val()=hd[ ... ], that is we wrap everything into a list and return its first element to make the type checker happy.

To make sure that no part of the data string can be removed without being noticed, the pattern-matching in val-declarations comes in handy again: The length of the final string to be printed (and thus the program length) should equal 195, so we can write let val t=... val 195=size t in print t end in the body of the fn abstraction instead of print(...). Removing a part of the string results in a length less than 189, thus causing a Bind exception to be thrown.

There is still an issue left: the whole val 195=size t check could simply be dropped. We can prevent this by expanding the check to match on a tuple: val t=... val(216,u)=(n+size t,t)in print u end, such that removing the check results in an unbound variable u.

Altogether, this yields the following 195 byte solution:

val()=hd[(fn s=>let val t=s^"\""^String.toString s^"\")"val(195,u)=(size t,t)in print u end)"val()=hd[(fn s=>let val t=s^\"\\\"\"^String.toString s^\"\\\")\"val(195,u)=(size t,t)in print u end)"]

Applying the golfing trick of using operator variable names like !, \$ and % instead of n, t and u in order to save some white space (see this tip) leads to the final 182 byte version.

All other substring-removals which where not explicitly stated in the explanation should result in a syntax or type error.

Edit 1: length(explode t) is just size t.
Edit 2: Thanks to Anders Kaseorg for a different quine approach and pointing out a "vulnerability".

• −2 bytes by writing "\"" directly and using String.toString for escaping. – Anders Kaseorg Jan 3 '18 at 12:53
• Wait, this is horrible: MLton seems to accept the program ", producing empty output (TIO). – Anders Kaseorg Jan 3 '18 at 13:17
• @AndersKaseorg Huh, that's strange. However it should be possible to fix this issue by using another let ... in ... end. – Laikoni Jan 3 '18 at 14:33
• @AndersKaseorg I fixed the issue, hopefully without introducing new "vulnerabilities". – Laikoni Jan 4 '18 at 18:42
• Actually I looked into MLton accepting "` as a program, and it seems that bug was fixed in this commit, so maybe your 182 or my 180 is fine as long as you specify the unreleased Git version of MLton. – Anders Kaseorg Jan 4 '18 at 19:33

format: plain


text:
# Text pre-processing in command-line

###### Apr 16, 2019

Whether your are a newbie or professional in natural language processing or data mining, text pre-processing is a task that you need to go through at some point. Although there is a plethora of libraries which do the pre-processing of your text perfectly, none of them may have power, simplicity and flexibility that the command-line programs provide to you. In this tutorial, a few simple but essential programs are introduced for text pre-processing in command-line.

What we mean by text pre-processing is the normalisation of text by removing special characters (e.g. punctuation marks, non-Unicode characters etc.), tokens or changing the whole structure of the text for a specific purpose (e.g. adding <eos> to the end of sentences for training neural networks). In other words, whatever required to prepare a text file to be processed is a part of text pre-processing. Later, we will discuss text processing tasks such as counting unique words in a document, sorting words by frequency, removing stop words, retrieving specific text structures.

Text pre-processing is fun with command-line.

Obviously, for one problem there may be more than one solution. However, in this tutorial, only a few techniques and programs are introduced. It will be up to you, your preference and the requirements of your tasks to decide which command fits better to your problem. Personally, I love the command-line and how each program can be used as a piece of puzzle, thanks to pipes, to solve sophisticated problems, particularly where processing time and performance matter.

System setup: The commands in this tutorial have been tested on GNU bash, version 5.0.2(1)-release (x86_64-apple-darwin18.2.0). You will normally have no problem running them on any Unix-based operating system. If you are a Windows user, the best solution is to start using a Linux-based open-source operating system like Ubuntu (seriously, do it!). Otherwise, you can simply install Cygwin which lets you enjoy GNU in you Windows, somehow!

If you are not familiar with command-line, particularly Bash–the command language interpreter for the GNU operating system, you should learn the basic concepts, features and commands. This reference manual may be useful. Recall that you may use the man command to display the user manual of any command.

## Text-preprocessing commands

If you are interested in executing the commands in practice, you can download this text file in your working directory and see how each command works. Our sample text is very noisy; it contains html tags, indented paragraphs, multiple unnecessary newlines, spaces and tokens. Our goal is to clean this sample text by getting rid of the noisy stuff.

The very first step of any task in text (pre-)processing is text reading. We will see later in this tutorial that some commands, like wc, take care of the text reading without requiring us to do any further commands for reading.

#### cat

##### Syntax: cat [options] [filenames]

The cat command (short for “concatenate“) is one of the most frequent commands which not only allows us to read files, but also create, display and concatenate them.

The following command prints out the whole file content in your command-line:

You may use the less command which lets you scroll through the file without having all the file content displayed on the command-line. Don’t forget to use pipes, i.e. | whenever you want to use the output of a command as the input of another command.

To exit the viewing window press q.

You may write your file content in a new file like:

The difference between > and >> is that the first one overwrites the file if it already exists while the latter one keeps the content untouched and appends to the existing file.

cat can also turn your command-line into a basic text editor as follows:

By using cat > quick_note.txt, you are creating a new file and allowing cat to write whatever you type in the command-line as the content of your file. Once you are done with typing, cntrl-d saves the content and returns the command-line to its normal functionality.

The awesomeness of cat is not limited to these! You can concatenate multiple files into one as follows:

This way, the content of those two files is merged into a new file called 2019_results.txt.

##### Syntax: head [options] [file(s)], tail [options] [file(s)]

Sometimes you only want to take a look at how the content of a file looks like. head and tail are two commands which allow us to view a certain number of lines of a file, respectively at the beginning and the end.

There is an interesting option -n which lets us to specify how many lines be displayed. The default value is 10 lines.

head and tail allow further manoeuvres by using them in various orders with pipes and different options. Suppose that you have file containing 1000 lines and you would like to read lines 286 to 300. One way to do so is the following:

##### Get a block of text with awk

But what if you only want a specific range of lines in your file? Well, you can use awk as the following:

where the first_line and last_line should be replaced by the line range that you are interested in. For instance, the lines 48 to 51 in our sample file are:

awk is a very useful command in text (pre)processing that we will discuss later.

### Conversion to UTF-8 with iconv

#### Syntax: iconv -f source-encoding-code -t target-encoding-code < inputfile > outputfile

Although nowadays Unicode standard is the default encoding of most programs and on the web, there are still texts for which older encodings such as ISO 8859 and Windows-1252 were used and therefore, converting them is necessary. For this purpose, there is a program called iconv which converts your text from an encoding to another one. The syntax of iconv is shown above; Change the source-encoding-code and the target-encoding-code to the encoding of your source text and your desired output encoding, respectively.

Our sample text file is encoded in UTF-8. The following is an example to convert “crépuscule” from UTF-8 to ISO-8859-15:

Recall that echo displays a text on standard output.

Any characters that iconv does not know how to convert will be replaced with question marks. This may not be good when conversion accuracy matters. However, when dealing with large number of files, I personally prefer having a bunch of ?s to prevent any text reading errors!

### Replace characters using tr

#### Syntax: tr [options] [set1] [set2]

Replacing or removing specific characters is also a part of text pre-processing. For instance, unnecessary spaces or newlines may not be welcomed for some tasks. tr, abbreviation of translate or transliterate, is a very useful command which deals with such cases.

Suppose that you have the following text in Greek, where ; is normally used as ?, and you want to replace ; with ?:

or, replacing spaces by newlines:

Replacing characters can also be done with a sequence of characters as follows:

In this case, tr simply translates a character in the first set “iplo” to its corresponding one in the second set “abnu”.

tr also supports character sets such as a-z, A-Z and 0-9 to represent lower case alphabets, upper case alphabets and digits, respectively:

What if we want to replace multiple occurrences of a character by another character? For instance, line 340 to 363 in the sample text file contain multiple spaces that we would like to be removed and be replaced by one. This can be done with the -s option of tr:

The text looks like the following after removing multiple spaces and newlines:

To delete all the occurrences of a character, you can use tr -d [set] which acts like tr [set] "":

To discover more interesting options, try man tr.

### Remove HTML tags (or anything between tags)

The commands that we introduced so far were used directly over the text with simple patterns. What if we need to deal with more sophisticated text patterns? This is where regular expressions (regex) come in!

Regex allow us to access parts of a text based on the rules that we define. In some ways, a regex is analogous to a database query or a semantic query. It’s a query to extract information from raw text!

Let’s take a look at our sample text file where lines 1215 to 1220 contain HTML code (look like an HTML table):

Let’s assume that we want to remove the tags, i.e. anything between < and > and we only want to keep whatever enclosed by tags. To do so, we create a regular expression which looks for anything starting with a < and proceeds until it gets to a >; the regex includes anything between those two characters, except a >. This regex is: /<[^>]*>/.

For this problem, we use Perl which is a programming language frequently used in text processing thanks to its facilities. It can also be used in the command-line just like other commands.

There are a few details that we should know.

• -0777 option lets us to slurp the file and feed all the lines to Perl in one go.
• -pe is composed of two flags: e which allows us to specify the Perl code to be run and, -p flag processes the file line by line.
• s/[set1]/[set2]/ is the substitution operator which substitutes [set1] by [set2].
• /g is the global flag which does the matching over the whole text.
• /s treats the string as a single long line (only difference is that \n is also included when . is used).

Another example with Perl. The following regular expression replaces newlines with more than two occurrences with only two newlines. This can also be done with the previous commands that we introduced, like tr.

Here you can learn more about the fascinating functionalities of regular expressions in Perl. Most of the text editors make it easy to test and debug regular expressions and visualizing them. There are also many websites for the same purpose, such as https://regex101.com/.

### Text split with split

#### Syntax: split [options] filename prefix

We perviously mentioned how to merge files using cat. What if we want to split a huge text file into smaller parts? This can be done with split.

split allows us to split a file based on the number of lines with -l option and based on size with -b. Let’s split our sample text file into smaller files containing 500 lines each one:

### Wrapping up

How your text is to be pre-processed depends on the content of your file and your pre-processing purpose. You should know what the noisy stuff are and the issues that should be cleaned or normalised.

Suppose that we need the following steps to clean our sample text file:

• Remove HTML tags (perl -0777 -pe 's/<[^>]*>//gs')
• Remove noisy non-alphanumeric content (perl -0777 -pe 's/^[\S]*[^\w\s][\S]*$//gmi') • Remove unwanted tokens, like javascript:void(0);, and characters (awk '{gsub(/^.*javascript.*$/,"\n"); print }' or awk '{gsub(/ /," "); print }')

Following the techniques introduced earlier in this tutorial, we clean the sample text as follows:

This is how this long command cleans our sample text file like a charm!

Last updated on 28 April 2019.


text:
### Listed in the item Bank are key terms and expressions, each of which is associated with one of the columns. Some terms may displayadditional

Listed in the item Bank are key terms and expressions, each of which is associated with one of the columns. Some terms may display additional information when you click on them. Drag and drop each item into the correct column. Order does not matter. ITEM BANK: Move to Bottom Court of Appeals Attorn...

### Diderot's Encyclopediawas used toA-attack religious superstitionB-attack capital punishmentC-support Islamic teachingsD-suppress

Diderot's Encyclopedia was used to A-attack religious superstition B-attack capital punishment C-support Islamic teachings D-suppress Enlightenment ideas...

### Which of the following is the best definition of a physical change?A. Ice melting into water.B. A change that occurs without changing

Which of the following is the best definition of a physical change? A. Ice melting into water. B. A change that occurs without changing the identity of the substance. C. Something that can be observed or measured while changing the identity of the substance. D. A nail rusting....

### If you could have ten things and nothing else-ever what would they be?(besides necessary things like food water yk like extra things and

If you could have ten things and nothing else-ever what would they be?(besides necessary things like food water yk like extra things and feelings)...

### HURRYWhich value is MOSTLY closely associated with the fundamental principles of Buddhism?A. Submission to authontyB. devotion to one godC. giving

HURRY Which value is MOSTLY closely associated with the fundamental principles of Buddhism? A. Submission to authonty B. devotion to one god C. giving up worldly desires D. honoring ancestors' spints...

### Initially, the war effort on the Western Front was characterized byO A) slow but steady advancement of the German army on the ground,OB)

Initially, the war effort on the Western Front was characterized by O A) slow but steady advancement of the German army on the ground, OB) trench warfare that kept both sides in the same positions for four years. C) decisive victories by the French army and swift retreat of German forces. O D) inno...

### Generic rectangles missing values

Generic rectangles missing values...

### The statement of changes in stockholders' equity: Multiple Choice Is part of the statement of retained earnings. Shows only the ending

The statement of changes in stockholders' equity: Multiple Choice Is part of the statement of retained earnings. Shows only the ending balances in stockholders' equity. Describes changes in paid-in capital and retained earnings subcategories. Does not include changes in treasury stock. Is reported b...

### Ariel, a federal government employee, works in acquisition and procurement. Federal policies require

Ariel, a federal government employee, works in acquisition and procurement. Federal policies require that in contracting with suppliers, at least three bids must be received, and the lowest bid that meets specifications will be accepted. In this case, Ariel is dealing with a(n)...

### Read the excerpt from Eighty Years and More.Until I was sixteen years old, I was a faithful student in the Johnstown Academy with a class of boys. Though

Read the excerpt from Eighty Years and More. Until I was sixteen years old, I was a faithful student in the Johnstown Academy with a class of boys. Though I was the only girl in the higher classes of mathematics and the languages, yet, in our plays, all the girls and boys mingled freely together. I...

### What is the value of y in the equation 5x + 2y = 20, when x = 0. 3 a) 2.5 b) 2.8 c) 9.25 d) 10.75

What is the value of y in the equation 5x + 2y = 20, when x = 0. 3 a) 2.5 b) 2.8 c) 9.25 d) 10.75...

### During the titration of a weak acid and a strong base, you would expect the ph at the endpoint of titration

During the titration of a weak acid and a strong base, you would expect the ph at the endpoint of titration to be a. less than 7 b. more than 7 c. 7 d. there is not enough information to determine what the ph would be....

### 6.Look at the diagram of the human digestive systemWhich part(s) is/are responsible for most of the mechanical digestion of food?1

6. Look at the diagram of the human digestive system Which part(s) is/are responsible for most of the mechanical digestion of food? 1 only c. 2 only b. 1 & 2 d. 1&4 a. $6. Look at the diagram of the human digestive system Which part(s) is/are responsible for most of$...

### What occurs in a dehydration synthesis reaction? a. the reaction breaks a chemical bond by adding water

What occurs in a dehydration synthesis reaction? a. the reaction breaks a chemical bond by adding water b. as the reaction occurs water is added c. as the reaction occurs oh- and h+ are removed d. the reaction breaks a chemical bond by removing water...

### Help Help Help Help Help Help Help

Help Help Help Help Help Help Help $Help Help Help Help Help Help Help$...

### Which of the following are characteristics that describe a member of theHouse of Representatives? Select the FOUR correct answers.

Which of the following are characteristics that describe a member of the House of Representatives? Select the FOUR correct answers....

### What name did president nixon give to those that he believed supported the war in vietnam? a. the 'silent

What name did president nixon give to those that he believed supported the war in vietnam? a. the "silent majority" b. the "moral majority" c. the "truest of patriots" d. the "blind leading the blind"?...

### Which Table represents a linear function?

Which Table represents a linear function? $Which Table represents a linear function?$...


text:
# Weighted estimates for dyadic operators with complexity

## LoboVault

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

# Weighted estimates for dyadic operators with complexity

 Title: Weighted estimates for dyadic operators with complexity Author: Moraes, Jean Carlo Pech de Advisor(s): Pereyra, Maria Cristina Committee Member(s): Blair, MatthewLorenz, JensPerez, Carlos Department: University of New Mexico. Dept. of Mathematics and Statistics Subject(s): dyadic operators, weights, complexity, Muckenhoupt LC Subject(s): Measure theory.Linear operators.Inequalities (Mathematics)Integrals, Haar.Lebesgue integral. Degree Level: Doctoral Abstract: We extend the definitions of dyadic paraproduct, dual dyadic paraproduct and $t$-Haar multipliers to dyadic operators that depend on the complexity $(m,n)$, for $m$ and $n$ positive integers. We will use the ideas developed by Nazarov and Volberg in \cite{NV} to prove that the weighted $L^2(w)$-norm of a paraproduct with complexity $(m,n)$ and the dual paraproduct associated to a function $b\in BMO$, depends linearly on the $A_2$-characteristic of the weight $w$, linearly on the $BMO$-norm of $b$, and polynomially in the complexity. Moreover we prove that the $L^2(w)$-norm of the composition of these operators depends linearly on the $A_2$-characteristic of the weight $w$, quadratic on the $BMO$-norm of $b$, and polynomially in the complexity. The argument for the paraproduct provides a new proof of the linear bound for the dyadic paraproduct \cite{Be1} (the one with complexity $(0,0)$). Paraproducts and their adjoints are examples of Haar shift multipliers of type 2 and 3. We adapt the Nazarov and Volberg method to show that for certain Haar shift multipliers of type 4 and complexity $(m,n)$ the same type of bounds in $L^2(w)$ hold. Also we prove that the $L^2$-norm of a $t$-Haar multiplier for any $t$ and weight $w$ depends on the square root of the $C_{2t}$-characteristic of $w$ times the square root of the $A_q$-characteristic of $w^{2t}$ and polynomially in the complexity $(m,n)$, recovering a result of Beznosova \cite{Be} for the $(0,0)$-complexity case. Last, we prove that for a pair of weights $u$ and $v$ and a class of locally integrable function $b$ that satisfies certain conditions, the dyadic paraproduct $\pi_b$ is bounded from $L^2(u)$ into $L^2(v)$ if and only if the weights satisfies the joint $A_2$ condition. Graduation Date: December 2011 URI: http://hdl.handle.net/1928/17491

## Files in this item

Files Size Format View Description
Dissertation OGS version.pdf 723.5Kb PDF View/Open dissertation


text:
# Inverse Laplace transform of $sech(\sqrt{2\lambda})$ and Brownian motion occupation time

In dimension 3 we have that for $T=\int_{[0,\infty)}1_{B_{t}\in B(0,1)}dt$ has the Laplace transform $$E[e^{-\lambda T}]=sech(\sqrt{2\lambda}).$$

And in dimension 1 we have the same for $\tau=\min\{t: |B(t)|=1\}$:

$$E[e^{-\lambda \tau}]=sech(\sqrt{2\lambda}).$$

Inverting this in Mathematica didn't give a clean answer, but I found in "An Atlas of Functions: with Equator, the Atlas Function Calculator" that

$$\int_{a-i\infty}^{a+i\infty}\frac{sech(\nu \sqrt{\lambda})}{\sqrt{\lambda}}e^{\lambda s}\frac{ds}{2\pi i}=\frac{1}{\nu}\hat{\theta}_{2}(\frac{1}{2},\frac{t}{\nu^{2}}),$$

where $$\hat{\theta}_{2}(x,t):=\frac{1}{\sqrt{\pi t}}[\sum_{0}^{\infty}(-1)^{n}\exp(\frac{-(x+n)^{2}}{t})-\sum_{-1}^{-\infty}(-1)^{n}\exp(\frac{-(x+n)^{2}}{t})].$$

Q1:Has there been any further work on relating this to behaviour for Brownian motion?

Q2:Is there a closed formula for the inverse laplace transform of $sech( \sqrt{2\lambda})$?

Q2 $\qquad$ "Is there a closed formula for the inverse Laplace transform of ${\rm sech}(\sqrt{2\lambda})$"
The inverse Laplace transform of ${\rm sech}(\sqrt{2\lambda})=1/\cosh(\sqrt{2\lambda})$ follows from an entry in Table 2 in Theta functions; transform tables and examples for electrochemists:
$$\int_0^\infty dt\, e^{-\lambda t}\,\frac{\partial}{\partial x}\theta_1\left(\frac{x}{2c}\biggl|\frac{i\pi t}{c^2}\right)=\frac{c\cosh(x\sqrt{\lambda})}{\cosh(c\sqrt{\lambda})},\;\;|x|<c,$$ where $\theta_1$ is a Jacobi theta function.
The inverse Laplace transform of $1/\cosh(\sqrt{2\lambda})$ is thus given by $${\cal L}^{-1}\left(\frac{1}{\cosh(\sqrt{2\lambda})}\right)=\frac{1}{\sqrt 2}\lim_{x\rightarrow 0}\frac{\partial}{\partial x}\theta_1\left(\frac{x}{2\sqrt{2}}\biggl|\frac{i\pi t}{2}\right).$$


text:
The answer to the first question is no. Let $G$ be the group $C_2 \times C_2$ and let $k$ be a field of characteristic 2. Then $kG \cong k[x,y]/(x^2, y^2)$. Let $M = k[x]/(x^2)$ with $y$ acting trivially, and let $N = k[y]/(y^2)$ with $x$ acting trivially. Then neither $M$ nor $N$ is projective (for modules over a $p$-group in characteristic $p$, projective is the same as free), but $M \otimes_k N \cong kG$.
Edit: I think that if the Sylow $p$-subgroup of $G$ is cyclic, it's also hard then you can use Avrunin and Scott's tensor product theorem to imagine what prove that whenever $M \otimes_k N$ is projective, then so is either $M$ or $N$, but that seems like a good answer big tool to use for the second question could bethis.
The answer to the first question is no. Let $G$ be the group $C_2 \times C_2$ and let $k$ be a field of characteristic 2. Then $kG \cong k[x,y]/(x^2, y^2)$. Let $M = k[x]/(x^2)$ with $y$ acting trivially, and let $N = k[y]/(y^2)$ with $x$ acting trivially. Then neither $M$ nor $N$ is projective (for modules over a $p$-group in characteristic $p$, projective is the same as free), but $M \otimes_k N \cong kG$.


text:
# The Minimum Possible Surface Area of A Tetrahedron with A Fixed Face and Volume

Geometry Level 5

Let $$ABC$$ be a triangle such that $$BC=13$$, $$CA=14$$, and $$AB=15$$. Furthermore, let $$D$$ be a point in space such that the volume of tetrahedron $$ABCD$$ is $$28$$. The minimum possible surface area of tetrahedron $$ABCD$$ can be expressed in the form $$p\sqrt{q}+r$$, where $$p$$ and $$r$$ are positive integers and $$q$$ is a squarefree integer. Find $$p+q+r$$.

×


text:
Find all School-related info fast with the new School-Specific MBA Forum

 It is currently 29 Jun 2015, 20:18

### GMAT Club Daily Prep

#### Thank you for using the timer - this advanced tool can estimate your performance and suggest more practice questions. We have subscribed you to Daily Prep Questions via email.

Customized
for You

we will pick new questions that match your level based on your Timer History

Track

every week, we’ll send you an estimated GMAT score based on your performance

Practice
Pays

we will pick new questions that match your level based on your Timer History

# Events & Promotions

###### Events & Promotions in June
Open Detailed Calendar

# Emily Dickinsons letters to Susan Huntington Dickinson were

Author Message
TAGS:
Manager
Joined: 08 Apr 2004
Posts: 137
Location: Corea
Followers: 1

Kudos [?]: 187 [6] , given: 0

Emily Dickinsons letters to Susan Huntington Dickinson were [#permalink]  23 Sep 2004, 15:54
6
KUDOS
26
This post was
BOOKMARKED
00:00

Difficulty:

55% (hard)

Question Stats:

56% (02:17) correct 44% (01:16) wrong based on 2257 sessions
Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering her letters to anyone else.

(A) Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering
(B) Dickinson were written over a period that begins a few years before Susan’s marriage to Emily’s brother and ended shortly before Emily’s death in 1886, outnumber
(C) Dickinson, written over a period beginning a few years before Susan’s marriage to Emily’s brother and that ends shortly before Emily’s death in 1886 and outnumbering
(D) Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother, ending shortly before Emily’s death in 1886, and outnumbering
(E) Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumber
[Reveal] Spoiler: OA
SVP
Joined: 03 Jan 2005
Posts: 2247
Followers: 13

Kudos [?]: 226 [8] , given: 0

8
KUDOS
1
This post was
BOOKMARKED
nocilis wrote:
I go with A
In E "which" is pointing to the closest noun Susan Huntington Dickinson and that would be wrong!

From the OG itself:

From the bark of the paper birch tree the Menomini crafted a canoe about twenty feet long and two feet wide, with small ribs and rails of cedar, which could carry four persons or eight hundred pounds of baggage yet was so light that a person could easily portage it around impeding rapids.

"which" here obviously doesn't refer to cedar, rather, it refers to "canoe". The noun that the nonrestrictive clause modifies doesn't necessarily need to be immediately proceed the comma. The OG concept is that it cannot refer to a vague idea that is expressed in the entire sentence, and that it must point to a noun (again, not necessarily immediately before the comma). For example, you can't say:
"The earth is not flat, which had puzzled many people in the old days."

Just my two cents.
Manager
Joined: 09 Jun 2009
Posts: 231
Followers: 2

Kudos [?]: 101 [6] , given: 6

Re: emily [#permalink]  09 Jul 2010, 22:33
6
KUDOS
Yes even i chose A because of the 'WHICH' in E though E looked better.

For those of you who are still confused with this question, heres something i gathered from manhattan:

First of all, 'WHICH' refers to previous noun no doubt but in sentences as clear as these, 'which' can in no way refer to Dickinson, who is a person. So it should refer to subject of the first part that is 'letters written'.

"
occasionally, when it is completely unambiguous, "which" can refer to a whole NOUN PHRASE that immediately precedes the comma.
in this case, this noun phrase is "X's letters to Y". (note that this noun phrase, as a unit, does immediately precede the comma.)

also, note the complete lack of grammatical ambiguity: "which" can't refer to dickinson, who is a person, and it's also followed by a plural verb. both of these pieces of evidence point to the noun phrase "X's letters to Y".

--

here's the basic summary:
if you have "X of Y, which..."
then:
* if Y works as the antecedent of "which", then "which" should stand for Y.
* if Y doesn't work as the antecedent, but "X of Y" DOES work, then "which" can stand for "X of Y"....."

Also, use of participle 'outnumbering' is not required here....it's not the period over which the letters were written that outnumber but it is the letters that outnumber letters to anyone else.

"...using a present participle phrase to express the (direct/indirect) result of the preceding clause is not allowed when the preceding clause is in a passive voice...."
--> from manhattan

Verbal is full of exceptions...
Senior Manager
Joined: 06 Dec 2003
Posts: 366
Location: India
Followers: 1

Kudos [?]: 4 [4] , given: 0

4
KUDOS
twixt wrote:
Actually I was between A & E. Chose E as gerund in A was not so clear while outnumber in E makes sense when you erase all the relative clause.
Anyway what is the killer trick here ?

the kingpin is that, "outnumber" is used as verb in choice "E". the correct sentence is this : BLUE PART

Emily Dickinsonâ€™s letters to Susan Huntington Dickinson, which were written over a period beginning a few years before Susanâ€™s marriage to Emilyâ€™s brother and ending shortly before Emilyâ€™s death in 1886, outnumber her letters to anyone else

no other choice construct grammatically correct sentence.

hope this will help
Dharmin
_________________

Perseverance, Hard Work and self confidence

e-GMAT Representative
Joined: 02 Nov 2011
Posts: 1864
Followers: 1537

Kudos [?]: 4615 [4] , given: 216

Re: Emily Dickinsons letters to Susan Huntington Dickinson were [#permalink]  24 Jul 2013, 05:51
4
KUDOS
Expert's post
1
This post was
BOOKMARKED
WaterFlowsUp wrote:
@ Ashish,
Could you please write a small doc explaining the participial phrases that is separated by a comma and are at the end? It would immensely useful for people like me getting stuck at something very basic.
Tons of thanks for the help

Hi WaterFlowsUp,

Let me try to explain the function of “verb-ing modifiers” when preceded by a comma.

When a “verb-ing modifier” appears after a clause and is preceded by a comma, then it modifies the action of the preceding clause. It modifies the action of the preceding clause in two ways:
1. By presenting the HOW aspect of the preceding action
2. By presenting the result of the preceding action

Now let’s analyze the usage of comma + outnumbering… in the official sentence.

Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering her letters to anyone else.

So ED wrote letters to SHD. Comma + outnumbering… modifies the preceding action “were written”. Since this modifier has two functions, let’s see which one fits here.
ED’s letters were written to SHAD by outnumbering her letters to anyone else. This modification suggests that ED wrote letters to SHD by outnumbering her letters to anyone else. This seems to be an action done deliberately. But this is not logical.

Now let’s check the second usage. ED’s letters were written SHD and as a result of this action, the letters outnumbers ED’s letters to anyone else. Do we really have a cause-effect here? Certainly not. None of the functions done by the comma + verb-ing modifier makes sense in this sentence. This is the reason why Choice A is incorrect.

You may read the following articles to know more about the comma + verb-ing modifiers:

usage-of-verb-ing-modifiers-135220.html
verb-ing-modifiers-part-2-in-our-first-article-on-verb-ing-135567.html
verb-ed-modifiers-vs-verb-ing-modifiers-125611.html

Also, this concept is covered in our Free Concepts. You can register on e-gmat for free and access this concepts along with many others. All these concepts have pre-assessment and post assessment quizzes through which you can gauge your knowledge of these concepts. So click on the “free trial” button and start learning for free.

Thanks.
_________________

Aiming to score 760+ on the GMAT? Attend our free webinar to learn how to define your GMAT strategy, create your study plan and master the core skills to excel on the GMAT. Click here to register for this webinar. The webinar will start at 7 AM PST on the 6th of June 2015.

GMAT Club Legend
Joined: 07 Jul 2004
Posts: 5068
Location: Singapore
Followers: 23

Kudos [?]: 192 [3] , given: 0

3
KUDOS
2
This post was
BOOKMARKED
A. Dickinson were written over a period beginning a few years before Susanâ€™s marriage to Emilyâ€™s brother and ending shortly before Emilyâ€™s death in 1886, outnumbering
- participle 'ountnumbering' is wrong. It suggests that the letters are still being written.

B. Dickinson were written over a period that begins a few years before Susanâ€™s marriage to Emilyâ€™s brother and ended shortly before Emilyâ€™s death in 1886, outnumber
- 'begins' is the wrong tense here.

C. Dickinson, written over a period beginning a few years before Susanâ€™s marriage to Emilyâ€™s brother and that ends shortly before Emilyâ€™s death in 1886and outnumbering
- 'that ends shortly' is wrong

D. Dickinson, which were written over a period beginning a few years before Susanâ€™s marriage to Emilyâ€™s brother, ending shortly before Emilyâ€™s death in 1886, and outnumbering
- 'outnumbering is out'

E. Dickinson, which were written over a period beginning a few years before Susanâ€™s marriage to Emilyâ€™s brother and ending shortly before Emilyâ€™s death in 1886, outnumber
- This is my chioce. 'which' to introduce the modifier (modify letters), and outnumber to state that the letters are no longer written but they outnumber any other letters she has wrote

E it is.
Director
Joined: 19 Nov 2004
Posts: 563
Location: SF Bay Area, USA
Followers: 3

Kudos [?]: 74 [3] , given: 0

3
KUDOS
3
This post was
BOOKMARKED
Ah ... I know where I made the mistake. I was correct when saying that "which" should point to the closest subject and it does, but wrong in identifying the subject.

"Emily Dickinsonâ€™s letters to Susan Huntington Dickinson, which were ..."

"to Susan Huntington Dickinson" is a prepositional phrase and not the subject. Emily Dickinson's letters is the subject and 'which' is correctly pointing to it.

HongHu, in your sentence from OG,

From the bark of the paper birch tree the Menomini crafted a canoe about twenty feet long and two feet wide, with small ribs and rails of cedar, which could carry four persons or eight hundred pounds of baggage yet was so light that a person could easily portage it around impeding rapids

about twenty feet long and two feet wide is a prepostional phrase and with small ribs and rails of cedar is a parenthetical element/additional info. The subject is "canoe", so 'which' appropriately points to it.

Thanks Honghu for pointing me my error.
A thorough analysis helps me remember.
VP
Joined: 15 Jul 2004
Posts: 1473
Schools: Wharton (R2 - submitted); HBS (R2 - submitted); IIMA (admitted for 1 year PGPX)
Followers: 17

Kudos [?]: 118 [2] , given: 13

Re: SC: Set 13, Q31 - Emily's letters [#permalink]  07 Oct 2007, 09:02
2
KUDOS
gluon wrote:
Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering her letters to anyone else.

A. Emily Dickinson’s letters to Susan HuntingtonDickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering

E. Emily Dickinson’s letters to Susan HuntingtonDickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumber

Quote:
BTW what is exactly wrong with A anyways? A and E are in the same voice whether it is passive or active the difference being A eliminates the erroneous placement of which.

Very interesting discussion going on here and that too on a topic that I confess is very dear to me!

Let's deal with this beast in two parts -

The problem with A is the participle OUTNUMBERING. As written in A, it clearly modifies period which is definitely not right. It must refer to letters.

In E on the other hand, it's quite clear what outnumber is referring to - letters.

However, of course, E seems to have a problem with the placement of which. We all know this fact cold that GMAT doesn't like the placement of which to be fiddled with in any way - and it must without fail appear immediately after the noun it's supposed to displace.

Thus - The Community hall in the townsquare which we all like is already booked for another marriage.

We know that which must refer to the community hall - but here it's appearing immediately after townsquare causing a GENUINE confusion in the reader's mind as to which of the two do WE ALL LIKE? Community Hall or Townsquare?

Compare this with another scenario -

All my requests to George which were to make him aware of his mistakes went unheeded by him.

Here IMO - the object of the preposition TO, George can't be modified by which; hence by logical extension, which modifies requests.

I don't want to contradict what we have all learnt about the usage of which and the restriction that it should be as close as possible to the noun it's intended to modify; all I am saying is, if a prepositional phrase intervenes between the which and the proable subject - so long as which can unambigously refer to the earlier subject and NOT the object of the preposition (as in the case of George above and UNLIKE the case of the townsquare earlier) we are OK.

In our example in this question - the scenario is simlar - it talks about Letters to Dickinson which --- again, the prepositional TO DICKINSON does not affect the relationship between which and Letters. Also, Dickinson can't be qualified by which anyway. You need WHO in the relative clause for an animate object like dickinson.
Retired Moderator
Status: I wish!
Joined: 21 May 2010
Posts: 788
Followers: 109

Kudos [?]: 297 [2] , given: 33

Re: emily [#permalink]  28 Sep 2010, 05:59
2
KUDOS
amolsk11 wrote:
Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years
before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering

her letters to anyone else.

A.Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and
ending shortly before Emily’s death in 1886, outnumbering

B.Dickinson were written over a period that beginsa few years before Susan’s marriage to Emily’s brother
and ended shortly before Emily’s death in 1886, outnumber

C.Dickinson, written over a period beginning a few years before Susan’s marriage to Emily’s brother and that
ends shortly before Emily’s death in 1886and outnumbering

D.Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s
brother, ending shortly before Emily’s death in 1886, and outnumbering

E.Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s
brother and ending shortly before Emily’s death in 1886, outnumber

I solved it in different manner, I didn't bothered much about "Which". As "outnumbering" doesn't make sense we are left with only B and E option.

In Option B check out the highlighted portion above, the portion which makes this choice wrong. The highlighted portions needs to be in same tense. So we are left with only choice E.

Also, I think this questions is from OGs as this questions seems familiar!
_________________
e-GMAT Representative
Joined: 02 Nov 2011
Posts: 1864
Followers: 1537

Kudos [?]: 4615 [2] , given: 216

Re: Emily Dickinsons letters to Susan Huntington Dickinson were [#permalink]  18 Feb 2014, 09:12
2
KUDOS
Expert's post
3
This post was
BOOKMARKED
jrashish wrote:
marine wrote:
Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering her letters to anyone else.

(A) Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering
(B) Dickinson were written over a period that begins a few years before Susan’s marriage to Emily’s brother and ended shortly before Emily’s death in 1886, outnumber
(C) Dickinson, written over a period beginning a few years before Susan’s marriage to Emily’s brother and that ends shortly before Emily’s death in 1886 and outnumbering
(D) Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother, ending shortly before Emily’s death in 1886, and outnumbering
(E) Dickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumber

pl review my analysis.

Q. Emily Dickinson’s letters to Susan Huntington
Dickinson were written over a period beginning a few
years before Susan’s marriage to Emily’s brother and
ending shortly before Emily’s death in 1886,
outnumbering her letters to anyone else

Meaning
ED wrote letters to SH over a period of time
Started before Susan marriage and ended before Emilys death

Error Analysis
1) Emily Dickinson’s letters to Susan Huntington
Dickinson were written over a period beginning a few
years before Susan’s marriage to Emily’s brother and
ending shortly before Emily’s death in 1886,
outnumbering her letters to anyone else

The sentence has only one clause.
S-V is correct
V is correctly placed in past tense (passive voice-simple past)
Parallelism is correct.... beginning and ending
Pronoun...her refers correctly to Emily
Meaning is clear
idioms...none
modifiers...beginning and ending correctly modifies period
....outnumbering also correctly adds information to the preceding clause

POE
A is correct
B & C parallelism issue
D fragment
E placement of which is not next to letters

I was confused b/w A & E, but for the stated reason selected A.

I dont find any grammatical error in A.

Pl clarify

Dear Ashish,

First, let's address the reason that you eliminated option E. Logically, "which" can only refer to "letters" here, and not to "Susan Huntington Dickinson" (since she's a person and "which" can't refer to people). Since the logical antecedent is clear, "which" doesn't need to be placed right next to "letters".

Second, option A can be eliminated in two ways: from the standpoint of meaning, and from that of grammar. The first is the explanation given in the OG. If I were to summarize the main point of this sentence, I'd say: "Emily Dickinson wrote more letters to Susan Huntington Dickinson than she wrote to anyone else." The period in which the letters were written is secondary to the main point of the sentence. In option A, "outnumber" is not even a verb: it's a verb-ing modifier. It doesn't make much sense to say that the main point of the sentence is to tell us when the letters were written.

Also, if you're unable to decide what the main point of the sentence is, you can apply the rules about verb-ing modifiers to this question. A verb-ing modifier placed after a comma either describes the preceding action or presents a result of the preceding action. The latter option is clearly ruled out in this case, so we're left with the former. Does "outnumbering" describe "were written"? It doesn't. The fact that the letters were written during a specific period isn't logically related to the fact that the letters outnumber Dickinson's letters to anyone else. So, the verb-ing modifier "outnumbering" doesn't make sense here. We clearly need the verb "outnumber" in the correct answer.

I hope this helps to clarify your doubt.

Regards,
Meghna
_________________

Aiming to score 760+ on the GMAT? Attend our free webinar to learn how to define your GMAT strategy, create your study plan and master the core skills to excel on the GMAT. Click here to register for this webinar. The webinar will start at 7 AM PST on the 6th of June 2015.

Director
Joined: 04 Jul 2004
Posts: 905
Followers: 4

Kudos [?]: 26 [1] , given: 0

1
KUDOS
nocilis wrote:
I was correct when saying that "which" should point to the closest subject and it does

Point to Note...

Also, (A) is passive construction..
VP
Joined: 07 Nov 2005
Posts: 1132
Location: India
Followers: 3

Kudos [?]: 30 [1] , given: 1

1
KUDOS
I will also go with E.
' letters to Susan Hunting ...........outnumber '
Director
Joined: 11 Jun 2007
Posts: 932
Followers: 1

Kudos [?]: 80 [1] , given: 0

Re: SC: Set 13, Q31 - Emily's letters [#permalink]  07 Oct 2007, 09:14
1
KUDOS
dwivedys wrote:
gluon wrote:
Emily Dickinson’s letters to Susan Huntington Dickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering her letters to anyone else.

A. Emily Dickinson’s letters to Susan HuntingtonDickinson were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumbering

E. Emily Dickinson’s letters to Susan HuntingtonDickinson, which were written over a period beginning a few years before Susan’s marriage to Emily’s brother and ending shortly before Emily’s death in 1886, outnumber

Quote:
BTW what is exactly wrong with A anyways? A and E are in the same voice whether it is passive or active the difference being A eliminates the erroneous placement of which.

Very interesting discussion going on here and that too on a topic that I confess is very dear to me!

Let's deal with this beast in two parts -

The problem with A is the participle OUTNUMBERING. As written in A, it clearly modifies period which is definitely not right. It must refer to letters.

In E on the other hand, it's quite clear what outnumber is referring to - letters.

However, of course, E seems to have a problem with the placement of which. We all know this fact cold that GMAT doesn't like the placement of which to be fiddled with in any way - and it must without fail appear immediately after the noun it's supposed to displace.

Thus - The Community hall in the townsquare which we all like is already booked for another marriage.

We know that which must refer to the community hall - but here it's appearing immediately after townsquare causing a GENUINE confusion in the reader's mind as to which of the two do WE ALL LIKE? Community Hall or Townsquare?

Compare this with another scenario -

All my requests to George which were to make him aware of his mistakes went unheeded by him.

Here IMO - the object of the preposition TO, George can't be modified by which; hence by logical extension, which modifies requests.

I don't want to contradict what we have all learnt about the usage of which and the restriction that it should be as close as possible to the noun it's intended to modify; all I am saying is, if a prepositional phrase intervenes between the which and the proable subject - so long as which can unambigously refer to the earlier subject and NOT the object of the preposition (as in the case of George above and UNLIKE the case of the townsquare earlier) we are OK.

In our example in this question - the scenario is simlar - it talks about Letters to Dickinson which --- again, the prepositional TO DICKINSON does not affect the relationship between which and Letters. Also, Dickinson can't be qualified by which anyway. You need WHO in the relative clause for an animate object like dickinson.

this one baffled me.. thanks for the explanation/analysis
Intern
Status: Applying
Joined: 14 Oct 2009
Posts: 31
Location: California
Schools: Cornell AMBA, Kellogg, Oxford, Cambridge
Followers: 0

Kudos [?]: 31 [1] , given: 4

Re: OG 12 SC #26 [#permalink]  10 Oct 2010, 22:44
1
KUDOS
Nice catch on the "comma which" rule. Just referred to Ron's explanation in the MGMAT forum

Copy+paste of his summary

if you have "X of Y, which..."
then:
* if Y works as the antecedent of "which", then "which" should stand for Y.
* if Y doesn't work as the antecedent, but "X of Y" DOES work, then "which" can stand for "X of Y".
Retired Moderator
Status: worked for Kaplan's associates, but now on my own, free and flying
Joined: 19 Feb 2007
Posts: 2269
Location: India
WE: Education (Education)
Followers: 316

Kudos [?]: 2336 [1] , given: 254

Re: Emily Dickinsons letters to Susan Huntington Dickinson were [#permalink]  15 Jun 2012, 20:02
1
KUDOS
Expert's post
May I butt in once again on this vexed question of the touch rule of the relative pronoun ‘which?’

First thing is that the intent of this text is to highlight primarily Dickinson’s letters to Susan outnumber her letters to anyone else. That they were written during a certain period is just a modifier, not very essential to the core. That is the reason that, writing and ending, which are addendums, need not parallel the primary action outnumber. In the context of understanding this subtlety of meaning, this passage is even more relevant to current thinking of GMAT.

Now to the relative pronoun ‘which”. What can ‘which’ refer to in choices D and E.? As per bare theory, it should refer to Dickinson who is a human and hence the use of ‘which’ is outrightly wrong. Secondly, the plural verb points out to some plural subject, and letters is the only plural that can antecede ‘which’. The prepositional phrase namely to Susan Huntington Dickinson is an essential modifier of the letters and therefore we are required to carry it along with the subject.
_________________
e-GMAT Representative
Joined: 02 Nov 2011
Posts: 1864
Followers: 1537

Kudos [?]: 4615 [1] , given: 216

Re: Emily Dickinson’s letters to Susan Huntington Dickinson were [#permalink]  02 Apr 2013, 12:07
1
KUDOS
Expert's post
1
This post was
BOOKMARKED
Choice A is incorrect because of modifier error.
"outnumbering her letters to anyone else" should modify the letters but its placement is such that it appears to modify the preceding clause.

Notice that comma + verb-ing modify the preceding clause. And this modification does not make sense here. This is because it was not because the letters were written in the specified period that these letters outnumbered the other set of letters. In fact these two actions - were written and outnumber are really two different characteristics of the letters.

Lets consider an example sentence:
The film was shot in a small town of Guthernberg, exceeding expectations of the producers.
This sentence is incorrect since the verb-ing modifier appears to modify preceding clause and in this sentence this modification does not make sense. The fact that the film was shot in a small town did not really lead to exceeding the expectations of the producers.

The correct sentence is:
The film, shot in a small town of Guthernberg, exceeded the expectations of the producers.

The sentence simply states a fact that this film exceeded the expectations. It does not provide any reasoning for the same.

The film received significant critical acclaim, exceeding the expectations of the producers.
This sentence is correct. In this sentence, the verb-ing modifier makes complete sense with the preceding clause. The expectations of the producers were exceeded by virtue of the film receiving significant critical acclaim.

Hope this helps
_________________

Aiming to score 760+ on the GMAT? Attend our free webinar to learn how to define your GMAT strategy, create your study plan and master the core skills to excel on the GMAT. Click here to register for this webinar. The webinar will start at 7 AM PST on the 6th of June 2015.

Manager
Joined: 09 May 2013
Posts: 57
Followers: 0

Kudos [?]: 10 [1] , given: 12

Re: SC... [#permalink]  08 Jun 2013, 03:09
1
KUDOS
egmat wrote:
Hi @buffaloboy,

Use of "which" is absolutely correct in the correct answer choice. To know the reason why, please read the article by clicking on the following link:
noun-modifiers-can-modify-slightly-far-away-noun-135868.html

If you have question regarding the article or this official question, then do post it here.
Hope this helps.
Thanks.

I have following reason to eliminate option 'A'.
please correct me if my line of reasoning is wrong.

In option 'A' "outnumbering" "-ing modifier" takes tense from the clause it is modifying.
In option "A' tense is past,which would not be correct.
because emily dickinson letter to susan still outnumber her letter to anyone else i.e. a facts,so simple present is correct,while the tense of a clause is past tense.

Manager
Joined: 09 May 2013
Posts: 57
Followers: 0

Kudos [?]: 10 [1] , given: 12

Re: SC... [#permalink]  09 Jun 2013, 02:21
1
KUDOS
ankurgupta03 wrote:
WarriorGmat wrote:
egmat wrote:
Hi @buffaloboy,

Use of "which" is absolutely correct in the correct answer choice. To know the reason why, please read the article by clicking on the following link:
noun-modifiers-can-modify-slightly-far-away-noun-135868.html

If you have question regarding the article or this official question, then do post it here.
Hope this helps.
Thanks.

I have following reason to eliminate option 'A'.
please correct me if my line of reasoning is wrong.

In option 'A' "outnumbering" "-ing modifier" takes tense from the clause it is modifying.
In option "A' tense is past,which would not be correct.
because emily dickinson letter to susan still outnumber her letter to anyone else i.e. a facts,so simple present is correct,while the tense of a clause is past tense.

Bingo!!
Outnumbering should not be used here ... precisely for the reason you have stated

"Kudos chahiye"
Verbal Forum Moderator
Status: Getting strong now, I'm so strong now!!!
Affiliations: National Institute of Technology, Durgapur
Joined: 04 Jun 2013
Posts: 554
Location: India
GPA: 3.32
WE: Information Technology (Computer Software)
Followers: 70

Kudos [?]: 278 [1] , given: 61

Re: Emily Dickinsons letters to Susan Huntington Dickinson were [#permalink]  25 Jul 2013, 10:32
1
KUDOS
Expert's post
Thanks a lot shraddha, by far the best post and explanation on -ING modifiers. #respect
_________________

Regards,

S

Consider +1 KUDOS if you find this post useful

Director
Joined: 31 Aug 2004
Posts: 610
Followers: 3

Kudos [?]: 50 [0], given: 0

Actually I was between A & E. Chose E as gerund in A was not so clear while outnumber in E makes sense when you erase all the relative clause.
Anyway what is the killer trick here ?

Go to page    1   2   3   4   5   6   7   8    Next  [ 155 posts ]

Similar topics Replies Last post
Similar
Topics:
Emily Dickinsons letters to Susan Huntington Dickinson were 0 23 Mar 2012, 13:29
Emily Dickinson's letters to Susan Huntington Dickinson were 0 14 Jun 2009, 04:48
Emily Dickinsons letters to Susan Huntington Dickinson were 0 21 Mar 2012, 01:01
Emily Dickinsons letters to Susan Huntington Dickinson were 0 01 Aug 2007, 15:43
Emily Dickinsons letters to Susan Huntington Dickinson were 0 09 Jan 2007, 20:28
Display posts from previous: Sort by


text:
# How do you graph x^2+y^2-4x-2y-4=0?

Feb 2, 2016

It is an equation of a circle with center in C=(2;1) and radius $r = 3$

#### Explanation:

From this form you can find out that the equation represents a circle.
To find its coordinates and radius you should transform it to form of:

${\left(x - a\right)}^{2} + {\left(y - b\right)}^{2} = {r}^{2}$ (1)

We start from the equation given:

${x}^{2} + {y}^{2} - 4 x - 2 y - 4 = 0$

Now we can group terms with the same variable:

${x}^{2} - 4 x + {y}^{2} - 2 y - 4 = 0$

Now we can complete the squares of variables:

${x}^{2} - 4 x \textcolor{red}{+ 4} + {y}^{2} - 2 y \textcolor{red}{+ 1} \textcolor{red}{- 5} - 4 = 0$

I added $5$ so I had to substract 5 to keep the equation balanced.

Now we can write the expressions with $x$ and $y$ as squares:

${\left(x - 2\right)}^{2} + {\left(y - 1\right)}^{2} - 9 = 0$

Finally I can move $9$ to right side to get the form (1)

${\left(x - 2\right)}^{2} + {\left(y - 1\right)}^{2} = 9$

From this equation I can read that the equation shows a circle with center in C=(2;1) and radius $r = 3$


text:
# Lightbulbs and a battery circuit

Tags:
1. Aug 26, 2016

### RoboNerd

1. The problem statement, all variables and given/known data

2. Relevant equations

no equations
3. The attempt at a solution
I know that we will have an equal current flowing through bulbs 1 and 2 when we connect them in parallel in accordance with kirchoff's voltage law which says that the voltage drops around both paths must be equal to 0, i.e., THE SAME.

Thus, bulb three will have an increased current through it, as connecting 1 and 2 in parallel will decrease the circuits overall resistance, increasing the current drawn from the battery, and increasing the current through bulb 3 which will increase its power and make it glow brighter.

OK, I get that.

Why bulb 2 does not glow brighter also? An increased overall current could mean that we have greater current through the branch of the current where bulb 2 is, increasing its power, and brightness.

Thanks in advance for the input!

2. Aug 26, 2016

### Staff: Mentor

As an exercise, you could give each bulb a resistance value, and call the battery 10V, then analyse the circuit and find the currents.

3. Aug 26, 2016

### RoboNerd

I tried doing that and I was not able to figure out how I could use it to prove it.

Besides, this is a multiple choice question for a high school students. It should be easy to solve this question quickly using a different method.

Would you be able to solve it using a fast method? If so, how?

4. Aug 26, 2016

### TomHart

If you did that exercise, what were your results? Could you show that work?

5. Aug 26, 2016

### David Lewis

When you close the switch, does voltage across bulb 2 change?

6. Aug 27, 2016

### CWatters

+1

Perhaps think about the alternative ways of calculating power dissipated in a bulb or resistor eg V^2/R What happens to the voltage across each lamp?

7. Aug 29, 2016

### RoboNerd

OK. let's look at the voltage drops across bulbs 1 and 2.

Both of them are connected in parallel, so voltage drop must be the same. Thus P = V^2/R, so the power consumed must be the same.
I get why we can eliminate answer B -> bulb 2 now. Thanks for that.

Now, let's look at why bulb 3 increases in brightness.
If its power P = V^2/R, then we would also have the same voltage drop across it as before (because regardless of the addition of another branch, it would be the same) and its resistance would be the same because it is that same bulb with the same intrinsic characteristics. That means that the power is not changing.

However, the right answer is (C) -> bulb 3 gets brighter. What is going on here?

8. Aug 29, 2016

### Staff: Mentor

⏩ Is bulb 3 connected in parallel or in series with the other pair?

9. Aug 30, 2016

### CWatters

That's not correct. Earlier you said...

and that is correct.

10. Aug 30, 2016

### RoboNerd

It is in series.

I understand why that logic may hold, but looking at this circuit by kirchoff's voltage law gives me a unique perspective. If I examine the circuit loop starting from the electromotive force, then I have either a voltage drop at bulb 1 or at bulb 2 and then the same voltage drop at bulb three. Both paths (with bulb 1 and bulb 2) must result in a net zero voltage, so the drop in voltage across bulbs 1 and 2 must be the same and the drop in voltage across bulb 3 is consistent.

Because bulb's three power is V^2/R, then its voltage will remain the same and its intrinsic resistance must remain the same, so its power is going to be the same.

Why is it not the case that the bulb is going to glow brighter?

11. Aug 30, 2016

### Staff: Mentor

No, it isn't. Now, I don't know what you exactly mean by "V", but whatever you do mean, there is no fixed V that you can be referring to. The only fixed potential in the circuit is $\Large\textrm ε$.

Is it becoming clearer that your best course is to follow my advice back in post #2?

12. Aug 31, 2016

### CWatters

The thing you are missing is that you have two different circuits here. One with the switch open and the other with the switch closed. It is true that in both cases the voltage around the circuit must sum to zero but KVL does not imply the individual voltage drops are the same in both circuits. For example..

Those voltages might be..

Switch open... +12-6-6=0

These example voltages were arrived at by adopting the strategy NascentOxygen outlined in #2

13. Sep 1, 2016

### RoboNerd

Aha. I see now why this is the case. I did a simple current analysis here, and doing it again somehow made me realize what was going on this time.

Thank you everyone for the help!!!


text:
## 3D Printer Models for MAT 232

Posted in Computers, Math, Teaching and Learning by pgadey on 2019/11/07

This semester, I am teaching MAT 232 Multivariable Calculus. We often talk about level curves and use the saddle surface $z = x^2 - y^2$ as a key example. Every time it comes up, I ask students to stare at the part of their hand where the thumb meets the palm. Of course, they stare at me like I am crazy! This region of the hand is a good model for a saddle surface. If you start looking around at biological examples, you’ll see saddle surfaces everywhere.

I got interested in getting some 3D printed models of saddle surfaces to hand around the class. I found a great project 3D Printed Models for Multivariable Calculus put together by John Zweck. The STL files for the models are freely available, and I asked Reinhard Grassmann of the Continuum Robotics Lab if he could 3D print some models of saddle surfaces and the paraboloid $z = x^2 + y^2$ for me.

They arrived yesterday and they turned out GREAT! You can clearly see the level curves in one model, and the coordinate grid in another. They feel great to hold and are durable enough to hand around to a class of students.

Tagged with: , ,

## Backing Up with TAR

Posted in Computers by pgadey on 2019/11/03

My laptop is on its last legs. I manage to wear out laptops at an alarming rate. The Lenovo X220 has served me well, but the battery is flaking out and it shuts down everytime the wind blows. So, I looked up some options for backing up the disk. I found this brief guide to backing up.

Here are the relevant commands for reference:

```\$ sudo tar -cvpzf backup.tar.gz --exclude=/backup.tar.gz --one-file-system / \$ sudo tar -xvpzf /path/to/backup.tar.gz -C /restore/location --numeric-owner```

Tagged with: , ,

## Symmetry @ Otterbein

Posted in Computers by pgadey on 2019/06/03

The image represents a molecule of chloropentacarbonylmanganese or ClMn(CO)5. For the last half-hour or so, I have been playing around in the Symmetry Gallery put together by Otterbein. Lots of lovely molecules with high degrees of symmetry. It is remarkable (to me) that such things even exist in nature. I encourage you to go and check out the lovely interactive demos on the site.

## Office Camera

Posted in Computers by pgadey on 2016/09/13

There is a camera in my office which I use to take photos of the white board. The photos are automatically posted to http://pgadey.ca/office/cam/. If we work on a question during office hours, then it will appear on that page.


text:
# Tag Info

86

Here is a further intuitive and unpretentious explanation along the lines of MGwynne's answer. With $2$-SAT, you can only express implications of the form $a \Rightarrow b$, where $a$ and $b$ are literals. More precisely, every $2$-clause $l_1 \lor l_2$ can be understood as a pair of implications: $\lnot l_1 \Rightarrow l_2$ and $\lnot l_2 \Rightarrow l_1$. ...

33

Probably not. What you are asking is whether NP $\subset$ P/poly. If this were true, then the polynomial hierarchy would collapse (this is the Karp–Lipton theorem), something that is widely believed not to happen.

31

Consider resolution on a 2-SAT formula. Any resolvent is of size at most 2 (note that $n + m -2 \le 2$ if $n, m \le 2$ for clauses of length $n$ and $m$ resp). The number of clauses of size 2 is quadratic in the number of variables. Therefore, the resolution algorithm is in P. Once you get to 3-SAT you can get bigger and bigger resolvents, so it all goes ...

29

Yes, this is known. It appears in one of the must-cite references on triangle finding... Namely, Itai and Rodeh show in SICOMP 1978 how to find, in $O(n^2)$ time, a cycle in a graph that has at most one more edge than the minimum length cycle. (See the first three sentences of the abstract here: http://www.cs.technion.ac.il/~itai/publications/Algorithms/min-...

26

I think that there is a fundamental underlying difficulty with the question you are asking here (and that you asked in your related question about incomprehensible languages). Roughly speaking, it seems you're seeking a language $L$ such that $L\in P$ but ZFC doesn't know that $L\in P$. To understand the difficulties with your question, I think you must ...

22

While admittedly I haven't done the analysis, and this is not strictly a decision problem, I am willing to wager the best known matrix multiplication algorithms (by Coppersmith, Winograd, Stothers, Williams, et al) have irrational exponent. This can be seen more clearly in the simple case of Strassen's algorithm, which has running time $O(n^{\log_2 7})$. ...

21

There has, in fact, been quite a lot of recent works on proving quasi-polynomial running time lower bound for computational problems, mostly based on the exponential time hypothesis. Here are some results for problems that I consider quite natural (all results below are conditional on ETH): Aaronson, Impagliazzo and Moshkovitz [1] show a quasi-polynomial ...

20

As Walter says, clauses of 2-SAT have a special form. This can be exploited to find solutions quickly. There are actually several classes of SAT instances that can be decided in polynomial time, and 2-SAT is just one of these tractable classes. There are three broad kinds of reasons for tractability: (Structural tractability) Any class of SAT instances ...

20

This is still #P-complete [1]. This problem is usually referred to as montone (#)SAT. Monotone #2-SAT is already #P-complete (this is equivalent to counting vertex covers of a graph). [1] Roth, Dan. "On the hardness of approximate reasoning." Artificial Intelligence 82.1-2 (1996): 273-302.

19

Megiddo and Vishkin proved that Minimum dominating set in tournaments is in $QP$. They showed that tournament dominating set has P-time algorithm iff SAT has subexponential time algorithm. Therefore, tournament dominating set problem can not be in $P$ unless the ETH is false. It is very interesting to note that the exponential time hypothesis simultaneously ...

16

Treewidth is NP-hard to compute on co-bipartite graphs, indeed the original NP-hardness proof of treewidth of Arnborg et al. shows this. Additionally, Bodlaender and Thilikos showed that it is NP-hard to compute the treewidth of graphs of maximum degree $9$. Finally, for any graph of treewidth at least $2$, subdividing an edge (i.e, replacing the edge by a ...

15

Visibly pushdown automata (or nested word automata, if you prefer working with nested words instead of finite words) extend the expressive power of deterministic finite automata: the class of regular languages is strictly contained within the class of visibly pushdown languages. For deterministic visibly pushdown automata, the language inclusion problem can ...

15

There is a notion of a monotone non-deterministic and, more generally, alternating Turing machine in the paper Monotone Complexity by Grigni and Sipser. Since polynomial time is the same as alternating logarithmic space, a machine characterization of uniform $\mathsf{mP}$ is the monotone alternating logspace Turing machine. Providing such a machine with ...

14

The famous primality testing problem, shown to be in P in the 2000 paper PRIMES is in P.

14

This problem is Monotone-SAT. It is #P-Complete under Cook Reductions. It is one of those problems that are "easy to decide but hard to count." I recommend the following paper. Self-Reducibility of Hard Counting Problems with Decision Version in P

13

If infinite words are in your scope, you can generalize DFA (with parity condition) to the so-called Good-for-Games automata (GFG), that still have polynomial containment. A NFA is GFG if there is a strategy $\sigma:A^*\times Q\times A\to \Delta$, that given the prefix read so far and the current state and letter, chooses a transition to go to the next ...

13

How bout the simplex algorithm for linear programming? In many occasions it is used in practice. Edited to add: I think it's more of a "worse-case exponential algorithm" which runs efficiently on practical instances/distributions rather than runs faster on practical sized adversarial instances.

13

It's not quadratic, but Alon Yuster and Zwick ("Finding and counting given length cycles", Algorithmica 1997) give an algorithm for finding triangles in time $O(m^{2\omega/(\omega+1)})$, where $\omega$ is the exponent for fast matrix multiplication. For 4-cycle-free graphs, plugging in $\omega<2.373$ and $m=O(n^{3/2})$ (else there is a $4$-cycle ...

13

Johnson graphs are actually easy to recognize. In particular, you can recognize whether an input graph is a Johnson graph in polynomial time, and you can construct an isomorphism between two isomorphic Johnson graphs in polynomial time. Johnson graphs come into the proof in a different way. Very roughly speaking, the proof juggles between group-theoretic ...

12

Take a formula $\phi$ in 3-CNF over variables $V=\{v_{i}\}$ and clauses $C=\{c_{j}\}$, and let $A:V\rightarrow \{TRUE,FALSE\}$ be an arbitrarily chosen assignment. The clauses of $\phi$ can be divided into two categories, those that are satisfied by $A$ and those that aren't. All those that are satisfied have at least one literal that evaluates to $TRUE$, ...

12

Testing perfect graphs. Famous people (Lovasz, Knuth, ...) conjectured in the 1980s that there is a polynomial time recognition for perfect graphs. Such an algorithm was found after almost 20 years later by famous people ( Cornuéjols and other, FOCS 2003).

12

The fastest algorithm known for the problem of identifying whether a graph has a knotless embedding is due to Miller and Naimi, and is exponential-time. Robertson-Seymour theory says that there is an $O(n^3)$ algorithm for this problem; however, to write it down we would need to know the list of forbidden minors for knotless embeddings. However, even if we ...

12

Group Isomorphism! Although Ricky Demer gave lots (though certainly not all) details on this, there is an important point I want to highlight, esp. given the stated motivation for the question, namely: Putting Group Isomorphism into $\mathsf{P}$ is a key obstacle to putting Graph Isomorphism into $\mathsf{P}$ Group Isomorphism (when given by ...

11

With respect to Problem II, it is coNP-hard (under Karp reductions) to tell if the number of unreachable strings is 0 or at least $1 - 2^{-\text{poly}(|x|)}$ fraction of all strings. I suspect there is a way to boost this and show that the gap problem is PSPACE-hard, maybe by using IP as a robust characterization of PSPACE. Let $L$ be a coNP-complete ...

11

The $k$-disjoint path problem for fixed $k$. Given an undirected graph $G$ and $k$ node pairs $s_1t_1,s_2t_2,\ldots,s_kt_k$, are there node-disjoint paths in $G$ connecting the pairs? Polynomial-time algorithm follows from the work of Robertson and Seymour and relies on very non-trivial and difficult graph theoretic results. There are more general problems ...

11

A Non deterministic XOR automaton (NXA) fits your question. A NXA $M$ is essentially an NFA, but a word $w\in \Sigma^*$ is said to be in $L(M)$ if it is accepted by an odd number of paths (Xor relation) instead of being accepted if there exists an accepting path for it (Or relation). NXAs are used for creating small representations of regular languages as ...

11

If $\mathrm{P\subseteq CSL}$, then $\mathrm{P\subseteq DSPACE}(n^2)$. By a padding argument, this implies $$\mathrm{DTIME}(t(n))\subseteq\mathrm{DSPACE}\bigl(t(n)^\epsilon\bigr)$$ for every superpolynomial well-behaved function $t(n)$ and every $\epsilon>0$. I believe such a strong advantage of space over time is not expected to be true. The best ...

10

Ok, so you have a polygon $P$ with integer-length axis-parallel sides and possibly with holes (the shape you want to cover) and you want to partition it into as few $1\times a$ or $b\times 1$ rectangles as possible. At first I thought you wanted the minimum partition into rectangles of arbitrary shapes, which has a known polynomial time solution involving a ...

10

If you understand the algorithm for 2SAT, you already know why it's in P - this is precisely what the algorithm demonstrates. I think this comic illustrates my point. As you already know why 2SAT is in P, what you probably want to know is why 2SAT isn't NP-hard. To understand why 2SAT isn't NP-hard, you have to consider how easy it is to reduce other ...

10

Solving the planted clique problem of distinguishing a uniformly random graph from the union of a random graph and a clique (of size intermediate between $2\log_2 n$ and $\sqrt n$), with success probability bounded away from 1/2. It differs from your ETH-violating example of finding polylog-sized cliques in arbitrary graphs, because this is an average-case ...

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


text:
### Algebra Fundamentals

While most approaches to algebra emphasize its mechanical rule-following nature, we will be working to develop an intuition for the principles that make algebra work.

In the upcoming problems, try to think about the problems as a physical system that you can manipulate. For example, in the image above, can you imagine what would happen to the scale if you removed only the blue circle? What if you removed both of the red triangles?

Developing this kind of intuition will help you become a stronger problem solver!

# Scale and Lever Logic

What is the mass of a single red square?

# Scale and Lever Logic

While this problem appears different, the intuition you can use to solve balance scale problems can also be used here.

• The mass of a full jar of honey is 1000 grams.
• With half of the honey, the total mass is 600 grams.

What is the mass of the empty jar in grams?

# Scale and Lever Logic

What weight will the fourth scale display?

Think carefully! There's a quick and clever shortcut for solving this.

# Scale and Lever Logic

At the end of this course, you'll have a thorough toolbox of algebraic techniques that feel natural to use and empower you to master complex problems and puzzles!

How many green squares should be placed on the right side of the bottom scale in order to make it balance when released?

# Scale and Lever Logic

How many red balls need to be added to the right hand side of the bottom scale to put it in balance?

×