text:
# CS21 Lab 8: Twitter Explorer

Due Saturday Night, November 14

Run update21, to create the cs21/labs/08 directory (and some additional files). Then cd into your cs21/labs/08 directory and create the python programs for lab 8 in this directory

Overview

For this lab, you will write a program to explore a collection of Twitter feeds. That program, which we will put in a file called twitex.py, will read a prepared database of tweets from a text file. It will then give the user the opportunity to perform sorting and filtering operations on those tweets and then display them.

Here's an example of how the program might run. The orange, italic text below is an annotation and is not part of the program output.

\$ python twitex.py
Welcome to TwitEx!

Valid commands in this program are:
[s]ort
[f]ilter
[d]isplay
[q]uit
You can use a command by typing its first letter.

What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? f
Filter by what field ([n]ame,[s]creenname,[c]ontent)? s
Filter using what string? @swarthmore
Filtering complete; there are 137 tweet(s) that match that filter.
What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? s
Sort by what field ([s]creenname,[n]ame,[t]ime,[r]etweets)? t
Sorted tweets by time.
What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? d
How many? 3
Swarthmore College (@swarthmore) at 2015-11-06 14:01:04 EST (0 retweets):
Will Indonesia continue as a highly multilingual society or move toward monolingualism? Linguist Abby Cohn lectures at 4:15pm in Trotter 203

Swarthmore College (@swarthmore) at 2015-11-06 13:32:45 EST (0 retweets):
Garnet Athletics Set to Battle for Conference Titles - https://t.co/9UEjgNWacQ https://t.co/1EkXDxPlrQ

Swarthmore College (@swarthmore) at 2015-11-06 11:30:30 EST (0 retweets):
Way-Ting Chen '94 of Blue Garnet hosts a workshop on developing your social impact formula today at 1 pm in the Lang Center.

(Notice that the above tweets are sorted in order of time and are all from @swarthmore.)
What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? f
Filter by what field ([n]ame,[s]creenname,[c]ontent)? c
Filter using what string? Halloween
Filtering complete; there are 2 tweet(s) that match that filter.
What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? d
How many? 2
Swarthmore College (@swarthmore) at 2015-10-30 14:16:51 EDT (1 retweets):
Happening now: @swatlibrary is hosting Halloween arts and crafts in McCabe Atrium #SwatStudentLife #Swatoberfest https://t.co/HHbNwxDlRe

Swarthmore College (@swarthmore) at 2015-10-29 15:30:31 EDT (0 retweets):
Follow the Pumpkin trail from Parrish Hall to celebrate Halloween with the dean! 4-7 pm #swatstudentlife

(These tweets are also from @swarthmore; filtering again further reduces the list of tweets, so these are all @swarthmore tweets containing "Halloween".)
What now ([s]ort,[f]ilter,[d]isplay,[q]uit)? q
Goodbye!

Here are some more examples of execution.

Data File

You have been provided a data file containing some pre-fetched tweets; that file is named /usr/local/doc/twitter-data.txt. Here are a select few lines of that file:

science|||@science|||2015-09-29 23:13:05 EDT|||21|||Hubble revisits the beautiful Veil Nebula http://t.co/4HyactBrPA
Wikipedia|||@Wikipedia|||2015-10-14 11:44:08 EDT|||0|||@Wikisteff Thanks, Steffen!
@RioGrandeGames|||@RioGrandeGames|||2014-01-17 21:58:37 EST|||1|||I am absolutely in love with Dominion.
NAACP|||@NAACP|||2015-11-02 09:21:52 EST|||23|||.@POTUS bans the box https://t.co/Q5TrSfVXbq via @MSNBC
NPR|||@NPR|||2015-11-04 17:04:59 EST|||91|||What happens when physicists say #YOLO. https://t.co/YInJz5PJ3U

The file contains almost four thousand tweets.

More precisely, the data file is organized in the following manner:

• Each line represents exactly one tweet.
• Each tweet is stored as five pieces of data, separated by the string "|||".
• The data for a tweet are, in order:
3. Time of post
4. Number of retweets
5. The content itself
Requirements

• Read all of the tweets from a data file.
• Accept commands from the user:
• Filtering commands: You must be able to allow the user to work with just tweets with a particular username, screenname, or content. If the user runs more than one filter, all of the filters should apply. (That is, filtering to screenname "@NPR" and content "festival" should give only posts from @NPR that include the word "festival".) Filtering should be partial; filtering screenname to "@NPR", for instance, would keep tweets from "@NPRFan" and filtering content to "#Downton" would keep all of the tweets using that hashtag.
• Sorting commands: You must be able to sort the list of tweets by username, screenname, time of post, or retweet count. Sorting by username or screenname should be alphabetic. Sorting by time should give the most recent post first. Sorting by retweet count should give the highest number first.
• Printing: Once a user has filtered and sorted the tweets, you should be able to show the tweets that meet those criteria (up to a specified limit).
• Usability: The user should be able to quit any time he or she could enter e.g. a printing command.
• Handle bad input. Your program should *never* crash with an exception, no matter what text the user types.
• Do its own sorting. You may not use the list.sort() method.
• Do the sorting, filtering, and printing in functions other than main().

Getting Started

Here are some tips to get your started.

Do some design. Although you are not required to submit a full top-down design of your program, you should still use what you have learned from the previous lab to help you organize your thoughts. Identify functions that you think you might need in order to perform these tasks. Write down their purposes, the parameters they need, and the return values they will produce. Also document whether they will modify their list parameters (like e.g. the shuffle function from the random library does).

Be clever if it makes sense to you. Using what you learned from class, it's possible to complete this assignment using one sorting function and one filtering function. You can also just write a different sorting function for each sorting task you need to perform; it's quite a bit more work, but it's less complex.

To sort in reverse, use your sorting function followed by list.reverse(). You're required to sort e.g. time in descending order, but you can do that by first sorting time the regular way and then calling list.reverse() to flip the list around.

Use str.split(...) to read each line. For example, consider:

>>> s = 'Big Ben|||@big_ben_clock|||2015-10-29 08:00:02 EDT|||4|||BONG'
>>> lst = s.split('|||')
>>> lst
['Big Ben', '@big_ben_clock', '2015-10-29 08:00:02 EDT','4','BONG']

Keep your data in a convenient format within your program. When you read the data file at the start of the program, it will be helpful to store the tweets as a list of lists. For instance, your list might look like this: [ ["NAACP", "@NAACP", "2015-10-19 14:30:57 EDT", 4, ...], ["Team Fortress 2", "@TeamFortress", "2011-12-21 20:20:29 EST", 6, ...], ...] Notice that we store the dates as strings but we store the retweet counts as integers. This is helpful because, when we sort,

• We want to sort the retweet count as numbers, not strings.
• We can sort the dates as strings. (We have chosen a date format in which an alphabetically greater string is also a chronologically greater string; that is, if time1 < time2, then time1 is before time2.

It's okay to handle the commands in main(). You may wish to handle input in its own function or you may wish to deal with it in main(). It's okay if your main() method handles the input; just make sure you write functions for your sorting, filtering, and so on.

Don't worry much about speed. You can use O(n2) sorting algorithms like bubble sort or selection sort on this data.

Write tests! You will write fairly complex functions which sort or filter lists of lists in different ways. It's hard to be sure you know what's happening in all of them; it's easier to be confident in your code if you've written some tests. For instance, the following might be a good test for a sorting function:

def test_my_name_sort():
lst = [["B","@B","TIME",0,"Post"],["A","@A","TIME",0,"Post"],["C","@C","TIME",0,"Post"]]
sort_by_name(lst)
expected = [["A","@A","TIME",0,"Post"],["B","@B","TIME",0,"Post"],["C","@C","TIME",0,"Post"]]
# TODO: now verify that lst == expected.  (Your approach may vary depending on instructor.)

A Bit of Fun

This section is some optional entertainment and is not necessary for the lab.

We have written a program to help you customize your Lab 08 experience by including data from Twitter accounts that you might be interested in. You may start by copying the Twitter data from its system-wide location to your own directory like so:

cp /usr/local/doc/twitter-data.txt ./twitter-data.txt

Once you have done this, you may add to that file by running our data file updating program like so:

python /usr/local/lib/twitter/twitter_getter.py ProBirdRights

In the above example, we are adding tweets from the user with the screenname @ProBirdRights. (Note that we left off the @ above.) This program will add tweets to the file in your current folder; make sure you're in your lab directory before you run it.

After you are done, you will (of course) need to make sure your program reads tweets from ./twitter-data.txt rather than /usr/local/doc/twitter-data.txt in order to see your new tweets.

Please note: do not overuse this program. The Twitter API will only support a few hundred calls per hour from an account and this program uses the credentials for a single Twitter account to do its work. These operations are shared among all CS21 students. For your own purposes, please only run the script a couple times to add some Twitter feeds you know about; do not try to create a massive file of several hundred Twitter accounts. If you receive errors when running this script, don't worry; you don't need to use it at all to complete this assignment.

Submit

Once you are satisfied with your program, hand it in by typing handin21 in a terminal window.


text:
Question #f34ab

Aug 8, 2015

The average kinetic energy of the gas molecules will decrease, assuming constant pressure and number of moles.

Explanation:

For a gas, the average kinetic energy of its molecules is determined by the temperature at which it is kept.

In your case, the extent to which the change in volume will impact the gas' temperature depends on the other parameters of the gas, number of moles and pressure.

When these two parameters are constant, you can use the ideal gas law equation to write two equations that describe your gas at a volume ${V}_{1}$ and at a volume ${V}_{2} < {V}_{1}$.

$\left\{\begin{matrix}P \cdot {V}_{1} = n \cdot R \cdot {T}_{1} \\ P \cdot {V}_{2} = n \cdot R \cdot {T}_{2}\end{matrix}\right.$

Since the average kinetic energy of the gas molecules increases when temperature increases and decreases when temperature decreases, you are actually interested in comparing ${T}_{2}$ and ${T}_{1}$.

If you divide these equations, you'll get

$\frac{\textcolor{red}{\cancel{\textcolor{b l a c k}{P}}} \cdot {V}_{1}}{\textcolor{red}{\cancel{\textcolor{b l a c k}{P}}} \cdot {V}_{2}} = \frac{\textcolor{red}{\cancel{\textcolor{b l a c k}{n \cdot R}}} \cdot {T}_{1}}{\textcolor{red}{\cancel{\textcolor{b l a c k}{n \cdot R}}} \cdot {T}_{2}}$

Rearrange to get

${T}_{2} = {V}_{2} / {V}_{1} \cdot {T}_{1}$

If ${V}_{2} < {V}_{1}$, then ${V}_{2} / {V}_{1} < 0$ and ${T}_{2} < {T}_{1}$, which means that the average kinetic energy of the molecules has decreased.

So, when pressure and number of moles are kept constant, a gas' volume and its temperature have a direct relationship - this is known as Charles' Law.

When volume increases, temperature decreases, and when volume increases, temperature increases as well.

format: plain


text:
Let $(\Omega, \mathcal{F}, P)$ be a probability space, on which $\mathcal{F}_t$ is filtration satisfying general conditions. $W_t$ is a standard Brownian motion. By law of iterated logarithm, one has $$P\Big(\lim_{t\to 0} \infty} \frac{W_t}{t} = 0\Big) = 1$$ This implies $$P\Big(\lim_{t\to 0} \infty} \frac{t + W_t}{t} = 1\Big) = 1. \quad (1)$$ We have contradiction in this below. By Girsanov theorem, there exists a probability measure $Q$ equivalent to $P$, such that $t+ W_t$ is a Brownian motion w.r.t. $Q$. By law of iterated logarithm, $$Q\Big(\lim_{t\to 0} \infty} \frac{t + W_t}{t} = 0\Big) = 1,$$ which implies $$P\Big(\lim_{t\to 0} \infty} \frac{t + W_t}{t} = 0\Big) = 1, \quad (2)$$ since $P$ is equivalent to $Q$. Why does this argument leads to a contradiction between (1) and (2)?
Let $(\Omega, \mathcal{F}, P)$ be a probability space, on which $\mathcal{F}_t$ is filtration satisfying general conditions. $W_t$ is a standard Brownian motion. By law of iterated logarithm, one has $$P\Big(\lim_{t\to 0} \frac{W_t}{t} = 0\Big) = 1$$ This implies $$P\Big(\lim_{t\to 0} \frac{t + W_t}{t} = 1\Big) = 1. \quad (1)$$ We have contradiction in this below. By Girsanov theorem, there exists a probability measure $Q$ equivalent to $P$, such that $t+ W_t$ is a Brownian motion w.r.t. $Q$. By law of iterated logarithm, $$Q\Big(\lim_{t\to 0} \frac{t + W_t}{t} = 0\Big) = 1,$$ which implies $$P\Big(\lim_{t\to 0} \frac{t + W_t}{t} = 0\Big) = 1, \quad (2)$$ since $P$ is equivalent to $Q$. Why does this argument leads to a contradiction between (1) and (2)?


text:
# In a parallel plate capacitor with air between the plates, each plate has an area of $6 \times 10^{−3} m^2$ and the distance between the plates is $3\; mm$. Calculate the capacitance of the capacitor. If this capacitor is connected to a $100\; V$ supply, what is the charge on each plate of the capacitor?

## 1 Answer

$17.71 pF$
$1.771 \times 10^{-9}\;C$
answered Jun 23, 2014 by

1 answer


text:
# Bitcoin forecast 2019, 2020, 2021, 2022

Bitcoin forecast for February 2019. The price rate for the beginning of the month is 3433 dollars. The maximum is \$ 3528, the minimum of \$ 3043. The forecast of the average rate is \$ 3319. The Bitcoin forecast for the end of the month is \$ 3272, -4.7%.

Bitcoin forecast for March 2019. The price rate for the beginning of the month is 3272 dollars. The maximum is \$ 3318, the minimum of \$ 2884. The forecast of the average rate is \$ 3144. The Bitcoin forecast for the end of the month is \$ 3101, -5.2%.

Bitcoin forecast for April 2019. The price rate for the beginning of the month is 3101 dollars. The maximum is \$ 3101, the minimum of \$ 2639. The forecast of the average rate is \$ 2920. The Bitcoin forecast for the end of the month is \$ 2838, -8.5%.

Bitcoin forecast for May 2019. The price rate for the beginning of the month is 2838 dollars. The maximum is \$ 2838, the minimum of \$ 2465. The forecast of the average rate is \$ 2698. The Bitcoin forecast for the end of the month is \$ 2651, -6.6%.

Bitcoin forecast for June 2019. The price rate for the beginning of the month is 2651 dollars. The maximum is \$ 2651, the minimum of \$ 2071. The forecast of the average rate is \$ 2400. The Bitcoin forecast for the end of the month is \$ 2227, -16.0%.

Bitcoin forecast for July 2019. The price rate for early this month is 2227 dollars. The maximum is \$ 2282, the minimum of \$ 1984. The forecast of the average rate is \$ 2157. The Bitcoin forecast for the end of the month is \$ 2133, -4.2%.

Bitcoin forecast for August 2019. The price rate for the beginning of the month is 2133 dollars. The maximum is \$ 2152, the minimum of \$ 1870. The forecast of the average rate is \$ 2042. The Bitcoin forecast for the end of the month is \$ 2011, -5.7%.

Bitcoin forecast for September 2019. The price rate for the beginning of the month is 2011 dollars. The maximum is \$ 2011, the minimum of \$ 1699. The forecast of the average rate is \$ 1887. The Bitcoin forecast for the end of the month is \$ 1827, -9.1%.

Bitcoin forecast for October 2019. The price rate for the beginning of the month is 1827 dollars. The maximum is \$ 2267, the minimum of \$ 1827. The forecast of the average rate is \$ 2010. The Bitcoin forecast for the end of the month is \$ 2119, 16.0%.

Bitcoin forecast for November 2019. The price rate for the beginning of the month is 2119 dollars. The maximum is \$ 2119, the minimum of \$ 1678. The forecast of the average rate is \$ 1930. The Bitcoin forecast for the end of the month is \$ 1804, -14.9%.

Bitcoin forecast for December 2019. The price rate for the beginning of the month is 1804 dollars. The maximum is \$ 1804, the minimum of \$ 1409. The forecast of the average rate is \$ 1633. The Bitcoin forecast for the end of the month is \$ 1515, -16.0%.

Bitcoin forecast for January 2020. The price rate for the beginning of the month is 1515 dollars. The maximum is \$ 1880, the minimum of \$ 1515. The forecast of the average rate is \$ 1667. The Bitcoin forecast for the end of the month is \$ 1757, 16.0%.

Bitcoin forecast for February 2020. The price rate for the beginning of the month is \$ 1757. The maximum is \$ 1757, the minimum of \$ 1373. The forecast of the average rate is \$ 1591. The Bitcoin forecast for the end of the month is \$ 1476, -16.0%.

Bitcoin forecast for March 2020. The price rate for the beginning of the month is 1476 dollars. The maximum is \$ 1610, the minimum of \$ 1400. The forecast of the average rate is \$ 1498. The Bitcoin forecast for the end of the month is \$ 1505, 2.0%.

Bitcoin forecast for April 2020. The price rate for the beginning of the month is 1505 dollars. The maximum is \$ 1505, the minimum of \$ 1176. The forecast of the average rate is \$ 1363. The Bitcoin forecast for the end of the month is \$ 1264, -16.0%.

Bitcoin forecast for May 2020. The price rate for the beginning of the month is 1264 dollars. The maximum is \$ 1569, the minimum of \$ 1264. The forecast of the average rate is \$ 1391. The Bitcoin forecast for the end of the month is \$ 1466, 16.0%.

Bitcoin forecast for June 2020. The price rate for the beginning of the month is 1466 dollars. The maximum is \$ 1820, the minimum of \$ 1466. The forecast of the average rate is \$ 1613. The Bitcoin forecast for the end of the month is \$ 1701, 16.0%.

Bitcoin forecast for July 2020. The price rate for the beginning of the month is 1701 dollars. The maximum is \$ 2111, the minimum of \$ 1701. The forecast of the average rate is \$ 1872. The Bitcoin forecast for the end of the month is \$ 1973, 16.0%.

Bitcoin forecast for August 2020. The price rate for the beginning of the month is 1973 dollars. The maximum is \$ 1973, the minimum of \$ 1698. The forecast of the average rate is \$ 1868. The Bitcoin forecast for the end of the month is \$ 1826, -7.5%.

Bitcoin forecast for September 2020. The price rate for the beginning of the month is 1826 dollars. The maximum is \$ 2266, the minimum of \$ 1826. The forecast of the average rate is \$ 2009. The Bitcoin forecast for the end of the month is \$ 2118, 16.0%.

Bitcoin forecast for October 2020. The price rate for the beginning of the month is 2118 dollars. The maximum is \$ 2629, the minimum of \$ 2118. The forecast of the average rate is \$ 2331. The Bitcoin forecast for the end of the month is \$ 2457, 16.0%.

Bitcoin forecast for November 2020. The price rate for the beginning of the month is 2457 dollars. The maximum is \$ 2904, the minimum of \$ 2457. The forecast of the average rate is \$ 2633. The Bitcoin forecast for the end of the month is \$ 2714, 10.5%.

Bitcoin forecast for December 2020. The price rate for the beginning of the month is 2714 dollars. The maximum is \$ 3368, the minimum of \$ 2714. The forecast of the average rate is \$ 2986. The Bitcoin forecast for the end of the month is \$ 3148, 16.0%.

Bitcoin forecast for January 2021. The price rate for the beginning of the month is 3148 dollars. The maximum is \$ 3908, the minimum of \$ 3148. The forecast of the average rate is \$ 3464. The Bitcoin forecast for the end of the month is \$ 3652, 16.0%.

Bitcoin forecast for February 2021. The price rate for the beginning of the month is 3652 dollars. The maximum is \$ 3652, the minimum of \$ 3089. The forecast of the average rate is \$ 3429. The Bitcoin forecast for the end of the month is \$ 3322, -9.0%.

Bitcoin forecast for March 2021. The price rate for the beginning of the month is 3322 dollars. The maximum is \$ 4124, the minimum of \$ 3322. The forecast of the average rate is \$ 3656. The Bitcoin forecast for the end of the month is \$ 3854, 16.0%.

Bitcoin forecast for April 2021. The price rate for the beginning of the month is 3854 dollars. The maximum is \$ 4122, the minimum of \$ 3582. The forecast of the average rate is \$ 3853. The Bitcoin forecast for the end of the month is \$ 3852, -0.1%.

Bitcoin forecast for May 2021. The price rate for the beginning of the month is 3852 dollars. The maximum is \$ 4781, the minimum of \$ 3852. The forecast of the average rate is \$ 4238. The Bitcoin forecast for the end of the month is \$ 4468, 16.0%.

Bitcoin forecast for June 2021. The price rate for the beginning of the month is 4468 dollars. The maximum is \$ 5017, the minimum of \$ 4361. The forecast of the average rate is \$ 4634. The Bitcoin forecast for the end of the month is \$ 4689, 4.9%.

Bitcoin forecast for July 2021. The price rate for the beginning of the month is \$ 4689. The maximum is \$ 5781, the minimum of \$ 4689. The forecast of the average rate is \$ 5141. The Bitcoin forecast for the end of the month is \$ 5403, 15.2%.

Bitcoin forecast for August 2021. The price rate for the beginning of the month is 5403 dollars. The maximum is \$ 6131, the minimum of \$ 5329. The forecast of the average rate is \$ 5648. The Bitcoin forecast for the end of the month is \$ 5730, 6.1%.

Bitcoin forecast for September 2021. The price rate for the beginning of the month is 5730 dollars. The maximum is \$ 5730, the minimum of \$ 4923. The forecast of the average rate is \$ 5419. The Bitcoin forecast for the end of the month is \$ 5294, -7.6%.

Bitcoin forecast for October 2021. The price rate for the beginning of the month is 5294 dollars. The maximum is \$ 5294, the minimum of \$ 4551. The forecast of the average rate is \$ 5008. The Bitcoin forecast for the end of the month is \$ 4894, -7.6%.

Bitcoin forecast for November 2021. The price rate for the beginning of the month is 4894 dollars. The maximum is \$ 6074, the minimum of \$ 4894. The forecast of the average rate is \$ 5385. The Bitcoin forecast for the end of the month is \$ 5677, 16.0%.

Bitcoin forecast for December 2021. The price rate for the beginning of the month is 5677 dollars. The maximum is \$ 7046, the minimum of \$ 5677. The forecast of the average rate is \$ 6,246. The Bitcoin forecast for the end of the month is \$ 6585, 16.0%.

Bitcoin forecast for January 2022. The price rate for early this month is 6585 dollars. The maximum is \$ 7564, the minimum of \$ 6574. The forecast of the average rate is \$ 6948. The Bitcoin forecast for the end of the month is \$ 7069, 7.4%.

Bitcoin forecast for February 2022. The price rate for the beginning of the month is 7069 dollars. The maximum is \$ 7165, the minimum of \$ 6,227. The forecast of the average rate is \$ 6,789. The Bitcoin forecast for the end of the month is \$ 6,696, -5.3%.

Bitcoin forecast for March 2022. The price rate for the beginning of the month is 6696 dollars. The maximum is \$ 8311, the minimum of \$ 6696. The forecast of the average rate is \$ 7368. The Bitcoin forecast for the end of the month is \$ 7767, 16.0%.

Bitcoin forecast for April 2022. The price rate for the beginning of the month is 7767 dollars. The maximum is \$ 7767, the minimum of \$ 6154. The forecast of the average rate is \$ 7076. The Bitcoin forecast for the end of the month is \$ 6617, -14.8%.

Bitcoin forecast for May 2022. The price rate for the beginning of the month is \$ 6617. The maximum is \$ 8059, the minimum of \$ 6617. The forecast of the average rate is \$ 7206. The Bitcoin forecast for the end of the month is \$ 7532, 13.8%.

Bitcoin forecast for June 2022. The price rate for the beginning of the month is 7532 dollars. The maximum is \$ 9,349, the minimum of \$ 7532. The forecast of the average rate is \$ 8288. The Bitcoin forecast for the end of the month is \$ 8,737, 16.0%.

Bitcoin forecast for July 2022. The price rate for the beginning of the month is 8737 dollars. The maximum is \$ 10844, the minimum of \$ 8737. The forecast of the average rate is \$ 9613. The Bitcoin forecast for the end of the month is \$ 10135, 16.0%.

Bitcoin forecast for August 2022. The price rate for the beginning of the month is 10135 dollars. The maximum is \$ 11083, the minimum of \$ 9633. The forecast of the average rate is \$ 10302. The Bitcoin forecast for the end of the month is \$ 10358, 2.2%.

Bitcoin forecast for September 2022. The price rate for the beginning of the month is 10358 dollars. The maximum is \$ 10358, the minimum of \$ 8092. The forecast of the average rate is \$ 9377. The Bitcoin forecast for the end of the month is \$ 8701, -16.0%.

Bitcoin forecast for October 2022. The price rate for the beginning of the month is 8701 dollars. The maximum is \$ 10075, the minimum of \$ 8701. The forecast of the average rate is \$ 9223. The Bitcoin forecast for the end of the month is \$ 9416, 8.2%.

Bitcoin forecast for November 2022. The price rate for the beginning of the month is 9416 dollars. The maximum is \$ 11,582, the minimum of \$ 9416. The forecast of the average rate is \$ 10310. The Bitcoin forecast for the end of the month is \$ 10824, 15.0%.

Bitcoin forecast for December 2022. The price rate for the beginning of the month is 10824 dollars. The maximum is \$ 11219, the minimum of \$ 9751. The forecast of the average rate is \$ 10570. The Bitcoin forecast for the end of the month is \$ 10,485, -3.1%.


text:
# alternative proof of Euclid’s lemma

We give an alternative proof (see Euclid’s lemma proof), which does not use the Fundamental Theorem of Arithmetic (since, usually, Euclid’s lemma is used to prove FTA).

###### Lemma 1.

If $a\mid bc$ and $\gcd(a,b)=1$ then $a\mid c$.

###### Proof.

By assumption $\gcd(a,b)=1$, thus we can use Bezout’s lemma to find integers $x,y$ such that $ax+by=1$. Hence $c\cdot(ax+by)=c$ and $acx+bcy=c$. Since $a\mid a$ and $a\mid bc$ (by hypothesis), we conclude that $a\mid acx+bcy=c$ as claimed. ∎

Title alternative proof of Euclid’s lemma AlternativeProofOfEuclidsLemma 2013-03-22 14:12:27 2013-03-22 14:12:27 alozano (2414) alozano (2414) 4 alozano (2414) Proof msc 11A05


text:
# 49 questions

Tagged
• x
43
views
1
vote
1

## Master Emulator exception when calling RequestData causes

Sometimes when the method RequestData is called after receiving a notify on the characteristic, the Master Emulator seems to hang for a set amount of time before throwing the exception listed below. I do not know what is causing this ... (more)

151
views
no
1

## Using C++ standard libraries

I am using C++ to program the nRF52 DK and I am trying to use the standard vector library.

When I try and compile it I get the linker error: \${GCC_PATH}/arm-none-eabi/include/c++/6.3.1/ext/new_allocator.h ... (more)

317
views
2
2

## Error when using c++ with TWI

I am trying to use gcc to compile a c++ code for nRF52. I am using the TWI library and am getting the error below. Can anyone help me rewriting this macro so that it compiles normally ?

Compiling file: main ...
(more)

112
views
no
1

## C++ compilation error using CLI with SDK 14: error: expected declaration before '}' token

Hi, i just renamed main.c to main.cpp.

In file included from ../../../main.cpp:57:0:
../../../../../../components/libraries/experimental_cli/nrf_cli.h:597:1: error: expected declaration before '}' token
}
^

What should be the right way to fix that?

If i ... (more)

70
views
no
1

## c++ Instead of nRF Connect

Hi,

I can send and receive commands from nRF51 Dongle to nRF51822 via using nRF Connect UART over BLE Service.

My question is : Is there another way to reach nRF51 Dongle for connecting my nRF51822 via C++?

79
views
1
vote
1

## Adding SPL option to Nordic Thingy:52

How do you think - is there resources enough to add SPL (sound pressure level) measurement functionality into Nordic Thingy:52? Is microphone appropriate or may be external one is needed?

From this DIY meter http://davidegironi.blogspot.se/2014/...

steps ... (more)

214
views
no
2

## iOS DFU Writing to characteristic failed

I'm using the iOS latest iOSDFULibrary pods to import to my app. However, after I using DFUServiceIniciator service the log just show as attach.DFUQuestionLog.m

The only different with the Nordic iOS toolbox is the following line : 10 ... (more)

72
views
2
2

## Dongle Firmware for Desktop App Serial Over BLE

Dear Nordic Team,

We have a customer that would like us to extend an C# desktop application to use serial over BLE. What is the best dongle firmware and Windows driver combination to accomplish this?

Thanks, Darren

87
views
2
1

## Some SDK 13.0.0 C++ fixes

Hi,

Ive made fixes in SDK 13.0.0 files described below:

nrf_section.h: to supress gcc warning: invalid suffix on literal; C++11 requires a space between literal and string macro [-Wliteral-suffix]

nrf_strerror.h: added C++ support (extern ... (more)

99
views
1
vote
1

## nrf_block_dev_sdc.h c++ compability

Hi,

A project I'm working on can be seen as a collector of data from many different sources. To keep I an overview I've decided to use C++ objects rather than C (in other words: a C++ project ... (more)

72
views
no
1

## nrf_strerror.h without extern "C" linkage specification

Hi,

Please add extern "C" to nrf_strerror.h header in next coming SDK release to make it more usable with c++.

Regards, Anatol

273
views
2
1

## How to use nrfjprog.dll

We are trying to use nrfjprog.dll in a c# program to help us with manufacturing and quality assurance. We are able to load and call the functions from c# and all the functions work one by one, but if ... (more)

182
views
1
vote
no

## undefined reference to operator new(unsigned int)' [closed]

If anyone will ever have this error: When using c++ and singleton the use of operator new is not possible.

I found the solution in this post: http://forum.arduino.cc/index.php?top...

#include <stdlib.h> // for malloc and ...
(more)

399
views
no
1

## Use C++ with Nordic SDK (nRF52 series)

Hi, i wrote a lot of firmwares for nRF51x22 using C language and they works fine. Now we passed to nRF52 series and we want to use C++ (preferibly C++11) that is more readable, ordered etc... but i got ... (more)

218
views
1
vote
1

## nRF UART driver initialization

Hello, i'm trying to use nRF UART driver (nrf_drv_uart) to implement a high level UART manager. I followed indications on SDK documentation but it doesn't work and i think that is a problem of initialization.

Configuration: nRF52832 - SDK ... (more)

77
views
1
vote
1

## Exported project from Mbed compiler to eclipse gcc arm has errors

Hi, After following all instructions on: http://gnuarmeclipse.github.io/install/ And after installing all Nordic Semi dependencies on eclipse.

I import on eclipse the UART_Loopback project, but whenever I try to compile I get errors like:

1) "Symbol 'NULL ... (more)

270
views
1
vote
2

## what C libraries are used with your nrf24l01 and an avr processor?

I see a number of libraries described on line but can't tell which is most appropriate for the avr processors.

310
views
no
2

## Including C++ library in C project?

Hi Nordic,

I want to include this library (https://github.com/jrowberg/i2cdevlib...) in my project, which is an evolution from ant_ broadcast example, in C. However, and after reading several related posts, I am not able to compile my ... (more)

122
views
1
vote
1

## Compiling SDK12 code with C++ failed

Hi

I've tried to update some of our environment to the SDK12 files. When I tried to compile some of the files a weird bracket error showed up.

At the end i could find the issue in a deeply ... (more)

842
views
2
3

## Compiling C and C++ code

We've currently only been developing our application in C. We now have a couple of C++ libraries we'd like to use and are having trouble compiling the mixture of C and C++ code.

This is the Makefile: http ... (more)

146
views
1
vote
no

## Is it possible to support C++ compatibility in the API?

There are certain design decisions that break C++, or at least the separation of concern between allocation of entities and the use of entities.

For example:

typedef app_timer_t *   app_timer_id_t
Timer ID type. Never declare a variable of this type, but ...
(more)

143
views
1
vote
1

## Problem: Create IOS app for nRF51822 beacon kit

Hello, I am apple developer and using Swift. Actually I'm just intern student.

# 1

My boss assign some task to me to CREATE IOS App to scan nRF51822 Bluetooth Smart Beacon Kit (https://www.nordicsemi.com/eng/Produc...). I ... (more)

756
views
1
vote
no

## C++ compilers for nRF52

Hi, I wonder if anyone knows any free C++ compilers for nRF52. I tried the mbed but it is not fully supported for nRF52.

The regular GNU GCC: arm-none-eabi-gcc works perfectly for nRF52, but I am unable to make the ... (more)

1k
views
3
4

## Windows 8.1 C# Example

Hi all,

Is there any example how can I communicate with 51822 device with SD110 on Windows 8.1 desktop? I successfully paired the device but I have no idea where can I start. I use VS 2013 C# for ... (more)

499
views
no
no

## Fitness Equipment Control protocol Library and example

Anyone can provide us an example of FE-C library and example. Also suggestion for modules that can be used in this type of application

55
views
no
no

## How to see which part of the code/variable is using more Memory ?

Hi.

I am using the NRF52 Development board, on Keil uVision, to implement a C program that uses Dynamic Structs. The Structs re-size themselves ( by increasing their capacity by 2 time ) whenever more elements need to be appended to them ... (more)

318
views
2
no

## FOTA (OTA) for Xamarin (C#)

Hi,

I've started developing a mobile app with Xamarin. Xamarin is a really nice platform that you can use to develop Native applications for iOS and Android using C# (reducing development time as source can be shared). The app ... (more)

1k
views
7
1

## Use the nrf SDK in C++

Hello,

I program the nrf51 in C++ using GCC and Eclipse as IDE (this question is not related to the C++ toolchain).

I was wondering if it is possible to add the extern wrapper #ifdef __cplusplus in all header files ... (more)

1k
views
4
2

Hi,

Many of us use C++ rather than C (as it is superior in every way). When including many of the Nordic SDK header files it is necessary to wrap them in

extern "C" {
}

to get the proper linkage. Otherwise ... (more)

1k
views
1
vote
1

## Problem with Designated Initializers in SDK when using C++

Hi,

I want to program the nrf51822 with C++ and from what I've found here it should be possible.

But nrf_drv_gpiote.h contains designated initializers wich aren't supported by C++. I'm including all SDK headers inside an ... (more)

#### Statistics

• Total users: 25345
• Latest user: Elisabeth Richard
• Resolved questions: 10981
• Total questions: 27097

## Recent blog posts

• ### Estudando Projetos do SDK 10 para nRF5x com Eclipse Oxygen (Portuguese)

Posted 2017-11-12 00:08:55 by Carlos Delfino
• ### Configurando o Eclipse Oxygen para Desenvolvimento com nRF5x (Portuguese)

Posted 2017-11-10 21:15:47 by Carlos Delfino
• ### How to use Git for embedded software development

Posted 2017-11-06 13:21:55 by Yaniv Nis
• ### Thingy:52 based Weather Station

Posted 2017-10-29 22:31:15 by Krzysztof Szewczyk
• ### How to build continuous integration and delivery process for embedded SW development

Posted 2017-10-03 11:01:29 by Yaniv Nis

## Recent questions

• ### what status is NRF_ERROR_INVALID_STATE from sd_ble_gattc_primary_services_discover?

Posted 2017-11-20 10:38:28 by Haruki Kawakami
• ### esb handler crash

Posted 2017-11-20 10:38:09 by Motti Ng
• ### nRF51822 - S130 : how do I check timer2 is running or stop

Posted 2017-11-20 10:18:36 by CFF.K
• ### HardFault_Handler when I use WDT

Posted 2017-11-20 10:00:57 by abosch
• ### Communication between pca10040 and another device using UART

Posted 2017-11-20 09:55:59 by lirank


text:
# Documentation

Std.Tactic.Lint.Misc

# Various linters #

This file defines several small linters.

A linter for checking whether a declaration has a namespace twice consecutively in its name.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking for unused arguments. We skip all declarations that contain sorry in their value.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking definition doc strings.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking theorem doc strings.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking whether the correct declaration constructor (definition or theorem) has been used.

Equations
• One or more equations did not get rendered due to their size.

A linter for missing checking whether statements of declarations are well-typed.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking that there are no bad max u v universe levels. Checks whether all universe levels u in the type of d are "good". This means that u either occurs in a level of d by itself, or (recursively) with only other good levels. When this fails, usually this means that there is a level max u v, where neither u nor v occur by themselves in a level. It is ok if one of u or v never occurs alone. For example, (α : Type u) (β : Type (max u v)) is a occasionally useful method of saying that β lives in a higher universe level than α.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking that declarations aren't syntactic tautologies. Checks whether a lemma is a declaration of the form ∀ a b ... z, e₁ = e₂∀ a b ... z, e₁ = e₂ where e₁ and e₂ are identical exprs. We call declarations of this form syntactic tautologies. Such lemmas are (mostly) useless and sometimes introduced unintentionally when proving basic facts with rfl when elaboration results in a different term than the user intended.

Equations
• One or more equations did not get rendered due to their size.

Return a list of unused have/suffices/let_fun terms in an expression. This actually finds all beta-redexes.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking that declarations don't have unused term mode have statements. We do not tag this as @[std_linter] so that it is not in the default linter set as it is slow and an uncommon problem.

Equations
• One or more equations did not get rendered due to their size.

A linter for checking if variables appearing on both sides of an iff are explicit. Ideally, such variables should be implicit instead.

Equations
• One or more equations did not get rendered due to their size.


text:
# American Institute of Mathematical Sciences

November  2003, 3(4): 541-563. doi: 10.3934/dcdsb.2003.3.541

## Lack of hyperbolicity in the two-fluid model for two-phase incompressible flow

 1 Department of Mathematics, University of Houston, Houston, Texas 77204-3008, United States, United States 2 Department of Mathematics, The Hebrew University, Jerusalem, Israel

Received  September 2002 Revised  January 2003 Published  August 2003

The two-fluid equations for two-phase flow, a model derived by averaging, analogy and experimental observation, have the property (in at least some commonly-occurring derivations) of losing hyperbolicity in their principal parts, those representing the chief entries in modeling conservation of mass and transfer of momentum and energy.
Much attention has centered on reformulating details of the model to avoid this awkwardness. This paper takes a different approach: a study of the nonhyperbolic operator itself. The objective is to understand the nature of ill-posedness in nonlinear, as distinct from linearized, models.
We present our initial study of the nonlinear operator that occurs in the two-fluid equations for incompressible two-phase flow. Our research indicates that one can solve Riemann problems for these nonlinear, nonhyperbolic equations. The solutions involve singular shocks, very low regularity solutions of conservation laws (solutions with singular shocks, however, are not restricted to nonhyperbolic equations). We present evidence, based on asymptotic treatment and numerical solution of regularized equations, that these singular solutions occur in the two-fluid model for incompressible two-phase flow. The Riemann solutions found using singular shocks have a reasonable physical interpretation.
Citation: Barbara Lee Keyfitz, Richard Sanders, Michael Sever. Lack of hyperbolicity in the two-fluid model for two-phase incompressible flow. Discrete & Continuous Dynamical Systems - B, 2003, 3 (4) : 541-563. doi: 10.3934/dcdsb.2003.3.541
 [1] Adán J. Corcho. Ill-Posedness for the Benney system. Discrete & Continuous Dynamical Systems - A, 2006, 15 (3) : 965-972. doi: 10.3934/dcds.2006.15.965 [2] Yonggeun Cho, Gyeongha Hwang, Soonsik Kwon, Sanghyuk Lee. Well-posedness and ill-posedness for the cubic fractional Schrödinger equations. Discrete & Continuous Dynamical Systems - A, 2015, 35 (7) : 2863-2880. doi: 10.3934/dcds.2015.35.2863 [3] Mahendra Panthee. On the ill-posedness result for the BBM equation. Discrete & Continuous Dynamical Systems - A, 2011, 30 (1) : 253-259. doi: 10.3934/dcds.2011.30.253 [4] Xavier Carvajal, Mahendra Panthee. On ill-posedness for the generalized BBM equation. Discrete & Continuous Dynamical Systems - A, 2014, 34 (11) : 4565-4576. doi: 10.3934/dcds.2014.34.4565 [5] Tsukasa Iwabuchi, Kota Uriya. Ill-posedness for the quadratic nonlinear Schrödinger equation with nonlinearity $|u|^2$. Communications on Pure & Applied Analysis, 2015, 14 (4) : 1395-1405. doi: 10.3934/cpaa.2015.14.1395 [6] Piero D'Ancona, Mamoru Okamoto. Blowup and ill-posedness results for a Dirac equation without gauge invariance. Evolution Equations & Control Theory, 2016, 5 (2) : 225-234. doi: 10.3934/eect.2016002 [7] In-Jee Jeong, Benoit Pausader. Discrete Schrödinger equation and ill-posedness for the Euler equation. Discrete & Continuous Dynamical Systems - A, 2017, 37 (1) : 281-293. doi: 10.3934/dcds.2017012 [8] Fuyi Xu, Meiling Chi, Lishan Liu, Yonghong Wu. On the well-posedness and decay rates of strong solutions to a multi-dimensional non-conservative viscous compressible two-fluid system. Discrete & Continuous Dynamical Systems - A, 2020, 40 (5) : 2515-2559. doi: 10.3934/dcds.2020140 [9] Renjun Duan, Xiongfeng Yang. Stability of rarefaction wave and boundary layer for outflow problem on the two-fluid Navier-Stokes-Poisson equations. Communications on Pure & Applied Analysis, 2013, 12 (2) : 985-1014. doi: 10.3934/cpaa.2013.12.985 [10] Yue-Jun Peng, Shu Wang. Asymptotic expansions in two-fluid compressible Euler-Maxwell equations with small parameters. Discrete & Continuous Dynamical Systems - A, 2009, 23 (1&2) : 415-433. doi: 10.3934/dcds.2009.23.415 [11] Chao Deng, Xiaohua Yao. Well-posedness and ill-posedness for the 3D generalized Navier-Stokes equations in $\dot{F}^{-\alpha,r}_{\frac{3}{\alpha-1}}$. Discrete & Continuous Dynamical Systems - A, 2014, 34 (2) : 437-459. doi: 10.3934/dcds.2014.34.437 [12] G. Fonseca, G. Rodríguez-Blanco, W. Sandoval. Well-posedness and ill-posedness results for the regularized Benjamin-Ono equation in weighted Sobolev spaces. Communications on Pure & Applied Analysis, 2015, 14 (4) : 1327-1341. doi: 10.3934/cpaa.2015.14.1327 [13] Yannis Angelopoulos. Well-posedness and ill-posedness results for the Novikov-Veselov equation. Communications on Pure & Applied Analysis, 2016, 15 (3) : 727-760. doi: 10.3934/cpaa.2016.15.727 [14] Antonio Fasano, Marco Gabrielli, Alberto Gandolfi. Investigating the steady state of multicellular spheroids by revisiting the two-fluid model. Mathematical Biosciences & Engineering, 2011, 8 (2) : 239-252. doi: 10.3934/mbe.2011.8.239 [15] Jean-François Crouzet. 3D coded aperture imaging, ill-posedness and link with incomplete data radon transform. Inverse Problems & Imaging, 2011, 5 (2) : 341-353. doi: 10.3934/ipi.2011.5.341 [16] Bernadette N. Hahn. Dynamic linear inverse problems with moderate movements of the object: Ill-posedness and regularization. Inverse Problems & Imaging, 2015, 9 (2) : 395-413. doi: 10.3934/ipi.2015.9.395 [17] Shunlian Liu, David M. Ambrose. Sufficiently strong dispersion removes ill-posedness in truncated series models of water waves. Discrete & Continuous Dynamical Systems - A, 2019, 39 (6) : 3123-3147. doi: 10.3934/dcds.2019129 [18] Marcel Braukhoff. Semiconductor Boltzmann-Dirac-Benney equation with a BGK-type collision operator: Existence of solutions vs. ill-posedness. Kinetic & Related Models, 2019, 12 (2) : 445-482. doi: 10.3934/krm.2019019 [19] Qiangchang Ju, Hailiang Li, Yong Li, Song Jiang. Quasi-neutral limit of the two-fluid Euler-Poisson system. Communications on Pure & Applied Analysis, 2010, 9 (6) : 1577-1590. doi: 10.3934/cpaa.2010.9.1577 [20] B. Wiwatanapataphee, Theeradech Mookum, Yong Hong Wu. Numerical simulation of two-fluid flow and meniscus interface movement in the electromagnetic continuous steel casting process. Discrete & Continuous Dynamical Systems - B, 2011, 16 (4) : 1171-1183. doi: 10.3934/dcdsb.2011.16.1171

2018 Impact Factor: 1.008


text:
Question

# Find the value of following expression, If $\tan {{\theta }_{1}}=k\times \cot {{\theta }_{2}}$:$\dfrac{\cos \left( {{\theta }_{1}}+{{\theta }_{2}} \right)}{\cos \left( {{\theta }_{1}}-{{\theta }_{2}} \right)}$A) $\dfrac{1+k}{1-k}$B) $\dfrac{1-k}{1+k}$C) $\dfrac{k+1}{k-1}$D) $\dfrac{k-1}{k+1}$

Verified
160.5k+ views
Hint: For solving this question use the formulae $\cos \left( A+B \right)=\cos A\times \cos B-\sin A\times \sin B$ and $\cos \left( A-B \right)=\cos A\times \cos B+\sin A\times \sin B$ to expand the given expression and convert it in the form of ‘tan’ to get the final answer.

To find the value of given expression we will write the given values first,
$\tan {{\theta }_{1}}=k\times \cot {{\theta }_{2}}$…………………………….. (1)
To proceed further we should know the formula of ‘cot x’ in terms of ‘tan x’ which is given below,
Formulae:
$\cot x=\dfrac{1}{\tan x}$
By using above formula we can write the equation (1) as,
$\therefore \tan {{\theta }_{1}}=k\times \dfrac{1}{\tan {{\theta }_{2}}}$
If we shift $\tan {{\theta }_{2}}$ on the right hand side of the equation we will get,
$\therefore \tan {{\theta }_{1}}\times \tan {{\theta }_{2}}=k$ …………………………………….. (2)
Now to find the value of given expression we will first write it down and assume it as T, therefore we will get,
$T=\dfrac{\cos \left( {{\theta }_{1}}+{{\theta }_{2}} \right)}{\cos \left( {{\theta }_{1}}-{{\theta }_{2}} \right)}$ ………………………………… (A)
Now to solve further we should know the formulae given below,
Formulae:
$\cos \left( A+B \right)=\cos A\times \cos B-\sin A\times \sin B$
$\cos \left( A-B \right)=\cos A\times \cos B+\sin A\times \sin B$
By using above formulae we can write T as shown below,
$\therefore T=\dfrac{\left( \cos {{\theta }_{1}}\times \cos {{\theta }_{2}}-\sin {{\theta }_{1}}\times \sin {{\theta }_{2}} \right)}{\left( \cos {{\theta }_{1}}\times \cos {{\theta }_{2}}+\sin {{\theta }_{1}}\times \sin {{\theta }_{2}} \right)}$
If we observe above equation and equation (2) then we can say that we have to convert above equation in the form of ‘tan’ as we have the value of $\tan {{\theta }_{1}}\times \tan {{\theta }_{2}}$.
Therefore to convert the above equation in the form of ‘tan’ we will divide both numerator and denominator by $\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}$ and therefore we will get,
$\therefore T=\dfrac{\left( \dfrac{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}-\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}{\left( \dfrac{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}+\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}$
By separating the denominators of numerator and denominator we will get,
$\therefore T=\dfrac{\left( \dfrac{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)-\left( \dfrac{\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}{\left( \dfrac{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)+\left( \dfrac{\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}$
As we all know that if any term is divided by itself we will get the answer equal to ‘1’, therefore above equation will become,
$\therefore T=\dfrac{1-\left( \dfrac{\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}{1+\left( \dfrac{\sin {{\theta }_{1}}\times \sin {{\theta }_{2}}}{\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}} \right)}$ …………………………………….. (3)
Now, to proceed further in the solution we should know the formula given below,
Formula:
$\dfrac{\sin x}{\cos x}=\tan x$
By using above formula we can write the equation (3) as shown below,
$\therefore T=\dfrac{1-\tan {{\theta }_{1}}\times \tan {{\theta }_{2}}}{1+\tan {{\theta }_{1}}\times \tan {{\theta }_{2}}}$
If we put the value of equation (2) in above equation we will get,
$\therefore T=\dfrac{1-k}{1+k}$
If we compare above equation with equation (A) we will get,
$\therefore T=\dfrac{\cos \left( {{\theta }_{1}}+{{\theta }_{2}} \right)}{\cos \left( {{\theta }_{1}}-{{\theta }_{2}} \right)}=\dfrac{1-k}{1+k}$
$\therefore \dfrac{\cos \left( {{\theta }_{1}}+{{\theta }_{2}} \right)}{\cos \left( {{\theta }_{1}}-{{\theta }_{2}} \right)}=\dfrac{1-k}{1+k}$
Therefore the value of $\dfrac{\cos \left( {{\theta }_{1}}+{{\theta }_{2}} \right)}{\cos \left( {{\theta }_{1}}-{{\theta }_{2}} \right)}$ is given b, $\dfrac{1-k}{1+k}$ .
Therefore Option (b) is correct.

Note- Do remember the adjustment of dividing the expression by $\cos {{\theta }_{1}}\times \cos {{\theta }_{2}}$ after expansion using formula to convert it in to the form of ‘tan’ otherwise the solution will become very lengthy as there will occur need of conversion of first equation.


text:
• Create Account

## Calculate number sequence

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

10 replies to this topic

### #1mr_malee  Members

173
Like
0Likes
Like

Posted 12 August 2014 - 05:44 PM

Hi, was wondering if there's a more mathematical approach to calculating a sequence of numbers where each number multiplies itself by 2. so starting with the number 5, and running 6 levels you would end up with

5, 10, 20, 40, 80, 160

I've got this and it works, but wondering if there's a more efficient way of doing it?

int n = 5;
int level = 6;

for (int i = 1; i < level; i++) {

n *= 2;
}

return n;

thanks

### #2Angus Hollands  Members

858
Like
0Likes
Like

Posted 12 August 2014 - 05:50 PM

You're performing a multiple of two, n times, which is the same as one multiplication of (2 ^ (n-1))

I.E

5 * 2 ^ (6 - 1)  is 5 * 2 ^ 5

### #3mr_malee  Members

173
Like
0Likes
Like

Posted 12 August 2014 - 06:02 PM

ah thank you.

Just gonna slap this here:

5 * Mathf.Pow(2, level - 1);

Edited by mr_malee, 12 August 2014 - 06:04 PM.

### #4Bacterius  Members

13102
Like
1Likes
Like

Posted 12 August 2014 - 06:04 PM

In code, you can do this using the bitshift operator as well instead of using pow or something, courtesy of binary:

n = 5 << (level - 1);

Watch out for overflow though. Of course, if later on you want to have partial levels, e.g. level = 2.5 somewhere between level 2 and level 3, then just using pow is the better solution, since you're using floats anyway.

Edited by Bacterius, 12 August 2014 - 06:06 PM.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

### #5mr_malee  Members

173
Like
0Likes
Like

Posted 12 August 2014 - 06:28 PM

awesome, thanks.

### #6mr_malee  Members

173
Like
0Likes
Like

Posted 12 August 2014 - 07:22 PM

Say I wanted to get the inverse of that function. Given these numbers:

5, 10, 20, 40, 80, 160

how could I produce:

1, 2, 3, 4, 5, 6

again, I only know how to do this using loops:

int n = 1;
int value = 80;

while (value > 5) {

value -= value / 2;
n++;
}

return n;

Edited by mr_malee, 12 August 2014 - 07:33 PM.

### #7Bacterius  Members

13102
Like
0Likes
Like

Posted 12 August 2014 - 07:30 PM

Say I wanted to get the inverse of that function. Given these numbers:

5, 10, 20, 40, 80, 160

how could I produce:

1, 2, 3, 4, 5, 6

It would be:

level = log2(n / 5) + 1

Where log2 is the base-two logarithm. (again, if using bitshifts and integers, log2 can be implemented as the "highest bit set to one" instruction, which has no built-in keyword but may have an intrinsic available on your compiler - but at this point, using your math library's log2 is probably easier).

So e.g. for n = 80, we take n / 5 = 16, and log2(16) = 4 which gives us level = 5, as expected.

“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”

### #8mr_malee  Members

173
Like
0Likes
Like

Posted 12 August 2014 - 07:39 PM

You are a wizard. Thank you.

Wish I understood these Math functions better. :|

### #9mr_malee  Members

173
Like
0Likes
Like

Posted 13 August 2014 - 05:29 PM

hello again, I've got another interesting sequence problem, more of a difficult pattern this time (imo)

given this sequence of numbers: 1, 5, 10, 30, 60, 300, 600, 1800, 3600, 18000, 36000

can you find a way (without arrays) to return one of these numbers based on an index (1, 2, 3, 4, 5, 6, 7...)?

ignoring 1. The sequence is separated into pairs of double size numbers:

(5, 10)

(30, 60)

(300, 600)

(1800, 3600)

(18000, 36000)

pairs are separated by a multiplication of the preceding number:

1 * 5 = 5

10 * 3 = 30

60 * 5 = 300

600 * 3 = 1800

3600 * 5 = 18000

I'm almost positive there needs to be some tricky modulus going on, but can't seem to crack it.

The very difficult problem is given only an index "7", and the first number real number "5". How do you get 1800.

Edited by mr_malee, 13 August 2014 - 05:48 PM.

### #10Brother Bob  Moderators

10109
Like
0Likes
Like

Posted 13 August 2014 - 06:11 PM

Your sequence increases by multiples of the repeating sequence [5, 2, 3, 2], so for each multiple of 4 indices, the sequence increases by a factor 60. The remainder of a multiple by 4 can easily be applied afterwards.

Two hints:

1. (index-1)/4 gives you the number of times to multiply by 60.
2. (index-1)%4 gives you the number of factors to multiply as a fraction of 60; for no remainder you multiply by 1 since all factors are covered by a whole number of 60's, for one remainder you multiply by 1*5=5, for two remainders you multiply by 1*5*2=10, and so on for the last factor which I leave up to you to understand.

### #11mr_malee  Members

173
Like
0Likes
Like

Posted 13 August 2014 - 07:16 PM

ah Thanks. Here's what I ended up with

if (index == 0) {

return 1;
}

int v = (index - 1) / 4;
int n = (index - 1) % 4;
int m = (int)Mathf.Pow(60, v);

if (n == 0) {

return 5 * m;
}
else if (n == 1) {

return 10 * m;
}
else if (n == 2) {

return 30 * m;
}
else if (n == 3) {

return 60 * m;
}

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
# Wi-Fi/Cellular Coex Channel Avoidance

Stay organized with collections Save and categorize content based on your preferences.

The Wi-Fi/cellular coex channel avoidance feature, introduced in Android 12, identifies and avoids using unsafe Wi-Fi channels in cases where there might be interference from/to cellular channels. This includes interfaces such as STA, SoftAp, Wi-Fi Direct (P2P), Wi-Fi Aware (NAN).

• Information the cellular modem must report to the Android framework
• Algorithms the Wi-Fi framework uses to calculate Wi-Fi channels to be avoided
• Configuration tables that device manufacturers must provide for the Wi-Fi framework
• System APIs, configurations, and HAL APIs related to the channel avoidance feature
• Framework behavior for handling channel avoidance
• Chip vendor behavior for handling channel avoidance
• Implementation details for channel avoidance
• Tests for validating channel avoidance behavior

## Background

For devices with cellular technologies such as LTE, 5G NR, and Licensed Assisted Access (LAA), the cellular channels in use can interfere with the Wi-Fi channel in use. This occurs when the cellular and Wi-Fi channels are within short frequency separation (neighboring channels) or when there is harmonic and intermodulation interference.

This type of interference becomes a problem when one antenna is transmitting and another is receiving at the same time. In this case, the transmitting antenna floods the receiving antenna, impacting its reception quality.

This document refers to the interfering transmitter as the aggressor and the receiver experiencing the interference as the victim. The Wi-Fi channel that is either the aggressor or the victim is referred to as an unsafe channel.

The Wi-Fi/cellular coex channel avoidance feature provides a consistent approach for channel avoidance reducing the need for proprietary code that diverges from the Wi-Fi framework. Additionally, the feature allows device manufacturers to configure, enable and disable, and override the feature.

The feature performs channel avoidance by controlling the Wi-Fi channels. The Wi-Fi channel avoidance scheme can be described as a series of four abstract steps:

1. Modem reports change in cellular frequency
2. Coex avoidance algorithm calculates unsafe Wi-Fi channels
3. Coex avoidance algorithm informs Wi-Fi service
4. Framework or driver performs appropriate Wi-Fi action

Figure 1. Channel avoidance scheme

## Reporting a change in cellular frequency

The telephony service reports the cellular channels currently in use. When the operating cellular frequency changes, the modem reports this information to the telephony service through IRadio::PhysicalChannelConfig. This information includes indications for licensed assisted access (LAA) and carrier aggregation (CA).

From Android 12, the following fields in 1.6 IRadio::PhysicalChannelConfig provide required information for the coex formulas that the modem must populate.

struct PhysicalChannelConfig {
/** Connection status for cell. Valid values are PRIMARY_SERVING and SECONDARY_SERVING */
CellConnectionStatus status;

/** The radio technology for this physical channel */

/** Downlink cell bandwidth, in kHz */

/** Uplink cell bandwidth, in kHz */
}

## Calculating unsafe Wi-Fi channels

When the modem reports a change in cellular frequency, the coex channel algorithm calculates the interference between cellular and Wi-Fi channels and determines what set of Wi-Fi channels are unsafe.

There are multiple types of interference requiring different formulas: neighboring and harmonic/intermodulation. Due to the physical differences in antenna and layout between devices, the patterns of neighboring and harmonic/intermodulation interference for each device are different. To account for this, device manufacturers must provide a lookup table to plug parameters into generic formulas for the two types of interference. These parameters are defined per cell band and are referenced by the bands of the active cell channels.

A maximum power cap can be defined in the lookup table. If a maximum power cap is defined, an unsafe channel transmits with the provided power cap. If there's no power cap, the channel transmits at full power.

In general, the channel avoidance feature uses a best effort approach to avoid unsafe Wi-Fi channels to optimize performance. But in certain cases (for example, because of carrier requirements), it's mandatory for certain interfaces to avoid unsafe channels for certain cellular bands. In such cases, mandatory restrictions are represented as a bitmask containing values for whether to prohibit certain channels such as Wi-Fi Direct (P2P), SoftAp, and Wi-Fi Aware (NAN). While an unsafe channel acts as a recommendation against using that channel for all use cases, mandatory restrictions mark specific use cases for mandatory avoidance.

If every channel of the 2.4GHz or 5GHz band is marked unsafe, the lookup table can define a default 2.4GHz channel or a default 5GHz channel per interfering cell band as the safest choice. These default channels aren't reported as unsafe channels when the rest of the band is reported unsafe.

### Override list

A formulaic approach is limited in cases where interference is heavily bandwidth dependent (and thus channels with larger bandwidth might be unsafe but not channels with smaller bandwidth). In cases, such as with LAA, it's beneficial to skip the calculations and use a specified list of unsafe channels.

To do this, you can specify an override list of unsafe channels in the lookup table for certain entries. An override list in a table entry signifies that the calculation for that particular cell channel is skipped and that the unsafe Wi-Fi channels for the matching cell channel are specified by the override list.

For bandwidth-sensitive cases, you can selectively avoid certain bandwidths by specifying certain channels with certain bandwidths in the override list. This is because each Wi-Fi channel number corresponds to a specified bandwidth.

The override list is represented by a list of channel numbers or pre-defined category keywords for each Wi-Fi band:

2g categories:

• all (entire 2.4GHz band)

5g categories:

• all (entire 5GHz band)
• 20mhz (5GHz 20MHz channels)
• 40mhz (5GHz 40MHz channels)
• 80mhz (5GHz 80MHz channels)
• 160mhz (5GHz 160MHz channels)

### Neighboring channel interference

To determine neighboring channel interference, the coex avoidance algorithm makes sure the distance ΔF between an aggressor and victim channel doesn't go under a specified threshold.

Figure 2. Distance between an aggressor and victim channel

The threshold is determined by the physical configuration of the device and the threshold value provided in the lookup table entry per interfering band. Bands that are considered non-interfering don't have a table entry and unsafe channels don't need to be calculated (this is the majority of the time).

Neighboring interference parameters

• wifiVictimMhz: MHz distance threshold for a Wi-Fi victim (cell uplink)
• cellVictimMhz: MHz distance threshold for a cell victim (cell downlink)

The algorithm behaves as follows for each active cell channel:

1. For the channel's band, tries to find a lookup table entry. If no table entry is found, returns with no unsafe channels for that cell channel.
2. Based on the cellular band, identifies which Wi-Fi band is at risk and which side of the band the interference comes from (for example, lower 2.4GHz channels, higher 2.4GHz channels, lower 5GHz channels).
3. If wifiVictimMhz is present and the cell channel has uplink and

1. If the lower part of the Wi-Fi band is at risk

1. Finds the upper limit of unsafe channels by adding wifiVictimMhz to the cell uplink's highest frequency.
2. Finds the first 20Mhz Wi-Fi channel whose lower edge overlaps the limit.
3. Marks the Wi-Fi channel, every larger bandwidth channel that contains it (for example, 40Mhz, 80Mhz), and every lower channel of the same band as the unsafe channel.
2. If the upper part of the Wi-Fi band is at risk

1. Finds the lower limit of unsafe channels by subtracting wifiVictimMhz to the cell uplink's lowest frequency.
2. Finds the first Wi-Fi channel whose upper edge overlaps the limit.
3. Marks the Wi-Fi channel, every larger channel that contains it (for example, 40Mhz, 80Mhz), and every higher channel of the same band as the unsafe channel.
4. If cellVictimMhz is present and the cell channel has downlink.

1. Performs step 3 using cellVictimMhz as the threshold and compares against cell downlink instead of cell uplink.
5. Applies the table entry's power cap to the calculated unsafe channels.

Figure 3. Unsafe channel calculation for neighboring channel interference

### Harmonic/intermodulation distortion

For harmonic/intermodulation distortion, the coex engine calculates the range of the harmonic/intermodulation signal and evaluates the percent overlap it has with a potential victim channel. If the overlap exceeds an overlap threshold, the algorithm considers this an unsafe situation. The calculation of the percent overlap of the harmonic/intermodulation distortion on a victim channel is performed with the following equation:

$$overlap = \frac{min(distortion_{high}, victim_{high}) - max(distortion_{low}, victim_{low})}{victim_{bandwidth}}$$

In the harmonic distortion case, the algorithm considers the harmonic distortion of a cell uplink channel victimizing Wi-Fi channels. It then substitutes the distortion high and distortion low with the harmonic values based on the cell uplink frequencies and a harmonic degree $N$.

$$harmonic_{high} = N * uplink_{high}$$
$$harmonic_{low} = N * uplink_{low}$$

Figure 4. Unsafe channel calculation for harmonic distortion

In the intermodulation case, the algorithm considers the intermodulation distortion of the cell uplink and the Wi-Fi channel victimizing the cell downlink channel. It then substitutes the distortion high and distortion low with the intermodulation values based on the cell uplink frequencies, Wi-Fi frequencies, and the two intermodulation coefficients $M$, $N$.

$$intermod_{high} = |M*wifi_{high} + N*uplink_{high}|$$
$$intermod_{low} = |M*wifi_{low} + N*uplink_{low}|$$

Figure 5. Unsafe channel calculation for intermodulation distortion

You can specify $M$, $N$ and overlap values in the lookup table per interfering cell band. If there is no interference for a band, then the values are omitted from the table for that band entry. Two sets of these values for the Wi-Fi 2.4GHz and 5GHz bands can be independently defined.

Similar to the neighboring interference algorithm, the algorithm reuses the same power cap value defined per interfering cell band.

The algorithm behaves as follows for each active cell channel:

1. For the cell channel's band, it tries to find a lookup table entry. If no table entry is found, returns with no unsafe channels for this channel.
2. Finds the unsafe 2.4GHz channels from harmonics if parameters are defined.

1. Finds the harmonic degree N for 2.4GHz.
2. Calculates the harmonic high frequency and the harmonic low frequency based on N and the cell uplink.
3. Finds the first 20MHz Wi-Fi channel that is within the lower bound of the harmonic coming from below.
4. Calculates the overlap of the harmonic over the Wi-Fi channel and marks the channel as unsafe if the overlap exceeds the 2.4GHz Wi-Fi overlap threshold.
5. Finds the first 20MHz Wi-Fi channel that is within the upper bound of the harmonic coming from above.
6. Calculates the overlap of the harmonic over the Wi-Fi channel and marks the channel as unsafe if the overlap exceeds the 2.4GHz Wi-Fi overlap threshold.
7. Marks every 20MHz channel in between as an unsafe channel.
3. Finds the unsafe 5GHz channels from harmonics if parameters are defined.

1. Finds the harmonic degree N for 5GHz. If N is 0, skips to step 5.
2. Calculates the harmonic high frequency and the harmonic low frequency based on N and the cell uplink.
3. Finds unsafe 20Mhz channels.

1. Finds the first 20MHz Wi-Fi channel that is within the lower bound of the harmonic coming from below.
2. Calculates the overlap of the harmonic over the Wi-Fi channel and marks the channel as unsafe if the overlap exceeds the 2.4GHz Wi-Fi overlap threshold.
3. Finds the first 20MHz Wi-Fi channel that is within the upper bound of the harmonic coming from above.
4. Calculates the overlap of the harmonic over the Wi-Fi channel and marks the channel as unsafe if the overlap exceeds the 2.4GHz Wi-Fi overlap threshold.
5. Marks every 20MHz channel in between as an unsafe channel with the specified power cap.
4. Finds unsafe 40MHz, 80MHz, 160MHz channels

1. Repeats step 3a but with 40MHz, 80MHz, 160MHz.
2. Instead of calculating the overlaps of the channels on the harmonic edge, reuses the calculated overlaps from the smaller constituent channels (for example, if two 20Mhz channels make a 40Mhz channel and have 30% and 90% overlap, then the average is 60% overlap for the 40Mhz channel).
4. Finds the unsafe 2.4GHz channels from intermodulation if parameters are defined.

1. Finds the intermodulation coefficients N, M for 2.4GHz.
2. For each 2.4GHz Wi-Fi channel:

1. Calculates the intermodulation low frequency and intermodulation high frequency based on N, M, cell uplink, and Wi-Fi channel.
2. Calculates the overlap of the intermodulation over cell downlink and marks the channel as unsafe if the overlap exceeds the 2.4GHz cell overlap threshold.
5. Finds the unsafe 5GHz channels from intermodulation if parameters are defined.

1. Repeats step 4 using the 5GHz Wi-Fi channels and 5GHz cell overlap threshold.
6. Applies the table entry's power cap to the calculated unsafe channels.

### Final result

After both sets of unsafe channels from neighboring and harmonic interference are calculated, the final set is calculated by taking the union of both sets (and selecting the lower power cap if there are collisions), and removing the default channels from the set if there are no mandatory restrictions applied.

The algorithm behaves as follows:

1. If every 2.4GHz Wi-Fi channel is marked as an unsafe channel, removes the default 2.4GHz Wi-Fi channel from the set.
2. If every 5GHz Wi-Fi channel is marked as an unsafe channel, removes the default 5GHz Wi-Fi channel from the set.
3. Returns the final set of unsafe channels.

### Lookup table format

The lookup tables are represented in an XML file located in the overlayable config string config_wifiCoexTableFilepath, and is defined by the following XSD.

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
version="1.0">

<xsd:element name="table">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="entry" minOccurs="1" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="entry">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="rat" type="ratType"/>
<xsd:element name="band" type="xsd:int"/>
<xsd:element name="powerCapDbm" type="xsd:int" minOccurs="0"/>
<xsd:choice>
<xsd:element ref="params"/>
<xsd:element ref="override"/>
</xsd:choice>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:simpleType name="ratType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="LTE"/>
<xsd:enumeration value="NR"/>
</xsd:restriction>
</xsd:simpleType>

<!-- Define coex algorithm parameters -->
<xsd:element name="params">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="neighborThresholds" minOccurs="0"/>
<xsd:element name="harmonicParams2g" type="harmonicParams" minOccurs="0"/>
<xsd:element name="harmonicParams5g" type="harmonicParams" minOccurs="0"/>
<xsd:element name="intermodParams2g" type="intermodParams" minOccurs="0"/>
<xsd:element name="intermodParams5g" type="intermodParams" minOccurs="0"/>
<xsd:element ref="defaultChannels" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="neighborThresholds">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="wifiVictimMhz" type="xsd:int" minOccurs="0"/>
<xsd:element name="cellVictimMhz" type="xsd:int" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:complexType name="harmonicParams">
<xsd:sequence>
<xsd:element name="N" type="xsd:int"/>
<xsd:element name="overlap" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>

<xsd:complexType name="intermodParams">
<xsd:sequence>
<xsd:element name="N" type="xsd:int"/>
<xsd:element name="M" type="xsd:int"/>
<xsd:element name="overlap" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>

<xsd:element name="defaultChannels">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="default2g" type="xsd:int" minOccurs="0"/>
<xsd:element name="default5g" type="xsd:int" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<!-- Define algorithm override lists -->
<xsd:element name="override">
<xsd:complexType>
<xsd:sequence>
<xsd:element ref="override2g" minOccurs="0"/>
<xsd:element ref="override5g" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="override2g">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="category" type="overrideCategory2g" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="channel" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:element name="override5g">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="category" type="overrideCategory5g" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="channel" type="xsd:int" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

<xsd:simpleType name="overrideCategory2g">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="all"/>
</xsd:restriction>
</xsd:simpleType>

<xsd:simpleType name="overrideCategory5g">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="all"/>
<xsd:enumeration value="20Mhz"/>
<xsd:enumeration value="40Mhz"/>
<xsd:enumeration value="80Mhz"/>
<xsd:enumeration value="160Mhz"/>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>

#### Example XML table

The following is an example XML lookup table:

<table>
<!-- Entry using algorithm parameters -->
<entry>
<rat>LTE</rat>
<band>40</band>
<powerCapDbm>50</powerCapDbm>
<params>
<neighborThresholds>
<wifiVictimMhz>25</wifiVictimMhz>
<cellVictimMhz>40</cellVictimMhz>
</neighborThresholds>

<harmonicParams2g>
<N>3</N>
<overlap>50</overlap>
</harmonicParams2g>

<harmonicParams5g>
<N>3</N>
<overlap>50</overlap>
</harmonicParams5g>

<intermodParams2g>
<N>-2</N>
<M>1</M>
<overlap>75</overlap>
</intermodParams2g>

<intermodParams5g>
<N>-2</N>
<M>1</M>
<overlap>75</overlap>
</intermodParams5g>

<defaultChannels>
<default2g>6</default2g>
<default5g>36</default5g>
</defaultChannels>
</params>
</entry>
<!-- Entry using the override list -->
<entry>
<rat>LTE</rat>
<band>41</band>
<powerCapDbm>50</powerCapDbm>
<override>
<override2g>
<channel>6</channel>
<channel>11</channel>
...
</override2g>
<override5g>
<category>40Mhz</category>
<channel>34</channel>
...
</override5g>
</override>
</entry>
</table>

### Carrier aggregation

For carrier aggregation (CA), the harmonic/intermodulation ranges for each uplink/downlink might not produce enough overlap to cause interference independently, but might produce enough overlap when combined. The algorithm considers each harmonic/intermodulation range independently and takes the union of the returned unsafe channels. For the intermodulation case, this means assessing the intermodulation range of every UL onto every DL.

The algorithm makes no distinction between PCELL/PSCELL/SCELLs and treats them as equal.

License Assisted Access (LAA) is identified as band #46. The algorithm treats this band similar to other bands. In this case, the full 5Ghz channels can be set as an override list in the lookup table.

Depending on carrier requirements, the channel avoidance algorithm sets mandatory restrictions on SoftAP and Wi-Fi Direct (P2P) for the entire 5GHz Wi-Fi band. For the algorithm to handle this use case, the carrier config value restrict_5g_softap_wifi_direct_for_laa must be defined. If the cell channel is on LAA and restrict_5g_softap_wifi_direct_for_laa is true, the algorithm returns the set of unsafe channels with the entire 5Ghz band and sets the mandatory restriction flags for SoftAP and Wi-Fi Direct (P2P).

## Informing Wi-Fi service

After the coex channel algorithm has calculated the unsafe channels, to provide your system apps with the unsafe channels and their restrictions, use the following @SystemApi data structure defined in the Android framework.

public final class CoexUnsafeChannel {
public static final int POWER_CAP_NONE
public @WifiAnnotations.WifiBandBasic int getBand();
public int getChannel();
// Returns the specified power cap in dBm, or POWER_CAP_NONE if not specified.
public int getPowerCapDbm();
}

Use the following WifiManager @SystemApi methods and callback to enable the apps to get updated values when the unsafe channels change.

public static final int COEX_RESTRICTION_WIFI_DIRECT;
public static final int COEX_RESTRICTION_SOFTAP;
public static final int COEX_RESTRICTION_WIFI_AWARE;

// Register a CoexCallback to listen on onCoexUnsafeChannelsChanged callbacks. The callback will be called whenever the unsafe channels change, as well as immediately after registering to get the current values.
public void registerCoexCallback(Executor executor, CoexCallback callback);
public void unregisterCoexCallback(CoexCallback callback);

public abstract static class CoexCallback {
//Gets called whenever getCoexUnsafeChannels()/getCoexRestrictions() have updated values
public void onCoexUnsafeChannelsChanged(List<CoexUnsafeChannels> unsafeChannels, int restrictions);
}

## Performing Wi-Fi action

When the Wi-Fi service receives information about the set of unsafe channels, it performs the appropriate action to ensure that those channels are avoided. This section describes the behavior of the Wi-Fi service in different scenarios.

### Informing the driver

Because the driver has a major role in performing channel avoidance, it's essential to convey the unsafe channels to the driver and firmware. To do this, use the 1.5::IWifiChip HAL API.

setCoexUnsafeChannels(vec<CoexUnsafeChannel> unsafeChannels,
bitfield<IfaceType> restrictions);

### SoftAP

SoftAP is the main use case for unsafe channel avoidance. The following section outlines the key SoftAp scenarios where channel avoidance can be applied with ACS. The scenarios describe the behavior of the channel avoidance algorithm and the driver or firmware.

#### Starting SoftAP with ACS enabled (no SoftAP is up yet)

1. If channels are unsafe and there is a SoftAP restriction

1. The framework removes unsafe channels from the ACS list.
2. If the list is empty, the framework stops SoftAP.
2. If channels are unsafe and there are no restrictions

1. The vendor driver/firmware gives priority to the safe channels over the unsafe channels.

#### SoftAP is up with ACS enabled and unsafe channels are updated

1. If the SoftAP channel is unsafe and there's a SoftAP restriction

1. The framework updates the ACS list by removing the unsafe channels.
2. If the list is empty, the framework closes SoftAP.
2. If the SoftAP channel is unsafe and there are no restrictions

1. No action is taken by the framework. The vendor driver/firmware handles avoiding the unsafe channels or applying the power cap if avoidance isn't feasible.

### Wi-Fi Direct (P2P)

1. If there are unsafe channels with Wi-Fi Direct (P2P) restrictions.

1. The framework requests wpa_supplicant to avoid the unsafe channels using the HAL method ISupplicantP2pIface::setDisallowedFrequencies().
2. If there are unsafe channels without restrictions.

1. The vendor driver/firmware applies the power cap if an unsafe channel without Wi-Fi Direct (P2P) restriction is used.

### Wi-Fi Aware (NAN)

The framework isn't involved in channel selection for Wi-Fi Aware (NAN) and no framework action is taken. The vendor driver/firmware is responsible for Wi-Fi Aware (NAN) channel avoidance.

## Disabling the algorithm

If you want to disable the default algorithm implementation and pass your own list of unsafe channels for avoidance, configure the overlay config_wifiDefaultCoexAlgorithmEnabled. If the overlay is set to false, the default algorithm is disabled. You can then use your own out-of-band proprietary algorithm to generate a list of unsafe channels to plumb to the framework using the following system API.

public void setCoexUnsafeChannels(Set<CoexUnsafeChannel> coexUnsafeChannels,
int coexRestrictions);

## Validating the implementation

To validate your implementation of the Wi-Fi/cellular coex channel avoidance feature, use the following tests.

### CTS tests

• WifiManagerTest.java

• testCoexMethodsShouldFailNoPermission()
• testListenOnCoexUnsafeChannels()

### ACTS tests

• WifiManagerTest.py

• test_set_get_coex_unsafe_channels()

### VTS tests

• wifi_chip_hidl_test.cpp

• TEST_P(WifiChipHidlTest, setCoexUnsafeChannels)
[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]


text:
# Tag Info

0

There are a number of Machine Learner explainers and diagnostics. Let's set up a sample problem. Mnist is a fair dataset, so let’s first use a random forest to describe it, and then vivisect the learner to understand what, why, and how it works. Here is code for mnist using h2o.ai: Here is how it did. The fastai example uses (note: this answer is mid-edit)

1

This approach makes some sense but it's not the best approach for several reasons. First, this control variable might not always be last in importance because it's possible that some other variable also don't have any impact at all on the target variable (outcome). More importantly, the concept of a control group/control variable is useful in cases where one ...

0

First you have to understand what are those records. What is the mean of each number from the sensor. If the order of each number is useful or useless. Then, you have to determine the number of input you've got, and how to make them more comprehensive. And then, you've got to build a classification. But, in those kind of case, I think it would be imbalanced. ...

0

Well, sometimes the features simply do not provide enough information to get 100% accuracy (like in your case), even with a model a flexible as the Decision Tree. The Decision Tree works by trying to split the data using condition statements (e.g. A < 1), but how does it choose which conditional statement is best? Well, we want the splits (conditional ...

1

I tried with different features: in one dataset with less features engineering, i.e., using only features from Text, I got a maximum value of F1-score equal to 68%. With more features, that I thought to be significant for improving the model, I am getting max 64%, that is weird considering the problem (email classification for spam detection). Typically ...

1

About the question whether to scale only a subset of features, I would tell you to do it over all the features (at least the continuous numeric ones) since the goal of data-scaling is to put these data on the same "reference scale" to be fairly compared. Nevertheless, having mixed data types (continuous numerical, categorical...) for your ...

0

So based on the definition we need to find $2^n$ arrangements that can be shattered by a linear boundary, which you have shown in the figure. Therefore, it does not matter if there are other arrangements that cannot be shattered. For $n = 4$ we cannot find $2^n = 16$ arrangements that can be shattered by a linear boundary hence we say we cannot shatter $4$ ...

0

Well, sometimes the features simply do not provide enough information to get 100% accuracy (like in your case), even with a model a flexible as the Decision Tree. The Decision Tree works by trying to split the data using condition statements (e.g. A < 1), but how does it choose which condition statement is best? Well, it does this by measuring the "...

0

@Erwan probably gave you a better idea, but for a simpler problem, when each token has a separate class, this can be viewed as a Part of Speech Tagging, which is essentially a per-token multiclass problem. This assumes each token can be mapped only to one correct class. In such case the LSTM's output would be size, e.g. (1, seq_length, hidden_dim), which you ...

0

If in each file the letters are spoken separately, with silence in between, and always in the same order (A,B...,Z) then one can try to automate finding each section and its label. Use a Voice Activity Detection (VAD) module to detect each spoken character. Then assign A to the first voiced area, B to the next etc. If you have very clean and uniform audio, ...

0

There are several different ways to frame the problem. One way is multiclass classification. The goal would be to assign a single discrete label to every phrase. In order to get phrases, you'll have to build a parse tree first. You did not list of all of the labels but let's assume they are all nouns. Then you'll need a Part-Of-Speech Tagger (POS Tagger) to ...

0

Generally, feature selection is somewhat of a fuzzy process. Since you usually don't have a ground truth in predicting biology, you will always have to consider how realistic whatever you came up with is. I would recommend to start with the most simple method and see how your model performs. After establishing this as a baseline, you can then explore other ...

1

Misclassification error will not help in splitting the Tree. Reason-We consider the weighted dip of error from parent Node to the child node and misclassification error will always result in 0(Other than pure splits). Let's consider an example Data = 1, 1, 0, 1, 0, 1, 0, 1, 0, 1 Parent Classification error= 4/10 = 0.4 Parent Gini Impurity = 1-(0.4x0.4+0.6x0....

1

Technically this is sequence labeling, the most common application being Named Entity Recognition. However it looks like in this case you're trying to solve a problem of coreference resolution, which is a quite difficult task in general. I think this usually involves a more complex model than simple sequence labeling, but I'm not an expert in this. You might ...

1

have you already tried using only very little of the -ve cases? So for example to train your model on 900 points total, 600/300? Then stratified sampling should still work fine. Then I'd evaluate your model based on it's ability to predict -ve cases and just monitor the performance it get's on the (in your case) gigantic test dataset that the model hasn't ...

0

Since I only had a gut feeling about this, I decided to implement it in code. For this, I followed the method described at https://victorzhou.com/blog/gini-impurity/. Generally, calculating the GI provides you with a metric for which you don't have to know the underlying distribution which I think is the reason why your example works. Generally, my ...

1

There are some distance/dissimilarity functions for two binary/boolean vectors such as Jaccard distance and Hamming distance. You can check them from scipy's documentation. You can calculate similarities between two boolean columns by using these distance functions. from scipy.spatial import distance distance.hamming([1, 0, 0], [0, 1, 0]) 0....

0

In general, the further away the green line is from the red line, the more the model is overfitting, however eventually enough data will cure all overfitting (there will be so much data the model can't possibly memorize all of it), and that's why the lines converge to being together (stops memorizing, red line goes down, starts generalising, green line goes ...

0

I over complicated the answer I was looking for. If you have the equation of the hyperplane, you can test it against each point in the dataset. If all points of class 1 are ALL (above or below) the intercept and the converse is true for all points of class -1. Then the hyperplane separates the two classes

0

The solution for my problem was implementing Batch Renormalization: BatchNormalization(renorm=True). In addition normalizing the inputs helped a lot improving the overall performance of the neural network.

1

i did it using matplotlib by showing the percentage of each country [ target class] is taking ratio is almost 62:18:19 which shows its a balanced data set if u want the proper code comment down

1

Answering your questions, it is important to remember that this kind of transformations, in this case the change in the minority class distribution by oversampling or in the majority class by undersampling, must be only done in the training dataset, so you do not alter the real situation when you want to apply your model (which, at training time, is your ...

1

Do the undersampling after the train/test split and only in the train split: you want to somehow "weigth" your learning algorithm in order to prevent it to be biased towards the majority class, indeed, other techniques can be applied, and always on the train split, what eventually is the data for the learning algorithm. But... your test set should ...

1

The fact that a feature has low correlation with the target variable shows that it's not a good indicator on its own, but that doesn't mean that it can't be useful for the model when combined with the other features. The only way to know if these features are useful is to use them to train a model, then evaluate on a validation set and see if it improves ...

1

I will raise several issues that could arise if you are selecting features based on chi-2 tests Repeated use of chi-2 test can lead to spurious results unless you correct for the number of times you run it You can include features that are correlated with each other, i.a. A is correlated with B, and both are correlated with label. Not sure, but I think, ...

4

What this shows is that the protocol is not a very discriminative feature: the probability of class 1 given http is 10/(109+10)=0.084 the probability of class 1 given https is 180/(180+1560)=0.103 If these conditional probabilities were very different this feature would be more helpful to predict the class, but they differ only slightly. Note that the ...

1

A common approach is what you suggest in 1. - apply time-shift as a Data Augmentation strategy. The augmentation is generally beneficial with deep learning models, and GPUs are fast so the compute time is rarely a big problem. Another strategy, less common, would be to make sure that the event is always located at the same position inside the analysis window ...

1

Correct, all categorical features should be encoded into binary digits so ML algo have more predictive power as categorised features cannot have order or magnitude ( be careful also about multicollinearity if you use regression) Some ML framework such as Catboost automatically encode features for you if you specify the feature index. I also like using ...

0

Please, edit your figure to be more concise... adding axis labels will help a lot. I guess Y-axis is the target label, and X-axis is one of the nine parameters. But looking at the plot, I wondering if you are plotting the labels of a dataset with more than 10K samples... Anyway, regarding the scatter plot of your nine parameters, which I belive they are the ...

0

Have a look at the comment in that notebook: # Define preprocessing for categorical features (encode the Age column) It seems that the data you have is different (maybe only in order) to what is used in the notebook as the Age column is the eigth column (index seven) in the notebook. See also the cell where data is selected from the input file: # Separate ...

0

using lstm or rnn's for time series data is like using a hammer to swat a fly. have you tried time series modeling using classical stat techniques ARCH, ARIMA etc ? the issue of using individual number as inputs (which is what your speedometer is going to give you) means that the states in each lstm / gru cell or unit will have like a 1x1 matrix , meaning 1 ...

0

Gated recurrent units (GRUs) is an advanced version of RNN and LSTM. It has less time complexity and good prediction results than LSTM ann RNN. You can use it for dealing with time series dataset. You can boosted it performance by combining advanced version 1D CNN like ResNet, etc.

1

The learning rate is one of those first and most important parameters of a model, and one that you need to start thinking about pretty much immediately upon starting to build a model. It controls how big the jumps your model makes, and from there, how quickly it learns. There are learning rate technique called Cyclical Learning Rates. Training with cyclical ...

0

Creating a new variable as you described would be redundant as it is a function of the other two variables. In other words it is not adding any information. The below suggestion assumes the model cannot deal with missing values, but a lot of the best models (ex. xgboost is typically one of the best for classification) will deal with this in a smart way for ...

0

Every Tree gets its OOB sample. So it might be possible that a data point is in the OOB sample of multiple Trees. oob_decision_function_ calculates the aggregate predicted probability for each data points across Trees when that data point is in the OOB sample of that particular Tree. The reason for putting above points is that OOB will give you the mean of ...

1

First of all, I do not think you need a DNN if task is as simple as you are describing it. There will be lot of digital image processing solutions or maybe check opencv-python (cv2). But, if you are particularly interested in DNN, I would suggest starting with Keras. According to me it should not be too tough to perform this task as CNN can do complex jobs ...

0

You can look at this article. Helmreich, James & Pruzek, Robert. (2008). PSAgraphics: An R Package to Support Propensity Score Analysis. Journal of Statistical Software. 29. 10.18637/jss.v029.i06. In section three, they show an example of how you can estimate propensity scores and stratify the data based on them. There is also a good example in Valliant, ...

0

import numpy as np import matplotlib.image as img import matplotlib.pyplot as plt from skimage.metrics import structural_similarity as ssim def rgb2gray(rgb): return np.dot(rgb[...,:3], [0.299, 0.587, 0.144]) full_image = rgb2gray(img.imread("img/full_image.png")) sub_image = rgb2gray(img.imread("img/sub_image.png")) full_w,full_h =...

Top 50 recent answers are included


text:
# Solve $\log_{7}{\log_{5}{\sqrt{x+5}+\sqrt{x}}} \,=\, 0$

The logarithm of the logarithm of square root of $x$ plus $5$ plus square root of $x$ to the base $5$, to the base $7$ equals to zero is the given logarithmic equation in this problem.

$\log_{7}{\Big(\log_{5}{\big(\sqrt{x+5}+\sqrt{x}\big)}\Big)}$ $\,=\,$ $0$

The value of the variable $x$ is unknown in this equation and it should be solved in this logarithmic equation problem. So, let’s learn how to find the value of the variable $x$ by solving this logarithmic equation.

### Remove the Logarithms from the equation

The logarithmic form in the equation initially creates the hurdles for solving the equation. Therefore, eliminating the logarithmic form is a recommendable trick for solving the given logarithmic equation. It can be done by using the mathematical relationship between logarithms and exponents.

$\implies$ $\log_{5}{\big(\sqrt{x+5}+\sqrt{x}\big)}$ $\,=\,$ $7^{0}$

According to the zero power rule, seven raised to the power of zero is equal to one.

$\implies$ $\log_{5}{\big(\sqrt{x+5}+\sqrt{x}\big)}$ $\,=\,$ $1$

### Eliminate the Logarithm completely from equation

The logarithm is still involved in the equation with base five. So, use the relation between the logarithms and exponents one more time for completely removing the logarithm from the equation.

$\implies$ $\sqrt{x+5}$ $+$ $\sqrt{x}$ $\,=\,$ $5^1$

### Solve the irrational equation by simplification

The given logarithmic equation is successfully converted into an irrational equation by releasing the equation from the logarithms.

$\implies$ $\sqrt{x+5}$ $+$ $\sqrt{x}$ $\,=\,$ $5$

Look at the algebraic expression on the left hand side of the equation. It is completely in irrational form and this irrational form creates problem for finding the value of the variable $x$. So, it is recommended to eliminate the irrational form from the equation.

Shift the square root of $x$ from the left hand side to right hand side of the equation by transposition for initiating the process of eliminating the irrational form the equation completely.

$\implies$ $\sqrt{x+5}$ $\,=\,$ $5-\sqrt{x}$

Take the square for the both expressions in order to try to eliminate the square root from the equation.

$\implies$ $(\sqrt{x+5})^2$ $\,=\,$ $(5-\sqrt{x})^2$

$\implies$ $x+5$ $\,=\,$ $(5-\sqrt{x})^2$

On the right hand side of the equation, expand the square of difference of the terms by using the square of difference rule.

$\implies$ $x+5$ $\,=\,$ $5^2$ $+$ $(\sqrt{x})^2$ $-$ $2 \times 5 \times \sqrt{x}$

Now, simplify the mathematical equation in algebraic form by transposing.

$\implies$ $x+5$ $\,=\,$ $25$ $+$ $x$ $-$ $10\sqrt{x}$

$\implies$ $10\sqrt{x}$ $\,=\,$ $25$ $+$ $x$ $-$ $x$ $-$ $5$

$\implies$ $10\sqrt{x}$ $\,=\,$ $25$ $-$ $5$ $+$ $x$ $-$ $x$

$\implies$ $10\sqrt{x}$ $\,=\,$ $20$ $+$ $\cancel{x}$ $-$ $\cancel{x}$

$\implies$ $10\sqrt{x}$ $\,=\,$ $20$

$\implies$ $10 \times \sqrt{x}$ $\,=\,$ $20$

$\implies$ $\sqrt{x}$ $\,=\,$ $\dfrac{20}{10}$

$\implies$ $\sqrt{x}$ $\,=\,$ $\dfrac{\cancel{20}}{\cancel{10}}$

$\implies$ $\sqrt{x}$ $\,=\,$ $2$

The equation is successfully simplified by it is still in irrational form. So, use the same technique to eliminate the irrational form the equation by taking square on both sides.

$\implies$ $(\sqrt{x})^2$ $\,=\,$ $2^2$

$\,\,\,\therefore\,\,\,\,\,\,$ $x$ $\,=\,$ $4$

Latest Math Problems

A best free mathematics education website for students, teachers and researchers.

###### Maths Topics

Learn each topic of the mathematics easily with understandable proofs and visual animation graphics.

###### Maths Problems

Learn how to solve the maths problems in different methods with understandable steps.

Learn solutions

###### Subscribe us

You can get the latest updates from us by following to our official page of Math Doubts in one of your favourite social media sites.