Sudoku, Linear Optimization, and the Ten Cent Diet

Posted by Jon Orwant, Engineering Manager

(cross-posted on the Google Apps Developer blog, and the Google Developers blog)

In 1945, future Nobel laureate George Stigler wrote an essay in the Journal of Farm Economics titled The Cost of Subsistence about a seemingly simple problem: how could a soldier be fed for as little money as possible?

The “Stigler Diet” became a classic problem in the then-new field of linear optimization, which is used today in many areas of science and engineering. Any time you have a set of linear constraints such as “at least 50 square meters of solar panels” or “the amount of paint should equal the amount of primer” along with a linear goal (e.g., “minimize cost” or “maximize customers served”), that’s a linear optimization problem.

At Google, our engineers work on plenty of optimization problems. One example is our YouTube video stabilization system, which uses linear optimization to eliminate the shakiness of handheld cameras. A more lighthearted example is in the Google Docs Sudoku add-on, which instantaneously generates and solves Sudoku puzzles inside a Google Sheet, using the SCIP mixed integer programming solver to compute the solution.

Today we’re proud to announce two new ways for everyone to solve linear optimization problems. First, you can now solve linear optimization problems in Google Sheets with the Linear Optimization add-on written by Google Software Engineer Mihai Amarandei-Stavila. The add-on uses Google Apps Script to send optimization problems to Google servers. The solutions are displayed inside the spreadsheet. For developers who want to create their own applications on top of Google Apps, we also provide an API to let you call our linear solver directly.

Second, we’re open-sourcing the linear solver underlying the add-on: Glop (the Google Linear Optimization Package), created by Bruno de Backer with other members of the Google Optimization team. It’s available as part of the or-tools suite and we provide a few examples to get you started. On that page, you’ll find the Glop solution to the Stigler diet problem. (A Google Sheets file that uses Glop and the Linear Optimization add-on to solve the Stigler diet problem is available here. You’ll need to install the add-on first.)

Stigler posed his problem as follows: given nine nutrients (calories, protein, Vitamin C, and so on) and 77 candidate foods, find the foods that could sustain soldiers at minimum cost.

The Simplex algorithm for linear optimization was two years away from being invented, so Stigler had to do his best, arriving at a diet that cost $39.93 per year (in 1939 dollars), or just over ten cents per day. Even that wasn’t the cheapest diet. In 1947, Jack Laderman used Simplex, nine calculator-wielding clerks, and 120 person-days to arrive at the optimal solution.

Glop’s Simplex implementation solves the problem in 300 milliseconds. Unfortunately, Stigler didn’t include taste as a constraint, and so the poor hypothetical soldiers will eat nothing but the following, ever:

  • Enriched wheat flour
  • Liver
  • Cabbage
  • Spinach
  • Navy beans

Is it possible to create an appealing dish out of these five ingredients? Google Chef Anthony Marco took it as a challenge, and we’re calling the result Foie Linéaire à la Stigler:

This optimal meal consists of seared calf liver dredged in flour, atop a navy bean purée with marinated cabbage and a spinach pesto.

Chef Marco reported that the most difficult constraint was making the dish tasty without butter or cream. That said, I had the opportunity to taste our linear optimization solution, and it was delicious.


Continua a leggere

Pubblicato in Senza categoria

Enterbay 1/6 Leslie Cheung as Ning Caichen (or Ling Choi San) from "A Chinese Ghost Story"

A Chinese Ghost Story is a 1987 Hong Kong romantic comedy horror film starring Leslie Cheung, Joey Wong, and Wu Ma, directed by Ching Siu-tung, and produced by Tsui Hark. The film was popular in Hong Kong and several Asian countries, including South Korea and Japan when released. Most notably it boosted the stardom of Joey Wong, won Leslie Cheung popularity in Japan, and sparked a trend of folklore ghost films in the Hong Kong film industry, including two sequels, an animated film, a television series and a 2011 remake.

Leslie Cheung plays Ning Choi-san (寧采臣), a timid debt collector whose job requires him to travel to rural areas. One night, he takes refuge in a deserted temple in the forest on the outskirts of a town because he ran out of money due to his inability to collect the debts as initially planned. Ning meets a beautiful and alluring young maiden called Nip Siu-sin and falls in love with her. However, when he later recalls that night’s events the next day, he becomes increasingly fearful and superstitious because a Taoist mystic told him that the people he saw at the temple were ghosts.

This is Enterbay’s 1/6 scale version of Leslie Cheung as Ning Choi-san (寧采臣) in A Chinese Ghost Story. I guess they believe there’s a demand in the market for this 12-inch figure. Joey Wong as Nip Siu-sin (聶小倩) would make a beautiful companion piece but don’t hold your breath waiting for it to happen.

Scroll down to see all the pictures.
Click on them for bigger and better views.

Continua a leggere

Pubblicato in Senza categoria

PowerCamp Power Guest–Tom Arbuthnot

On Oct 18/19th, I run the next PowerShell PowerCamp – a 2 day PowerShell jump start event. Over the course of 2 days, I run through the basics of PowerShell – from Cmdlets/Objects/Pipelines, through formatting, the ISE, the language and its syntax, functions and modules, and Desired State Configuration (DSC). You bring your laptop and while I’m lecturing, you are banging out PowerShell to manage a set of VMs you bring along!
As part of the event, I always try to get another guest speaker, who I ask to talk about PowerShell in general. What are the things they have learned (which attendees will have to to)? What are their best practices? For this event, I am pleased to announce we will have the presence of Tom Arbuthnot, a superstar Lync MVP and Lync Consultant (and a Lync MCM!), and a great PowerShell evangelist. Tom’s spoken before at these events, and his talks are good and very entertaining.
I still have a few places left on this event – so if you want a great jump start to PowerShell, or to review the basics and more, then contact me at [email protected] !

Continua a leggere

Pubblicato in Senza categoria

ACCESORIOS DE ALUMINIO

   

La venta de accesorios de aluminio para carpinteria se ha incrementado notablemente. En la crisis actual, han aumentado significativamente las reparaciones dómesticas del hogar que realiza uno mismo. Hoy dia es más habitual acudir a una tienda especializada o ferreteria para adquirir recambios de muebles, pequeños electrodomésticos y hacer pequeñas reparaciones en instalaciones sanitarias y eléctricas. Hacerlo uno mismo, además de repercutir en el precio, produce una satisfacción personal al haber mejorado uno mismo el funcionamiento de diversos elementos del hogar. Para puertas y ventanas de aluminio en las ferreterías es muy difícil por no decir imposible encontrar elementos sustitutorios o accesorios de ventanas de aluminio, por lo que es muy complicado encontrar repuestos. Las carpinterias de aluminio suelen estar en talleres en polígonos industriales alejados de los centros urbanos y cada vez hay menos tiendas y exposiciones de carpintería, en la mayoría de las cuales no te sirven repuestos, ya sea porque no sean especialistas en reparaciones, que no vendan al por menor o que no sean distribuidores.
    Desde esta plataforma te invitamos a buscar los accesorios de aluminio que necesites para tu reparación, sustitución o mejora de tus ventanas y persianas de aluminio. Nos tendrás que enviar una foto, medidas y características del accesorio a solicitar y nosotros te lo encontraremos. Somos distribuidores oficiales de diversas marcas y tratamos directamente con fábrica y por eso te ofrecemos unos precios muy competitivos. Además ofrecemos videos y tutoriales en nuestro canal de youtube e instrucciones que te mandaremos junto con los accesorios para que puedas hacerlo tu mismo como si lo instalara un profesional.

    Disponemos de cualquier accesorios para persianas como motores, emisores vía radio con mando a distancia, cintas, recogedores, accesorios para tornos… todo ello marcas profesionales. También cualquier elemento para carpinteria de aluminio desde kits para convertir una ventana abatible en oscilobatiente, cremonas, bisagras, cierres, ruedas para correderas… Y también disponemos de elementos de seguridad infantil y contra robos como todo tipo de cierres con o sin llave para abatibles y correderas y también diversos productos para el mantenimiento y limpieza del aluminio. Tu nos dices lo que necesitas y nosotros te lo encontramos, te mandamos fotos y te indicamos el precio y te lo mandamos a tu domicilio mediante correo certificado contrareembolso. 
   Ponte en contacto con nosotros para la venta de accesorios de carpinteria de aluminio a través del formulario de contacto al inicio del blog.

Continua a leggere

Pubblicato in Senza categoria

Hot Toys Sucker Punch 1/6th scale Babydoll (Emily Browning) 28cm Female Figure Review II

continued from previous post

In the 2011 science fiction fantasy film “Sucker Punch” directed by Zack Snyder, a young girl is institutionalized by her abusive stepfather. Retreating to an alternative reality as a coping strategy, she envisions a plan which will help her escape from the mental facility. In the fantasy sequences, the mix of weaponry in the film spans several decades from the time period of the reality depicted in the film. The women in the film also underwent extensive training with former Navy SEALs in both weapons handling as well as room clearing techniques.

When Babydoll (Emily Browning) fantasizes she is in feudal Japan, she meets the Wise Man (Scott Glenn). After she expresses her desire to “escape”, the Wise Man presents Babydoll with weapons and tells her that she would need to collect five items: a map, fire, a knife, a key, and a fifth, unrevealed item that would require “a deep sacrifice” but bring a “perfect victory”.

Baby Doll (Emily Browning) uses a suppressed Heckler & Koch MP7A1 with a tiny red dot sight, a flashlight, and two magazines taped together during the assault on the dragon’s lair. Hot Toys 1/6 scale M7 comes with all except the double magazine. Besides the MP7, the Wiseman (Scott Glenn) also presented Baby Doll with a nickel plated engraved M1911A1 pistol with spare magazines (and small jewelry attachments – trinkets attached by cord to the lanyard ring).

Scroll down to see the rest of the pictures.
Click on them for bigger and better views.

Here’s a look at the Hot Toys Movie Masterpiece Series MMS157 Sucker Punch 1/6th scale Babydoll (Emily Browning) approx 12-inch Female Collectible Figure with her nickel plated engraved M1911A1 pistol with trinkets attached by cord to the lanyard ring and map holder with strap. The first of five items Babydoll needed to escape was a map and that should go into the map holder.
Check out the turnaround views of Hot Toys Movie Masterpiece Series MMS157 Sucker Punch 1/6th scale Babydoll Female Collectible Figure with her M1911A1 pistol and katana sword in sheath.
Sucker Punch Babydoll (Emily Browning) costume / outfit consists of: One (1) set of sailor-styled dark-blue shirt with tie and belt, as well as skirt, One (1) pair of long black socks, One (1) pair of dark-blue high heels. She also has a shoulder holster for her pistol and spare pistol magazines. Her sword sheath is attached to a rope and slung over her right shoulder.
Hot Toys Movie Masterpiece Series MMS157 Sucker Punch 1/6th scale Babydoll Collectible Figure comes with Real-like long golden implanted curly blond hair.
A closer view of the Hot Toys 1/6 scale Emily Browning as Babydoll head sculpt. More close-up shots were shown in the previous post HERE. The sculpt is very well done – Authentic and detailed fully realized likeness of Emily Browning as Babydoll
Close-up views of the nickel plated engraved M1911A1 pistol with trinkets attached by cord to the lanyard ring. There are engravings on the pistol slide. The engraving are of the same design as her Katana: bunny, vines, and berries but with one difference – there is a cartoon capital “B” at the start of the pattern which is the first initial of her name. The 4 charms attached to the Lanyard Ring are: a bunny head, an hour glass, a baby’s bottle and a skull.
Hot Toys Sucker Punch Babydoll other 1/6th scale accessories include: One (1) map holder with strap, 
One (1) Japanese-styled metal Katana with sheath and carrying strap (rope), shoulder holster for her pistol and spare pistol magazines x 2
Here’s Hot Toys Sucker Punch 1/6th scale Babydoll (Emily Browning) 28cm Collectible Figure armed with the suppressed Heckler & Koch MP7A1 with red dot sight and tactical flashlight and showing off some skin.
In the film, Babydoll fights giant samurais in feudal Japan, then teams up with her fellow dancers to take on steampunk inspired World War I German soldiers, dragons, and killer robots on an alien world. She does all these dressed in a provocative schoolgirl costume that leaves little to the imagination. While physically looking like the stereotypical sweet school girl, Babydoll is anything but that!

NEXT: Review of Hot Toys Movie Masterpiece Series MMS158 Sucker Punch 1/6th scale Amber Collectible Figure (which was part of my September 2014 haul posted HERE – better late than never)

Related posts:
September 25, 2013 – Comparison pictures of Hot Toys Catwoman with Batman Returns Catwoman, Black Widow & Bats posted in my toy blog HERE
July 1, 2013 – Hot Toys 1/6 scale Female Action Figures group shots with Scarlett Johansson (x 3) & others (pictures HERE)

Continua a leggere

Pubblicato in Senza categoria