text:
# 12.1. Representing Sets via Binary Search Trees¶

• File BST.ml

Binary Search Trees (BSTs) are one of the most versatile representations of mutable sets of ordered elements, supporting a variety of operations, such as insertion, deletion, checking membership, finding minimums, maximums, predecessors and successors of a value — all those operations taking the time proportional to the height $$h$$ of the tree or, if the tree is constructed randomly out of $$n$$ elements — $$O(\log n)$$. This makes BST a superior alternative to lists, heaps, and even hash-tables when impelmenting mutable sets with a number of standard set operations.

The key to this expressivity and efficience is the invariant of a tree-shaped data structure, that mandates that, for any node q,

• any element in its left subtree q.l is less or equal (with respect to a certain total order) than the element in the node q itself, and
• any element in its right subtree q.r is greater or equal than the element in the node q itself.

This invariant is maintained by all operations that modify the set, and is relied upon by all its queries. The logarithmic complexity of operations, thus, follows from the intuition similar to the one powering Binary Search in arrays.

## 12.1.1. A Data Structure for Binary-Search Trees¶

We start by defining a linked in-memory data structure for BSTs in its own module.

The tree is populated by nodes, each of which carries a value (immutable), and also maintains references (mutable) to its left/right children and a parent, which can be either absent or refer to some other nodes of the tree:

module BinarySearchTree = struct

type 'e tree_node = {
value : 'e;
parent  : 'e tree_node option ref;
left  : 'e tree_node option ref;
right  : 'e tree_node option ref;
}

type 'e tree = {
root : 'e tree_node option ref;
size : int ref
}

(* More definitions coming here *)

end

For convenience, we define several operations to dereference various components of a tree and its nodes:

let left n = !(n.left)
let right n = !(n.right)
let parent n = !(n.parent)
let get_root t = !(t.root)
let get_size t = !(t.size)

let mk_node e =
{value = e;
parent = ref None;
left = ref None;
right = ref None}

let mk_tree _ = {root = ref None; size = ref 0}

Finally, since nodes are represented by an option type, we introduce the following combinator, simplifying working with option-wrapped values:

let map_option o f z = match o with
| None -> z
| Some n -> f n

In words map_option returns applies f to the value n within o, if o = Some n, or returns z otherwise.

## 12.1.2. Inserting an element into a BST¶

The defined above mk_tree function creates an empty tree. Let us now implement a procedure for populating it with elements by inserting them one by one:

let insert t e =
let rec insert_element n e =
let m = mk_node e in
if e < n.value
then match left n with
| Some m -> insert_element m e
| None ->
m.parent := Some n;
n.left := Some m;
true
else if e > n.value
then match right n with
| Some m -> insert_element m e
| None ->
m.parent := Some n;
n.right := Some m;
true
else false
in
match !(t.root) with
| None -> (
t.root := Some (mk_node e);
t.size := 1;
true)
| Some n ->
if insert_element n e
then (t.size := !(t.size) + 1; true)
else false

Notice that the main working routine insert_element respects the BST property defined above: it positions the node m with the element e, so it would be in the correct subtree (smaller-left/greater-right) with respect to its parent nodes. Finally, insert_element returns a boolean to indicate whether the element has been indeed added (true) or ignored as duplicated (false). In the former case the size of the tree is increased, in the latter it remains the same.

## 12.1.3. Binary-Search-Tree Invariant¶

Let us now assert that tree-manipulating operations such as insert indeed preserve the discussed above BST property. For this, let us define the BST invariant in the form of the following function:

let check_bst_inv t =
let rec walk node p =
(p node.value) &&
let res_left = match left node with
| None -> true
| Some l -> walk l (fun w -> p w && w <= node.value)
in
let res_right = match right node with
| None -> true
| Some r -> walk r (fun w -> p w && w >= node.value)
in
res_left && res_right
in
match !(t.root) with
| None -> true
| Some n -> walk n (fun _ -> true)

The main recursive sub-function walk works by “growing” a predicate p that applies to each node further down the tree, making sure that it is correctly positioned with regard to all its parents. At the top level p is instantiated with (fun _ -> true), as there are no restrictions imposed for the root of the tree, but more and more conjuncts added, as the checking proceeds recursively.

## 12.1.4. Testing Tree Operations¶

Let us put or invariant to work by using it to test the correctness of insert.

We do so by first defining a function for generating random trees from random arrays via insertion:

open BinarySearchTree

let mk_tree_of_size n =
let t = mk_tree () in
let a = generate_key_value_array n in
for i = 0 to n - 1 do
insert t a.(i)
done;
t

Next, we check that the generated trees indeed satisfy the BST property:

let%test "Testing insertion" =
let n = 1000 in
let t = mk_tree_of_size n in
check_bst_inv t

## 12.1.5. Printing a Tree¶

It would be very nice if we could not only test but also visualise our binary search trees.

Unfortunately, printing a tree in a standard top-down fashion requires quite a bit of book-keeping of tree-specific information. Printing a tree left-to-right is, however, can be done quite easily as follows:

let print_tree pp snum t =
let print_node_with_spaces l s =
for i = 0 to s - 1 do
Printf.printf " "
done;
print_endline (pp l.value);
in

let rec walk s node = match node with
| None -> ()
| Some n -> begin
walk (s + snum) (right n);
print_node_with_spaces n s;
walk (s + snum) (left n);
end

in
map_option (get_root t) (fun n -> walk 0 (Some n)) ()

The first auxiliary function print_node_with_spaces prints a string of s spaces and the value of a node l.

The second function walk traverses the tree recursively, accumulating the “offset” proportionally to the depth of the tree node. It first prints the right sub-tree, then the node itself and then the left sub-tree, making use of the accumulated offset for printing the necessary number of spaces. Finally, it runs walk for the top-level root node, if it exists.

Let us observe the effect of print_tree by instantiating it to print trees of key-value pairs:

let print_kv_tree = print_tree
(fun (k, v) -> Printf.sprintf "(%d, %s)" k v) 12

We can now use utop to experiment with it:

utop # open BST;;
utop # open BinarySearchTree;;
utop # let t = mk_tree ();;
val t : '_weak1 tree = {root = {contents = None}}
utop # let a =
[|(4, "ayuys"); (7, "cdrhf"); (4, "ukobi"); (5, "hwsjs"); (8, "uyrla");
(0, "uldju"); (3, "rkolw"); (7, "gnzzo"); (7, "nksfe"); (4, "geevu")|]
utop # for i = 0 to 9 do insert t a.(i) done;;
- : unit = ()
utop # print_kv_tree t;;
(8, uyrla)
(7, nksfe)
(7, gnzzo)
(7, cdrhf)
(5, hwsjs)
(4, ukobi)
(4, geevu)
(4, ayuys)
(3, rkolw)
(0, uldju)
- : unit = ()

That is, on can see that (4, "ayuys") is the root of the tree, and the whole structure satisfies the BST property.

## 12.1.6. Searching Elements¶

We define the search function so it would return not just the element, but also the node that contains it. It does so by recursively traversing the tree, while relying on its BST property:

let search t k =
let rec walk k n =
let nk = n.value in
if k = nk then Some n
else if k < nk
then match left n with
| None -> None
| Some l -> walk k l
else match right n with
| None -> None
| Some r -> walk k r
in
map_option (get_root t) (walk k) None

In the absence of the abstract module signature, it is quite dangerous to return a node (not just its value), as one can break the BST properties, by messing with its mutable components (e.g., reference to left/right children). However, returning a node also simplifies the implementation of various testing and manipulation procedures, specifically, deletion of tree nodes.

## 12.1.7. Tree Traversals¶

There are multiple ways to flatten a tree into a list, which can be convenient for the sake of testing and other inspections.

The simplest way to do it is via an accumulator (implemented as a mutable queue) and a procedure, known as Depth-First-Search (DFS), which traverses the tree recursively, following its order (sometimes, this travelsal is also called in-order traversal):

open Queues
open DLLBasedQueue

let depth_first_search_rec t =
let rec walk q n =
(match left n with
| Some l -> walk q l
| None -> ());
enqueue q n.value;
(match right n with
| Some r -> walk q r
| None -> ());
in
let acc = (mk_queue 0) in
map_option (get_root t) (walk acc) ();
queue_to_list acc

With the call stack, DFS traverses the tree in a Last-In-First-Out mode (LIFO). By replacing the implicit stack with an explicit mutable queue (First-In-First-Out, FIFO), we can obtain an alternative traversal, known as Breadth-First-Search (BFS), so it would accumulate tree elements by following its “layers”:

let breadth_first_search_loop t =

let loop wlist q depth =
while not (is_empty wlist) do
let n = get_exn @@ dequeue wlist in
(match left n with
| Some l -> enqueue wlist l
| _ -> ());
enqueue q n.value;
(match right n with
| Some r -> enqueue wlist r
| _ -> ());
done
in
let acc = (mk_queue 0) in
let wlist = mk_queue 0 in
(match get_root t with
| None -> ()
| Some n -> begin
enqueue wlist n;
loop wlist acc 0;
end);
queue_to_list acc

We can also define all elements of the set in terms of the traversal:

let elements t = breadth_first_search_loop t

## 12.1.8. Testing Element Retrieval and Tree Traversals¶

As we know well how to work with lists, we can use traversals to test each other, as well as the search function:

(******************************************)
(*          Testing traversals            *)
(******************************************)

let check_elem_in_tree t e =
let n = search t e in
(get_exn @@ n).value = e

let%test "Testing DFS" =
let n = 1000 in
let t = mk_tree_of_size n in
let l1 = depth_first_search_rec t in
List.length l1 = n &&
List.for_all (fun e -> check_elem_in_tree t e) l1 &&
sorted l1

let%test "Testing BFS" =
let n = 1000 in
let t = mk_tree_of_size n in
let l1 = depth_first_search_rec t in
let l2 = breadth_first_search_loop t in
List.length l1 = n &&
List.for_all (fun e -> List.mem e l2) l1 &&
List.for_all (fun e -> List.mem e l1) l2

(******************************************)
(*          Testing retrieval             *)
(******************************************)

let%test "Testing retrieval" =
let n = 1000 in
let t = mk_tree_of_size n in
let m = Random.int n in
let l = breadth_first_search_loop t in
let e = List.nth l m in
let z = search t e in
z <> None

## 12.1.9. More BST operations¶

Thanks to its invariant, a BST makes it almost trivial to implement operations, such as

• Getting minimum/maximum element in a set representing by a tree
• Find a successor/predecessor of an element

For instance, finding the minimal element of a subtree starting from a node n can be achieved by the following operation:

let rec find_min_node n =
match left n with
| Some m -> find_min_node m
| None -> n

Notice that this operation does not find the global tree-wise successor of the element in node n, although that is also possible to do in $$O(\log n)$$ operations for a tree that is well-balanced (i.e., not to “tall” and “thin”).

## 12.1.10. Deleting a node from BST¶

Deletion of a node from a BST is the most complicated operation, as it requires significant restructuring of the tree in order to maintain its invariant.

Deletion of a non-leaf node from a tree will require some other node (along with its subtree) to take its place. This can be achieved by the following operation for performing “transplantation” of one node by another:

(* Replacing node U by (optional) node V in T. *)
let transplant t u v =
(match parent u with
| None -> t.root := v
| Some p ->
match left p with
| Some l when u == l -> p.left := v
| _ -> p.right := v);
(* Update parent of v *)
match v with
| Some n -> n.parent := parent u
| _ -> ()

Notice the comparison via when u == l in the implementation above. This is essential: node references must be compared using OCaml’s “shallow” equality mechanism, as structural “deep” equality on references (=) in the case of linked data structures, such as BSTs, may lead to errors that are very difficult to debug.

Let us now discuss possible scenarios for removing a node z from the tree T by preserving the BST property.

1. The simplest case is when z is a leaf, so we can simply remove it.
2. The node z has no left child. In this case, we can simply replace it by its right child (argue, why this is correct) as on the picture below:
1. A similar situation takes place when z has only the left child, which replaces it (via transplant):
1. In the case when z has two children, we need to look up for the node that corresponds to its successor in z-rooted subtree wrt. the ordering of elements. In this particular case, such a successor, y, is the immediate right child of z that has no left child itself (convince yourself that in this case y is indeed a successor of z), therefore we can transplate y to replace z:
1. Finally, in the most nasty case, y, the successor of z (in its subtree), is buried deep below z, and potentially hasa right child (but no left child, otherwise it wouldn’t be the successor of z) . In this case we need to make to perform the transformation as follows:

Specifically, in the last case we first transplant y with its right child x and then make r, the former right child of z to be the right child of y. After that we simply transplant y to the place of z.

The full code of deletion is as follows:

let delete_node t z =
t.size := !(t.size) - 1;
if left z = None
then transplant t z (right z)
else if right z = None
then transplant t z (left z)
else
(* Finding the successor of z *)
let z_right_child = (get_exn @@ right z) in
let y = find_min_node z_right_child in
(* Fact: y has no left child *)

(if parent y <> None &&
z != get_exn @@ parent y
then
(*  If y is not immediately under z,
replace y by its right subtree *)
let x = right y in
(transplant t y x;
y.right := right z;
(get_exn @@ right y).parent := Some y));

(* Now y replaces z at its position *)
transplant t z (Some y);
y.left := !(z.left);
(get_exn @@ left y).parent := Some y

How would we test deletion? We can do so by generating a random BST, choosing a random node in it z, and then checking the following properties for the modified tree after the deletion of z:

• The tree still satisfies the BST invariant;
• It has the previous number of elements minus one;
• All elements from the modified tree plus the deleted one are the elements of the old tree.

These checks can be automatically performed by the following function, parameterised by the size of the tree:

let test_delete n =
let t = mk_tree_of_size n in
let m = Random.int n in
let l = breadth_first_search_loop t in
let e = List.nth l m in
let z = get_exn @@ search t e in
delete_node t z;
(* Checkign the tree invariant *)
assert (check_bst_inv t);

(* Checkign the tree size *)
let ld = breadth_first_search_loop t in
assert (List.length ld = n - 1);

(* Checking integrity *)
assert (List.for_all (fun x -> List.mem x ld || x == e) l)

## 12.1.11. BST Rotations¶

In a BST, left and right rotations exchange the node with its right/left child (if present), correspondingly. Diagrammatically, this can be represented by the following picture:

That is, via left rotation, $$y$$ becomes a parent of $$x$$ and vice versa. The implementation of left rotation of a node $$x$$ in a tree $$T$$ is given below:

let left_rotate t x =
match right x with
| None -> ()
| Some y ->

(* turn y's left subtree into x's right subtree *)
x.right := left y;
(if left y <> None
then (get_exn @@ left y).parent := Some x);

(* link x's parent to y *)
y.parent := parent x;

(match parent x with
| None -> t.root := Some y
| Some p -> match left p with
| Some l when x == l ->
p.left := Some y
| _ ->
p.right := Some y);

(* Make x the left child of y *)
y.left := Some x;
x.parent := Some y

When a subtree is rotated, the subtree side upon which it is rotated increases its height by one node while the other subtree decreases its height. This makes tree rotations useful for rebalancing a tree when it becomes “degenerate” (tall and thin). This makes it possible to keep the worst-case complexity of tree operations within $$O(\log n)$$, without it degenerating to $$O(n)$$.

Implementation of the right BST rotation and rotation testing of the rotations are left as an exercise.


text:
# Volcano Watch — Lights! Camera! Disaster!: Mixing fact and fantasy in the movies

Release Date:

Colossal natural disasters have been fodder for Hollywood movies long enough that we can recognize the basic recipe. A pinch of fact, a fistful of myth and exaggeration, and a large dose of spectacular special effects add up to an entertaining, but often preposterous disaster movie.

In the recent TV movie "10.5", an earthquake in the Pacific Northwest starts a chain reaction of ever-larger earthquakes propagating down the west coast, predicted to culminate in a magnitude 10.5 earthquake that will send much of California sliding off into the ocean. Luckily, an intrepid heroine saves the day by setting off nuclear devices to seal the fault and prevent the earthquake. Hard to find the pinch of fact in that storyline!

Is a magnitude-10.5 (M10.5) earthquake even possible? Theoretically, yes. Realistically, no. The strength of an earthquake depends primarily on the area of rupture, and there are no known faults anywhere near the size it would take to generate a "mega-quake" of magnitude greater than 10. The largest earthquake ever recorded was a M9.5 in 1960 on a fault almost 1,000 miles long in Chile.

One of the more amazing fantasies in the movie is the revival of the old myth that California will one day fall into the ocean - totally impossible. The ocean is not a hole that California can get swept into. In fact, southwestern California is part of the Pacific tectonic plate, as are the Hawaiian Islands. The boundary between the Pacific and North American plates is the San Andreas fault system, not the coastline. So southwestern California is riding along with the plate, as we are, northward about 46 millimeters (2 inches) per year. Unfortunately for Californians, the North American plate is moving southward, so the plates grind past each other along the San Andreas, building up stresses that are released through earthquakes.

Another fantasy is the idea that a nuclear explosion could seal a fault. People cannot prevent earthquakes from happening or stop them once they've started. Giant nuclear explosions at shallow depths won't stop an earthquake.

Every seismologist wishes he/she could, like the rebel scientist in the movie, predict the time, place, and magnitude of a future earthquake. Unfortunately, no one has that ability yet. Research into earthquake prediction continues, but, in the meantime, we can make long-range forecasts of the likelihood of earthquakes for specific locations. For example, scientists estimate that over the next 30 years the probability of a major earthquake occurring in the San Francisco Bay area is 62 percent.

Most people associate large earthquakes in the U.S. with the west coast of the mainland, but in fact the Big Island has as high a hazard from ground motion due to earthquakes as any area in the continental U.S.

The intensity of expected ground motion is based on the geology and history of earthquake activity of the region. Engineers and building-code developers use these site response models to improve the safety of structures. So while some of the most spectacular special effects in the movie had the Seattle Space Needle and the Golden Gate Bridge toppling, collapses of major public structures during an earthquake are not very likely in most of the United States.

While we can't stop earthquakes or predict exactly when they will occur, we can be prepared for them. We can minimize our risk by knowing and practicing how to stay safe during the next earthquake. For example, did you know that a doorway is no longer considered a safe place to be during the shaking? The safest place is actually under a sturdy table or desk, but even sitting next to an inside wall or lying down and holding on to a heavy piece of furniture will help reduce the likelihood of injury.

You can take simple steps to reduce earthquake damage in your home, such as securing your water heater and bolting bookshelves to the wall. http://www.earthquakecountry.info/roots/steps.html is one of many good sites on the internet that give advice on earthquake preparedness.

### Volcano Activity Update

Eruptive activity at Puu Oo continues. The Banana flow, which breaks out of the Mother's Day lava tube a short distance above Pulama pali, has moved to within 550 yards of the coastline. Early this week a flow moved steadily toward the ocean, but stagnated on Tuesday about 400 yards from the sea cliff. Many active flows along the coastal flat made spectacular lava viewing conditions this week. There is no eruptive activity in Puu Oo's crater except for sporadic minor spattering.

No earthquakes were reported felt on the island during the week ending May 13.

Mauna Loa is not erupting. The summit region continues to inflate slowly. Seismic activity remains low, with 2 earthquakes located during the past week.

format: plain


text:
## Sunday, 3 June 2007

The official RepRap project uses Microchip PIC micro controllers. I have done several projects at work with these because they have such a wide range of parts that they often have the best fit price wise. However, I have never liked them very much. They have a horrible instruction set which does not lend itself to running C efficiently. Also, the development kit is a bit primitive by today's standards. When doing a home project ease of use and development kit cost becomes more important than part price. I have been following the RepRap forums and people are having lots of problems with a buggy open source PIC compiler and programmer.

I recently did a project at work which needed a micro with a very low power consumption so we used a Texas Instruments MSP430 series micro. I was very impressed with the USB key development kit which only costs $20. For that you get an IAR C compiler, assembler, simulator and debugger. The instruction set of the chip is very small but has just the right instructions to run C efficiently and the C compiler does a good job of using them. The code size is limited to 4K but, as I am only using a 2K part, that doesn't matter. The USB key contains a programmer / "Spy Bi-Wire" in circuit debugger and a little detachable target board. The chip is surface mount but the target board brings all the pins out to a 0.1 inch header so you can incorporate it into a through-hole board and you can get additional target boards at$10 for three.

So for \$30 I get a development kit and micros to control four of HydraRaptor's heads.

The smaller parts don't have UARTs but they do have I²C which is easier to make a multi-drop bus with.

#### 1 comment:

1. Yes, these are very sweet micros. Plus there's a version of gcc which targets the msp430 series.


text:
# Electric generator

(Redirected from Electrical generator)
U.S. NRC image of a modern steam turbine generator (STG).

In electricity generation, a generator[1] is a device that converts motive power (mechanical energy) into electrical power for use in an external circuit. Sources of mechanical energy include steam turbines, gas turbines, water turbines, internal combustion engines, wind turbines and even hand cranks. The first electromagnetic generator, the Faraday disk, was invented in 1831 by British scientist Michael Faraday. Generators provide nearly all of the power for electric power grids.

The reverse conversion of electrical energy into mechanical energy is done by an electric motor, and motors and generators have many similarities. Many motors can be mechanically driven to generate electricity and frequently make acceptable manual generators.

## Terminology

Early Ganz Generator in Zwevegem, West Flanders, Belgium

Electromagnetic generators fall into one of two broad categories, dynamos and alternators.

Mechanically a generator consists of a rotating part and a stationary part:

Rotor
The rotating part of an electrical machine.
Stator
The stationary part of an electrical machine, which surrounds the rotor.

One of these parts generates a magnetic field, the other has a wire winding in which the changing field induces an electric current:

Field winding or field (permanent) magnets
The magnetic field producing component of an electrical machine. The magnetic field of the dynamo or alternator can be provided by either wire windings called field coils or permanent magnets. Electrically-excited generators include an excitation system to produce the field flux. A generator using permanent magnets (PMs) is sometimes called a magneto, or permanent magnet synchronous generators (PMSMs).
Armature
The power-producing component of an electrical machine. In a generator, alternator, or dynamo, the armature windings generate the electric current, which provides power to an external circuit. The armature can be on either the rotor or the stator, depending on the design, with the field coil or magnet on the other part.

## History

Before the connection between magnetism and electricity was discovered, electrostatic generators were invented. They operated on electrostatic principles, by using moving electrically charged belts, plates, and disks that carried charge to a high potential electrode. The charge was generated using either of two mechanisms: electrostatic induction or the triboelectric effect. Such generators generated very high voltage and low current. Because of their inefficiency and the difficulty of insulating machines that produced very high voltages, electrostatic generators had low power ratings, and were never used for generation of commercially significant quantities of electric power. Their only practical applications were to power early X-ray tubes, and later in some atomic particle accelerators.

The Faraday disk was the first electric generator. The horseshoe-shaped magnet (A) created a magnetic field through the disk (D). When the disk was turned, this induced an electric current radially outward from the center toward the rim. The current flowed out through the sliding spring contact m, through the external circuit, and back into the center of the disk through the axle.

The operating principle of electromagnetic generators was discovered in the years of 1831–1832 by Michael Faraday. The principle, later called Faraday's law, is that an electromotive force is generated in an electrical conductor which encircles a varying magnetic flux.

He also built the first electromagnetic generator, called the Faraday disk; a type of homopolar generator, using a copper disc rotating between the poles of a horseshoe magnet. It produced a small DC voltage.

This design was inefficient, due to self-cancelling counterflows of current in regions of the disk that were not under the influence of the magnetic field. While current was induced directly underneath the magnet, the current would circulate backwards in regions that were outside the influence of the magnetic field. This counterflow limited the power output to the pickup wires, and induced waste heating of the copper disc. Later homopolar generators would solve this problem by using an array of magnets arranged around the disc perimeter to maintain a steady field effect in one current-flow direction.

Another disadvantage was that the output voltage was very low, due to the single current path through the magnetic flux. Experimenters found that using multiple turns of wire in a coil could produce higher, more useful voltages. Since the output voltage is proportional to the number of turns, generators could be easily designed to produce any desired voltage by varying the number of turns. Wire windings became a basic feature of all subsequent generator designs.

### Jedlik and the self-excitation phenomenon

Independently of Faraday, Ányos Jedlik started experimenting in 1827 with the electromagnetic rotating devices which he called electromagnetic self-rotors. In the prototype of the single-pole electric starter (finished between 1852 and 1854) both the stationary and the revolving parts were electromagnetic. It was also the discovery of the principle of dynamo self-excitation,[2] which replaced permanent magnet designs. He also may have formulated the concept of the dynamo in 1861 (before Siemens and Wheatstone) but didn't patent it as he thought he wasn't the first to realize this.[3]

### Direct current generators

Hippolyte Pixii's dynamo. The commutator is located on the shaft below the spinning magnet.

This large belt-driven high-current dynamo produced 310 amperes at 7 volts. Dynamos are no longer used due to the size and complexity of the commutator needed for high power applications.

A coil of wire rotating in a magnetic field produces a current which changes direction with each 180° rotation, an alternating current (AC). However many early uses of electricity required direct current (DC). In the first practical electric generators, called dynamos, the AC was converted into DC with a commutator, a set of rotating switch contacts on the armature shaft. The commutator reversed the connection of the armature winding to the circuit every 180° rotation of the shaft, creating a pulsing DC current. One of the first dynamos was built by Hippolyte Pixii in 1832.

The dynamo was the first electrical generator capable of delivering power for industry. The Woolrich Electrical Generator of 1844, now in Thinktank, Birmingham Science Museum, is the earliest electrical generator used in an industrial process.[4] It was used by the firm of Elkingtons for commercial electroplating.[5][6][7]

The modern dynamo, fit for use in industrial applications, was invented independently by Sir Charles Wheatstone, Werner von Siemens and Samuel Alfred Varley. Varley took out a patent on 24 December 1866, while Siemens and Wheatstone both announced their discoveries on 17 January 1867, the latter delivering a paper on his discovery to the Royal Society.

The "dynamo-electric machine" employed self-powering electromagnetic field coils rather than permanent magnets to create the stator field.[8] Wheatstone's design was similar to Siemens', with the difference that in the Siemens design the stator electromagnets were in series with the rotor, but in Wheatstone's design they were in parallel.[9] The use of electromagnets rather than permanent magnets greatly increased the power output of a dynamo and enabled high power generation for the first time. This invention led directly to the first major industrial uses of electricity. For example, in the 1870s Siemens used electromagnetic dynamos to power electric arc furnaces for the production of metals and other materials.

The dynamo machine that was developed consisted of a stationary structure, which provides the magnetic field, and a set of rotating windings which turn within that field. On larger machines the constant magnetic field is provided by one or more electromagnets, which are usually called field coils.

Large power generation dynamos are now rarely seen due to the now nearly universal use of alternating current for power distribution. Before the adoption of AC, very large direct-current dynamos were the only means of power generation and distribution. AC has come to dominate due to the ability of AC to be easily transformed to and from very high voltages to permit low losses over large distances.

### Synchronous generators (alternating current generators)

Through a series of discoveries, the dynamo was succeeded by many later inventions, especially the AC alternator, which was capable of generating alternating current. It is commonly known to be the Synchronous Generators (SGs). The synchronous machines are directly connected to the grid and need to be properly synchronized during startup.[10] Moreover, they are excited with special control to enhance the stability of the power system.[11]

Alternating current generating systems were known in simple forms from Michael Faraday's original discovery of the magnetic induction of electric current. Faraday himself built an early alternator. His machine was a "rotating rectangle", whose operation was heteropolar - each active conductor passed successively through regions where the magnetic field was in opposite directions.[12]

Large two-phase alternating current generators were built by a British electrician, J.E.H. Gordon, in 1882. The first public demonstration of an "alternator system" was given by William Stanley, Jr., an employee of Westinghouse Electric in 1886.[13]

Sebastian Ziani de Ferranti established Ferranti, Thompson and Ince in 1882, to market his Ferranti-Thompson Alternator, invented with the help of renowned physicist Lord Kelvin.[14] His early alternators produced frequencies between 100 and 300 Hz. Ferranti went on to design the Deptford Power Station for the London Electric Supply Corporation in 1887 using an alternating current system. On its completion in 1891, it was the first truly modern power station, supplying high-voltage AC power that was then "stepped down" for consumer use on each street. This basic system remains in use today around the world.

A small early 1900s 75 kVA direct-driven power station AC alternator, with a separate belt-driven exciter generator.

After 1891, polyphase alternators were introduced to supply currents of multiple differing phases.[15] Later alternators were designed for varying alternating-current frequencies between sixteen and about one hundred hertz, for use with arc lighting, incandescent lighting and electric motors.[16]

### Self-excitation

As the requirements for larger scale power generation increased, a new limitation rose: the magnetic fields available from permanent magnets. Diverting a small amount of the power generated by the generator to an electromagnetic field coil allowed the generator to produce substantially more power. This concept was dubbed self-excitation.

The field coils are connected in series or parallel with the armature winding. When the generator first starts to turn, the small amount of remanent magnetism present in the iron core provides a magnetic field to get it started, generating a small current in the armature. This flows through the field coils, creating a larger magnetic field which generates a larger armature current. This "bootstrap" process continues until the magnetic field in the core levels off due to saturation and the generator reaches a steady state power output.

Very large power station generators often utilize a separate smaller generator to excite the field coils of the larger. In the event of a severe widespread power outage where islanding of power stations has occurred, the stations may need to perform a black start to excite the fields of their largest generators, in order to restore customer power service.[17]

## Specialized types of generator

### Direct current (DC)

An important class of direct-current generators are the dynamos - these are electrical machines with commutators to produce (DC) direct current, and are self excited - their field electromagnets are powered by the machine's own output. Other types of DC generator use a separate source of direct current to energize their field magnets.

#### Homopolar generator

A homopolar generator is a DC electrical generator comprising an electrically conductive disc or cylinder rotating in a plane perpendicular to a uniform static magnetic field. A potential difference is created between the center of the disc and the rim (or ends of the cylinder), the electrical polarity depending on the direction of rotation and the orientation of the field.

It is also known as a unipolar generator, acyclic generator, disk dynamo, or Faraday disc. The voltage is typically low, on the order of a few volts in the case of small demonstration models, but large research generators can produce hundreds of volts, and some systems have multiple generators in series to produce an even larger voltage.[18] They are unusual in that they can produce tremendous electric current, some more than a million amperes, because the homopolar generator can be made to have very low internal resistance.

#### Magnetohydrodynamic (MHD) generator

A magnetohydrodynamic generator directly extracts electric power from moving hot gases through a magnetic field, without the use of rotating electromagnetic machinery. MHD generators were originally developed because the output of a plasma MHD generator is a flame, well able to heat the boilers of a steam power plant. The first practical design was the AVCO Mk. 25, developed in 1965. The U.S. government funded substantial development, culminating in a 25 MW demonstration plant in 1987. In the Soviet Union from 1972 until the late 1980s, the MHD plant U 25 was in regular commercial operation on the Moscow power system with a rating of 25 MW, the largest MHD plant rating in the world at that time.[19] MHD generators operated as a topping cycle are currently (2007) less efficient than combined cycle gas turbines.

### Alternating current (AC)

#### Induction generator

Induction AC motors may be used as generators, turning mechanical energy into electric current. Induction generators operate by mechanically turning their rotor faster than the synchronous speed, giving negative slip. A regular AC asynchronous motor usually can be used as a generator, without any internal modifications. Induction generators are useful in applications such as minihydro power plants, wind turbines, or in reducing high-pressure gas streams to lower pressure, because they can recover energy with relatively simple controls. They do not require an exciter circuit because the rotating magnetic field is provided by induction from the stator circuit. They also do not require speed governor equipment as they inherently operate at the connected grid frequency.

To operate, an induction generator must be excited with a leading voltage; this is usually done by connection to an electrical grid, or sometimes they are self-excited by using phase correcting capacitors.

#### Linear electric generator

In the simplest form of linear electric generator, a sliding magnet moves back and forth through a solenoid - a spool of copper wire. An alternating current is induced in the loops of wire by Faraday's law of induction each time the magnet slides through. This type of generator is used in the Faraday flashlight. Larger linear electricity generators are used in wave power schemes.

#### Variable-speed constant-frequency generators

Many renewable energy efforts attempt to harvest natural sources of mechanical energy (wind, tides, etc.) to produce electricity. Because these sources fluctuate in power applied, standard generators using permanent magnets and fixed windings would deliver unregulated voltage and frequency. The overhead of regulation (whether before the generator via gear reduction or after generation by electrical means) is high in proportion to the naturally-derived energy available.

New generator designs such as the asynchronous or induction singly-fed generator, the doubly-fed generator, or the brushless wound-rotor doubly-fed generator are seeing success in variable speed constant frequency applications, such as wind turbines or other renewable energy technologies. These systems thus offer cost, reliability and efficiency benefits in certain use cases.

## Common use cases

### Power station

Hydroelectric power station at Gabčíkovo Dam, Slovakia

Hydroelectric power station at Glen Canyon Dam, Page, Arizona

A power station, also referred to as a power plant or powerhouse and sometimes generating station or generating plant, is an industrial facility for the generation of electric power. Most power stations contain one or more generators, a rotating machine that converts mechanical power into three-phase electric power. The relative motion between a magnetic field and a conductor creates an electrical current. The energy source harnessed to turn the generator varies widely. Most power stations in the world burn fossil fuels such as coal, oil, and natural gas to generate electricity. Cleaner sources include nuclear power, and an increasing use of renewables such as solar, wind, wave and hydroelectric.

### Vehicular generators

Motor vehicles require electrical energy to power their instrumentation, keep the engine itself operating, and recharge their batteries. Until about the 1960s motor vehicles tended to use DC generators with electromechanical regulators. Following the historical trend above and for many of the same reasons, these have now been replaced by alternators with built-in rectifier circuits.

#### Bicycles

Bicycles require energy to power running lights and other equipment. There are two common kinds of generator in use on bicycles: bottle dynamos which engage the bicycle's tire on an as-needed basis, and hub dynamos which are directly attached to the bicycle's drive train. The name is conventional as these they are small permanent-magnet alternators, not self-excited DC machines as are dynamos. Some electric bicycles are capable of regenerative braking, where the drive motor is used as a generator to recover some energy during braking.

#### Sailboats

Sailing boats may use a water- or wind-powered generator to trickle-charge the batteries. A small propeller, wind turbine or impeller is connected to a low-power generator to supply currents at typical wind or cruising speeds.

#### Electric scooters

Electric scooters with regenerative braking have become popular all over the world. Engineers use kinetic energy recovery systems on the scooter to reduce energy consumption and increase its range up to 40-60% by simply recovering energy using the magnetic brake, which generates electric energy for further use. Modern vehicles reach speed up to 25-30 km/h and can run up to 35-40 km.

### Genset

An engine-generator is the combination of an electrical generator and an engine (prime mover) mounted together to form a single piece of self-contained equipment. The engines used are usually piston engines, but gas turbines can also be used. And there are even hybrid diesel-gas units, called dual-fuel units. Many different versions of engine-generators are available - ranging from very small portable petrol powered sets to large turbine installations. The primary advantage of engine-generators is the ability to independently supply electricity, allowing the units to serve as backup power solutions.[20]

### Human powered electrical generators

A generator can also be driven by human muscle power (for instance, in field radio station equipment).

Protesters at Occupy Wall Street using bicycles connected to a motor and one-way diode to charge batteries for their electronics[21]

Human powered direct current generators are commercially available, and have been the project of some DIY enthusiasts. Typically operated by means of pedal power, a converted bicycle trainer, or a foot pump, such generators can be practically used to charge batteries, and in some cases are designed with an integral inverter. An average "healthy human" can produce a steady 75 Watts (0.1 horsepower) for a full eight hour period, while a "first class athlete" can produce approximately 298 Watts (0.4 horsepower) for a similar period. At the end of which an undetermined period of rest and recovery will be required. At 298 Watts the average "healthy human" becomes exhausted within 10 minutes.[22] The net electrical power that can be produced will be less, due to the efficiency of the generator. Portable radio receivers with a crank are made to reduce battery purchase requirements, see clockwork radio. During the mid 20th century, pedal powered radios were used throughout the Australian outback, to provide schooling (School of the Air), medical and other needs in remote stations and towns.

### Mechanical measurement

A tachogenerator is an electromechanical device which produces an output voltage proportional to its shaft speed. It may be used for a speed indicator or in a feedback speed control system. Tachogenerators are frequently used to power tachometers to measure the speeds of electric motors, engines, and the equipment they power. Generators generate voltage roughly proportional to shaft speed. With precise construction and design, generators can be built to produce very precise voltages for certain ranges of shaft speeds.[citation needed]

## Equivalent circuit

Equivalent circuit of generator and load.
• G, generator
• VG, generator open-circuit voltage
• RG, generator internal resistance

An equivalent circuit of a generator and load is shown in the adjacent diagram. The generator is represented by an abstract generator consisting of an ideal voltage source and an internal resistance. The generator's ${\displaystyle V_{\text{G}}}$  and ${\displaystyle R_{\text{G}}}$  parameters can be determined by measuring the winding resistance (corrected to operating temperature), and measuring the open-circuit and loaded voltage for a defined current load.

This is the simplest model of a generator, further elements may need to be added for an accurate representation. In particular, inductance can be added to allow for the machine's windings and magnetic leakage flux,[23] but a full representation can become much more complex than this.[24]

## References

1. ^ Also called electric generator, electrical generator, and electromagnetic generator.
2. ^ Augustus Heller (April 2, 1896). "Anianus Jedlik". Nature. Norman Lockyer. 53 (1379): 516. Bibcode:1896Natur..53..516H. doi:10.1038/053516a0.
3. ^ Augustus Heller (2 April 1896), "Anianus Jedlik", Nature, Norman Lockyer, 53 (1379): 516, Bibcode:1896Natur..53..516H, doi:10.1038/053516a0
4. ^ Birmingham Museums trust catalogue, accession number: 1889S00044
5. ^ Thomas, John Meurig (1991). Michael Faraday and the Royal Institution: The Genius of Man and Place. Bristol: Hilger. p. 51. ISBN 978-0750301459.
6. ^ Beauchamp, K G (1997). Exhibiting Electricity. IET. p. 90. ISBN 9780852968956.
7. ^ Hunt, L. B. (March 1973). "The early history of gold plating". Gold Bulletin. 6 (1): 16–27. doi:10.1007/BF03215178.
8. ^ Berliner Berichte. January 1867. Missing or empty |title= (help)
9. ^ Proceedings of the Royal Society. February 14, 1867. Missing or empty |title= (help)
10. ^ Schaefer, Richard C. (Jan–Feb 2017). "Art of Generator Synchronizing". IEEE Transactions on Industry Applications. 53 (1): 751–757. doi:10.1109/tia.2016.2602215. ISSN 0093-9994.CS1 maint: date format (link)
11. ^ Basler, Michael J.; Schaefer, Richard C. (2008). "Understanding Power-System Stability". IEEE Transactions on Industry Applications. 44 (2): 463–474. doi:10.1109/tia.2008.916726. ISSN 0093-9994.
12. ^ Thompson, Sylvanus P., Dynamo-Electric Machinery. pp. 7
13. ^ Blalock, Thomas J., "Alternating Current Electrification, 1886". IEEE History Center, IEEE Milestone. (ed. first practical demonstration of a dc generator - ac transformer system.)
14. ^ Ferranti Timeline Archived October 3, 2015, at the Wayback MachineMuseum of Science and Industry (Accessed 22-02-2012)
15. ^ Thompson, Sylvanus P., Dynamo-Electric Machinery. pp. 17
16. ^ Thompson, Sylvanus P., Dynamo-Electric Machinery. pp. 16
17. ^ SpecSizer: Generator Set Sizing
18. ^ Losty, H.H.W & Lewis, D.L. (1973) Homopolar Machines. Philosophical Transactions for the Royal Society of London. Series A, Mathematical and Physical Sciences. 275 (1248), 69-75
19. ^ Langdon Crane, Magnetohydrodynamic (MHD) Power Generator: More Energy from Less Fuel, Issue Brief Number IB74057, Library of Congress Congressional Research Service, 1981, retrieved from Digital.library.unt.edu 18 July 2008
20. ^ "Hurricane Preparedness: Protection Provided by Power Generators | Power On with Mark Lum". Wpowerproducts.com. 10 May 2011. Retrieved 2012-08-24.
21. ^ With Generators Gone, Wall Street Protesters Try Bicycle Power, Colin Moynihan, New York Times, 30 October 2011; accessed 2 November 2011
22. ^ "Program: hpv (updated 6/22/11)". Ohio.edu. Retrieved 2012-08-24.
23. ^ Geoff Klempner, Isidor Kerszenbaum, "1.7.4 Equivalent circuit", Handbook of Large Turbo-Generator Operation and Maintenance, John Wiley & Sons, 2011 (Kindle edition) ISBN 1118210409.
24. ^ Yoshihide Hase, "10: Theory of generators", Handbook of Power System Engineering, John Wiley & Sons, 2007 ISBN 0470033665.


text:
If x and y are integers and 4xy = x^2*y+4y, what is the : GMAT Data Sufficiency (DS)
Check GMAT Club Decision Tracker for the Latest School Decision Releases http://gmatclub.com/AppTrack

 It is currently 20 Jan 2017, 02:12

### GMAT Club Daily Prep

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

Customized
for You

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

Track

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

Practice
Pays

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

# Events & Promotions

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

# If x and y are integers and 4xy = x^2*y+4y, what is the

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics
Author Message
TAGS:

### Hide Tags

Manager
Joined: 02 Jun 2011
Posts: 159
Followers: 1

Kudos [?]: 75 [1] , given: 11

If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

23 May 2012, 00:57
1
KUDOS
6
This post was
BOOKMARKED
00:00

Difficulty:

95% (hard)

Question Stats:

41% (02:46) correct 59% (01:36) wrong based on 240 sessions

### HideShow timer Statistics

If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

(1) y-x = 2
(2) x^3 <0

what I did : 4xy = x^2y+4y
4x = x^2+4
x^2-4x+4 = 0
(x-2)^2=0
x = 2
is this wrong?
[Reveal] Spoiler: OA

Last edited by Bunuel on 23 May 2012, 01:15, edited 1 time in total.
Edited the OA
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [9] , given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

23 May 2012, 01:14
9
KUDOS
Expert's post
3
This post was
BOOKMARKED
kashishh wrote:
If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

(1) y-x = 2
(2) x^3 <0

what I did : 4xy = x^2y+4y
4x = x^2+4
x^2-4x+4 = 0
(x-2)^2=0
x = 2
is this wrong?

You cannot divide 4xy=x^2y+4y by y and write 4x=x^2+4, because y can be zero and division be zero is not allowed. Never reduce equation by variable (or expression with variable), if you are not certain that variable (or expression with variable) doesn't equal to zero. We can not divide by zero. So when you divide by y you assume, with no ground for it, that y does not equal to zero thus exclude a possible solution.

If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

$$4xy=x^2*y+4y$$ --> $$x^2*y-4xy+4y=0$$ --> $$y(x^2-4x+4)=0$$ --> $$y(x-2)^2=0$$ --> either $$x=2$$ or $$y=0$$ (or both).

(1) y-x = 2 --> if $$x=2$$ then $$y=4$$ and $$xy=8$$ but if $$y=0$$ then $$x=-2$$ and $$xy = 0$$. Not sufficient.

(2) x^3<0 --> $$x<0$$, so $$x\neq{2}$$ which means that $$y$$ must equal to zero --> $$xy=0$$. Sufficient.

Hope it's clear.
_________________
Senior Manager
Joined: 28 Dec 2010
Posts: 334
Location: India
Followers: 1

Kudos [?]: 201 [0], given: 33

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

25 May 2012, 18:15
thanks bunuel. Its a common error to 'cancel' y on both sides. I fell prey to the same mistake.
However, just to clarify, basically when x = 2 then y can take any value and when y=0 x can take any value. In either case xy=0?
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [0], given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

26 May 2012, 01:42
vibhav wrote:
thanks bunuel. Its a common error to 'cancel' y on both sides. I fell prey to the same mistake.
However, just to clarify, basically when x = 2 then y can take any value and when y=0 x can take any value. In either case xy=0?

If y=0 then x can take any value - TRUE. In this case xy=0.
If x=2 then y can take any value - TRUE. In this case xy=0 only if y=0 but for any other possible value of y xy does not equal to zero (for example consider x=2 and y=1).

Hope it's clear.
_________________
Senior Manager
Joined: 28 Dec 2010
Posts: 334
Location: India
Followers: 1

Kudos [?]: 201 [0], given: 33

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

26 May 2012, 06:09
Bunuel wrote:

If x=2 then y can take any value - TRUE. In this case xy=0 only if y=0 but for any other possible value of y xy does not equal to zero (for example consider x=2 and y=1).

Just by looking at this equation y(x^2 -4x+4) = 0 either the quadratic term has to equal 0, in which case x=2, or y has to equal to zero. In which scenario will y =1 and x=2 occur?
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [0], given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

28 May 2012, 04:26
vibhav wrote:
Bunuel wrote:

If x=2 then y can take any value - TRUE. In this case xy=0 only if y=0 but for any other possible value of y xy does not equal to zero (for example consider x=2 and y=1).

Just by looking at this equation y(x^2 -4x+4) = 0 either the quadratic term has to equal 0, in which case x=2, or y has to equal to zero. In which scenario will y =1 and x=2 occur?

Again: $$y(x-2)^2=0$$ means that either $$x=2$$ or $$y=0$$ (or both).

Now, if $$x=2$$ then $$y$$ can take ANY value including 1.

Hope it's clear.
_________________
Intern
Joined: 28 Sep 2011
Posts: 35
Location: India
WE: Consulting (Computer Software)
Followers: 1

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

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

31 May 2012, 19:55
I thought using stmt 1 - xy always comes to be 0...
_________________

Kudos if you like the post!!!

Manager
Joined: 27 May 2012
Posts: 217
Followers: 2

Kudos [?]: 71 [0], given: 432

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

14 Sep 2013, 02:21
Bunuel wrote:
kashishh wrote:
If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

(1) y-x = 2
(2) x^3 <0

what I did : 4xy = x^2y+4y
4x = x^2+4
x^2-4x+4 = 0
(x-2)^2=0
x = 2
is this wrong?

You cannot divide 4xy=x^2y+4y by y and write 4x=x^2+4, because y can be zero and division be zero is not allowed. Never reduce equation by variable (or expression with variable), if you are not certain that variable (or expression with variable) doesn't equal to zero. We can not divide by zero. So when you divide by y you assume, with no ground for it, that y does not equal to zero thus exclude a possible solution.

If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

$$4xy=x^2*y+4y$$ --> $$x^2*y-4xy+4y=0$$ --> $$y(x^2-4x+4)=0$$ --> $$y(x-2)^2=0$$ --> either $$x=2$$ or $$y=0$$ (or both).

(1) y-x = 2 --> if $$x=2$$ then $$y=4$$ and $$xy=8$$ but if $$y=0$$ then $$x=-2$$ and $$xy = 0$$. Not sufficient.

(2) x^3<0 --> $$x<0$$, so $$x\neq{2}$$ which means that $$y$$ must equal to zero --> $$xy=0$$. Sufficient.

Hope it's clear.

instead of taking LHS to RHS , I brought RHS to LHS
and got 4xy-x^2y - 4y = 0
now y (4x-x^2- 4 )= 0
y (-x^2 +4x - 4)= 0
y (x+2)^2= 0
either y = 0 or x = -2
now obviously x=-2 does not satisfy 4xy = x^2*y+4y, now I was expecting the same answer both ways.
Now am I doing something wrong,or is it just one of those cases where the equation works a certain way and not the other way

by the way factorization of -x^2 +4x-4 =0 is (x+2)^2 right? if x^2 has a coefficient we have to multiply the constant (-4) with the coefficient of x^2 do we not.
_________________

- Stne

Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [1] , given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

14 Sep 2013, 02:29
1
KUDOS
Expert's post
stne wrote:
Bunuel wrote:
kashishh wrote:
If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

(1) y-x = 2
(2) x^3 <0

what I did : 4xy = x^2y+4y
4x = x^2+4
x^2-4x+4 = 0
(x-2)^2=0
x = 2
is this wrong?

You cannot divide 4xy=x^2y+4y by y and write 4x=x^2+4, because y can be zero and division be zero is not allowed. Never reduce equation by variable (or expression with variable), if you are not certain that variable (or expression with variable) doesn't equal to zero. We can not divide by zero. So when you divide by y you assume, with no ground for it, that y does not equal to zero thus exclude a possible solution.

If x and y are integers and 4xy = x^2*y+4y, what is the value of xy?

$$4xy=x^2*y+4y$$ --> $$x^2*y-4xy+4y=0$$ --> $$y(x^2-4x+4)=0$$ --> $$y(x-2)^2=0$$ --> either $$x=2$$ or $$y=0$$ (or both).

(1) y-x = 2 --> if $$x=2$$ then $$y=4$$ and $$xy=8$$ but if $$y=0$$ then $$x=-2$$ and $$xy = 0$$. Not sufficient.

(2) x^3<0 --> $$x<0$$, so $$x\neq{2}$$ which means that $$y$$ must equal to zero --> $$xy=0$$. Sufficient.

Hope it's clear.

instead of taking LHS to RHS , I brought RHS to LHS
and got 4xy-x^2y - 4y = 0
now y (4x-x^2- 4 )= 0
y (-x^2 +4x - 4)= 0
y (x+2)^2= 0
either y = 0 or x = -2
now obviously x=-2 does not satisfy 4xy = x^2*y+4y, now I was expecting the same answer both ways.
Now am I doing something wrong,or is it just one of those cases where the equation works a certain way and not the other way

by the way factorization of -x^2 +4x-4 =0 is (x+2)^2 right? if x^2 has a coefficient we have to multiply the constant (-4) with the coefficient of x^2 do we not.

You could expand $$(x+2)^2$$ to check your reasoning: $$(x+2)^2=x^2+2x+4$$, while $$-x^2 +4x-4=-(x^2-4x+4)=-(x-2)^2$$. Thus, $$y(4x-x^2- 4 )=0$$ can be written as $$-y(x-2)^2=0$$ --> $$x=2$$ or $$y=0$$.

Hope it's clear.
_________________
Manager
Joined: 27 May 2012
Posts: 217
Followers: 2

Kudos [?]: 71 [1] , given: 432

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

14 Sep 2013, 02:59
1
KUDOS
Bunuel wrote:
stne wrote:

instead of taking LHS to RHS , I brought RHS to LHS
and got 4xy-x^2y - 4y = 0
now y (4x-x^2- 4 )= 0
y (-x^2 +4x - 4)= 0
y (x+2)^2= 0
either y = 0 or x = -2
now obviously x=-2 does not satisfy 4xy = x^2*y+4y, now I was expecting the same answer both ways.
Now am I doing something wrong,or is it just one of those cases where the equation works a certain way and not the other way

by the way factorization of -x^2 +4x-4 =0 is (x+2)^2 right? if x^2 has a coefficient we have to multiply the constant (-4) with the coefficient of x^2 do we not.

You could expand $$(x+2)^2$$ to check your reasoning: $$(x+2)^2=x^2+2x+4$$, while $$-x^2 +4x-4=-(x^2-4x+4)=-(x-2)^2$$. Thus, $$y(4x-x^2- 4 )=0$$ can be written as $$-y(x-2)^2=0$$ --> $$x=2$$ or $$y=0$$.

Hope it's clear.

I think I am still missing something, can you please show me how to factorize -x^2+4x-4= 0 without taking out the negative sign, answer should be same right? Thank you
_________________

- Stne

Last edited by stne on 14 Sep 2013, 03:07, edited 1 time in total.
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [1] , given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

14 Sep 2013, 03:02
1
KUDOS
Expert's post
stne wrote:
stne wrote:
Bunuel wrote:

instead of taking LHS to RHS , I brought RHS to LHS
and got 4xy-x^2y - 4y = 0
now y (4x-x^2- 4 )= 0
y (-x^2 +4x - 4)= 0
y (x+2)^2= 0
either y = 0 or x = -2
now obviously x=-2 does not satisfy 4xy = x^2*y+4y, now I was expecting the same answer both ways.
Now am I doing something wrong,or is it just one of those cases where the equation works a certain way and not the other way

by the way factorization of -x^2 +4x-4 =0 is (x+2)^2 right? if x^2 has a coefficient we have to multiply the constant (-4) with the coefficient of x^2 do we not.

You could expand $$(x+2)^2$$ to check your reasoning: $$(x+2)^2=x^2+2x+4$$, while $$-x^2 +4x-4=-(x^2-4x+4)=-(x-2)^2$$. Thus, $$y(4x-x^2- 4 )=0$$ can be written as $$-y(x-2)^2=0$$ --> $$x=2$$ or $$y=0$$.

Hope it's clear.

I think I am still missing something, can you please show me how to factorize -x^2+4x-4= 0 without taking out the negative sign, answer should be same right? Thank you

You can factor -x^2 + 4x - 4 only as -(x-2)^2.
_________________
Manager
Joined: 27 May 2012
Posts: 217
Followers: 2

Kudos [?]: 71 [1] , given: 432

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

14 Sep 2013, 04:40
1
KUDOS
Bunuel wrote:
stne wrote:
Bunuel wrote:

You could expand $$(x+2)^2$$ to check your reasoning: $$(x+2)^2=x^2+2x+4$$, while $$-x^2 +4x-4=-(x^2-4x+4)=-(x-2)^2$$. Thus, $$y(4x-x^2- 4 )=0$$ can be written as $$-y(x-2)^2=0$$ --> $$x=2$$ or $$y=0$$.

Hope it's clear.

I think I am still missing something, can you please show me how to factorize -x^2+4x-4= 0 without taking out the negative sign, answer should be same right? Thank you

You can factor -x^2 + 4x - 4 only as -(x-2)^2.

Thank you +1, I was under the impression that it was possible to factor -x^2 +4x-4 as it is and it was not necessary to take out the negative sign. One of those mistakes , waiting to happen.
_________________

- Stne

Manager
Joined: 18 Oct 2013
Posts: 81
Location: India
Concentration: Technology, Finance
GMAT 1: 580 Q48 V21
GMAT 2: 530 Q49 V13
GMAT 3: 590 Q49 V21
WE: Information Technology (Computer Software)
Followers: 3

Kudos [?]: 29 [0], given: 36

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

03 Jan 2014, 11:14
Hi Bunuel,
Thanks for the wonderful response. Please let me know that we should you use it as truth statement for DS question (Algebra) that "Never reduce equation by variable (or expression with variable), if you are not certain that variable (or expression with variable) doesn't equal to zero. We can not divide by zero". I surely follow it that reduce variable in algebra only when I am sure that they are not equal to 0.

Please do explain one doubt .What you said make logical sense but it contradicts from my previous knowledge that if we have an equation and two expression are equal to each other than we can reduce the common variable such as y from both side and there is no where mention that variable not equal to 0.
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [0], given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

03 Jan 2014, 11:19
vikrantgulia wrote:
Hi Bunuel,
Thanks for the wonderful response. Please let me know that we should you use it as truth statement for DS question (Algebra) that "Never reduce equation by variable (or expression with variable), if you are not certain that variable (or expression with variable) doesn't equal to zero. We can not divide by zero". I surely follow it that reduce variable in algebra only when I am sure that they are not equal to 0.

Please do explain one doubt .What you said make logical sense but it contradicts from my previous knowledge that if we have an equation and two expression are equal to each other than we can reduce the common variable such as y from both side and there is no where mention that variable not equal to 0.

Yes, the property is true.

Consider simple example: xy=x. If you reduce this expression by x you get definite answer that y=1 but if there x=0, then y is not necessary to be 1, it can be any number.

Correct solution would be xy=x --> x(y-1)=0 --> x=0 OR y=1.

Does this make sense?
_________________
Manager
Joined: 14 Oct 2014
Posts: 66
Location: United States
GMAT 1: 500 Q36 V23
Followers: 0

Kudos [?]: 58 [0], given: 98

If x and y are integers and 4xy = y*(x^2 + 4), what is the value of xy [#permalink]

### Show Tags

22 Jan 2015, 17:50
If x and y are integers and 4xy = y*(x^2 + 4), what is the value of xy?

(1) y-x = 2
(2) x^3 < 0
Math Expert
Joined: 02 Sep 2009
Posts: 36568
Followers: 7082

Kudos [?]: 93231 [0], given: 10553

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

22 Jan 2015, 18:51
viktorija wrote:
If x and y are integers and 4xy = y*(x^2 + 4), what is the value of xy?

(1) y-x = 2
(2) x^3 < 0

Merging similar topics. Please refer to the solutions above.
_________________
GMAT Club Legend
Joined: 09 Sep 2013
Posts: 13459
Followers: 575

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

Re: If x and y are integers and 4xy = x^2*y+4y, what is the [#permalink]

### Show Tags

18 Oct 2016, 22:30
Hello from the GMAT Club BumpBot!

Thanks to another GMAT Club member, I have just discovered this valuable topic, yet it had no discussion for over a year. I am now bumping it up - doing my job. I think you may find it valuable (esp those replies with Kudos).

Want to see all other topics I dig out? Follow me (click follow button on profile). You will receive a summary of all topics I bump in your profile area as well as via email.
_________________
Re: If x and y are integers and 4xy = x^2*y+4y, what is the   [#permalink] 18 Oct 2016, 22:30
Similar topics Replies Last post
Similar
Topics:
9 If x and y are integers, what is the value of x + y? 6 06 Dec 2012, 03:59
Is x^2 = y^4/(y^4)^(1/2) ? 1 28 Jan 2012, 10:53
7 If x and y are integers, what is the value of x+y? 7 12 Apr 2011, 05:16
12 If x and y are integers and x<y, what is the value of x+y? 9 26 Apr 2010, 19:54
4 If X and Y are prime integers, what is X+Y? 1. X-Y is a 6 29 Jul 2010, 12:35
Display posts from previous: Sort by

# If x and y are integers and 4xy = x^2*y+4y, what is the

 new topic post reply Question banks Downloads My Bookmarks Reviews Important topics

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


text:
# False proof of $H_0 ( X) = 0$

I've written the following "proof" that if $X$ is path-connected then $H_0 (X) = 0$. I know that that's not the case, yet I can't find the mistake in my "proof". Can you please point it out to me? Here is my "proof":

$X$ path-connected $\implies$ any 2 singular 0-simplexes (constant maps) $x,y$ in $X$ are the boundary of a 1-simplex (path) $\sigma$

$\iff \partial \sigma = x - y$

$\implies x,y$ differ by a boundary

$\implies x,y$ are in the same homology class $\{ c \} \in H_0(X)$

$\implies H_0 (X) = \{ c \} = 0$.

Thanks for your help, it's much appreciated.

-
Why is the class of $c$ zero? –  Bonanza Aug 10 '11 at 11:54
Because it's a group and it only has one element, so that element has got to be neutral element otherwise it's not a group. –  Rudy the Reindeer Aug 10 '11 at 11:57
Remember, the chain group consists of formal sums of 0-simplices, not just of 0-simplices themselves. –  Chris Eagle Aug 10 '11 at 11:58
Oh!! $\{ c\}$, $\{c + c\}$, $\dots$ are all different elements of $H_0 (X)$. That's what you're saying? –  Rudy the Reindeer Aug 10 '11 at 12:07
That's it, Matt :-) –  Eivind Dahl Aug 10 '11 at 12:52

As you point out, in a path-connected space, all 0-simplices (i.e. points) are homologous. But the 0th chain group consists not of 0-simplices, but of formal sums of 0-simplices. So, assuming our space is also nonempty, and so contains a point $p$, the 0th chain group contains chains $0$, $p$, $-p$, $p+p$, $-p-p$, and so on. Since every point is homologous to $p$, every chain is homologous to one of these chains. Moreover, since every boundary of a 1-chain is a sum of points with total weight 0, there are no non-trivial homology relations among these chains, and so the 0th homology group is $\mathbb{Z}$.

-


text:
### Home > PC > Chapter 1 > Lesson 1.1.3 > Problem1-42

1-42.

Suppose $h\left(x\right) = 3x − 2$ and $j\left(x\right) = ax + b$. Find a relationship between $a$ and $b$ such that $h\left(j\left(x\right)\right) = j\left(h\left(x\right)\right)$.

Manipulate the functions until you have an equation with a and b as the only variables.


text:
# worldToIntrinsic

Transform planar world to intrinsic coordinates

## Syntax

``[xIntrinsic,yIntrinsic] = worldToIntrinsic(R,xWorld,yWorld)``

## Description

example

````[xIntrinsic,yIntrinsic] = worldToIntrinsic(R,xWorld,yWorld)` returns the intrinsic coordinates corresponding to planar world coordinates (`xWorld`, `yWorld`) in map raster `R`. If a point is outside the bounds of `R`, then `worldToIntrinsic` extrapolates the `xIntrinsic` and `yIntrinsic` coordinates.```

## Examples

collapse all

Import a GeoTIFF image [1] of Boston as an array and a `MapCellsReference` object. Find the intrinsic coordinates corresponding to the world $\mathit{x}$- and $\mathit{y}$-coordinates of `776500` and `2956600` survey feet, respectively.

```[Z,R] = readgeoraster('boston.tif'); [xIntrinsic,yIntrinsic] = worldToIntrinsic(R,776500,2956600)```
```xIntrinsic = 3.7136e+03 ```
```yIntrinsic = 1.2119e+03 ```

The result means that the world coordinates fall close to the center of the cell corresponding to column 3713 and row 1211 of the array.

You can reverse the operation by using the `intrinsicToWorld` function.

`[xWorld,yWorld] = intrinsicToWorld(R,xIntrinsic,yIntrinsic)`
```xWorld = 776500 ```
```yWorld = 2956600 ```

## Input Arguments

collapse all

x-coordinates in the world coordinate system, specified as a numeric array. `xWorld` coordinates can be outside the bounds of the raster `R`.

Data Types: `single` | `double`

y-coordinates in the world coordinate system, specified as a numeric array. `yWorld` is the same size as `xWorld`. `yWorld` coordinates can be outside the bounds of the raster `R`.

Data Types: `single` | `double`

## Output Arguments

collapse all

x-coordinates in the intrinsic coordinate system, returned as a numeric array. `xIntrinsic` is the same size as `xWorld`.

When `xWorld`(k) is outside the bounds of raster `R`, `xIntrinsic`(k) is extrapolated in the intrinsic coordinate system.

Data Types: `double`

y-coordinates in the intrinsic coordinate system, returned as a numeric array. `yIntrinsic` is the same size as `xWorld`.

When `yWorld`(k) outside the bounds of raster `R`, `yIntrinsic`(k) is extrapolated in the intrinsic coordinate system.

Data Types: `double`

## Version History

Introduced in R2013b


text:
# Waves and currents by X-band radar

This article describes how X-band radar can be used to obtain several sea state parameters. X-band radar is an example of a remote sensing technique. This article starts with an introduction of the measurement technique. Furthermore it explains how obtained data can be used to generate a required output.

## Introduction

Many offshore operations are critically dependent on the prevailing sea state. To enhance the safety of crew, vessels, buildings and environment, reliable sea state measurements are required. In coastal areas, sea state measurements are needed to support weather, wave climate and ship routing services. Wave data is essential for the protection of the coastal zone to estimate the eroding forces of wind, waves, and currents. Due to climate change and its impact on coastal protection, wave and current measurements are of growing importance.

Figure 1: Components of X-band radar system

## Measurement principle

Figure 2: Example of a radar image obtained by X-band radar system on board a vessel.
Figure 3: 2-Dimensional Frequency-Direction Spectrum obtained by X-band radar system on board a vessel.

It is known that under certain conditions signatures of the sea surface are visible in the near range (< 5 km) of nautical radar images: The local wind generates small surface ripple waves (i.e. small waves with wave length of a few cm). The rough water surface reflects a part of the incidence radar beams. Given a wind speed of more than approximately 3 m/s, the backscatter from sea surface becomes visible in radar images. This base signal is modulated by longer ocean waves ('surface gravity waves' with wave length in the order of magnitude of some 10 m to several 100 m), generating a stripe like pattern, the so-called 'sea clutter'. Usually, this signal is treated as noise and suppressed, but it contains valuable information on the actual sea state: As the basic imaging mechanisms of ocean waves in radar images are known (Alpers et al, 1981[1]; Plant et al, 1990[2]), it is possible to analyse the spatial and temporal development of these pattern to gain information on wave height, wave length, wave period, surface current and other (see also the article Use of ground based radar in hydrography)

Oceanographic measurement systems based on X-band radar allow to scan the ocean surface in real time with high temporal (1 – 2 s) and spatial (5 – 10 m) resolution. A water surface of several km2 can be monitored continuously. These remote sensing systems can be installed on moving vessels as well as on fixed platforms or at coastal sites. For wave measurements, the radar raw signal is digitized and transferred to an analysis computer. Results can be displayed on site or transferred to remote locations via internet.

A typical wave measurement by means of X-Band radar is composed of a temporal sequence of sea clutter images $I(x,y,t)$ (see also Figure 2). To derive wave information from such data sets, several analysis steps are required.

First, the images sequence is transformed into the spectral domain by means of a discrete 3D Fourier Transform. The resulting 3D image spectrum is a function of wave number $\vec{k}=(k_x,k_y)$ and frequency $\omega$. It can be transformed into an energy density spectrum of the ocean surface waves by correcting for distortions due to the imaging mechanism and exploiting the known dispersion relation of water waves (Young et al, 1985[3], Ziemer & Rosenthal, 1987[4]). The dispersion relation describes the temporal and spatial evolution of ocean waves in spectral domain. It is used as a filter function to separate the wave signal in the image spectra from background noise and patterns not related to the wave field. In this step, the mean encounter current speed $U$ (current component directed to the radar) and direction $\theta_U$ is determined (Seemann, 1997[5], Nieto et al, 1999[6]). For a fixed platform, this corresponds to the ‘true’ current, whereas for a moving vessel ship speed and course is used to derive the true mean current from this data.

The resulting 2D ocean wave spectrum (see also Figure 3) $E(\omega, \theta)$ is usually expressed as a function of wave frequency $\omega$ and wave direction $\theta$. It gives a comprehensive description of the sea state. Integration over all directions yields the 1D wave spectrum $S(\omega)$. Commonly, various statistical sea state parameters are calculated from these spectra to give a compact description of the wave climate. See Statistical description of wave parameters.

## Obtained sea state parameters

Figure 4: Comparative time series of significant wave height measured from X-band radar system and wave rider buoy on board 2/4k Ekofisk platform in the North Sea.
Figure 5: Comparative time series of peak wave period and peak wave direction measured from X-band radar system and wave rider buoy at the Island Helgoland in the German Bight
Figure 6: Comparative time series of peak wave length measured from X-band radar system and wave rider buoy at the Island Helgoland in the German Bight.

### Significant wave height

In contrast to in situ sensors, the wave spectra determined from radar images are not properly scaled. Thus, the total wave energy and the significant wave height cannot be computed directly from these spectral estimates. The significant wave height is determined by using a linear regression equation, which relates the root square of the signal-to-noise ratio of the radar images to the significant wave height (Nieto et al, 1998[7]) (see also Figure 4).

### Peak wave period and direction

The peak wave period and direction can be derived from the frequency-direction spectrum $E(\omega, \theta)$ (Young et al, 1985[3] (see also Figure 5). They are defined as the location of the energy maximum within the spectrum. To determine the peak frequency, the centroid formula can be used which implies a frequency interval of 80 % energy maximum. This method is recommended by IAHR/ AIRH because of its high stability with respect to theoretical spectral variability. The wave period can also be derived by the spectral moments obtained over the full range of frequencies.

### Peak wave length

Wave length and periods of ocean waves are connected by the dispersion relation. Thus, it is possible to express wave spectra as a function of frequency ($E(\omega, \theta)$) or wave number ($E(k, \theta)$). The peak wave length can be determined from $E(k, \theta)$ directly in the same way as the peak period (see also Figure 6).

### Surface current calculation

The surface current is obtained by minimising the distance between the location of the spectral energy in the 3D image spectrum and its theoretical position defined by the dispersion relation for linear surface gravity waves. The surface current is the basic step to calculate directional wave spectra from radar images (see also currents).

### Wave systems

X-Band radar systems are able to resolve multiple wave systems, e.g. swell and wind sea systems. Usually, swell is characterized by its phase speed: Swell waves propagate faster than the wind, where as wind driven waves can not travel faster than the wind that generated these waves (see also waves).

## Output of X-band radar systems

### Resolution and limits

The resolution of sea state measurements of X-band radar systems are limited by the properties of the radar sensor:

• The spatial resolution is limited by the sampling frequency (SFR), antenna aperture $\Phi_A$ and the size of the analysis areas $N_x \times N_y$ placed within in the radar image.
• The temporal resolution is limited by the antenna repetition rate (RPT) and the number $N_t$ of images used for the wave analysis.

### Output parameters and accuracy

Figure 7 lists the standard output parameters with corresponding resolutions, ranges, and accuracies. These values indicate typical ranges. The numbers depend on the radar hardware, the total time of measurement and therefore can vary for each individual installation.

Figure 7: Standard output parameters of X-band radar system with corresponding resolutions, ranges, and accuracy.