Vincenty's Formula - geodesic-sphere

I have been researching about Vincenty's formula for my research but through many books and websites I didn't find any explanation about the definition of upper case A, upper case B and u square . From the Reddit they say that it's an intermediate terms but my teacher wants a definition about its meaning. Does someone knows what are there meaning? Or what can I write for define each symbol? Thanks
https://imgur.com/a/ku8sk0H
These are the some websites that I have read:
https://www.ngs.noaa.gov/PUBS_LIB/inverse.pdf
https://www.movable-type.co.uk/scripts/latlong-vincenty.html

Related

java- Big O Notations

So, I have tried to solve some big o questions and I had some troubles with some of them. I don't quite understand them.
like for eg the dominant term of 10MlogM + (N/2) log (N/2) + N/4
and M log (N) + M log (M ). I have trouble understanding big o expressions with 'log' in them. Any help would be appreciated and thanks in advance.
I have trouble understanding big o expressions with 'log' in them
It's quite easy to understand Big-O of log (or any function) if we draw its graph:
Now since you are facing an equation having multiple terms (and one of them is log), so maybe it would confuse you out. If we plot first term (I assume its NlogN and discard the constant (10)):
Similarly for other term (N/2 * log(N/2)):
I am sure you will already know, but this graph easily demonstrates that only major term (N logN) defines the Big O (as its just to show the upper bound of function) as I plot the graph of whole function:
What does N log N mean
This link provides very good explanation with this example:
O(n log n): There was a mix-up at the printer's office, and our phone book had all its pages inserted in a random order. Fix the ordering so that it's correct by looking at the first name on each page and then putting that page in the appropriate spot in a new, empty phone book.
For the below examples, we're now at the printer's office. Phone books
are waiting to be mailed to each resident or business, and there's a
sticker on each phone book identifying where it should be mailed to.
Every person or business gets one phone book.
O(n log n): We want to personalize the phone book, so we're going to
find each person or business's name in their designated copy, then
circle their name in the book and write a short thank-you note for
their patronage.

Show whether f is Big Oh of g with logarithmic equations

Hello, how would you do whether f is Big Oh of g. I know how to do this for simple exponential functions but when it comes to logs, I have no idea what to do. Can anyone help?
You should use the properties of the logarithm. For example, for your second case, you can use the fact that:
So in big O notation:
Regarding the first case, my advice is to read this document, specially the section 4, labeled "Growth Rate of Standard Functions", where you will find a bullet titled "Any polylog grows slower than any polynomial".

Telephone book algorithm

This is an exam practice question i've been working on, i know of methods to do this but as the question states i don't know which would be the most efficient.
You
are
given
a
telephone
book
listing
the
surnames
of
people
in
alphabetical
order.
Describe
the
fastest
method
(clearly
explain
what
you
have
to
do)
you
can
use
to
find
a
given
surname.
If
there
are
n
people
listed
in
the
telephone
book,
what
is
the
Big
O
complexity
of
your
fastest
method
(and
explain
why)?
In this case you know the phone book entries are in order already. This means that a binary search is probably your best bet. This search works by cutting the number of entries to search in half on each iteration. It only works if your data is already sorted however. Check out this website for time complexity in Big O notation: http://bigocheatsheet.com
Edit wording

About an exercise appearing in TAOCP volume one's "Notes on the Exercises"

There is a question in TAOCP vol 1, in "Notes on Exercises" section, which goes something like:
"Prove that 13^3 = 2197. Generalize your answer. (This is a horrible kind of problem that the author has tried to avoid)."
Questions:
How would you actually go about proving this ? (Direct multiplication is one way, another way could be using formula of (a+b)^3). Does the solution requires using some method that will allow us to make some kind of generalization ?
What is the generalization here ?
Why is this a horrible kind of problem ?
What are some other kind of similar horrible problems that you are aware of ?
Appreciate any answers.
P.S. I apologize if the statement of problem above makes it look like a homework problem, but its not. Request people to not tag this as a homework problem, so that more people can give answers.
I'd guess that he's alluding to perhaps proving it starting from just the Peano axioms. Then constructing the integers, and going on to formally show that 13^3 = 2197 is a natural, logical conclusion that flows from the definition of exponentiation.
We could generalize to show that given an a and b, there exists some integer c, that is a^b.
This is a horrible kind of a problem because most people find it uninteresting.
Similar sorts of problems can be found in a course on analysis (along with some greatly more interesting).
I initially considered it as follows:
n3 = n * n * n
logn(n3) = logn(n*n*n)
logn(n3) = logn(n) + logn(n) + logn(n)
3 = 1 + 1 + 1
3 = 3
This seems fairly circular in its use of logarithmic identities, but given where I'm at in my algorithms research, it was oddly comforting.
Got stuck at the same exercise and 'solved' it this way:
a^b = mult(i=1 to b) a
After a bit of thinking I came to the conclusion that this is a prime factorization (both 13 and 3 are primes). Look up fermat's little theorem.
(I know, it's an old thread but maybe this'll help somebody who is also seeking an answer to this execise.)

Algorithm for best suiting people's choices from a definite list of items where there is only one of each available?

Ladies and Gents,
My best friends and I do a "Secret Santa" type gift exchange every year, this year I've been trying to think of a couple of ways to make it interesting. There are six of us involved and I want to design a small program that allows the six of us to rank their preferred gift-recipients from 1 to 5 as well as their preferred gift-givers.
So, let's say we're called A, B, C, D, E and F.
A submits two lists:
List 1 - People I would most like to give a present to: B, D, C, F, E
List 2 - People I would most like to recieve a present from: F, D, E, B, C
All six of us will submit both these lists, so I'll have 12 lists all together. I suppose my question is what is the best algorithm to now go ahead and assign each person a gift recipient?
I thought of something like this:
If two people have both selected each other in their opposing lists (i.e. A most wants to give to B, B most wants to get from A) then I immediately assign A to B. So now A is removed from our list of gift-recipients and B is removed from our pool of gift-givers.
Once I've assigned the "perfect matches" I'm kind of lost though, is there an establish algorithm for situations like this? Obviously it's only for entertainment value but surely there must be a "real" application of something similar? Perhaps timetabling or something?
My Google-fu has failed me but I have a feeling it might just be due my own lack of precision in search terms.
Cheers,
(and Happy Holidays I guess),
Rob
Update / Part 2
Okay, Ying Xiao came to the rescue by recommending the Gale Shapley Algorithm for the Stable Marriage Problem and I've implemented that in Python and it works a treat. However, this is just a thought that occurred to me. I guess within our group of six best friends there are three pairings of "extra-best" friends so I have a feeling we'll just end up with three pairs of AB, CD, EF and BA, DC, FE in terms of gift giving and recieving.
Is there an algorithm we could design that did take peoples rankings into account but also restricted two people forming a "closed group"? That is, if A is assigned to buy a gift for B, B can not be assigned to buy a gift for A? Perhaps I need to solve the Stable roommates problem?
Related questions:
Secret santa algorithm.
What is the best low-tech protocol to simulate drawing names out of a hat and ensure secrecy?
The Gale-Shapley algorithm (for the Stable Marriage problem) applies only when each person has a ranked list of all other participants -- you may or may not be able to convert your problem to that form (make everyone rank everyone).
Also, note that the thing it is optimizing for is something different: it tries to find a set of stable marriages, where no pair of people will "elope" because they prefer each other to their current partners. This is not something you care about in your Secret Santa application.
What you want (depending on your definition of "best") is a maximum-weight bipartite matching, which fixes both the above objections: put the "givers" on one side, the "receivers" on the other (so two copies of each person, in this case), give each edge a weight corresponding to how highly that giver ranks that receiver, and it is now the assignment problem. You can use the Hungarian algorithm for this, or simpler (slower) ones. You can also vary how you assign the weights to optimize for different things (e.g. maximize the number of people who get their first choice, or minimize the worst choice that anyone gets, etc.)
If you do use the Gale-Shapley stable marriage algorithm, note that it is optimal for the "proposers" (male-optimal and female-pessimal), so be sure to put the "givers" as the "proposers", and not vice versa.
For each person, create two virtual people, a "giver" and a "receiver". Now match the set of givers against the set of receivers using the Gale Shapley Algorithm. Runs in O(n^2) time.
http://en.wikipedia.org/wiki/Stable_marriage_problem

Resources