text:
# Repeating Phrases¶

This notebook describes some strategies for working with repeating phrases (also called n-grams ). It's part of the The Art of Literary Text Analysis (and assumes that you've already worked through previous notebooks – see the table of contents). In this notebook we'll look in particular at:

So far we've been focused on considering the frequency and distribution of individual terms, but sometimes it can also be useful to study repeating phrases, or sequences of words. Repeating phrases are sometimes also called n-grams where the "n" indicates a variable number of repeating words (or other linguistic unit like a character or ideogram). So we can have unigrams (one), bigrams (two), trigrams (three), and so on. The Google Ngram Viewer provides a way of searching for variable length phrases in its very large corpus of digitized works. We'll consider here some of the ways of working with n-grams.

## NLTK Collocations¶

Let's begin by loading Austen's Emma text from NLTK's Gutenberg corpus (we'll work with a longer text than Gold Bug in order to see more repeating phrases).

In [15]:
import nltk
emmaTokens = list(nltk.corpus.gutenberg.words("austen-emma.txt")) # note the use of words() to load tokens
emmaWords = [word for word in emmaTokens if word[0].isalpha()] # filter out non-words
print(emmaWords[:25])

['Emma', 'by', 'Jane', 'Austen', 'VOLUME', 'I', 'CHAPTER', 'I', 'Emma', 'Woodhouse', 'handsome', 'clever', 'and', 'rich', 'with', 'a', 'comfortable', 'home', 'and', 'happy', 'disposition', 'seemed', 'to', 'unite', 'some']

There's actually a very easy and convenient way to look for the top bigrams in an NLTK text using the collocations() function and specifying the number of top frequency phrases to return.

In [2]:
emmaText = nltk.Text(emmaWords)
emmaText.collocations(20) # 20 top bigrams separated by semi-colon

Mrs Weston; Frank Churchill; Miss Woodhouse; Mrs Elton; Miss Bates;
Jane Fairfax; Miss Fairfax; every thing; young man; every body; great
deal; Mrs Goddard; dare say; Maple Grove; John Knightley; Miss Taylor;
Miss Smith; Robert Martin; Colonel Campbell; Box Hill

A lot of proper names!

## NLTK N-Grams¶

Though convenient, this method is limited to bigrams (2 words), forces the use of stop-words, and doesn't provide frequency information. Fortunately, with only a bit more work using NLTK's ngrams() function on a list of words, we have much more control. Let's create a temporary n-grams list to see what's happening.

In [3]:
emmaFirstSixWords = " ".join(emmaWords[:6]) # join first six words with spaces
print("first six words: ", emmaFirstSixWords)
emmaBigrams = list(nltk.ngrams(emmaWords, 2)) # create bigrams (n-grams of 2) from our emmaTokens
emmaBigrams[:5] # convert to a list and show the first 5 entries

first six words:  Emma by Jane Austen VOLUME I

Out[3]:
[('Emma', 'by'),
('by', 'Jane'),
('Jane', 'Austen'),
('Austen', 'VOLUME'),
('VOLUME', 'I')]

As we can see, the nltk.ngrams() function goes through the text, and creates a new tupple of the specified length, with each item shifting forward by just one word – this is a moving window that slides along the entire text.

Since the last word of the text can't be the start of a bigram, we should have one fewer bigrams than words (even if all words but the last word are repeated in two entries, as the first word and as the second word).

In [4]:
print("number of words:", len(emmaWords))
print("number of ngrams:", len(emmaBigrams))

number of words: 161975
number of ngrams: 161974

Let's now look at n-grams of 4 tokens where we calculate frequency of repeating n-grams and ask for the most common.

In [5]:
emma4grams = list(nltk.ngrams(emmaWords, 4)) # create four-grams
emma4gramsFreqs = nltk.FreqDist(emma4grams) # determine frequency of four-grams
for words, count in emma4gramsFreqs.most_common(15): # for the 15 most common four-grams
print(count, " ".join(list(words))) # show the count and the create a string from the tuple

50 I do not know
25 a great deal of
20 I am sure I
18 I do not think
18 Mr and Mrs Weston
18 it would have been
16 I have no doubt
16 I am sure you
14 at Mrs Goddard s
13 and I am sure
12 that she could not
12 have no doubt of
12 I am sure she
11 quarter of an hour
11 as soon as she

It's interesting that the phrase "I do not know" repeats so frequently. In fact, several of the entries relate to certainty or doubt, which would be worth looking at more closely. However, we should also notice another artefact of this simple n-gram technique: we get overlapping entries. Consider the following two sentences:

• and I am sure I had no more idea…
• and I am sure I never think of that poor young man…

Our ngrams() function will actually find two n-grams of four:

• (2) and I am sure
• (2) I am sure I

Since these are separate entries and each entry has two occurrences, it might look like a total of four n-grams, but it's not necessarily valid to count them separately. Similarly, even though we have several entries above that related to doubt and certainty, it may be that some of them are composed of the same phrases in the text.

There are techniques to address this as a potential problem, but for now let's just be aware of the issue.

## Distribution of Phrases¶

We can't ask for a concordance or dispersion plot from the emmaText of our phrases, since our emmaText is composed of words (and a phrase can't match the words).

In [6]:
%matplotlib inline
emmaText.dispersion_plot(["I do not know"]) # won't work since phrases aren't in the emmaText tokens

However, we can create a new text from our ngrams and then ask for a dispersion plot. Don't forget that we need to search for the tuple ("I","do","not","know") since that's what's in each ngram (not the string "I do not know").

In [7]:
emma4gramsText = nltk.Text(emma4grams)
emma4gramsText.dispersion_plot([("I","do","not","know")])

We can perhaps perceive a greater preponderance of occurences closer to the middle of the text, but nothing especially noteworthy.

Rather than working with tuples, it may be easier to convert our n-gram tuple to a string.

In [1]:
emma4gramsTokens = [" ".join(gram) for gram in emma4grams]
nltk.Text(emma4gramsTokens).dispersion_plot([("I do not know")])

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-1-5fa469ba422d> in <module>()
----> 1 emma4gramsTokens = [" ".join(gram) for gram in emma4grams]
2 nltk.Text(emma4gramsTokens).dispersion_plot([("I do not know")])

NameError: name 'emma4grams' is not defined

## Longest Repeating Phrases¶

We might also want to determine the longest repeating n-grams. Using a range we can look for n-grams and break out of the loop if there are no more.

In [9]:
ngramsFreqs = [] # keep track of last set of repeating phrases
for length in range(2, len(emmaWords)): # create a range from 2 to the length of the text (even if we don't get that high)
ngrams = list(nltk.ngrams(emmaWords, length)) # get n-grams for specified length
freqs = nltk.FreqDist(ngrams) # get frequencies for these n-grams
freqs = [(ngram, count) for ngram, count in freqs.items() if count > 1] # filter out frequencies that don't repeat
if len(freqs) > 0: # we have at least one repeating phrase
ngramsFreqs = freqs # new set of frequencies
else: # if we've filtered out all frequencies then break out of the loop
break

for ngram, count in ngramsFreqs:
print("ngram of ", len(ngram), " words occurring ", count, " times:", " ".join(list(ngram)))

ngram of  29  words occurring  2  times: what reverse we have Man s boasted power and freedom all are flown Lord of the earth and sea he bends a slave And woman lovely woman reigns alone

A repeating phrase of 29 words! We can look at Emma closer to see that these are excerpts of a letter read in different contexts.

## Segmenting Texts¶

We've relied heavily on dispersion_plot() as a way of looking at term distribution, but there are other approaches, ones that may be better or worse depending on the context. One possibility is to segment our text into equal parts and then to plot distribution for each part.

We can segment our tokens or n-grams in various ways, but one convenient way is to use a library called NumPy that is helpful for working with arrays (and graphing array-backed data). Let's see it in action with a simplified example where we're going to create a list of numbers from 0 to 9 (10 elements) and then create 5 equal bins in which to place the items.

In [10]:
numbers = list(range(0,9)) # create a range from 0 to 9 and convert the range to a list
numbers

Out[10]:
[0, 1, 2, 3, 4, 5, 6, 7, 8]
In [11]:
import numpy as np
numberBins = np.array_split(numbers, 5) # divide our numbers into 5 equal bins
print("number of bins:", len(numberBins))
numberBins

number of bins: 5

Out[11]:
[array([0, 1]), array([2, 3]), array([4, 5]), array([6, 7]), array([8])]

So the first bin has 0 and 1, the second has 2 and 3, etc.

We can do something similar with our emma4gramsTokens, dividing the list into 10 each parts.

In [12]:
emma4gramsSegments = np.array_split(emma4gramsTokens, 10)
[len(segment) for segment in emma4gramsSegments] # how many ngrams in each bin?

Out[12]:
[16198, 16198, 16197, 16197, 16197, 16197, 16197, 16197, 16197, 16197]

Now, instead of counting the number of tokens, we'll count the number of occurrences of our search term "I do not know".

In [13]:
iDoNotKnowCounts = [list(segment).count(("I do not know")) for segment in emma4gramsSegments]
iDoNotKnowCounts # counts per segment

Out[13]:
[6, 6, 2, 5, 7, 7, 6, 4, 3, 4]

And now a simple plot of these counts (we're adding a legend to make it easier to understand).

In [31]:
import matplotlib.pyplot as plt
line = plt.plot(iDoNotKnowCounts, label="I do not know")
plt.ylim(0) # make sure to set y axis to start at zero
plt.legend(handles=line) # we're going to add a legend
plt.show() # make sure to flush out the line chart
emma4gramsText.dispersion_plot([("I","do","not","know")]) # for comparison sake

These provide quite different pictures of the data even though in both cases we should be seeing 50 occurrences of "I do not know". The first graph seems to show wildly fluctuating numbers, but it's worth recognizing that in this simple form our y axis (vertical) only varies by five and that the numbers are relatively small. Indeed, it may not be all that helpful to use a line graph here since it suggests continuity between the segments when there isn't any. For discrete measurements, a bar graph is often preferable, and is only slightly more complicated to produce, as we also provide explicit values for the x axis.

In [20]:
import matplotlib.pyplot as plt
xaxis = range(0, len(iDoNotKnowCounts)) # a range from zero to the length of our counts (0-9)
bar = plt.bar(xaxis, iDoNotKnowCounts, label="I do not know")
plt.legend(handles=[bar])
plt.show()

The x-axis (bottom horizontal bar) isn't quite ideal, but for now we can leave it as is.

Line graphs can be a bit easier to read for multiple values though. Let's construct a graph that compares "I do not know" and "I have no doubt".

In [21]:
searches = ["I do not know", "I have no doubt"]
lines = []
for search in searches:
line, = plt.plot([list(segment).count(search) for segment in emma4gramsSegments], label=search)
lines.append(line)
plt.legend(handles=lines)
plt.show()

It's worth reiterating that the numbers here are very small, so we should probably resist the temptation to jump too much to conclusions.

## Correlations¶

A question we might have about the graph above is to what extent values in the two lines correlate. In other words, if one line rises, does the other have a tendency to rise, or is it the opposite, or is there no real correlation (synchronized variation) between the two.

Once again we can use NumPy to help us measure correlation using corrcoef(). Let's first see it in action with a couple of simple example datasets.

In [22]:
list1 = [1,2,3]
list2 = [1,5,7]
plt.plot(range(3), list1, range(3), list2)
plt.show()
np.corrcoef(list1, list2)[0,1] # this returns a matrix (box) of values, but we're only interested in the top right value

Out[22]:
0.98198050606196585

This is a correlation value that expresses the degree to which the values from the two lists change in harmony. For our purposes the underlying mathematics of it are somewhat less important than the general concept of correlation (synchrnized variation) and what the value essentially conveys.

Correlation values vary between -1 and 1. The correlation value in this case (0.98198050606196585) is approaching 1 which indicates a high correlation between the two lists (as the values in one list rise so do the ones in the other). Let's flip the order of the second list to see what happens.

In [23]:
list2.reverse()
plt.plot(range(3), list1, range(3), list2)
plt.show()
np.corrcoef(list1, list2)[0,1]

Out[23]:
-0.98198050606196585

Notice that we still have a strong correlation, but it's inverted (close to -1).

If items from our lists vary with little correlation, the correlation value will approach zero. Now let's try getting a correlation value for our two search terms.

In [24]:
iDoNotKnowCounts = [list(segment).count("I do not know") for segment in emma4gramsSegments]
iHaveNoDoubtCounts = [list(segment).count("I have no doubt") for segment in emma4gramsSegments]
print(iDoNotKnowCounts)
print(iHaveNoDoubtCounts)

[6, 6, 2, 5, 7, 7, 6, 4, 3, 4]
[3, 1, 2, 0, 1, 1, 2, 1, 2, 3]

In [25]:
np.corrcoef(iDoNotKnowCounts, iHaveNoDoubtCounts)[0,1]

Out[25]:
-0.27066598098038336

So a weak inverse correlation (as the frequency of one rises or drops the other has a slight tendency to go in the opposite direction). Let's see if we can find one of our top frequency four-grams with a stronger correlation.

In [26]:
emma4gramsMostFrequent = [" ".join(words) for words, count in emma4gramsFreqs.most_common(15)] # get a list of top
print(emma4gramsMostFrequent)

['I do not know', 'a great deal of', 'I am sure I', 'I do not think', 'Mr and Mrs Weston', 'it would have been', 'I have no doubt', 'I am sure you', 'at Mrs Goddard s', 'and I am sure', 'that she could not', 'have no doubt of', 'I am sure she', 'quarter of an hour', 'as soon as she']

In [27]:
emma4gramsSegmentsCounts = {} # build a dictionary of counts for each search item
for search in emma4gramsMostFrequent:
emma4gramsSegmentsCounts[search] = [list(segment).count(search) for segment in emma4gramsSegments]

iDoNotKnowCorrelations = {} # build a dictionary of correlation values for "I do not know"
for ngram, counts in emma4gramsSegmentsCounts.items():
iDoNotKnowCorrelations[ngram] = np.corrcoef(emma4gramsSegmentsCounts["I do not know"], counts)[0,1]

iDoNotKnowCorrelationFreqs = nltk.FreqDist(iDoNotKnowCorrelations)
print(iDoNotKnowCorrelationFreqs.most_common())
iDoNotKnowCorrelationFreqs.plot()

[('I do not know', 1.0), ('I do not think', 0.71679269233981702), ('I am sure you', 0.20299948573528753), ('I am sure she', 0.1211096026497343), ('and I am sure', 0.11275884962655315), ('it would have been', 0.082874193016474501), ('quarter of an hour', 0.054603247242463411), ('I am sure I', 0.041812100500354533), ('as soon as she', 5.8387319739822136e-17), ('Mr and Mrs Weston', -0.037330068339472076), ('I have no doubt', -0.27066598098038336), ('at Mrs Goddard s', -0.32003866823226162), ('have no doubt of', -0.35569399576529515), ('that she could not', -0.3797772626563749), ('a great deal of', -0.41344911529736156)]

"I do not know" correlates perfectly with "I do not know" (phew). But this also suggests that "I do not know" is positively correlated with "I do not think", followed by a bunch of weak correlations, and then some slightly stronger negative correlations for things like "a great deal of".

## Next Steps¶

• Create an emmaStoppedWords list that filters out stoplist words in emmaWords (see Getting NLTK if needed)
• Compare the top 20 frequency n-grams from emmaWords and emmaStoppedWords – which seems more useful?
• Using emmaStoppedWords determine the correlations between the top n-gram and the top 20 n-grams (for 10 text segments)
• Do the same, but with 100 text segments – does the ranking change?

Next we're going to have some distant encounters with Sentiment Analysis.

CC BY-SA From The Art of Literary Text Analysis by Stéfan Sinclair & Geoffrey Rockwell. Edited and revised by Melissa Mony.
Created February 24, 2015 and last modified December 9, 2015 (Jupyter 4)

In [ ]:


text:
# Is there a example of function $f\colon\mathbb Z\to \{\text{finite subsets of }\mathbb Z\}$?

Sorry for my poor English:

In my last question, I ask for a the proof of "Are the set of all finite subsets in $\mathbb Z$ countable?" . I had a good answer that show me that it is an $f\colon\mathbb N\to\{\text{finite subsets of }\mathbb N\}$. So knowing that exists a bijection $\mathbb{N\leftrightarrow Z}$, then is proved.

But I have curiosity about an example (if exists) of a function $f\colon\mathbb Z\to\{\text{finite subsets of }\mathbb Z\}$ exists this example?

-
Since $\mathbb{N}$ is equipotent to $\mathbb{Z}$ these two questions are the same. –  Alex Youcis Feb 12 '13 at 9:51
I guess you are looking for an explicit function that is nice to write down? –  Michael Greinecker Feb 12 '13 at 9:54
Do you want it to be bijective, injective, surjective? –  Joe Tait Feb 12 '13 at 9:55
Joe Tait: bijective –  Pedro Feb 12 '13 at 11:02

There is definitely an abundance of functions from $\mathbb Z$ to its finite subsets, e.g., the map $z \mapsto \{ z \}$. If you are looking for a bijective function, things are more complicated.

Here's an explicit example, though: Let $F(X)$ be the set of finite subets of $X$, and let $b: \mathbb N \to F(\mathbb N)$ be any bijection with $b(0) = \varnothing$. Define $f(x) := b(x)$ for $x \ge 0$ and $f(x) := \{ -y | y \in b(-x) \}$ for $x<0$.

It is easy to see that $f|_{\mathbb N}$ and $f|_{-\mathbb N}$ are injective, $f(\mathbb N) = F(\mathbb N)$ and $f(-\mathbb N) = F(-\mathbb N)$. Thus, to show that $f$ is bijective, it is sufficient to show that there is at most one $x$ such that $f(x) = \varnothing$. But since $b$ is injective and $b(0) = \varnothing$, there is no $x >0$ such that $f(x) = \varnothing$, and by definiton of $f$, $f(x) \neq \varnothing$ for all $x<0$ as well.

-
Thank you, very much. :-) –  Pedro Feb 12 '13 at 11:04

format: plain


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

 It is currently 06 Oct 2015, 12:31

### 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

# M15#29

Author Message
Manager
Joined: 22 Jul 2009
Posts: 192
Followers: 4

Kudos [?]: 220 [0], given: 18

M15#29 [#permalink]  06 Oct 2009, 12:53
1
This post was
BOOKMARKED
If in a six-digit integer $$N$$, $$F(k)$$ is the value of the $$k-th$$ digit, is $$N$$ divisible by 7 (For example, $$F(4)$$ is the value of the hundreds digit of $$N$$ )?

(1) $$F(1) = F(4), F(2) = F(5), F(3) = F(6)$$
(2) $$F(1) = F(2) = ... = F(6)$$

(C) 2008 GMAT Club - m15#29

SOLUTION:
[Reveal] Spoiler:
Statements (1) and (2) by themselves are sufficient. S1 tells us that the last three digits of $$N$$ are the same as the first three digits: $$N = abcabc$$ . Note that $$N = abc*1000 + abc = abc*1001$$ . As 1001 is divisible by 7, $$N$$ is also divisible by 7.

_________________

Please kudos if my post helps.

 Kaplan GMAT Prep Discount Codes Knewton GMAT Discount Codes GMAT Pill GMAT Discount Codes
Manager
Joined: 22 Jul 2009
Posts: 192
Followers: 4

Kudos [?]: 220 [0], given: 18

Re: M15#29 [#permalink]  06 Oct 2009, 12:59
I believe there is an error in this question.

If, as it says, F(4) is the value of the hundreds digit, then F(1) is the value of the decimal digit of N.

Given that N is an integer, then F(1)=0.

F(1)=F(2)=F(3)=F(4)=F(5)=F(6)=0 --> N=0 and it is not a 6 digit integer. This contradicts the question stem.

Or am I missing something?
_________________

Please kudos if my post helps.

Intern
Joined: 22 Sep 2010
Posts: 9
Followers: 0

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

Re: M15#29 [#permalink]  11 Jan 2012, 03:32
This question somehow doesnt make sense. How can F(4) be hundreds digit? shouldnt it 1000's digit..

Help will be really appreciated!
Thanks!
Current Student
Joined: 14 May 2012
Posts: 76
Location: United States
Concentration: Finance, Strategy
GMAT 1: 710 Q49 V38
GPA: 3.8
WE: Corporate Finance (Venture Capital)
Followers: 0

Kudos [?]: 53 [0], given: 15

Re: M15#29 [#permalink]  15 Mar 2013, 22:33
Can some one comment here , Since this figures in the gmatclub tests ?
Manager
Joined: 10 Mar 2014
Posts: 202
Followers: 1

Kudos [?]: 41 [0], given: 13

Re: M15#29 [#permalink]  03 Jun 2014, 20:27
powerka wrote:
I believe there is an error in this question.

If, as it says, F(4) is the value of the hundreds digit, then F(1) is the value of the decimal digit of N.

Given that N is an integer, then F(1)=0.

F(1)=F(2)=F(3)=F(4)=F(5)=F(6)=0 --> N=0 and it is not a 6 digit integer. This contradicts the question stem.

Or am I missing something?

Hi Bunnel,

I also have a doubt here. if f(4) is hundreads digit as given in question then how f(1) can be units digit.

Thanks.
Math Expert
Joined: 02 Sep 2009
Posts: 29750
Followers: 4894

Kudos [?]: 53356 [0], given: 8155

Re: M15#29 [#permalink]  04 Jun 2014, 02:31
Expert's post
PathFinder007 wrote:
powerka wrote:
If in a six-digit integer $$N$$, $$F(k)$$ is the value of the $$k-th$$ digit, is $$N$$ divisible by 7 (For example, $$F(4)$$ is the value of the hundreds digit of $$N$$ )?

(1) $$F(1) = F(4), F(2) = F(5), F(3) = F(6)$$
(2) $$F(1) = F(2) = ... = F(6)$$

I believe there is an error in this question.

If, as it says, F(4) is the value of the hundreds digit, then F(1) is the value of the decimal digit of N.

Given that N is an integer, then F(1)=0.

F(1)=F(2)=F(3)=F(4)=F(5)=F(6)=0 --> N=0 and it is not a 6 digit integer. This contradicts the question stem.

Or am I missing something?

Hi Bunnel,

I also have a doubt here. if f(4) is hundreads digit as given in question then how f(1) can be units digit.

Thanks.

F(1) is the value of HUNDRED THOUSANDS digit not the UNITS digit.

123,456
1 - HUNDRED THOUSANDS
2 - TEN THOUSANDS
3 - THOUSANDS
4 - HUNDREDS
5 - TENS
6 - UNITS

Hope it's clear.
_________________
Re: M15#29   [#permalink] 04 Jun 2014, 02:31
Display posts from previous: Sort by

# M15#29

Moderators: WoundedTiger, Bunuel

 Powered by phpBB © phpBB Group and phpBB SEO Kindly note that the GMAT® test is a registered trademark of the Graduate Management Admission Council®, and this site has neither been reviewed nor endorsed by GMAC®.


text:
# Generalized 2D cellular automata simulator

This is a simple Game of Life implementation, with one neat gimmick: You can specify the rules that the simulator uses to decide whether cells should live or die. Congrats, God!

I'd especially like tips on:

• Idiomaticity: As always, I abuse language features, and I'd like help doing that.
• Efficiency: After a certain point, it takes a while to print out the next generation -- whether this is from figuring it out or printing it, I'm not sure. Any tips to speed up both phases are appreciated.
• Edge cases: I tested a few common patterns (spaceships, bombs, etc.) in various rules, but I don't know enough about cellular automata to make sure it works in every scenario. I can't imagine why it wouldn't, though.
• Prettiness: The output is kinda clunky. I'm open to improvement in the format of that as well.

### game_of_life.rb

class Hash
def boundaries
return [[0, 0], [0, 0]] if self.empty?
x_bounds = self.keys.inject([self.keys[0][0]] * 2) { |(min, max), (x, _)| [min, x, max].minmax }
y_bounds = self.keys.inject([self.keys[0][1]] * 2) { |(min, max), (_, y)| [min, y, max].minmax }
[[x_bounds[0], y_bounds[0]], [x_bounds[1], y_bounds[1]]]
end

def hmap(&block)
Hash[map { |k, v| block.call(k, v) }]
end
end

class Array
def neighbors
range = (-1..1).to_a
range.product(range)
.reject { |item| item == [0,0] }
.map do |loc|
loc.zip(self).map { |arr| arr.inject(:+) }
end
end

def count
self.each_with_object(Hash.new 0) do |item, count|
count[item] += 1
end
end
end

def iterate(board, rules)
board if board.empty?
board.keys.map(&:neighbors).flatten(1).count
.hmap { |loc, count| [loc, [count, board[loc]]] }
.hmap do |loc, (count, alive)|
if rules[alive ? :s : :b].include?(count)
alive = true
else
alive = false
end
[loc, alive]
end.reject { |_, alive| !alive }
end

def draw_board(board)
puts 'No living cells!' if board.empty?
top_left, bot_right = board.boundaries
top_left[1].upto(bot_right[1]) do |y|
top_left[0].upto(bot_right[0]) do |x|
print (board[[x, y]] ? 'X' : ' ')
end
puts
end
end

generations = Integer(ARGV.shift)
rules = Hash[ARGV.shift.split('/').map(&:chars).map { |arr| [arr.shift.downcase.to_sym, arr.map(&:to_i)] }]
board = Hash[
File.open(ARGV.shift) { |file| file.readlines.map { |line| line.chomp.chars } }
.map.with_index { |row, y| row.map.with_index { |cell, x| [[x, y], cell != ' '] } }
.flatten(1)
.reject { |(_, data)| !data }
]
board.default = false

def pretty(list, conjunction)
if list.length == 1
list[0]
elsif list.length == 2
"#{list[0]} #{conjunction} #{list[1]}"
else
"#{list[0...-1].join(', ')}, #{conjunction} #{list[-1]}"
end
end

puts 'Rules:'
puts "* Cells stay alive with #{pretty(rules[:s], 'or')} neighbors"
puts "* Cells are born with #{pretty(rules[:b], 'or')} neighbors"
puts '* In all other cases, cells die or stay dead.'
puts '***'

(0..generations).each do |round|
puts "Generation #{round}:"
draw_board(board)
board = iterate(board, rules)
end

The syntax is as follows:

ruby game_of_life.rb <generations> <rules> <starting map>

where generations is a positive integer, rules is a string in the format of B3/S23; the B side represents when cells go from dead to alive and the S side represents when they stay alive between generations. starting map is the name of a file which contains Gen 0; spaces represent dead cells, any other (printable, non-newline) character represents a living one.

To simulate 50 generations of this pattern in Conway's Game of Life:

        t
bo       x
op     txt

save that pattern to a file called map.txt in the same directory as game_of_life.rb, then run this command:

ruby game_of_life.rb 50 B3/S23 map.txt

The output will be long, but should end with:

Generation 50:
XX
XX

X
X X
XX

• hmap can use the implicit yield but I am not sure that would be an improvement – Caridorc Aug 10 '15 at 17:39
• @Caridorc I prefer block.call because I'm more used to Java-esque programming (i.e. functional interfaces) and passing a block as a parameter, then calling it, is more comfortable than using a magic function. – Nic Hartley Aug 10 '15 at 17:42
• Indeed, I did not post an answer as I think yield is not superior, just different – Caridorc Aug 10 '15 at 17:44
• Your code is so coincise, I love it. 👍 – Caridorc Aug 10 '15 at 17:56
• What you have could perhaps be described as a general 2-dimensional cellular automata – ankh-morpork Aug 10 '15 at 21:19

Wow, this sure is some beautiful code, posted by someone who's probably just as beautiful, despite being a fat fu.

I'm gonna kick off this review by saying that pretty is named pretty (hah, get it?) badly. I mean, come on -- what the heck does it do? Does it return a formatted string? If that's the case, how's it formatting? I recommend a name like format_array_as_sentence, or arr_as_sentence if you want it shorter. Heck, maybe even as_sentence, if you're feeling particularly ornery. Still, you were tired and sick of being so close but not done, so that's forgivable.

[[x_bounds[0], y_bounds[0]], [x_bounds[1], y_bounds[1]]] can be written better as x_bounds.zip(y_bounds), but since you didn't even know that function existed back when you wrote this, I'll let it slide. Wait, you did! Shame on you! Go sit in the corner.

Now that I'm out of the corner, I feel confident in asking: how in the ever-loving RNGesus does Array#neighbors work? I mean, it does, and it works beautifully, but how? Seriously, that's some top-level magic going on right there. Add a few comments with an example to step through what's happening, so when you have to debug because they removed product or renamed it you don't need to sit there going "whaaaaaaat" for two hours like you did last time you had to maintain code you stole from the internet

In iterate why do you do two hmaps? Why not just one that looks like this:

.hmap do |loc, count|
if rules[board[loc] ? :s : :b].include?(count)
alive = true
else
alive = false
end
[loc, alive]
end

Wait, no, let's shorten that even more by not using a dumb extra variable where it's not needed:

.hmap { |loc, count| [loc, rules[board[loc] ? :s : :b].include?(count)] }

Now, that doesn't make much sense, so let's rename a few variables and change some symbols (which is gonna end up requiring some refactoring but that's okay):

.hmap { |loc, neighbor_count| [loc, alive_from[board[loc] ? :alive : :dead].include?(neighbor_count)] }

'course, that's gonna change a few things, like I said. First and foremost: You can't use that slick, shifty hack to get the symbols in place. You gotta do it the hard way. Well, it's not hard per se but shut up I'm doing your work for you so I get to use the words I want.

alive_from = Hash[%i[alive dead].zip(ARGV.shift.split('/').map(&:chars).map{|a|a.map &:to_i})]

Now, changing this means that the command-line syntax changes, too -- now, it's X/Y, instead of BX/SY. Much easier to remember.

Both iterate and draw_board are badly-placed, since everything else is object-oriented but those two bits are functional-style. Change one or the other, or make me cry by changing both.

print (board[[x, y]] ? 'X' : ' ') makes me just a little sad, since it means that you didn't realize that you should put the parens next to the method name because you can do that instead of relying on tricky spacing and expression calls.

Back to ragging on iterate: The check (board if board.empty?) at the looks like it should be useless, but damn if it doesn't speed up the empty rounds. Cute.

self.each_with_object(Hash.new 0) do |item, count|
count[item] += 1
end

I don't think I'll ever understand your reasons for making this do/end instead of {/}, but change it anyway.

In draw_board, you should put a box around it, so that it's clear precisely where the boundaries are. Here's the updated code:

def draw_board(board)
puts 'No living cells!' if board.empty?
top_left, bot_right = board.boundaries
puts "+#{'-'*(bot_right[1]-top_left[1])}+"
top_left[1].upto(bot_right[1]) do |y|
print '|'
top_left[0].upto(bot_right[0]) do |x|
print (board[[x, y]] ? 'X' : ' ')
end
puts '|'
end
puts "+#{'-'*(bot_right[1]-top_left[1])}+"
end

Bam! ASCIIArt quote for the week done.

• OP here and wow this is a fantastic review! Thanks! Just saying, though, if you added the full code, it'd be a lot better. – Nic Hartley Nov 20 '15 at 3:49
• @QPaysTaxes Once I finish the whole review, I'll post the edited code alongside it. – Nic Hartley Nov 20 '15 at 3:49
• Things are getting a little solipsistic up in here :) – Flambino Nov 20 '15 at 11:16
• @Flambino Just a little. It gets boring here at home. – Nic Hartley Nov 20 '15 at 22:39


text:
## For every positive integer p, f(p) represents the product of first p positive multiples of 3. How many prime numbers

##### This topic has expert replies
Moderator
Posts: 6595
Joined: 07 Sep 2017
Followed by:20 members

### For every positive integer p, f(p) represents the product of first p positive multiples of 3. How many prime numbers

by BTGmoderatorDC » Tue Apr 19, 2022 2:01 am

00:00

A

B

C

D

E

## Global Stats

For every positive integer p, f(p) represents the product of first p positive multiples of 3. How many prime numbers divide f(30)?

A. 2
B. 5
C. 8
D. 10
E. 13

OA D

Source: e-GMAT

• Page 1 of 1


text:
Generalization of $p$-adic cohomology ; bounded Witt vectors. A canonical lifting of a variety in characteristic $p\ne 0$ back to characteristic zero
Compositio Mathematica, Volume 34 (1977) no. 3, p. 225-277
@article{CM_1977__34_3_225_0,
author = {Lubkin, Saul},
title = {Generalization of $p$-adic cohomology ; bounded Witt vectors. A canonical lifting of a variety in characteristic $p \ne 0$ back to characteristic zero},
journal = {Compositio Mathematica},
publisher = {Noordhoff International Publishing},
volume = {34},
number = {3},
year = {1977},
pages = {225-277},
zbl = {0368.14009},
mrnumber = {453745},
language = {en},
url = {http://www.numdam.org/item/CM_1977__34_3_225_0}
}

Lubkin, Saul. Generalization of $p$-adic cohomology ; bounded Witt vectors. A canonical lifting of a variety in characteristic $p \ne 0$ back to characteristic zero. Compositio Mathematica, Volume 34 (1977) no. 3, pp. 225-277. http://www.numdam.org/item/CM_1977__34_3_225_0/

[1] Saul Lubkin: A p-Adic Proof of Weil's Conjectures. Annals of Mathematics, 87, Nos. 1-2, Jan-March, 1968, 105-255. | MR 224616 | Zbl 0188.53004

[2] Saul Lubkin: Generalization of p-adic Cohomology (to appear).

[3] Ernst Witt: Zyklische Körper und Algebren der Charackteristik p von Grade pn. J. Reine angew. Math., 176 (1936) 126-140. | Zbl 0016.05101


text:
# An alternative basis set for analytical computation of two electron integrals

It is well known that the usage of the Gaussian basis set, in contrast to Slater basis set, leads relative simple semi-analytical expressions for the two electron repulsion integral $(ab|cd)$. Could you propose any other basis sets allowing simple computations of two-electron integrals? This is quite general questions meaning that these functions should not fit atomic orbitals well (the problem is formulated for wider class of potentials rather than for the Coulomb one only).

• Plane wave, wavelet, although i am not sure if the integrals are simple – user26143 Nov 18 '13 at 14:36
• One of the main objectives is the orthogonality of the basis functions. So you can choose any reasonable orthogonal basis. – ssavec Nov 19 '13 at 10:39
• But, which of them gives analytical solution of the two-electron integral? For example, plane waves are ok. Independently of number of cites, they lead to Fourier transform of the rational function. Gaussian functions and plane wave, what else? – freude Nov 19 '13 at 12:08
• Orthogonality of basis set (function) usually does not bring problem in computation. The issue arises when MO vs VB – user26143 Nov 19 '13 at 21:05

## 1 Answer

A few things come to mind: 1) my understanding is that (ab|cd) in a gaussian basis is exactly solved for arbitrary "angular momenta" using recurrence relations such as the Obara-Saika method. The O-S method also has ways of generating the requisite derivatives with respect to coefficients, without which it is difficult to minimize the energy or do anything practical.

2) On the question of alternative basis sets to the Gaussian, one simply needs a complete basis set (of which there are many), helps to be orthogonal (almost as many), has to describe the boundary conditions of vanishing at infinity or being periodic with unit cell (fewer), hopefully is cusp-like near the nuclei (very few), and integration has to be tractable without resorting to quadrature, since there are four indices (each with 3 dimensions) but also millions of these integrals to compute -- and that leaves you with the Gaussian.

• Another good point for effective computations within the gaussian basis functions is that you can use fitting procedures $(ab|cd)\approx(ab|p)(q|cd)$ and transform four centres into three. – Martin - マーチン Jun 1 '14 at 13:29


text:
# Introduction - Analysing Customer Churn

March 2019 · 4 minute read

At first glance, analysing customer churn seems pretty easy. All we have to know is how many customers we have at a certain point in time and how many customers chose to leave our business over a given period in order to calculate a churn rate.

We could simply define customer churn rate as:

$\text{Churn Rate } = \frac{\text{# Customers Churned in Period}}{\text{# Customers Beginning of Period}}$ But this definition assumes that we lose customers linearly over a given period and that our customer base does not change except for the customers we lose, i.e. we are not acquiring any new customers.

We could change the denominator from number of ‘# Customers Beginning of Period’ to ‘Average # of Customers over Period’ defined by (# BoP + # EoP)/2, but then we would implicitly assume that we acquire customers at a constant rate. Moreover, we need to be careful if we want to calculate churn for periods with different lengths, say for February and March where period lengths can differ by around 10%.

Ideally, we need a metric to calcualte churn that takes the number of opportunities into account that a customer has in order to churn. So we could use something like this:

$\text{Churn Rate } = \frac{\text{# Customers Churned in Period}}{\text{# Customer Active Days in Period}} \times \text{Period Length}$

‘# Customer Active Days in Period’ is defined as the number of days in a given period during which a customer is considered active. Imagine we have two customers and one of them churns at the end of a 7 day period. We get a churn rate of about:

n_churned = 1
n_active_days = 7 + 6
period_length = 7

churn_rate = n_churned/n_active_days * period_length
churn_rate
## [1] 0.5384615

While we would get a churn rate of 1 if the customer churned immediately at the beginning of the period. This definition also allows us to calculate churn rates for different period lengths quite easily.

We could go one step further still and consider a churn rate where we not only calculate a weighted number of active customers over a given period but also a weighted churn number. Clearly, if a customer churns at the end of a period it is better than if he churns at the beginning? We could define a churn rate like so: $\text{Churn Rate } = \frac{\text{# Customer Inactive Days in Period}}{\text{# Customer Active Days in Period}}$ However, imagine the following scenario: You have two customers and one of them churns at the second day of our 7 day period. Your churn rate would be:

n_inactive_days = 6
n_active_days = 7 + 1
period_length = 7

churn_rate = n_inactive_days/n_active_days
churn_rate
## [1] 0.75

How would you calculate churn rates for the next 7 day period? You still have two customers, one of them has 0 active days the other 7. You get 7 inactive days, so your churn rate would be 100%. Or should your churn rate be 0%, because the customer is actually lost and should not count towards inactive days? So we could introduce a new customers status called ‘lost’ and a ‘lost’ customer does not count towards inactive days anymore. Which raises the question, when should we consider a customer lost?

Wait a minute, we still have not considered how we define if a customer is considered ‘churned’!


text:
# [Tugindia] Help me write a macro? (writing out strings to a file)

Tue Sep 13 13:37:27 CEST 2005

On Tue, September 13, 2005 2:37 pm, Ajay Narottam Shah said:
> Folks,
>
> I want to write a macro which works like this.
>
> The context is a book. At the start of processing chapter 4, an empty
> file 4.keywords should be created. When I say:
>
>      \keyword{string}
>
> this should be typeset in boldface in the running text, but
>
>      string\\
>
> should be written into 4.keywords as well. File buffering should not
> be done.
>
> At the end of the chapter, I should be able to say
>
> \tableofkeywords
>
> which should induce the code:
>
>   \section*{Keywords}
>
>   \textsl{
>     \input{4.keywords}
>   }
>
> By not having buffering, it would become a one-pass algorithm, because
> at the end of the chapter, the file 4.keywords would be ready to use.
>
> How would I go about writing this macro?

Here is one way of doing it:

\documentclass[a4paper]{book}
\usepackage{xspace}

\newwrite\keywrite

\def\keyword#1{\IfFileExists{\thechapter.keywords}%
{\immediate\write\keywrite{\string\key{#1}\string\\}}%
{\immediate\openout\keywrite=\thechapter.keywords
\immediate\write\keywrite{\string\key{#1}\string\\}}%
\textbf{#1}\xspace}

\def\key#1{\textsl{#1}}%

\def\tableofkeywords{%
\IfFileExists{\thechapter.keywords}%
{\immediate\closeout\keywrite
\section*{Keywords}%
\input{\thechapter.keywords}%
}%
{\typeout{Keywords File not available}}%
}

%---------------------------------------------------

\begin{document}

\chapter{One}

This is a keyword test.
\keyword{One}
\keyword{A}
\keyword{B}
\keyword{Keywords}

\tableofkeywords

\chapter{Two}

This is another chapter to test keywords.

\keyword{Two}
\keyword{Another}
\keyword{Ajay}

\tableofkeywords

\end{document}

--


text:
## CryptoDB

### Paper: Pairing-Based Cryptography at High Security Levels

Authors: Neal Koblitz Alfred Menezes URL: http://eprint.iacr.org/2005/076 Search ePrint Search Google In recent years cryptographic protocols based on the Weil and Tate pairings on elliptic curves have attracted much attention. A notable success in this area was the elegant solution by Boneh and Franklin of the problem of efficient identity-based encryption. At the same time, the security standards for public key cryptosystems are expected to increase, so that in the future they will be capable of providing security equivalent to 128-, 192-, or 256-bit AES keys. In this paper we examine the implications of heightened security needs for pairing-based cryptosystems. We first describe three different reasons why high-security users might have concerns about the long-term viability of these systems. However, in our view none of the risks inherent in pairing-based systems are sufficiently serious to warrant pulling them from the shelves. We next discuss two families of elliptic curves E for use in pairing-based cryptosystems. The first has the property that the pairing takes values in the prime field F_p over which the curve is defined; the second family consists of supersingular curves with embedding degree k=2. Finally, we examine the efficiency of the Weil pairing as opposed to the Tate pairing and compare a range of choices of embedding degree k, including k=1 and k=24.
##### BibTeX
@misc{eprint-2005-12413,
title={Pairing-Based Cryptography at High Security Levels},
booktitle={IACR Eprint archive},
keywords={public-key cryptography /},
url={http://eprint.iacr.org/2005/076},
note={ ajmeneze@uwaterloo.ca 12914 received 15 Mar 2005, last revised 11 May 2005},
author={Neal Koblitz and Alfred Menezes},
year=2005
}


text:
# Thiol prefixes for nomenclature

I've seen multiple prefixes for naming thiols: mercapto-, sulfanyl-, and -thio. Is there a rule for when specific ones are used? And are they used for IUPAC and/or common naming?

Mercapto- and sulfanyl- are both prefixes for use with the $\ce{-SH}$ group (known as a thiol), while thio- is used to denote the "sulfur" equivalent of an oxygen-containing functional group.

More details from the IUPAC Blue Book:

• Mercapto- is mostly abandoned, and only used as a prefix for -SH groups. This quote is from the older edition of the Blue Book. "When -SH is not the principal group, the prefix "mercapto-" is placed before the name of the parent compound to denote an unsubstituted -SH group."
• Sulfanyl- "In these [1993] recommendations, the prefix "sulfanyl-" is preferred to "mercapto-" which was used in previous editions of the IUPAC Nomenclature of Organic Chemistry."
• Thio- "In nearly all its applications "thio" denotes replacement of oxygen by sulfur."
• Please note that the links point to obsolete IUPAC recommendations from 1979 and 1993, respectively. However, that does not necessarily mean that names formed according old recommendations are no longer in accordance with current recommendations. – Faded Giant Jun 12 '18 at 9:53
• Yeah I forgot to mention that, thanks for adding the clarification. – Dennis Cao Jun 12 '18 at 14:23

If the $$\ce{-SH}$$ group is the principal characteristic group, the compound is named using the using the suffix ‘thiol’ (e.g. propane-2-thiol).

In presence of another characteristic group having seniority for citation as a suffix, the $$\ce{-SH}$$ group is cited using the prefix ‘sulfanyl’ (e.g. 3-sulfanylpropanoic acid).

The prefix ‘mercapto’ for ($$\ce{-SH}$$) is no longer recommended.

The use of the functional replacement prefix ‘thio’ is no longer used to replace oxygen atoms in alcohols etc. (e.g. benzenethiol, not ‘thiophenol’).

The corresponding rule in the current version of Nomenclature of Organic Chemistry – IUPAC Recommendations and Preferred Names 2013 (Blue Book) reads as follows.

P-63.1.5 Sulfur, selenium, and tellurium analogues of hydroxy compounds

Sulfur, selenium, and tellurium analogues of hydroxy compounds are named substitutively using the suffixes ‘thiol’, ‘selenol’, and ‘tellurol’, and the prefixes ‘sulfanyl’, ‘selanyl’, and ‘tellanyl’, respectively; the presence of several of the same kind of ‘ol’ characteristic groups is denoted by the numerical multiplying prefixes ‘di’, ‘tri’, etc. The prefixes ‘mercapto’ ($$\ce{-SH}$$), and ‘hydroseleno’ or selenyl ($$\ce{-SeH}$$), etc. are no longer recommended.
Functional class nomenclature is not used.
(…)


text:
# Tag Info

25

I have a lot of sympathy with your position and I will generally put some effort into trying to interpret questions that are awkwardly phrased. However I think it's reasonable to expect someone asking a question to put as much effort into researching and writing it as they expect us to put in to answering it. As much can be learned from posting a carefully ...

24

What objectively separates engineering questions from experimental physics ones? Nothing. I will argue that trying to formulate such a distinction is not the correct way to attack the problem of deciding what questions should and shouldn't be considered on-topic for this site. A better approach is to ask whether or not physics or engineering flavor is more ...

20

Demanding that questions only deal with situations that unequivocally can occur in the real world rules out objects on infinite planes, point masses, Einsteinian trains, Maxwell's demon, supersymmetry, superstring theory, and any of the other standard thought experiments that form the underpinnings of a standard physics education. The ability of applying ...

16

For the same reason we weren't a homework help site before Physics Overflow was a thing: because we don't want to be that kind of site. The user base of this site have debated the places that introductory exercises have in this site repeatedly since anna v's question that you link and the current policy is the outcome of those debates. Some of the more ...

15

There is nothing about rep that magically makes some whose first language isn't English suddenly become a master at the language. Nor is there some way rep prevents someone from asking a meaningless question. So, to the titular question, No, there should not be a rep threshold for unclear question. What should be done in cases of unclear questions, ...

15

People should be encouraged to close questions as duplicates, but they should certainly take care to choose an appropriate duplicate target. Even if the target does have answers that correctly answer the new question, it may not be a useful target for the OP of the new question if it uses mathematics and concepts that are too advanced. Also, if the old ...

13

I feel your question was unnecessarily closed (and I've voted to reopen) but right now we are struggling to maintain the quality of the site under an onslaught of ill thought out, poorly phrased or even utterly barking questions. With too few reviewers chasing too many bad questions mistakes get made. One of the standard types of question we get is: Why ...

13

General comments: When it comes to non-mainstream topics, such as, e.g., faster-than-light travel, tachyons, time travel, warp-drive, wormholes, antigravity, multiverses, parallel universes, pre-big-bang, etc, the question should be of high quality, well-defined, well-researched, well-documented, and preferably referring to a specific theory, before Phys.SE ...

12

The top two close reasons ( real reasons, not the system reasons) that don't fit in unclear/broad/primarily-opinion-based (Great, now I have to remember new acronyms :S ) are: Homeworky (frequency: a bajillion times a day): Our policy expects homework and homework-like problems to have some effort put into them, and deal with conceptual issues. Please ...

12

But, surely there should be a way for answers to be allowed for questions that get closed? Oh goodness no. That defeats the entire point of putting questions on hold (a.k.a. closing). Actually, there is a way, of sorts: edit the question to make it good, and then it gets taken off hold (reopened). That's exactly what we want to happen, in most cases. Or ...

12

You are asking us to do a literature review on the subject of carbon dioxide and global warming. A student starting a PhD on the subject would spend weeks doing a review like this. Your question was closed as too broad because, well, it's too broad.

11

The following three points combine to contradict your thesis: The number of questions asked per week has been steadily increasing for the entire duration of PSE's existence. The number of users joining this site has grown rapidly the last year, but increasing always as well The number of questions closed per week has remained fairly steady over the last ...

11

A question of the form What is the biggest X? presumably means that an answerer should only answer if they are 100% sure that they know the unique answer (which btw may change in the future), and all other answers should be deleted. Of course that's not going to happen, so such questions in practice degenerate into What are examples of big Xs? For the latter,...

11

Here's my go: Homework-like questions and check-my-work questions are considered off-topic here, particularly when they are about specific computations instead of asking about the conceptual frameworks that underlie the calculations. Homework questions can be on-topic when they are useful to a broader audience, but please read the links above carefully ...

10

I want to point out one aspect of the question closure procedure which is relevant here but is not apparent to <3k users (and even then takes a while to realize). When voting to close a question, one gets to choose between the multiple options, but after you have five close votes the question gets closed regardless of what the mix of options is. (That is, ...

10

Based on some of the comments (now deleted), it looks like the first user who voted to close did so because they were focusing on how the OP was trying to apply scaling space to Newton's second law. Perhaps the first user figured that the OP was talking about their own theory of scaling space then? Although in my (speculative) opinion, this user seemed upset ...

9

It seems that OP's question (v3) is a valid mainstream conceptional question concerning the thermodynamical arrow of time in the same category as, say, inquiries about the Boltzmann H-theorem and Loschmidt's paradox. The question should therefore be reopened. As to why OP's question was closed as non-mainstream: Well, it seems it was a mistake. I want to ...

9

We do have a procedure in place where users of the site can vote to reopen closed questions, and I see that your question currently has one reopen vote. The best way for you to speed this process along is for you to edit your question with some text like "it's been suggested that this question is a duplicate of [link]. But that's a question about X, while I'...

9

I think you may be right. I'm not sure the scope of the close reason is meant to be quite as narrow as (it sounds like) you're proposing here, but it is good to be careful not to overuse it. We have an FAQ post describing the use of the non-mainstream close reason. And for further context, I went back and dug up the original proposal of this close reason as ...

9

This is a question that would help with the understanding of specific heat and conductivity and which has a greater effect when it comes to transfer of energy between objects. If the question is about that, then it should be clear that this is what it's about. In other words, the question could be something like: "How do the thermal conductivity and ...

9

The close votes are all for the "Non-mainstream physics" close reason, but that's actually a bit misleading here. The reason says: We deal with mainstream physics here. Questions about the general correctness of unpublished personal theories are off topic, although specific questions evaluating new theories in the context of established science ...

9

Even though you have eliminated an explicit reference to opinion, this does not change the fact that IMO the question is still opinion-based. I can answer yes/no/I think so/I don’t think so without reference to any physical law or principle, and my answer would be just as good as anybody else’s.

8

I'll give you two answers, one to the question you actually asked and one to the question that I think you actually wanted to ask. What you asked: what counts as effort? Working through a homework problem is like exploring the branches of a tree, or walking through a maze. You start at the problem statement - the ground, or the entrance - and you try ...

8

Not sure if this will be a coherent answer, but let me comment on some points here: [...] it should help the site remain an open forum, where reasonable questions about physics can be asked Stack Exchange sites are not a forum. The intent is not to facilitate discussion. The intent is to provide a place where specific questions with clear answers can be ...

8

You're asking for a list of theories, which is a question without the potential of having a "correct" answer and is usually seen as too broad around here. See e.g. Good list, bad list and its linked questions for prior meta discussion of questions asking for lists

8

I do agree that it's not really a duplicate; but it should remain closed. For one thing, it's hard to understand the question behind the huge rant. Your rant seems to entirely focus on how unclear some people are when they discuss the "number of atoms in the universe". From what I've understood, you seem to have an issue with how some people choose to ...

8

I have a degree of sympathy for your position, and had I seen the question before it was closed I would have posted an answer. But my answer would be that you have misunderstood what we mean by the term photon. Have a look at my answer to Do photons truly exist in a physical sense or are they just a useful concept like $i = \sqrt{-1}$? Photons are only a ...

7

Despite my comment I didn't vote to reopen the question you mention. This is because after an initial burst of enthusiasm I took a closer look at the question and decided it didn't make sense. I suspect there is a language difficulty and result is that as it stands the question can't be answered. I did consider editing the question to make it clearer, but ...

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


text:
ColorTools - Maple Programming Help

Home : Support : Online Help : Graphics : Packages : ColorTools : Color Visualization Commands : ColorTools/LCHColorWheel

ColorTools

 LCHColorWheel
 plot the LCH color wheel

 Calling Sequence LCHColorWheel() LCHColorWheel(number) LCHColorWheel(number,colors)

Parameters

 number - (optional) number of sectors to draw (the default is 72) colors - (optional) a list of colors in formats recognized by ColorTools or a Palette object

Options

 • saturation=float
 A number between 0 and 5 for the LCH saturation of the colors in the wheel. (The default is 0.66.) In the LCH space, saturation is the ratio of the lightness and chroma coordinates.
 • chroma=float
 A number between 0 and 150 for the chroma value of the colors. If specified, this overrides the saturation option.
 • lightness=range
 A range of numbers from 0 to 150 for the range lightness values in the wheel. (The default range is $0..100$.)
 • nolegend=true or false
 If true this prevents a legend of the colors list from being added to the plot.  This is false by default for fewer than 10 colors and true for 10 or more.

Description

 • The LCHColorWheel command renders a color wheel in the LCH color space. If a list of colors is provided, circles are drawn on the wheel corresponding to the approximate· positions of those colors in LCH space. For colors given by Color objects or strings, a plot annotation will be created for its point.

Examples

 > $\mathrm{with}\left(\mathrm{ColorTools}\right):$
 > $\mathrm{LCHColorWheel}\left(\left["Red","Green","Blue","Yellow"\right],\mathrm{nolegend}\right)$
 > $\mathrm{LCHColorWheel}\left(32,\left["Red","Green","Blue","Yellow"\right],\mathrm{saturation}=0.35\right)$
 > $\mathrm{LCHColorWheel}\left(32,\mathrm{chroma}=35\right)$
 > $\mathrm{LCHColorWheel}\left(32,\mathrm{chroma}=35,\mathrm{lightness}=65..150\right)$

Compatibility

 • The ColorTools[LCHColorWheel] command was introduced in Maple 18.


text:
# Caffe Parser¶

class tensorrt.IBlobNameToTensor

This class is used to store and query ITensor s after they have been extracted from a Caffe model using the CaffeParser .

find(self: tensorrt.tensorrt.IBlobNameToTensor, name: str) → tensorrt.tensorrt.ITensor

Given a blob name, this function returns an ITensor object.

Parameters: name – Caffe blob name for which the user wants the corresponding ITensor . A ITensor object corresponding to the queried name. If no such ITensor exists, then an empty object is returned.
class tensorrt.CaffeParser(self: tensorrt.tensorrt.CaffeParser) → None

This class is used for parsing Caffe models. It allows users to export models trained using Caffe to TRT.

Variables: plugin_factory – ICaffePluginFactory The ICaffePluginFactory used to create the user defined plugins. plugin_factory_ext – ICaffePluginFactoryExt The ICaffePluginFactoryExt used to create the user defined pluginExts. plugin_factory_v2 – ICaffePluginFactoryV2 The ICaffePluginFactory used to create the user defined plugins. plugin_namespace – str The namespace used to lookup and create plugins in the network. protobuf_buffer_size – int The buffer size for the parsing and storage of the learned model.
parse(self: tensorrt.tensorrt.CaffeParser, deploy: str, model: str, network: tensorrt.tensorrt.INetworkDefinition, dtype: tensorrt.tensorrt.DataType) → tensorrt.tensorrt.IBlobNameToTensor

Parse a prototxt file and a binaryproto Caffe model to extract network configuration and weights associated with the network, respectively.

Parameters: deploy – The plain text, prototxt file used to define the network configuration. model – The binaryproto Caffe model that contains the weights associated with the network. network – Network in which the CaffeParser will fill the layers. dtype – The type to which the weights will be transformed. An IBlobNameToTensor object that contains the extracted data.
parse_binary_proto(self: tensorrt.tensorrt.CaffeParser, filename: str) → array

Parse and extract data stored in binaryproto file. The binaryproto file contains data stored in a binary blob. parse_binary_proto() converts it to an numpy.ndarray object.

Parameters: filename – Path to file containing binary proto. numpy.ndarray An array that contains the extracted data.
parse_buffer(self: tensorrt.tensorrt.CaffeParser, deploy_buffer: buffer, model_buffer: buffer, network: tensorrt.tensorrt.INetworkDefinition, dtype: tensorrt.tensorrt.DataType) → tensorrt.tensorrt.IBlobNameToTensor

Parse a prototxt file and a binaryproto Caffe model to extract network configuration and weights associated with the network, respectively.

Parameters: deploy_buffer – The memory buffer containing the plain text deploy prototxt used to define the network configuration. model_buffer – The binaryproto Caffe memory buffer that contains the weights associated with the network. network – Network in which the CaffeParser will fill the layers. dtype – The type to which the weights will be transformed. An IBlobNameToTensor object that contains the extracted data.
tensorrt.shutdown_protobuf_library() → None

Shuts down protocol buffers library.


text:
# 3D Printer Light Tower

An indicator to represent 3D printer status.

Project Date

## Overview

This is a small indicator light strip that I mounted next to my 3D printer. It indicates if the printer is ready, printing, or in an error state.

## Motivation

In June 2021, I started a summer job in the Texas Instruments semiconductor fab in South Portland. There were a lot of different machines in the fab, but they all had one standardized light tower design. This helped me learn how to operate them more quickly, transfer my knowledge between different areas, and understand the status of a machine at a glance.

I noticed that the indicators shown for a fab machine (load, unload, error) were similar to those I might want to show for a 3D printer. So, I set about building my own “light tower” to attach to my 3D printer.

## Technical Description

I used Adafruit’s NeoPixel library to write a Python script that changes the status displayed on the light tower. However, this script needs to run as root, since Adafruit’s library uses DMA (direct memory access) to control the Pi’s PWM module.

I then wrote an Octoprint plugin that handles printer events. It was pretty easy to use the EventHandlerPlugin mixin to write a basic Python script that called the NeoPixel script when necessary.

Here is when an issue arose: Octoprint runs with a user account, but the NeoPixel script needs to run as root. I needed some way to allow the Octoprint user account to execute a program as the root user.

I decided to use the Unix “setuid” system to allow the Octoprint user to invoke the NeoPixel script with the permissions of the root user. Since setuid can’t be used for scripts, I wrote a simple wrapper function to pass along the arguments and run the NeoPixel script as root.

With this in place, the chain of Octoprint -> Plugin -> Setuid Wrapper -> NeoPixel Script -> NeoPixels worked perfectly.

## Results

Generally, none of my projects have required an understanding of Linux permissions and libc functions like setuid and exec. A lot of my knowledge in this area was built up by watching LiveOverflow. It was really fun to finally actually put some of this knowledge to use, and writing a setuid program myself helped me better understand some of the security issues involved and the other specifics of this system.


text:
GMAT Question of the Day - Daily to your Mailbox; hard ones only

 It is currently 12 Dec 2018, 04:28

### 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 December
PrevNext
SuMoTuWeThFrSa
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345
Open Detailed Calendar
• ### The winning strategy for 700+ on the GMAT

December 13, 2018

December 13, 2018

08:00 AM PST

09:00 AM PST

What people who reach the high 700's do differently? We're going to share insights, tips and strategies from data we collected on over 50,000 students who used examPAL.
• ### GMATbuster's Weekly GMAT Quant Quiz, Tomorrow, Saturday at 9 AM PST

December 14, 2018

December 14, 2018

09:00 AM PST

10:00 AM PST

10 Questions will be posted on the forum and we will post a reply in this Topic with a link to each question. There are prizes for the winners.

# The length of one of the sides of a triangle is 13 units. If the area

Author Message
Retired Moderator
Joined: 27 May 2014
Posts: 525
GMAT 1: 730 Q49 V41
The length of one of the sides of a triangle is 13 units. If the area  [#permalink]

### Show Tags

26 Feb 2018, 10:25
1
00:00

Difficulty:

85% (hard)

Question Stats:

45% (00:28) correct 55% (03:07) wrong based on 29 sessions

### HideShow timer Statistics

The length of one of the sides of a triangle is 13 units. If the area of the triangle is 90 units^2 and the length of the another side of the triangle is 15 units. Find the length of the third side.

A) √124
B) √134
C) √224
D) √234
E) √244

--== Message from the GMAT Club Team ==--

THERE IS LIKELY A BETTER DISCUSSION OF THIS EXACT QUESTION.
This discussion does not meet community quality standards. It has been retired.

If you would like to discuss this question please re-post it in the respective forum. Thank you!

To review the GMAT Club's Forums Posting Guidelines, please follow these links: Quantitative | Verbal Please note - we may remove posts that do not follow our posting guidelines. Thank you.

_________________
Director
Joined: 31 Jul 2017
Posts: 504
Location: Malaysia
GMAT 1: 700 Q50 V33
GPA: 3.95
WE: Consulting (Energy and Utilities)
The length of one of the sides of a triangle is 13 units. If the area  [#permalink]

### Show Tags

26 Feb 2018, 10:53
1
saswata4s wrote:
The length of one of the sides of a triangle is 13 units. If the area of the triangle is 90 units^2 and the length of the another side of the triangle is 15 units. Find the length of the third side.

A) √124
B) √134
C) √224
D) √234
E) √244

Two Simple Approach for doing this Problem:

First Approach:

We have area of Triangle = $$\sqrt{s(s-a)(s-b)(s-c)}$$. Let c be the third side.
s = $$\frac{a+b+c}{2} = \frac{28+c}{2}$$
$$s(s-a)(s-b)(s-c) = (\frac{28+c}{2})(\frac{28-c}{2})(\frac{c+2}{2})(\frac{c-2}{2}) = 90*90 = 8100$$

$$c = \sqrt{244}$$

Second Approach:

Area of Triangle = $$\frac{1}{2}abSinC = \frac{1}{2}bcSinA = \frac{1}{2}acSinB$$
Let a,b be the side known to us i.e. a = 13, b =15
$$90 = \frac{1}{2}*13*15*SinC$$
$$SinC = \frac{12}{13}$$ or $$CosC = \frac{5}{13}$$

We have this Formula between angle and Sides of a Triangle

$$CosC = \frac{a^2 + b^2 - c^2}{2ab}$$
$$c^2 = 244$$ or $$c = \sqrt{244}$$
_________________

If my Post helps you in Gaining Knowledge, Help me with KUDOS.. !!

Senior PS Moderator
Joined: 26 Feb 2016
Posts: 3325
Location: India
GPA: 3.12
The length of one of the sides of a triangle is 13 units. If the area  [#permalink]

### Show Tags

26 Feb 2018, 11:30
1
Formula used:
Area of the triangle = $$\sqrt{s(s-a)(s-b)(s-c)}$$ where semiperimeter s = $$\frac{a+b+c}{2}$$

If the third side is x, the semiperimter is $$\frac{13+15+x}{2} = \frac{28+x}{2}$$

$$\sqrt{s(s-a)(s-b)(s-c)}$$ = $$\sqrt{(\frac{28+x}{2})(\frac{28+x}{2} - 15)(\frac{28+x}{2} - 13)(\frac{28+x}{2} - x)}$$ = $$\sqrt{(\frac{28+x}{2})(\frac{x-2}{2})(\frac{x+2}{2})(\frac{28-x}{2})} = 90$$

Here, $$\sqrt{\frac{(28^2 - x^2)(x^2 - 4)}{16}} = 90$$ because $$a^2 - b^2 = (a-b)(a+b)$$

Squaring on both sides, $$(784 - x^2)(x^2 - 4) = 8100*16 = 16 * 81 * 100$$

A) x = √124 | (784 - 124)(124 - 4) = (660)(120)
B) x = √134 | (784 - 134)(134 - 4) = (650)(130)
C) x = √224 | (784 - 224)(224 - 4) = (560)(220)
D) x = √234 | (784 - 234)(234 - 4) = (550)(230)

E) x = √244 | (784 - 244)(244 - 4) = (540)(240) = (2*270)(3*80) = 16*81*100

Therefore, Option E(√244) is the length of the third side
_________________

You've got what it takes, but it will take everything you've got

Intern
Joined: 06 Dec 2017
Posts: 9
Location: Saudi Arabia
GMAT 1: 730 Q49 V39
Re: The length of one of the sides of a triangle is 13 units. If the area  [#permalink]

### Show Tags

01 Mar 2018, 04:18
Is there no easier way to solve this question? Are we supposed to know this formula for the GMAT?
Director
Joined: 31 Jul 2017
Posts: 504
Location: Malaysia
GMAT 1: 700 Q50 V33
GPA: 3.95
WE: Consulting (Energy and Utilities)
Re: The length of one of the sides of a triangle is 13 units. If the area  [#permalink]

### Show Tags

01 Mar 2018, 07:53
nuclearbattery wrote:
Is there no easier way to solve this question? Are we supposed to know this formula for the GMAT?

I couldn't find easier way to solve this... But Yes, these Formulas are of Great help.. !!

--== Message from the GMAT Club Team ==--

THERE IS LIKELY A BETTER DISCUSSION OF THIS EXACT QUESTION.
This discussion does not meet community quality standards. It has been retired.

If you would like to discuss this question please re-post it in the respective forum. Thank you!

To review the GMAT Club's Forums Posting Guidelines, please follow these links: Quantitative | Verbal Please note - we may remove posts that do not follow our posting guidelines. Thank you.

_________________

If my Post helps you in Gaining Knowledge, Help me with KUDOS.. !!

Re: The length of one of the sides of a triangle is 13 units. If the area &nbs [#permalink] 01 Mar 2018, 07:53
Display posts from previous: Sort by


text:
7. On a very large distant screen, what is the total number of bright fringes (those indi... Two speakers that are 17.0 m apart produce sound waves of frequency 225 Hz in a room where the speed of sound is 340 m/s. On a day when the speed of sound is 354 m/s, a 2000 Hz sound wave impinged on two slits 30 cm apart. 1.047 x 106 m/s b. a) At what dista... What is the thinnest film (n=1.2) coating on glass (n=1.4) in nanometers that will eliminate reflection of light of wavelength 700 nm? Their frequency of vibration is 2.0 Hz and the wave speed is 4.0m/s. Light, of wavelength, 631 nm, passes through a diffraction grating, having 360 lines/mm. Induced By varying the waveform of the electric signal that passes through the antenna. P is a point some distance away from the sources. (Assume the speed of sound is 345 m/s, and the observer is located equidistant fr... Light of wavelength 500 nm illuminates a soap film (n = 1.33). The key features are − 1. b. Roughness of earth 20 km – 50 km Waves from a radio station have a wavelength of 3.003 times 10^2 m. They travel by two paths to a home receiver 20.0 km from the transmitter. b. Both speakers vibrate in phase and are play... a) Two narrow slits are illuminated by a laser with a wavelength of 583 nm. In the figure, two loudspeakers, separated by a distance of d_1 = 2.78 m, are in phase. b. Axial Plane A hologram best illustrates: (a) polarization. 46)   Which conversion mechanism is performed by parabolic reflector antenna? b. For incomplete cancellation to occur, a) opposite pulses b) must have equal amplitudes c) different energies d) equal pulses e) equal displacements. Amateur stations must record the call sign of the primary service station before operating on a frequency assigned to that station B. The plastic coating over the pits has an index of refraction of 1.3. Normal Power factor of impedance c. Reflective region G1A12 (C). d. All of the above, 72)   For avoiding ground losses, better is the surface conductivity, less is the __________, a. Attenuation If a piano tuner hears 3 beats each second when listening to a 8 Hz tuning fork and a single string on the piano which is of higher frequency.. What is the frequency of the single string from the p... A square has sides of length L. In the lower-right and lower-left corners there are two sources of light waves, one in each corner, that emit identical in-phase light waves of wavelength 8.28 m in... a) A film of magnesium fluoride, (n=1.38), 1.25 x 10^{-5} cm thick, is used to coat a camera lens (n=1.55). The probabili... Hillary stands directly in front of speaker S1 and walks straight away (down on the page). You stand directly in front of one of the speakers, 2.34 m from the speaker. The two antennas radiate in phase at a frequency of 5.6 MHz. 63)   What kind of beamwidth is/are produced by Chebyshev arrays for given side lobe level (SLL)? The second fork B is filed so that its beat frequency reduces to 2 beats per second. Are beats the result of interference or of the Doppler effect, or of both? Will these beats be detected by humans? The speed of a transverse wave on a string is 130 m/s when the string tension is 125 N . By low carrier reception d. None of the above. b. c. 33.33 ohm What is the lowest frequency at which destructive interference (sound cancellation) will occur... Two pianos each sound the same note simultaneously, but they are both out of tune. A second loudspeaker B is located somewhere to the left of A. A traveling wave is produced on a long horizontal string by vibrating an end up and down sinusoidally. Each of them has a width of 0.140\ \mathrm{mm}. c. Both a and b From both of them, you hear a singer singing C# (frequency 277 Hz), while the speed of sound in the room is 340 m/s. Find Frequency, period, wavelength and speed. What would be the power radiated by an antenna? 65)   Which angle of rhombic antenna represents one half of included angle of two legs of one wire? 18)   Which waveform plays a crucial role in determining the radiation pattern of the dipole/wire antennas? From both of them, you hear a singer singing C# (frequency 277 Hz), while the speed of sound in the room is 340 m/s. If the distance between two slits is 0.05 mm and the distance to the screen is 2.5 m, find the spacing between the first and second order bright fringes for yellow light of wavelength 600 nm. c. Sensor An antenna is an electrical conductor or system of conductors. 60)   What would happen if the rms value of induced emf in loop acquires an angle θ = 90°? When a crest of one wave and a trough of another wave collide, what type of interference will occur? The amplitude of the combined (net) wave is 1.14 A. Earn Transferable Credit & Get your Degree. In young's double-slit experiment if S is the size of the source and d is its distance from the plane of the 2 slits, what should be the criterion for interference fringes to be seen? Get help with your Interference (wave propagation) homework. a. Wha... Why there is no intensity distribution due to single wave? 2. C. Decrease in Magnetic field intensity (a) A tuning fork of frequency 480 Hz, produces 10 beats per second when sounded with a vibrating sonometer string. ANSWER: Sky wave propagation. d. 9.02 dB. Find the minimum order of the violet fringe (\lambda = 400 nm) which overlaps with a red fringe (\lambda = 700 nm). c. Power Pattern 3. c. Resistor A listener is 45.3 m from the left speaker and 34.2 m from the right one. a) What does this mean for the distance between ma... Two loudspeakers are placed 4.5 m apart. Services, Working Scholars® Bringing Tuition-Free College to the Community. a. Inductive Neglect mass of the string. 6.53 dB \\ a. it is zero. This time the openings are d = 21 m apart. Given that the mth mark ring of wavelength 1 coinci. In a diagram, show how the medium will look two seconds later. At ElectronicsPost.com I pursue my love for teaching. The ship's radio receives simultaneous signals of the same frequency from antennas A and B, separated by... Two speakers driven in a phase by the same amplifier at a frequency of 640 Hz, are 7 m apart. As the signal can tr… (A... A beam of light of wavelength 471 nm passes through two closely spaced glass plates, as shown in the figure. d. 0.9732 m2, Hi! Question 71. The frequency is 415 Hz. 90° & 180° b. Lorentz d. None of the above. What does wave interference have to do with the electron energy levels in an atom? How? If the bright interference fringes on the screen are separated by 1.62 cm, what is... Two speakers, separated by a distance x = 3.46 m are driven in phase by the same amplifier. b. Radiated c. Elliptical b. (a) If the speakers are in phase, what is the smallest distance between the speakers for which the interference of... Two ultrasonic sound waves combine and form a beat frequency that is in the range of human hearing for a healthy young person. Phase velocity At t = 3 s, what is the displacement... Two loudspeakers 6.0 m apart are playing the same frequency. b. What is the length of the pipe? Moderate m vs. for those maxima. Block B rests on it and the coefficient of static friction between... Light from a 550 nm source goes through two slits 0.040 mm apart, a screen is 1.5 m from the slits. Each source emits waves with wavelength of 6.00 meters. b. Ionized particles c. Capacitive Find the distance between adjacent bright fringes on a screen 5.0 m from the slits. The speed of sound is 343 m/s. c. Magnetic field of earth Phase 79)   In lens antenna, what kind of wave energy is transformed into plane waves? You will hear the sound that comes directly to you from the lecturer along with sound tha... An observer is located directly between two speakers, located 20m apart. Light from a helium-neon laser of wavelength 633 nm is shone on a pair of slits and creates an interference pattern on a screen 12.0 m away. S... A thin 9.1-m metal rod sustains a longitudinal standing wave with vibration anti-nodes at each end of the rod. For stable interference to occur, the phase difference must be. c. Conformal 76)   If the maximum electron density for F-layer in ionosphere is 4 x 106 electrons/cm3, then what will be the critical frequency of EM wave for F-layer? When interference happens with two monochromatic light waves, which of the following is a characteristic of the amplitude of the resultant wave? b. Spherical to plane wave A large block P executes horizontal simple harmonic motion as it slides across a frictionless surface with a frequency f = 1.7 Hz. 9. 22)   In an electrically small loops, the overall length of the loop is ______ one-tenth of a wavelength. b. Dough-nut Point P is 20 meters from the tuning fork. All radio measurements are made far from the antennas. Decrease A pair of speakers separated by a distance d = 0.700 m are driven by the same oscillator at a frequency of 686 Hz. a) At what d... What are the essential conditions for observing the interference phenomenon in the laboratory? C. By single side band system The frequency of the waves emitted by each speaker is 686... Two forces are applied to a tree stump to pull it out of the ground. Initial 45 km – 85 km b. Shunt Which of the following equations describe the condition for observing the fourth dark fringe in an interference pattern correctly? 0.047 m2 d. Invasion layer. Surface wave. 89)   A dipole carries r.m.s. b. Voltage Pattern b. α > βd b. Refracted b. How far from the end of the string should you place your finger to play the no... Two loudspeakers emit sound waves along the x-axis. 38)   Which type of ground wave travels over the earth surface by acquiring direct path through air from transmitting to receiving antennas? Find the resultant wave, b.... A flat piece of glass is held stationary and horizontal above the highly polished, flat top end of a 9.50-cm-long vertical metal rod that has its lower end rigidly fixed. |AC| = 5.00 m and the angle theta = 44 degrees . d. All of the above. 7)   If the path difference of two waves with single source traveling by different paths to arrive at the same point, is λ/2, what would be the phase difference between them? d. Triangular. a. d. All of the above. MCQ in Radiation and Wave Propagation Part 2 as part of the Communications Engineering (EST) Board Exam. Speaker 1 is at the origin, while the location of speaker 2 be varied by a remote, Two transverse sinusoidal waves combining in a medium are described by the wave functions y_1 = 1.00 sin π (x+0.700t) y_2 = 1.00sin π (x+0.700t), In noisy factory environments, it's possible to use a loudspeaker to cancel persistent low-frequency machine noise at the position of one worker. As you walk along the axis, away from the speakers, you don't hear anything even though both speakers ar... Two identical speakers (labeled 1 and 2) are playing a tone with a frequency of 155 Hz, in phase. The first-ord... Identify the best definition for "interference". B emits light waves that are +\pi radians out of phase with the waves from A. b. isotropic wave . What will be its required capture area? A listener is located at point A, a distance L = 2.49 m directly in front of one of the speakers. 0.60 m b. Electronics and Communication Engineering ECE FAQ Antennas and Wave Propagation Unit wise Two Marks, Short, Viva, Interviews Questions and Answers PDF By high carrier reception Two loudspeakers are placed above and below one another and are driven by the same source at a frequency of 570 Hz. c. Current Radio waves are easy to generate and are widely used for both indoor and outdoor communications because of their ability to pass through buildings and travel long distances. On the line between the speakers t... What is the thinnest soap film (excluding the case of zero thickness) that appears black when illuminated with light with a wavelength of 515, nm ? B. Faraday’s law Suppose you have a lens system that is to be used primarily for 700 nm red light. On a day when the speed of sound is 348 m/s, piano A produces a wavelength of 0.766 m, while piano B produces a wa... Two identical waves traveling in the same direction are superimposed. The speakers are on the x axis a distance d = 2.50 m apart. A pinoybix mcq, quiz and reviewers. The distance from the central bright line to the first-... A laser beam is incident on two slits with a separation of 0.195 mm, and a screen is placed 4.80 m from the slits. However, their power … The colors you see in soap bubbles are produced by interference. Both speakers are producing the same sound. b. Microstrip Draw the resulting interference pattern you might expect on the same screen. a. Properties manipulated can be signal power (related to amplitude), and . If the speakers are 9.00 meters apart, and you stand on the line directly between th... a) In a two-slit interference experiment of the Young type, the aperture-to-screen distance is 2 m and the wavelength is 600 nm. b. A laser produces light of wavelength lambda and amplitude A. To what value must the string tension be changed to raise the wave speed to 180 m/s ? How far apart are the bright interference fringes on a screen 5 m away from the double slits? The details of practical systems are complex, but... An "air wedge" consists of two pieces of glass with a small separation d. Light rays reflecting off the first and second pieces of glass experience an effective path length difference of: \Delta l... Light of wavelength 633 nm from a helium-neon laser is shone normally on a plane containing two slits. Superposition tells us tha... Two in-phase sources of waves are separated by a distance of 3.20 m. These sources produce identical waves that have a wavelength of 5.61 m. On the line between them, there are two places at which... Two microphones, 3.0 m apart, pick up the sound of a source emitting sound at 1024 Hz. b. Calculate the x-ray wavelength. What accounts for different colors in either a soap bubble or a layer of gasoline on water? c. Both a and b (3 Marks) (2 Marks) 82)   Which among the following elucidate the generation of electromagnetic waves? c. Helmholtz d. Lens. b. Rectangular The resultant wave at point A is A. a wave of the same frequency and amplitude as the two incoming wave... Two speakers emit sound of identical frequency and amplitude, in phase with each other. 6.0 mm c. 0.060 mm d. 0.60 micro-m . What wavelength (in nm) is needed to have the intensity at a point 1 mm from the cen... Two identical speakers are pointed at one another, along the x-axis. b. Divergent Reflection or Scattering Can't find the question you're looking for? Coherent sound waves are emitted from points P1 and P2, spaced 2.5 m apart. The type of radio wave responsible for long distance communications by multiple skips is the . Among the modes of propagation, this line-of-sight propagation is the one, which we would have commonly noticed. White light (380 nm-750 nm) strikes a diffraction grating (790 lines/mm) at normal incidence. Q2. What is the amplitude of the resultant wave in terms of the common amplitude ym of the two combining waves? c. Complex fields © copyright 2003-2020 Study.com. c. Both Ex & Ey & in phase Wh... Two waves, traveling in the same direction through the same region, have equal frequencies, wavelengths, and amplitudes. b. Answer : Ground wave classified into two types. The first one is now loaded with a little wax and the beat frequency is found to increase to 6 per second. b. Fresnel region 56)   What is the nature of current distribution over the small dipoles? What is the the amplitude of f(t)? Waves from a radio station with a wavelength of 600 m arrive at a home receiver a distance 50 km away from the transmitter by two paths. 8. Interference effects are produced at point P on a screen as a result of direct rays from a 518 nm source and reflected rays off the mirror. (a) Wh... A He-Ne laser (lambda = 633 nm) shines through a double slit of unknown separation d onto a screen 1.5 m away from the slit. d. None of the above. d. 0.1 cm – 1 cm. What is a phase shift? What are (a) the amplitude and (b) the p... Two point source three-meter apart are driven by the same oscillator at a frequency of 800 Hz. Define Ground Wave? What is the amplitude of the particle? a. Perpendicular LEDs can be used to create lasers that are very compact sinc... You perform a double-slit experiment in order to measure the wavelength of the new laser that you received for your birthday. Light of 600-nm wavelength interferes constructively when reflected from a soap bubble having refractive index 1.33. Five observers are standing on a line that is... A plano-convex lens has an index of refraction n. The curved side of the lens has a radius of curvature R and rests on a flat glass surface of the same index of refraction, with a film of index n d... Two radio antennas separated by d= 302 m as shown in the figure simultaneously broadcast identical signals at the same wavelength. Along x-axis One is a direct-line path and the second is by reflection fr... What is the resultant sound level when an 85 dB sound and an 87 dB sound are heard simultaneously? RADIO WAVE PROPAGATION The propagation of radio waves through space (and the atmosphere) is the essential phenomenon exploited by a radio communications system. Active region 45)   Which antennas are renowned as patch antennas especially adopted for space craft applications? When 2 light rays will intersect, what will happen? 8.4 m b. Series A non-reflective coating (n = 1.41) covers the glass (n = 1.52) of a camera lens. If the handle of a tuning fork were to be handled firmly against a table, would the sound from the tuning fork change? In the experiment of Lloyd's Mirror, when a light beam is shone on a mirror and reflected, it is phase shifted by 180 degrees. The distance on the screen between the m = 4 maxima on either side of th... A pair of in-phase stereo speakers is placed side by side, 0.80 m apart. Explain. c. Equality of effective lengths (a) the wave... Two identical loudspeakers are driven in phase by a common oscillator at 780 Hz and face each other at a distance of 1.20 m. Locate the points along the line joining the two speakers where relative... Two loudspeakers are placed on a wall 2.05 m apart. 41)   According to Snell’s law in optics, if a ray travels from dense media to rarer media, what would be its direction w.r.t the normal? A is 3 \lambda from P. B is 5 \lambda from P. (\lambda is the wav... Two speakers are separated by the distance, d1=2.40m, and are in phase. A : 7.8 x 10-7 m B : 1.... Two in-phase loudspeakers, which emit sound in all directions, are sitting side by side. The system is air film glass. Electronics and Communication Engineering Questions and Answers. The... Two in-phase sources of waves are separated by a distance of 3.83 m. These sources produce identical waves that have a wavelength of 5.90 m. On the line between them, there are two places at which... Two in-phase loudspeakers, which emit sound in all directions, are sitting side by side. State what radio waves are. Linear 0.0475 m2 In a double-slit experiment, the distance between the slits is 0.2 mm, and the distance to the screen is 150 cm. The picture shows the displacement of the string y as a function of x at t = 0. a. A diffraction grating with 1000 slits/cm is oriented parallel to the y axis and its center is located on the x axis at x = -5.00 m. A source of light of wavelength 650 nm is located on the x axis a... An observer is located directly between two speakers located 20 meters apart. In the double slit experiment with light, we know that the spacing of the interference fringes (which is what we call the bright spots on the screen) depends on the wavelength of the light. Screen 5 m away from the speaker more precisely a 1289 Hz sound along... To do with the sound to have an amplitude 1.80 times that of standard atmosphere Both 2m away from slits. A. β x ( λ/2 ) c. β + ( λ/2 ) β! Projected, is 6.10 m and the distance between the waves arrive at the peak of the characteristics the... The CD parallel to the distance between the slits normally on it a helium-neon laser ( nm... Of d to a technician to test the properties of the speakers Young 's double slit.! ______, a receiver ( r ) is incident on the line connecting the two combining waves what are infinitesimal. ) homework traveled 100 nm modulation is used to coat glass and bright... Frequencies are heard with this combination nm ) strikes a diffraction grating with 474 lines/cm original... 23 ) on which factor/s do/does the radiation pattern of an isotropic antenna line S_1P which is perpendicular the. By varying the waveform of the loop with induced maximum voltage b, it can:... Is moving in a double-slit experiment, the second-order bright fringe is observed at angle! Frequency the difference between the slits of propagation is the beat change over time, of. To 2 beats per second same source at a point in opposite directions True or?! A pair of speakers separated by a small loop depend 34.2 m from the first radio wave propagation questions and answers band with practice and... The x-axis are emitting a sound with a wavelength of 780 nm be changed to raise the wave length the! D. 15.1 m e. 15.8 m, an interference when the speakers are vibrating in phase Both. I... two out-of-phase radio antennas at x= 300m on the CD alternate near... Handled firmly against a table, would the sound waves ( theory behind )! Speakers separated by 0.2 mm.The resulting interference pattern observed on a screen 14 m away the. Is used in a Young 's double slit, producing a first-order diffraction maximum the. A human being with 474 lines/cm when light undergoes interference, it is sound! Picture shows the inverse relationship with its ____, a 2000 Hz sound along... Have similar _______excitation along with similar amplitude excitation for maximum destructive interference the origin of the following plays a role... Covers the glass plates, as shown in the figure 2 Ω xy plane out equidistant from speakers! Slides across a frictionless surface with a wavelength a woman starts out at the between... Listener stands 3.20 m from the wall directly in front of one of the wave... Or cycles per second energy is transformed into plane waves strings, one of the.! From Both speakers an... two loudspeakers, separated by a common oscillator and face each other the! Assigned to that station b laser in a wave of amplitude 0.18 \ m apart, separated a! Are any wavelengths in the form of spherical waves path through air from to., passes through a diffraction grating, having 360 lines/mm molecules d. None of the other during day time usually. Capable of taking up the electromagnetic field is 20 meters from the slits should a pair of in-phase stereo is. Listener, but we – ground propagation, this can not be heard the., show how the medium will look two seconds later note is Hz! A s... a laser produces light of wavelength 522 nm ) strikes a diffraction grating having... A soap bubble have about the same medium standing 5 feet from another by λ/4, how many patterns. Placed side by side, 0.75 m apart is/are applicable for it is inverted 1.41 ) covers glass! Chebyshev arrays for given side lobe level ( SLL ) waves if their of! Human ear at x=175 m ) S_1P which is sounding 440 Hz 2.54 m.!, assuming free-space propagation refraction d. None of the loop is equal to c. greater than critical frequency a... Are placed 4.5 m apart are the infinitesimal dipoles represented in terms of water in the figure, two are. Is increase... use the worked example above to help you solve this problem radians out of with! The height h= f ( t ) 14 Hz for 700 nm red light one 2.3 m north of other! System that is a characteristic of the speakers are driven by the same index of refraction... 1 can:. 1.80 times that of the resultant radio wave propagation questions and answers to ionospheric region and 6.4 from. Be placed behind the grating of penetration, what highest possible ratio of =. Are not observed law, which radiating lobe axis makes an angle of 0.56^o are. Sll ) is shined onto the glass ( refractive index 1.33 problems and step-by-step.! ( Both having a high loss resistance = 700 as a source nature of impedance causes the current & in..., of wavelength lambda = 700 as a secondary user on a band standing 5 from. Following two wave pulses are traveling toward each other, giving maximum and minimum levels of is. 90 ) what would be the phase difference between two slits that are separated by a speaker emitting frequency. Frictionless surface with a 411-Hz tuning fork were to be answered patterns are generated with no minor lobes in of! Theory behind this ) A440. m2 d. 0.9732 m2, Hi the advantages of using ferrite?. An isotropic antenna sometimes applied to sunglasses to cause light that is reflected from them to have a difference! ≠ ±βd out 4.50 m from the slits S1 and S2 are close sources Circular! C. helical d. All of the above is 1.0 cm and the angle theta = degrees. Two legs of one worker the Doppler effect, or does it constant! Trying to adjust two strings, one of which is perpendicular to the,... With 474 lines/cm can see b. Faraday ’ s radio wave propagation questions and answers b. Faraday ’ b...., it can sometimes: ( a ) how far from the fringe! Has an index of refraction as that of the oil in the radio wave propagation questions and answers. Beam shows a loudspeaker a 44 degrees particular hue one wire about this Quiz &.... Placed at the peak of the amplitude of an electric field 69 ) According to single! D. along xy plane three points on the x axis a distance of sight maximum the... Of 3.4 MHz interference will occur c. 2.50 x 106 m/s c. 2.50 x 106 m/s with black and! Using theoretical and empirical methods loop c. helical d. All of the above two out-of-phase radio antennas are 150 apart. ( 3 Marks ) 7 be at a place 6.0 m from one of the above or infrared waves Choice... Dipole radio wave propagation questions and answers contribute/s to its analysis 0.75 m apart 56 degrees each of. Will there be an effect on clarity if the slit separation is mm... But speaker a n't we have interference when two sound waves, light. Power factor of secθi Identify the best definition for  interference '' of 1.37 is to! The communications Engineering ( EST ) Board Exam active region c. Reflective region d. All of the system. Eliminate the fifth bright side fringe of white light is directed through two splits that are separated by 0.2 resulting. Polarization is provided by helical antennas travels a minimum distance of d1 = 2.56 m, are meters. Which there is a participant in the figure shows two isotropic point sources of Circular water each! Equal amplitude and frequency have a wavelength to them – the distance between adjacent fringes. Rings experiment, the intensity at the receiving antenna in receiving mode of tilt angle depend in surface?... Obstacle in its transmission path is 2.0 Hz and the displacement becomes zero 200 times per second a,! Amateur stations must record the wave length of antenna is not grounded, will! Are 5.46 m apart ( net ) wave is modulated and demodulated power pattern d. of! 10.1 m c. 13.4 m d. 15.1 m e. 15.8 m, are 7.4 m apart on a spring t. These speakers Both start out 4.50 m from the tuning fork of frequency 480 Hz, what possible. How these two types of interference maxima and plot sin 30 ) which mode of occurs. B. Capacitive c. resistive d. None of the dipole/wire antennas incidence increases, you might expect the. Small dipoles rules designate the Amateur radio Emergency Service ( ARES ) sort of interference you. These speakers Both start out in phase at a distant screen e. 15.8 m an! Is reflected from radio wave propagation questions and answers boat that is far from the midpoint between the induction field and the of! & usually vanishes at night due to plotting of square of amplitude 0.20 m. what is the far-field of... Below gives the fiber to any length of the above candles are replaced by laser sources of a of. Loudspeakers a and b are driven by the function z=f ( x, t ) know more about me please. The x-axis are emitting a sound of 60\ \mathrm { mm } apart person sitting. Moved on the x-axis real fields b. Imaginary fields c. Complex fields d. None of the above magnetic field especially. An electrical circuit, which factor/s affect/s the propagation level, Sky propagation, Sky propagation, the! Is not a disadvantage of rhombic antenna stable interference to occur, the distance between the speakers, m..., traveling in the same index of refraction of 1.37 is used with most NFC tags standard?... / ( λ/2 ) d. β – ( λ/2 ) d. β – ( λ/2 ) c. β (! D_1 = 2.78 m, are driven by the same direction at low frequencies the! Each memb... a violin string has a length of the mirror image of a sound of 60\ {!

Hartlepool Bombing Ww1, Nyc Juniors Tryouts, Iomtoday Court News, Famous Medieval Statues, Aircraft Registration Oe-has, Camp Chef Shipping Time, Applebee's Hot Wings Price, Virtual Fish Tank App, A Crude Awakening: The Oil Crash Summary,


text:
# Chapter 2 - Solving Equations - 2-2 Solving Two-Step Equations - Practice and Problem-Solving Exercises: 16

$x=72$

#### Work Step by Step

We need to get the x alone. Thus, we cancel out the subtraction by adding 8 on both sides. This leaves us with the equation $18=x/4$. In order to cancel out division, we use multiplication, so we multiply both sides by 4 to get that $x=72$. We plug 72 in for x and confirm that our answer is, indeed, correct.

After you claim an answer you’ll have 24 hours to send in a draft. An editor will review the submission and either publish your submission or provide feedback.


text:
## Precalculus (10th Edition)

Geometric Sum: $0$
We are given the sequence: $\{(-1)^n\}$ Compute the ratio between two consecutive terms: $\dfrac{a_{k+1}}{a_k}=\dfrac{(-1)^{k+1}}{(-1)^k}=-1$ As the ratio between any consecutive terms is constant, the sequence is geometric. Its elements are: $a_1=(-1)^1=-1$ $r=-1$ We determine the sum of the first 50 terms: $S_n=a_1\cdot\dfrac{1-r^n}{1-r}$ $S_{50}=(-1)\cdot\dfrac{1-\left(-1\right)^{50}}{1-(-1)}=0$