# Solving A\*x=b in Nemo

**URL:** https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051
**Category:** General Usage
**Tags:** matrices, convert, nemo
**Created:** [July 1, 2023, 1:04pm UTC](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051 "2023-07-01T13:04:09Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![thofma](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thofma/32/1691_2.png) [@thofma](https://discourse.julialang.org/u/thofma)
#### Post date: [July 2, 2023, 5:34am UTC](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051/6 "2023-07-02T05:34:22Z")

</div>

The functions for solving or checking solvability are `can_solve` and `can_solve_with_solution`. Only works with matrices though, so your example would look like:

```julia
julia> A = QQ[1 0 0; 0 1 1; 0 3 0; 0 0 1]
[1 0 0]
[0 1 1]
[0 3 0]
[0 0 1]

julia> Q = [2 ,-3 , 1, 1]
4-element Vector{Int64}:
  2
 -3
  1
  1

julia> B = matrix(QQ, 4, 1, Q)
[2]
[-3]
[1]
[1]

julia> can_solve(A, B)
false

```

See also the docstring of `can_solve`.

(Here is how it would look like to compute a solution in case one exists:

```julia
julia> B = matrix(QQ, 4, 1, [1, 0, 0, 0])
[1]
[0]
[0]
[0]

julia> can_solve_with_solution(A, B)
(true, [1; 0; 0])

```

)

---

_[View the full topic](https://discourse.julialang.org/t/solving-a-x-b-in-nemo/101051)._
