The robots will someday take our jobs. But not all our jobs, and we don’t really know how many. Nor do we understand which jobs will be eliminated and which will be transitioned into what some say will be better, less tedious work.

What we do know is that automation and artificial intelligence will affect Americans unevenly, according to data from McKinsey and the 2016 US Census that was analyzed by the Brookings think tank.

Young people — especially those in rural areas or who are underrepresented minorities — will have a greater likelihood of having their jobs replaced by automation. Meanwhile, older, more educated white people living in big cities are more likely to maintain their coveted positions, either because their jobs are irreplaceable or because they’re needed in new jobs alongside our robot overlords.

The Brookings study also warns that automation will exacerbate existing social inequalities along certain geographic and demographic lines, because it will likely eliminate many lower- and middle-skill jobs considered stepping stones to more advanced careers. These job losses will be in concentrated in rural areas, particularly the swath of America between the coasts.

However, at least in the case of gender, it’s the men, for once, who will be getting the short end of the stick. Jobs traditionally held by men have a higher “average automation potential” than those held by women, meaning that a greater share of those tasks could be automated with current technology, according to Brookings. That’s because the occupations men are more likely to hold tend to be more manual and more easily replaced by machines and artificial intelligence.

Of course, the real point here is that people of all stripes face employment disruption as new technologies are able to do many of our tasks faster, more efficiently, and more precisely than mere mortals. The implications of this unemployment upheaval are far-reaching and raise many questions: How will people transition to the jobs of the future? What will those jobs be? Is it possible to mitigate the polarizing effects automation will have on our already-stratified society of haves and have-nots?

A recent McKinsey report estimated that by 2030, up to one-third of work activities could be displaced by automation, meaning a large portion of the populace will have to make changes in how they work and support themselves.

Related Join the Open Sourced Reporting Network

“This anger we see among many people across our country feeling like they’re being left behind from the American dream, this report highlights that many of these same people are in the crosshairs of the impact of automation,” said Alastair Fitzpayne, executive director of the Future of Work Initiative at the Aspen Institute.

“Without policy intervention, the problems we see in our economy in terms of wage stagnation, labor participation, alarming levels of growth in low-wage jobs — those problems are likely to get worse, not better,” Fitzpayne told Recode. “Tech has a history that isn’t only negative if you look over the last 150 years. It can improve economic growth, it can create new jobs, it can boost people’s incomes, but you have to make sure the mechanisms are in place for that growth to be inclusive.”

Before we look at potential solutions, here are six charts that break down which groups are going to be affected most by the oncoming automation — and which have a better chance of surviving the robot apocalypse:

Occupation

The type of job you have affects your likelihood of being replaced by a machine. Jobs that require precision and repetition — food prep and manufacturing, for example — can be automated much more easily. Jobs that require creativity and critical thinking, like analysts and teachers, can’t as easily be recreated by machines. You can drill down further into which jobs fall under each job type here.

Education

People’s level of education greatly affects the types of work they are eligible for, so education and occupation are closely linked. Less education will more likely land a person in a more automatable job, while more education means more job options.

Age

Younger people are less likely to have attained higher degrees than older people; they’re also more likely to be in entry-level jobs that don’t require as much variation or decision-making as they might have later in life. Therefore, young people are more likely to be employed in occupations that are at risk of automation.

Race

The robot revolution will also increase racial inequality, as underrepresented minorities are more likely to hold jobs with tasks that could be automated — like food service, office administration, and agriculture.

Gender

Men, who have always been more likely to have better jobs and pay than women, also might be the first to have their jobs usurped. That’s because men tend to over-index in production, transportation, and construction jobs — all occupational groups that have tasks with above-average automation exposure. Women, meanwhile, are overrepresented in occupations related to human interaction, like health care and education — jobs that largely require human labor. Women are also now more likely to attain higher education degrees than men, meaning their jobs could be somewhat safer from being usurped by automation.

Location

Heartland states and rural areas — places that have large shares of employment in routine-intensive occupations like those found in the manufacturing, transportation, and extraction industries — contain a disproportionate share of occupations whose tasks are highly automatable. Small metro areas are also highly susceptible to job automation, though places with universities tend to be an exception. Cities — especially ones that are tech-focused and contain a highly educated populace, like New York; San Jose, California; and Chapel Hill, North Carolina — have the lowest automation potential of all.

See how your county could fare on the map below — the darker purple colors represent higher potential for automation:

Note that in none of the charts above are the percentages of tasks that could be automated very small — in most cases, the Brookings study estimates, at least 20 percent of any given demographic will see changes to their tasks due to automation. Of course, none of this means the end of work for any one group, but rather a transition in the way we work that won’t be felt equally.

“The fact that some of the groups struggling most now are among the groups that may face most challenges is a sobering thought,” said Mark Muro, a senior fellow at Brookings’s Metropolitan Policy Program.

In the worst-case scenario, automation will cause unemployment in the US to soar and exacerbate existing social divides. Depending on the estimate, anywhere from 3 million to 80 million people in the US could lose their jobs, so the implications could be dire.

“The Mad Max thing is possible, maybe not here but the impact on developing countries could be a lot worse as there was less stability to begin with,” said Martin Ford, author of Rise of the Robots and Architects of Intelligence. “Ultimately, it depends on the choices we make, what we do, how we can adapt.”

Fortunately, there are a number of potential solutions. The Brookings study and others lay out ways to mitigate job loss, and maybe even make the jobs of the future better and more attainable. The hardest part will be getting the government and private sector to agree on and pay for them. The Brookings policy recommendations include:

Create a universal adjustment benefit to laid-off workers. This involves offering career counseling, education, and training in new, relevant skills, and giving displaced workers financial support while they work on getting a new job. But as we know from the first manufacturing revolution, it’s difficult if not impossible to get government and corporations on board with aiding and reeducating displaced low-skilled workers. Indeed, many cities across the Rust Belt have yet to recover from the automation of car and steel plants in the last century. Government universal adjustment programs, which vary in cost based on their size and scope, provide a template but have had their own failings. Some suggest a carbon tax could be a way to create billions of dollars in revenue for universal benefits or even universal basic income. Additionally, taxing income as opposed to labor — which could become scarcer with automation — provides other ways to fund universal benefits.

This involves offering career counseling, education, and training in new, relevant skills, and giving displaced workers financial support while they work on getting a new job. But as we know from the first manufacturing revolution, it’s difficult if not impossible to get government and corporations on board with aiding and reeducating displaced low-skilled workers. Indeed, many cities across the Rust Belt have yet to recover from the automation of car and steel plants in the last century. Government universal adjustment programs, which vary in cost based on their size and scope, provide a template but have had their own failings. Some suggest a carbon tax could be a way to create billions of dollars in revenue for universal benefits or even universal basic income. Additionally, taxing income as opposed to labor — which could become scarcer with automation — provides other ways to fund universal benefits. Maintain a full-employment economy. A focus on creating new jobs through subsidized employment programs will help create jobs for all who want them. Being employed will cushion some of the blow associated with transitioning jobs. Progressive Democrats’ proposed Green New Deal, which would create jobs geared toward lessening the United States’ dependence on fossil fuels, could be one way of getting to full employment. Brookings also recommends a federal monetary policy that prioritizes full employment over fighting inflation — a feasible action, but one that would require a meaningful change to the fed’s longstanding priorities.

A focus on creating new jobs through subsidized employment programs will help create jobs for all who want them. Being employed will cushion some of the blow associated with transitioning jobs. Progressive Democrats’ proposed Green New Deal, which would create jobs geared toward lessening the United States’ dependence on fossil fuels, could be one way of getting to full employment. Brookings also recommends a federal monetary policy that prioritizes full employment over fighting inflation — a feasible action, but one that would require a meaningful change to the fed’s longstanding priorities. Introduce portable benefits programs. This would give workers access to traditional employment benefits like health care, regardless of if or where they’re employed. If people are taken care of in the meantime, some of the stress of transitioning to new jobs would be lessened. These benefits also allow the possibility of part-time jobs or gig work — something that has lately become more of a necessity for many Americans. Currently, half of Americans get their health care through their jobs, and doctors and politicians have historically fought against government-run systems. The concept of portable benefits has recently been popular among freelance unions as well as among contract workers employed in gig economy jobs like Uber.

This would give workers access to traditional employment benefits like health care, regardless of if or where they’re employed. If people are taken care of in the meantime, some of the stress of transitioning to new jobs would be lessened. These benefits also allow the possibility of part-time jobs or gig work — something that has lately become more of a necessity for many Americans. Currently, half of Americans get their health care through their jobs, and doctors and politicians have historically fought against government-run systems. The concept of portable benefits has recently been popular among freelance unions as well as among contract workers employed in gig economy jobs like Uber. Pay special attention to communities that are hardest hit. As we know from the charts above, some parts of America will have it way worse than others. But there are already a number of programs in place that provide regional protection for at-risk communities that could be expanded upon to deal with disruption from automation. The Department of Defense already does this on a smaller scale, with programs to help communities adjust after base closures or other program cancellations. Automation aid efforts would provide a variety of support, including grants and project management, as well as funding to convert facilities into new uses. Additionally, “Opportunity Zones” in the tax code — popular among the tech set — give companies tax breaks for investing in low-income areas. These investments in turn create jobs and stimulate spending in areas where it’s most needed.

As we know from the charts above, some parts of America will have it way worse than others. But there are already a number of programs in place that provide regional protection for at-risk communities that could be expanded upon to deal with disruption from automation. The Department of Defense already does this on a smaller scale, with programs to help communities adjust after base closures or other program cancellations. Automation aid efforts would provide a variety of support, including grants and project management, as well as funding to convert facilities into new uses. Additionally, “Opportunity Zones” in the tax code — popular among the tech set — give companies tax breaks for investing in low-income areas. These investments in turn create jobs and stimulate spending in areas where it’s most needed. Increased investment in AI, automation, and related technology. This may seem counterintuitive, seeing as automation is causing many of these problems in the first place, but Brookings believes that embracing this new tech — not erecting barriers to the inevitable — will generate the economic productivity needed to increase both standards of living and jobs outside of those that will be automated. “We are not vilifying these technologies; we are calling attention to positive side effects,” Brookings’s Muro said. “These technologies will be integral in boosting American productivity, which is dragging.”

None of these solutions, of course, is a silver bullet, but in conjunction, they could help mitigate some of the pain Americans will face from increased automation — if we act soon. Additionally, many of these ideas currently seem rather progressive, so they could be difficult to implement in a Republican-led government.

“I’m a long-run optimist. I think we will work it out. We have to — we have no choice,” Ford told Recode, emphasizing that humanity also stands to gain huge benefits from using AI and robotics to solve our biggest problems, like climate change and disease.

“The short term, though, could be tough — I worry about our ability to react in that time frame,” Ford said, especially given the current political climate. “But there comes a point when the cost of not adapting exceeds the cost of change.”

Open Sourced is made possible by the Omidyar Network. All Open Sourced content is editorially independent and produced by our journalists.